Random Number Generator: Difference between revisions

m
m (update links)
 
(2 intermediate revisions by one other user not shown)
Line 1:
{{Useful Notes}}
In [[Tabletop Games]] (such as [[Dungeons and& Dragons]]) events and their magnitude can be determined by a simple throw of the dice; [[Video Games]] use a similar mechanism which is usually much less transparent to the user. As these rolls are hidden, a common form of [[Fake Difficulty]] is to have the random number generator roll in favour of a computer player [[The Computer Is a Cheating Bastard|more often than it does for you]].
{{trope}}
In [[Tabletop Games]] (such as [[Dungeons and Dragons]]) events and their magnitude can be determined by a simple throw of the dice; [[Video Games]] use a similar mechanism which is usually much less transparent to the user. As these rolls are hidden, a common form of [[Fake Difficulty]] is to have the random number generator roll in favour of a computer player [[The Computer Is a Cheating Bastard|more often than it does for you]].
 
For example, [[Role -Playing Game|Role Playing Games]] will commonly use a random number generator to determine if a blow landed in combat. If so, the random number generator might then be called again to determine if it is a [[Critical Hit]] or not; then yet again to determine what percentage of the character's maximum attack power will be applied to the enemy.
 
Note that almost all computer systems are incapable of producing truly "random" numbers on their own. Some have [[wikipedia:Hardware random number generator|special hardware]] which can achieve this, but you'd be hard-pressed to find such hardware in a home computer. As such, the random number generator is usually producing a series of numbers based on an initial "seed" value. This "seed" is assumed to be "truly" random, and often will be the time of day (down to the microsecond) when the program started.
Line 17 ⟶ 16:
On the other hand, it could be argued that a sufficiently skilled player could roll dice in a manner that would guarantee certain results... It is, after all, simple physics that determines which way up they'll face. Regardless, it's very difficult to determine the outcome of a roll before making one, and so dice rolls are usually assumed to be "truly" random. In practise, which is more "random" usually boils down to how many opportunities there are to cheat. It's also commonly argued that all values are hand-picked by the [[Random Number God]] anyway, hence rendering the mechanics moot.
 
In any modern well written program, the "random" number is generally random. Only in the case of encryption (where massive computer power can be harnessed to discover and exploit the tiniest flaw) would there be any problem. Programmers who have the knowledge and desire to do so can ensure that any computer game has all the randomness it needs. On the other hand it is trivially easy to [[Idiot Programming|write random number generator]] ''[[Idiot Programming|wrong]]'', and it ''was'' done on the several occasions.
 
The best known (and most reviled) of them is the infamous IBM-designed RANDU, which failed even the most relaxed definition of the RNG (such as that the number it generates must be spread uniformly over the range, which they weren't). Unfortunately, due to popularity if the [[Mainframes and Minicomputers|IBM hardware]] and software that were supplied with it<ref>RANDU was a part of the FORTRAN scientific library that was bundled with IBM System/360 mainframe, ''the'' most popular, used and cloned computer of the "Big Iron" era.</ref>, it was ''the'' most widespread RNG of [[The Sixties]] and [[The Seventies]], and even now a lot of scientific results in computing are suspect because it was used to get them.
 
{{reflist}}
[[Category:Useful Notes]]
[[Category:How Video Game Specs Work]]
[[Category:Random Number Generator{{PAGENAME}}]]
[[Category:UsefulRandomness NotesIndex]]