• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

truly random attack damage

Status
Not open for further replies.
Level 5
Joined
Apr 22, 2008
Messages
139
okay so from what ive heard, no matter what max and min values a units attack damage is set to, numbers in the middle of the spread occur far more often than numbers at the ends (ie if damage is 1-10, 5 and 6 damage will happen way more often than 1 or 10). is it possible without using enormously complicated triggers to make it so that all damage values have an equal chance of occuring?
this isnt particularly important, im just wondering
 
Level 3
Joined
Aug 4, 2009
Messages
54
It really depends on how the damage range is calculated. The more "Dice" you use in the unit's damage, the more likely you are to see middling values.

For instance, if you take two six-sided dice and one d12, the pair of d6s are most likely to come up 7 due to how many ways 7 can be calculated (1+6, 2+5, 3+4, and in reverse), whereas on a single d12 there's only a 1 in 12 chance of hitting 7, same as any other outcome, because there's only one die.

Or in short, if you want random damage values, use a single die.
 
Level 5
Joined
Apr 22, 2008
Messages
139
i guess i heard wrong then. i heard that no matter how many die you used, the engine automatically had a tendency to select the values in the middle
 
Could you elaborate, give an example.

that's what my physical chemistry professor said... and yeah Reason 3 is right reality of logic....

I think it wont work in only 1 variable so maybe using only 1 die will work good...
It has something to with "balance", anyways I think it works this way... for example 1 six-sided die when you start you will probably see randomness but as you prolong the test it will somehow close to the middle values...

for 2 or more dice it will mostly already show mostly the middle values......
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
To me it seems that i know that middle values will trigger more often although i cannot really explain it...its just common sense for me.Sorry.
EDIT:Think it like this,you set damage to 40-60.There must be a "balance" in the chances from both sides and 40 and 60.The balance is close to the middle values,so values like 48,49,50,51,52 will come much more often than the others.
 
Level 5
Joined
Apr 22, 2008
Messages
139
right because of all the combinations. i remember that from a functions stats and trig class.
also, i love how this went from a question about the warcraft engine to a discussion of statistics and logic...
 
Level 7
Joined
Jul 18, 2009
Messages
272
It has something to with "balance", anyways I think it works this way... for example 1 six-sided die when you start you will probably see randomness but as you prolong the test it will somehow close to the middle values...
If you use only one dice, all numbers from 1 to 6 have the exact same chance to appear. What draws near the middle value (3.5) is the average of the rolled numbers.

1: (1)
2: (2)
3: (3)
4: (4)
5: (5)
6: (6)

--> 6 possibilities to roll. Chances are 1/6, 1/6, 1/6, 1/6, 1/6, 1/6. All chances are equal no matter how many times you roll.

But like Loyal2NES said, when you use 2 or more dices, the middle numbers will have a higher chance to appear.

2: (1+1)
3: (1+2),(2+1)
4: (1+3),(2+2),(3+1)
5: (1+4),(2+3),(3+2),(4+1)
6: (1+5),(2+4),(3+3),(4+2),(5+1)
7: (1+6),(2+5),(3+4),(4+3),(5+2),(6+1)
8: (2+6),(3+5),(4+4),(5+3),(6+2)
9: (3+6),(4+5),(5+4),(6+3)
10: (4+6),(5+5),(6+4)
11: (5+6),(6+5)
12: (6+6)

--> 36 (6²) possibilities to roll. Chances are 1/36, 2/36, 3/36, 4/36, 5/36, 6/36, 5/36, 4/36, 3/36, 2/26, 1/36. As you can see, the chance to roll a 7 is the highest in this case.


3: (1+1+1)
4: (1+1+2),(1+2+1),(2+1+1)
5: (1+1+3),(1+2+2),(1+3+1),(2+1+2),(2+2+1),(3+1+1)
6: (1+1+4),(1+2+3),(1+3+2),(1+4+1),(2+1+3),(2+2+2),(2+3+1),(3+1+2),(3+2+1),(4+1+1)
7: (1+1+5),(1+2+4),(1+3+3),(1+4+2),(1+5+1),(2+1+4),(2+2+3),(2+3+2),(2+4+1),(3+1+3),(3+2+2),(3+3+1),(4+1+2),(4+2+1),(5+1+1)
8: (1+1+6),(1+2+5),(1+3+4),(1+4+3),(1+5+2),(1+6+1),(2+1+5),(2+2+4),(2+3+3),(2+4+2),(2+5+1),(3+1+4),(3+2+3),(3+3+2),(3+4+1),(4+1+3),(4+2+2),(4+3+1),(5+1+2),(5+2+1),(6+1+1)
9: (1+2+6),(1+3+5),(1+4+4),(1+5+3),(1+6+2),(2+1+6),(2+2+5),(2+3+4),(2+4+3),(2+5+2),(2+6+1),(3+1+5),(3+2+4),(3+3+3),(3+4+2),(3+5+1),(4+1+4),(4+2+3),(4+3+2),(4+4+1),(5+1+3),(5+2+2),(5+3+1),(6+1+2),(6+2+1)
10: (1+3+6),(1+4+5),(1+5+4),(1+6+3),(2+2+6),(2+3+5),(2+4+4),(2+5+3),(2+6+2),(3+1+6),(3+2+5),(3+3+4),(3+4+3),(3+5+2),(3+6+1),(4+1+5),(4+2+4),(4+3+3),(4+4+2),(4+5+1),(5+1+4),(5+2+3),(5+3+2),(5+4+1),(6+1+3),(6+2+2),(6+3+1)
11: (1+4+6),(1+5+5),(1+6+4),(2+3+6),(2+4+5),(2+5+4),(2+6+3),(3+2+6),(3+3+5),(3+4+4),(3+5+3),(3+6+2),(4+1+6),(4+2+5),(4+3+4),(4+4+3),(4+5+2),(4+6+1),(5+1+5),(5+2+4),(5+3+3),(5+4+2),(5+5+1),(6+1+4),(6+2+3),(6+3+2),(6+4+1)
12: (1+5+6),(1+6+5),(2+4+6),(2+5+5),(2+6+4),(3+3+6),(3+4+5),(3+5+4),(3+6+3),(4+2+6),(4+3+5),(4+4+4),(4+5+3),(4+6+2),(5+1+6),(5+2+5),(5+3+4),(5+4+3),(5+5+2),(5+6+1),(6+1+5),(6+2+4),(6+3+3),(6+4+2),(6+5+1)
13: (1+6+6),(2+5+6),(2+6+5),(3+4+6),(3+5+5),(3+6+4),(4+3+6),(4+4+5),(4+5+4),(4+6+3),(5+2+6),(5+3+5),(5+4+4),(5+5+3),(5+6+2),(6+1+6),(6+2+5),(6+3+4),(6+4+3),(6+5+2),(6+6+1)
14: (2+6+6),(3+5+6),(3+6+5),(4+4+6),(4+5+5),(4+6+4),(5+3+6),(5+4+5),(5+5+4),(5+6+3),(6+2+6),(6+3+5),(6+4+4),(6+5+3),(6+6+2)
15: (3+6+6),(4+5+6),(4+6+5),(5+4+6),(5+5+5),(5+6+4),(6+3+6),(6+4+5),(6+5+4),(6+6+3)
16: (4+6+6),(5+5+6),(5+6+5),(6+4+6),(6+5+5),(6+6+4)
17: (5+6+6),(6+5+6),(6+6+5)
18: (6+6+6)

--> 216 (6³) possibilities to roll. Chances are 1/216, 3/216, 6/216, 10/216, 15/216, 21/216, 25/216, 27/216, 27/216, 25/216, 21/216, 15/216, 10/216, 6/216, 3/216, 1/216. Looks pretty bad for randomness already (10+11 have a 27 times higher chance to appear than 1+18).

Conclusion: The more dices you roll, the lower is the chance to get a value that's far away from the middle.
To me it seems that i know that middle values will trigger more often although i cannot really explain it...its just common sense for me.Sorry.
EDIT:Think it like this,you set damage to 40-60.There must be a "balance" in the chances from both sides and 40 and 60.The balance is close to the middle values,so values like 48,49,50,51,52 will come much more often than the others.
This is just wrong, sorry.
And something that only you think can't really be called "common sense". ^^
(Okay I know that you're not the only one thinking like that. I once saw in a tv documentation that quite many people make the mistake to think the middle values of a random array would appear more often. But even if many people think it's like that - it's not.)
 
Last edited:
Level 9
Joined
Oct 15, 2006
Messages
339
OK, I understand what your professor is on about. Based on what you're saying, you may have understood it incorrectly.

REALLY? What Adiktuz said was this:
The probability of picking a random number in a series of numbers will conclude in the mid-range of numbers being picked.

1 2 3 4 5 6 7 8 9

Place those numbers on a piece of paper and put them in a hat and tell me which are likely to come out first.. They might even come out in this sequence:

8 2 9 4 1 3 7 5 6

Lets say we have this sequence:

2 1 1 1 1 1 1 1 3

Well the number 2 is the median yet the likelihood of it being picked first or second is slim.

And back to the original example:

1 2 3 4 5 6 7 8 9

Well let me re-arrange them like so:

5 6 7 8 9 1 2 3 4
or even
5 4 3 2 1 9 8 7 6

Why would any range of numbers come out more usual than others? It wouldn't. All of you stop accepting what you're told as fact because someone "older" than you told you so, he or she probably half-assed their own way through school because they need to eat, too.. ASK your teachers some fucking questions once in awhile, if not on everything they say all the time, whether you intend to learn or just to piss them off, do. IT. Because you make the world a worse place for other people when your politics are NOT.. TRUTH.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
1 2 3 4 5 6 7 8 9

Place those numbers on a piece of paper and put them in a hat and tell me which are likely to come out first..

Each number has 1/9 chance to come out first. No surprises there :eekani:

Lets say we have this sequence:
2 1 1 1 1 1 1 1 3

Well the number 2 is the median yet the likelihood of it being picked first or second is slim.

The median of those numbers is 1, not 2. Then chance for 2 to be picked is 1/9.

And back to the original example:

1 2 3 4 5 6 7 8 9

Well let me re-arrange them like so:

5 6 7 8 9 1 2 3 4
or even
5 4 3 2 1 9 8 7 6

And...?

Why would any range of numbers come out more usual than others?

That's what I'm saying, all combinations are just as probable.
 
Level 3
Joined
Mar 3, 2009
Messages
34
when counting probabilities of random numbers(in the real world or anywhere else assuming no other variables are changed) those in the middle always have better chances to show up, that is a reality of life...

That's completely wrong! When you have a six - sided dice, you have the same chance (= 1/6) for getting each number!

Only when you take two of them, the middle value 7 will show up more often, because there is more than one way to get this number:

2: chance = 1 of 36 = 1/36
3: chance = 2 of 36 = 1/18
4: chance = 3 of 36 = 1/12
5: chance = 4 of 36 = 1/9
6: chance = 5 of 36 = 5/36
7: chance = 6 of 36 = 1/6
8: chance = 5 of 36 = 5/36
9: chance = 4 of 36 = 1/9
10: chance = 3 of 36 = 1/12
11: chance = 2 of 36 = 1/18
12: chance = 1 of 36 = 1/36

I hope, you understand, what i want to show you:wink:.

Oh btt: When you want a really random number, you should give your unit only one damage dice!
 
Status
Not open for further replies.
Top