Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
It generates a random number, checks to see how badly it would inconvenience you, and if that value is not high enough it rolls again until it is.
This is mostly accurate, but it will also check to see how lucky you are on a daily basis in other, unrelated activities, and adjust the final roll based on your average luck factor over the past two weeks.
Higher average luck factor = higher chance to roll low.
I guess the point I'm trying to get at is that computers can't "do" true random, because they rely on statistical probability. I'm looking in to it too much. I'd imagine it's something rather simple but the problem you run in to when your game has a heavy emphasis on dice rolls and such is that randomness, in reality, isn't so simple. Knowing what goes in to it wouldn't really do much besides give a bit of insight, I guess.
Going back to talking about Tharsis for a bit, (not promoting the game, just using its dice roll system to sort of explain what I mean about "randomness" and dice rolls) I think the RNG on dice rolls in that game is more "convincing" because more goes in to it than just each side having a 1/6th chance coming up; pseudo-random factors like the velocity and angle at which the dice are thrown, and how they collide in to eachother and the surface, are simulated and it just sort of aids comprehension, I guess, to know and see why you roll what you roll. Not perfectly random, but it's more lifelike than just picking a number.
But it all works well enough in OJ and I'm not trying to criticize the game or ask for unreasonable changes. Having a slight enthusiasm for statistics just makes this stuff more interesting to me than it should be. Just saying "it generates a random number" doesn't really say anything.
Can and do, at least to the best scientific defninition of random. Modern CPUs have hardware for querying all kinds of physical randomness, up to and including quantum states. Time is actually avoided in important cases because it can lead to problems in many situations and it can be easy to expliot.
For a game that requires high quality randomness, C++ includes std::random_device for querying the hardware RNG and std::mt19937, a well formed mersenne twister. The random device is slow, but it can be used to seed the twister with true randomness, and the twister can crap out high quality bits at a pretty good rate.
If a game or other application needs less quality then the same <random> library includes a classic linear congruential generator (like rand() usually is) that is lightweight and a bit faster than the already very fast mersenne twister. The <random> library also has distribution tools that avoid a lot of the pitfalls associated with distributing rand() results, like pigeonholing or uneven distributions due to incorrect modulo usage.
More information:
https://channel9.msdn.com/Events/GoingNative/2013/rand-Considered-Harmful