I notice most questions here are for homework or such, but i graduated long ago and just like to have some fun sometimes, so I don't mean to take away time from helping any of the students out there but would appreciate some guidance if anyone can offer any.
I sometimes like making complicated excel charts to emulate certain video game mechanics by figuring out their hidden equations, coming up with various other statistics, probabilities, etc. See, like I said, FUN right? ...Yeah my wife doesn't think so either but I'm weird I guess.
I'm currently emulating the combat of a turn based strategy game, and have everything completed except for the probability distribution over the different possible damage values when 1 unit stack attacks another. It's sort of like adding multiple dice rolls except the rolls are put through a function before being added which is throwing me off.
The situation is such.
When 1 stack of units attacks another, a random number is chosen from their damage range, lets use an example of 32-34 base damage. The number is put through a function to factor in other things like stats/gear/etc which isn't important here but gives some value that is usually not an integer. To give an accurate picture in this example the function returns these values bases on what number was chosen.
F(32) = 37.54666...7
F(33) = 38.72
F(34) = 39.89333...
This happens for each unit in the stack and is added together before it is rounded to a final integer.
So if there are 11 units in the stack, then you would have 11 random choices from the set F(32), F(33), F(34) that are added together and rounded to the nearest integer. The min value would be Round(F(32)*11) and max is obviously Round(F(34)*11)
When rounded the range of damage is 413 - 439
What I want to do list all of the possible damages 413 - 439 and give the probability that the sum of the 11 random choices will round to that number.
I've tried to modify one of the dice algorithms I found here Dice - Wikipedia, the free encyclopedia but since the numbers are put through the function and are not integers, not consecutive, and not starting at 1, I have been unable to figure out what to do.
For an even more advanced bonus idea I'd, like to be able to set ranges and find the probability that the result falls in that range. This is because some units damage range and stack size might mean a total damage result anywhere from 500-2000, so for these I might give the probability of the damage falling between 500-599, 600-699, etc.
Any ideas or help is welcome.
Thanks for reading,