Remove Advertisements

PHP WoW Tanking Simulator

All things /script related

Moderators: Fridmarr, Worldie, Aergis, _Chloe

PHP WoW Tanking Simulator

Postby moduspwnens » Sat Aug 09, 2008 10:16 am

PHP WoW Tanking Simulator
Want to host it on your fan or guild website? Download it here:
http://www.wowinterface.com/downloads/info10154-PHPPaladinTankSimulator.html

Intro
This tanking simulator lets you choose a tanking class, and then input:
    Avoidance %
    Passive Block % (Warrior and Paladin only)
    Holy Shield Charges (4, 6, 8, or 10) (Paladin only)
    Holy Shield Duration (8 or 10 seconds) (Paladin only)
    [item=29388]Libram of Repentance[/item] Equipped (Paladin only)
    Points in Redoubt (0-5) (Paladin only)
    Shield Block Style: TBC or WotLK (Warrior only)
    Points in Critical Block (0, 1, 2, or 3) (WotLK Warrior only)
    Crushing Blows (On or Off)
    Show Rolls (See the random numbers generated to ensure it is working properly)
    Show Time (Show at what time, in seconds, the mob attacks)
    Mobs
    Average Attack Speed
    Swings per Mob
And with that information, it simulates however many swings you specified.

Image

How It Works
It's fairly simple, really. Any halfway experienced Prot Paladin can tell you how the attack table works. All I really had to do was explain it to the computer.
    1. It takes the avoidance levels you gave it, then generates a roll table, like this:
      Miss: 0-5.
      Dodge:5.01-15.
      Parry: 15.01-30.
      Block: 30.01-50.
      Hit: 50.01-100.
    2. Next, it modifies that roll table with any buffs you have. Holy Shield is automatically cast at the end of each duration (8 or 10 seconds), Shield Block works in a similar way, and Redoubt has its own system.
    3. After that, it picks a random number between 1 and 10000, then multiplies it by 0.01 to make it set between 0.01 and 100.
    4. It goes down the list, and wherever that random number lies is the outcome that is reached. Using the above roll table, a 17.38 would be a parry, and a 0.85 would be a miss.

    For a Paladin -
    5. If the result is a miss, dodge, or parry, the hit simulation ends. If it is a block, hit, or crushing blow, a number between 1 and 10 is generated. If the number is 1 (a 10% chance), the simulator says Redoubt has proc'd and sets the variable to modify the attack table for the next five blocks or 10 seconds.

    For a Warrior -
    5. If the shield block style is TBC, it works almost exactly like Holy Shield with different charges and duration. If it's like WotLK, though, it has no charges. However, it also increases block value by 100%. Since a block during Shield Block blocks for more than one without, another counter keeps track of it. Yet another task is to deal with Critical Blocks. Depending on how many talent points are entered, there is a 0%, 10%, 20%, or 30% chance that a block will be "critical" and count for double. So two more counters are added, one being for a critical passive block, and another being for a critical block during Shield Block. All the stats are reported at the end.

    For a Druid or Death Knight -
    5. Irrelevant stats are automatically entered as zeroes (neither can block, Druids can't parry), and that's about it. Druids don't have any avoidance or block-related tools like Holy Shield or Shield Block, and I don't know enough about Death Knights to add in theirs (if any exist).

    And it's about as simple as that! It actually does a little more in respect to time (it keeps track, and removes buffs as they expire). It also keeps a running total of the outcomes, and returns them at the end (and their percentages of the total).


    Why Use It
    Using this, you can find out how much effective block % Holy Shield and Redoubt are worth in different instances of mobs, avoidance, and passive block. As a warrior, you can find out how many blocks either style of Shield Block is worth in different situations, and how many blocks can be expected to be "critical." The original idea was to find out how effective Redoubt is at Sunwell avoidance levels versus a single mob, but feeling diligent, I went ahead and made it work for as many mobs as you'd like, at any average attack speed. Some questions this simulator can answer:
      How much effective % block is Redoubt worth when not at 100% avoidance and block versus single mobs?
      How much effective % block is Holy Shield worth when AoE tanking 15 Ghouls in Hyjal?
      At what levels of avoidance, block, and number of mobs is Redoubt most effective?
      The WotLK style of a Warrior's Shield Block has no charges. How does that affect his mitigation?
...and any other questions you can think of. The simulator doesn't involve block value or swing damage for simplicity's sake, but obviously with the effective block %, this can be calculated rather easily.

Also, now in Version 1.3, a link is provided after each simulation that can be given to others to repeat it.
Version 1.5 added the capability of simulating with classes other than just Paladins, as well as some nice scriptaculous and images to make it look a little more professional.

Image

Comments
It has a total swing limit of 5000 to make sure nothing crazy happens. I haven't yet done all the data validation, so if you type in something silly (like 100% miss, 1% dodge, 1% parry, and 1% block), it will still simulate it right, but the printed roll table might look a little weird (or try to divide by zero, etc.). I'll get to this in a future update. The source code will hopefully be available on WoWInterface soon.

If you want to see the rolls, check the "See Rolls" box before simulating, and it will show you every random number generated throughout the simulation, as well as the charges remaining on Holy Shield and Redoubt until they expire on each block. Using this, you can easily find any bugs (hopefully none) or odd happenings.

FAQ
Q: I can only simulate 5000 total swings at a time. Why?
A: PHP is a server-side language, so simulating a ton of swings would bog down my server. It's my personal website and I don't purchase additional bandwidth, so I don't want my bandwidth eaten too quickly (or my PHP server bugged). There is a way to disable the limit, though, PM me if you really want to do so.

Q: I saw something odd happen in the simulator. What should I do?
A: If it's not because you put something weird in the simulator (negative values, letters, etc.), post it up here and I'll take a look into it.
Last edited by moduspwnens on Mon Aug 25, 2008 9:54 am, edited 5 times in total.
I rule.
moduspwnens
Moderator
 
Posts: 6211
Joined: Tue Nov 06, 2007 12:28 pm
Location: Shattered Hand

Postby moduspwnens » Sat Aug 09, 2008 10:17 am

Offer your thoughts and feedback below. :)

One thing I'm looking into adding is a way of "bookmarking" situations. For example, you'd be able to link to:

index.php?miss_chance=5&dodge_chance=10&parry_chance=15&block_chance=20

to share what you've been trying with others that allows them to just click and see a new simulation without typing in all the values. This would also allow for a link to, say, average T4-geared tank, average T5-geared tank, etc. It wouldn't be too tough to do, if there's interest, I'll do it.
I rule.
moduspwnens
Moderator
 
Posts: 6211
Joined: Tue Nov 06, 2007 12:28 pm
Location: Shattered Hand

Postby mikesoup » Sat Aug 09, 2008 11:13 am

holy shield not recasting at 1.5second attack speed?

Mob 1: 18s | 60.94 | BLOCK (PASSIVE)(Current Redoubt Charges:2) (No proc. 10)
Mob 1: 19.5s | 67.82 | BLOCK (HOLY SHIELD)(Current Redoubt Charges:1) (No proc. 10)
Holy Shield fades.
Mob 1: 21s | 19.16 | DODGE
Mob 1: 22.5s | 62.28 | BLOCK (PASSIVE)(Current Redoubt Charges:0) (No proc. 4)
Redoubt fades.
Mob 1: 24s | 97.15 | HIT (No proc. 6)


Also not saying it faded at 10s

Mob 1: 7.5s | 83.34 | BLOCK (HOLY SHIELD) (No proc. 8 )
Mob 1: 9s | 48.6 | BLOCK (PASSIVE) (No proc. 6)
Mob 1: 10.5s | 3.45 | MISS
Mob 1: 12s | 78.88 | BLOCK (HOLY SHIELD) (Redoubt proc. 1)
Mob 1: 13.5s | 78.29 | BLOCK (HOLY SHIELD)(Current Redoubt
Last edited by mikesoup on Sat Aug 09, 2008 11:16 am, edited 1 time in total.
mikesoup
 
Posts: 7
Joined: Fri Jul 25, 2008 3:05 am

Postby moduspwnens » Sat Aug 09, 2008 11:16 am

mikesoup wrote:holy shield not recasting at 1.5second attack speed?

Mob 1: 18s | 60.94 | BLOCK (PASSIVE)(Current Redoubt Charges:2) (No proc. 10)
Mob 1: 19.5s | 67.82 | BLOCK (HOLY SHIELD)(Current Redoubt Charges:1) (No proc. 10)
Holy Shield fades.
Mob 1: 21s | 19.16 | DODGE
Mob 1: 22.5s | 62.28 | BLOCK (PASSIVE)(Current Redoubt Charges:0) (No proc. 4)
Redoubt fades.
Mob 1: 24s | 97.15 | HIT (No proc. 6)


Hmm, you're right. Ahh! I know why it's happening. I'll fix that. When it checks time, it checks it based on the time the attacker swings, so it never ticked at 10 seconds (when Holy Shield should expire), so it never recast. 2.0 should work for now, but I'll fix the timing for anything that doesn't divide evenly into 10. :)
I rule.
moduspwnens
Moderator
 
Posts: 6211
Joined: Tue Nov 06, 2007 12:28 pm
Location: Shattered Hand

Postby mikesoup » Sat Aug 09, 2008 11:21 am

i was quite suprised when i saw:

Misses: 122 (12.2%)
Dodge: 244 (24.4%)
Parry: 141 (14.1%)
Block (Passive): 161 (16.1%)
Block (Holy Shield): 6 (0.6%)
Block (Redoubt): 106 (10.6%)
Crushing Blow: 105 (10.5%)
Hit: 115 (11.5%)
Redoubt Procs: 45 (9.13% proc rate)


I knew i was crushable but not by that much.
mikesoup
 
Posts: 7
Joined: Fri Jul 25, 2008 3:05 am

Postby moduspwnens » Sat Aug 09, 2008 12:02 pm

This is issue is now resolved. Let me know if you have any other feedback.
I rule.
moduspwnens
Moderator
 
Posts: 6211
Joined: Tue Nov 06, 2007 12:28 pm
Location: Shattered Hand

Postby moduspwnens » Sun Aug 10, 2008 10:01 pm

The change log wrote:Version 1.2 Update
Data validation has been enabled. It will no longer try to simulate if you type in "fish" as your miss chance.
Redoubt was not fading correctly when its expire timer was between mob swings. This was fixed.
If both Holy Shield and Redoubt faded between swings, there is a chance that even though Redoubt faded first, it would show Holy Shield fading and recasting first even though the time was correct. This was fixed.
Even when "show time" was enabled, time was not shown when Redoubt proc'd, and in some other situations. This has been fixed.
Added a version declaration at the bottom of all pages, and date.
Fixed the attack table generation page to work with even weird levels of avoidance and block, and hide any avoidance/block that is pushed off the table.
Created a roll generation page (it was integrated previously) and fixed it to also be accurate at weird levels of avoidance and block, and hide any avoidance/block that is pushed off the table.
Added in check_redoubt_proc.php to prevent a little code duplication and fix the way Redoubt procs appear when "show rolls" is on to be more consistent.
If the player's avoidance was high enough, there would be no blocks, and when getting the percentage of Redoubt procs, the page would divide by zero, kicking back an error. This has been fixed.
Updated files: index.php, validate_variables.php (new), simulate.php, print_attack_table.php, print_roll_table.php (new), check_redoubt_proc.php (new), print_results.php, readme.txt.

Version 1.1 Update
Holy Shield blocks were showing up correctly, but Holy Shield being cast was not. This issue was fixed.
It now no longer lets you skip typing in avoidance and block values.
Added an override function. Go to the "index.php?override" to override the 5000 swing limit. Be careful, though.
Changed the columns in the text area when rolls are showing to 60 instead of 100.
Holy Shield wasn't being refreshed when its refresh timer was between mob swings. This is now fixed.
Updated files: index.php, initialize_roll_table.php, simulate.php, check_recasts.php, readme.txt.


All known issues have been resolved, and all functionality I originally envisioned for this simulator now exists. Also, it should now be unbreakable, so you can put "fish" as your miss chance, and it will catch it. You can put in whatever crazy possible values for avoidance you can think of, and it will still work. Let me know if you find anything else wrong or want something to be added, but barring those two things, this program will be coasting.
I rule.
moduspwnens
Moderator
 
Posts: 6211
Joined: Tue Nov 06, 2007 12:28 pm
Location: Shattered Hand

Postby _Chloe » Mon Aug 11, 2008 2:34 am

Under all the headers, ie Attack Table, Roll Table, miss needs to be on a new line. Also add a damage range per mob, able to be crit etc.
User avatar
_Chloe
Moderator
 
Posts: 971
Joined: Fri Dec 07, 2007 6:36 pm
Location: Santa Monica, CA

Postby KysenMurrin » Mon Aug 11, 2008 3:59 am

Error!

The following error(s) occurred:
- Invalid talent points in Redoubt entered.

Please try again.

When I try to select anything below 4 points in Redoubt. This was working last time I tried it (ie before the fix).
I don't play WoW any more.
Donnan - Nangun - Kysen - Kysen - Mardun - Timkins

Mostly-Book Blog.
KysenMurrin
 
Posts: 6814
Joined: Thu Jun 26, 2008 6:37 am
Location: UK

Postby moduspwnens » Mon Aug 11, 2008 9:16 am

_Chloe wrote:Under all the headers, ie Attack Table, Roll Table, miss needs to be on a new line. Also add a damage range per mob, able to be crit etc.


I can only test currently in IE and Firefox, but why add a new line there? Here's a screenshot of what I'm seeing:
Image
If I add in a line break for Miss, it skips a line and then there's blank space between the header and Miss. What do you mean?

As far as a damage range, ability to be crit, and block value, this may be something I add in the future as an option, but the main idea of this simulator was just to show how much effective block Holy Shield and Redoubt are in different situations.

KysenMurrin wrote:When I try to select anything below 4 points in Redoubt. This was working last time I tried it (ie before the fix).

Yeah, this was a bad copy/paste of me and I forgot to change the values. It was going off of Holy Shield charges, so you could have had up to 10 points in Redoubt. :P Either way though, it's fixed on the simulator and will be included in the next upload to WoWInterface.

Also, I forgot that one thing I definitely wanted to add was the ability to "bookmark" certain avoidance and block values, like Tier 4, Pre-Karazhan, or Sunwell, so that one could just click a link and have all the variables entered. I'll be doing that in the next version, too.
I rule.
moduspwnens
Moderator
 
Posts: 6211
Joined: Tue Nov 06, 2007 12:28 pm
Location: Shattered Hand

Postby moduspwnens » Mon Aug 11, 2008 6:21 pm

It now generates the "bookmarks" I mentioned in my previous post.
I rule.
moduspwnens
Moderator
 
Posts: 6211
Joined: Tue Nov 06, 2007 12:28 pm
Location: Shattered Hand

Postby _Chloe » Mon Aug 11, 2008 6:43 pm

Last edited by _Chloe on Mon Aug 11, 2008 6:46 pm, edited 1 time in total.
User avatar
_Chloe
Moderator
 
Posts: 971
Joined: Fri Dec 07, 2007 6:36 pm
Location: Santa Monica, CA

Postby moduspwnens » Mon Aug 11, 2008 6:46 pm

Oh, yeah I'm definitely not seeing that. What browser are you using?
I rule.
moduspwnens
Moderator
 
Posts: 6211
Joined: Tue Nov 06, 2007 12:28 pm
Location: Shattered Hand

Postby _Chloe » Mon Aug 11, 2008 6:55 pm

Drop <br /> after the closing legend bracket and should fix it for FF. Also grab the web developer plug-in.
User avatar
_Chloe
Moderator
 
Posts: 971
Joined: Fri Dec 07, 2007 6:36 pm
Location: Santa Monica, CA

Postby moduspwnens » Mon Aug 11, 2008 7:02 pm

_Chloe wrote:Drop <br /> after the closing legend bracket and should fix it for FF. Also grab the web developer plug-in.


But I'm in FF and don't see it. I already have the web developer plugin. Here I'll do that right now, and you tell me how it looks on yours. Here's how it looks in mine now:

Image

That extra space is in the other fieldsets, too.
I rule.
moduspwnens
Moderator
 
Posts: 6211
Joined: Tue Nov 06, 2007 12:28 pm
Location: Shattered Hand

Next

Return to Add-ons, UI, and Macros

Who is online

Users browsing this forum: No registered users and 1 guest


Remove Advertisements

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 380 on Tue Oct 14, 2008 6:28 pm

Users browsing this forum: No registered users and 1 guest