# Help modelling game mechanics

• December 14th 2009, 09:56 AM
xpl0itz
Help modelling game mechanics
I have made a simple Flurry simulator, it uses a uniform random number generator, and produces really nice results. So I won't need any more help.

I am trying to come up with a formula for calculating my damage output per second on a game which I play, World of Warcraft. But I have no idea where to even start. Let me explain how the particular mechanic I am trying to simulate, Flurry, works:

Let's say you have an axe. With that axe, you hit your foe once every second for 1 damage. So that gives you 1 DPS (=damage per second).

Now here comes the part where it becomes complicated:

Every hit has a 20% chance of being a critical hit, and when it does it will trigger an effect called Flurry, increasing the attack speed of your next 3 attacks by 25%. In addition, a critical hit hits for 200% damage.

Now, I'm not necessarily asking for someone to guide me through solving this entire problem, but at the very least some pointers to useful information would be nice :).

EDIT: I am trying to figure out how changing the attack speed of my weapon (1.00 seconds here) and critical hit chance will affect my DPS.

EDIT2: I think I might just resort to simulation, since this is all getting really complicated. I just found out a critical hit can occur during one of the 3 hastened attacks, refreshing the charges.

(English isn't my first language, so the things I say might be a little incoherent)
• December 14th 2009, 03:22 PM
ANDS!
The problem here, is understanding the underlying way WOW calculates DPS. From what I remember, there was a range for a certain weapon yes, as well as an attack speed, and then some formula for calculation the damage per second of that particular weapon. You would need to know that formula (or the mechanics of it) to continue with what you are doing because a weapons damage per second is based on how long it takes to make one swing correct? Increasing the attack speed, decreases the speed of the weapon, increasing the damage per second (since base damage is constant).

Another problem is that you really aren't finding a formula for damage per second, but the long run AVERAGE of damage per second. For example, [url=http://www.wowhead.com/?item=47001]this weapon[url] has a range of values from 227 to 453 for some value X. I would say this is a continuous random variable (there some algorithm being done in the background that rounds up or down the calculated damage), and you need to know the probability of such a value before you can start doing any calculations on it. Say for example WOW calculates the damage for ANY weapon and the probability of getting a value between a and b is:

$f(x) = F(x), a $0$ $otherwise.$

Therefore we'd want the average value of this function (the integral) over the possible values of X:

$\int_a^b xf(x) dx$

Without knowing much more about how WOW operates behind the scenes, you're kind of limited in how much TRUE calculating you can do. At best, you can simply log your hits over like I dunno 100 (just to be safe), and see what values of those you produce, construct a histogram, and then see if a pattern emerges in the shape of such a histogram.
• December 14th 2009, 10:02 PM
xpl0itz
Every weapon has a damage range $a \leq x \leq b$, where $x$ would be the damage your hit deals to the enemy. The probability for any number within that range to be selected is the same (i.e. a uniform distribution).

Now, I don't really know that much about probability and statistics, so would you mind telling me what the definition of the function $F$ you used is?