title: Need for predictable random generator
body: <p>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 &mdash; 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.</p>
  
  <p>Currently I use PHP <code>mt_rand()</code>, but we are just moving our code to C++, so I want to solve this problem in our game's new engine.</p>
  
  <p>I don't know if the solution is some uniform random generator, or maybe to remember previous random states to force proper distribution.</p>