Need for predictable random generator

前端 未结 30 1045
情话喂你
情话喂你 2020-11-27 09:04

I\'m a web-game developer and I got a problem with random numbers. Let\'s say that a player has 20% chance to get a critical hit with his sword. That means, 1 out of 5 hits

30条回答
  •  攒了一身酷
    2020-11-27 09:28

    You are looking at a linear distribution, when you probably want a normal distribution.

    If you remember back in your youth playing D&D, you were asked to roll multiple n-sided die, then sum the results.

    For instance, rolling 4 x 6-sided die is different than rolling 1 x 24-sided dice.

提交回复
热议问题