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 should be critical. The problem is I got very bad real life results -- sometimes players get 3 crits in 5 hits, sometimes none in 15 hits. Battles are rather short (3-10 hits) so it's important to get good random distribution.
Currently I use PHP mt_rand(), but we are just moving our code to C++, so I want to solve this problem in our game's new engine.
I don't know if the solution is some uniform random generator, or maybe to remember previous random states to force proper distribution.