[Search] Search   [Recent Topics] Recent   [Hottest Topics] Hottest   [Login] Login
UniWar damage calculation
Forum Index » General Discussion
FuzzyEukaryote

Messages: 32,
Joined: Oct 26, 2016,
Offline

FuzzyEukaryote

Messages: 32,
Joined: Oct 26, 2016,
Offline
Pashaka recently enlightened the community about the update to the damage calculation to use 12 rolls per health, narrowing the damage range and making it less random.

I discussed the details with him and this is how he said damage is calculated:

Success chance = 50 + 5 * [ (attack + terrain bonus) - (1 - AP%)(defense + terrain bonus)]

Success chance is then truncated to an integer between 0 and 100.

Then random integers 0 to 100 are compared to success chance and if they are less (but not equal) then the roll counts.

Finally, rolls/12 gives damage (any fractional damage is discarded)


I'm not an expert comparing discrete and continuous probabilities, but it seems like continuous probability functions are fine to use (e.g. binomial distribution), but might need a slight modification to give the same results. Since the actual calculation is random integers and the comparison is "less than" and not "less than or equal to" then % chance should be divided by 1.01.

For example, if the chance is 50, then there are 50 numbers that give success (0 to 49), but 51 that give failure (50 to 100). So the probability to use for continuous would be 49.5.

The one question i still have for Pashaka is about cases where the random number is 100, it seems like it would fail even when it should give success (e.g. speeder vs bopper on even terrain). I'll update with his reply if he doesn't post it here himself.
pashaka

Messages: 12,
Joined: Aug 18, 2017,
Offline

pashaka

Messages: 12,
Joined: Aug 18, 2017,
Offline
Thanks FuzzyEukariotes for your interest and help analyzing the algorythm and for being eukariote, of course

Your last question made me think of it and even to check attacks for Veteran Speeder vs Engineer. However the thing works fine

Regarding 100 vs 101 numbers comarison:

The thing is that chance of success P (integer number from 0 to 100) is being compared on each dice roll to a random number R (from 0 to 99). This way if P is 100, then R<P is true every single dice roll. And if P is 0, then R<P is false every time. Also P is always a number %5 so chance for it to be 99 or 51.

FuzzyEukaryote

Messages: 32,
Joined: Oct 26, 2016,
Offline

FuzzyEukaryote

Messages: 32,
Joined: Oct 26, 2016,
Offline
Ok, thanks for the clarification. So it's something like floor(100*rand()). So then 50% is really 50% and we can all continue to be happy. That's good. So there will be no problems with speeder vs engineer because R will never be 100, only 99 at most.

And in that case, I think the continuous distribution function will be identical to the discrete.
Forum Index » General Discussion
Powered by JForum 2.1.9 © - 2020-04-14 v124 - UniWar website