Follow TV Tropes

Following

History MediaNotes / RandomNumberGenerator

Go To

OR

Is there an issue? Send a MessageReason:
None


In any modern well written program, the "random" number is generally random enough. 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 [[DarthWiki/IdiotProgramming write a random number generator]] ''[[DarthWiki/IdiotProgramming wrong]]'', and it ''was'' done on 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 numbers it generates must be spread uniformly over the range, which they weren't). Unfortunately, due to the popularity of the [[UsefulNotes/MainframesAndMinicomputers IBM hardware]] and software that were supplied with it[[note]]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.[[/note]], it was ''the'' most widespread RNG of TheSixties and TheSeventies, and even now a lot of scientific results in computing are suspect because it was used to get them.

to:

In any modern well written program, the "random" number is generally random enough. 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 [[DarthWiki/IdiotProgramming write a random number generator]] ''[[DarthWiki/IdiotProgramming wrong]]'', and it ''was'' done on 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 numbers it generates must be spread uniformly over the range, which they weren't). Unfortunately, due to the popularity of the [[UsefulNotes/MainframesAndMinicomputers [[Platform/MainframesAndMinicomputers IBM hardware]] and software that were supplied with it[[note]]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.[[/note]], it was ''the'' most widespread RNG of TheSixties and TheSeventies, and even now a lot of scientific results in computing are suspect because it was used to get them.
Is there an issue? Send a MessageReason:
None


In TabletopGames (such as ''TabletopGame/DungeonsAndDragons''), events and their magnitude can be [[GameplayRandomization randomized]] by a simple throw of the UsefulNotes/{{dice}}; VideoGames use a similar mechanism which is usually much less transparent to the user. As these rolls are hidden, a common form of FakeDifficulty is to have the random number generator roll in favour of a computer player [[TheComputerIsACheatingBastard more often than it does for you]].

to:

In TabletopGames (such as ''TabletopGame/DungeonsAndDragons''), events and their magnitude can be [[GameplayRandomization randomized]] by a simple throw of the UsefulNotes/{{dice}}; MediaNotes/{{dice}}; VideoGames use a similar mechanism which is usually much less transparent to the user. As these rolls are hidden, a common form of FakeDifficulty is to have the random number generator roll in favour of a computer player [[TheComputerIsACheatingBastard more often than it does for you]].



One method commonly employed was to start a timer when the console powered up, then grab the current value from that as required. A variant is where the game might start an internal timer when a level loads and use this as a seed, though this has a disadvantage in that if you take an action quickly you can end up with a deterministic result. In practice, this isn't likely to be an issue. Another method was to modify the current random value by a number based on the controller input each frame. This would appear random to the user, since the limits of human precision prevent manipulating this (for example, Microsoft's [=XInput=] API uses ~65K discrete values for both the X and Y axis of a controller's analog stick). However, through UsefulNotes/{{Emulation}}, one can actually determine the algorithm in question by reverse-engineering and then provide the precise controller input to get whatever random number you want. In tool-assisted speed running, this is known as "luck manipulation".

to:

One method commonly employed was to start a timer when the console powered up, then grab the current value from that as required. A variant is where the game might start an internal timer when a level loads and use this as a seed, though this has a disadvantage in that if you take an action quickly you can end up with a deterministic result. In practice, this isn't likely to be an issue. Another method was to modify the current random value by a number based on the controller input each frame. This would appear random to the user, since the limits of human precision prevent manipulating this (for example, Microsoft's [=XInput=] API uses ~65K discrete values for both the X and Y axis of a controller's analog stick). However, through UsefulNotes/{{Emulation}}, MediaNotes/{{Emulation}}, one can actually determine the algorithm in question by reverse-engineering and then provide the precise controller input to get whatever random number you want. In tool-assisted speed running, this is known as "luck manipulation".
Is there an issue? Send a MessageReason:
Page was movedfrom UsefulNotes.Random Number Generator to MediaNotes.Random Number Generator. Null edit to update page.
Is there an issue? Send a MessageReason:
None


@@[[UsefulNotes/{{Python}} import random\\\

to:

@@[[UsefulNotes/{{Python}} @@[[MediaNotes/{{Python}} import random\\\



Some games look to other sources for a seed value. For example, the [[UsefulNotes/GameBoyAdvance GBA]] game ''VideoGame/GoldenSun'' based its [[RandomlyDrops random drops]] on the enemies you fought, how your party was equipped, the turn order throughout the battle, and so on. That is to say, if a player managed to win an item as a random drop using certain battle tactics – be it ShopFodder or the InfinityPlusOneSword – then repeating the battle against the same monsters with the same tactics would be ''guaranteed'' to give the same reward. This made the random number generator [[GameBreaker far easier to exploit]] than one using the timer as a seed.

to:

Some games look to other sources for a seed value. For example, the [[UsefulNotes/GameBoyAdvance [[Platform/GameBoyAdvance GBA]] game ''VideoGame/GoldenSun'' based its [[RandomlyDrops random drops]] on the enemies you fought, how your party was equipped, the turn order throughout the battle, and so on. That is to say, if a player managed to win an item as a random drop using certain battle tactics – be it ShopFodder or the InfinityPlusOneSword – then repeating the battle against the same monsters with the same tactics would be ''guaranteed'' to give the same reward. This made the random number generator [[GameBreaker far easier to exploit]] than one using the timer as a seed.



The modern standard for pseudorandom number generators ([=PRNGs=]) is the Mersenne Twister, which passes numerous rigorous tests of statistical randomness and is the default algorithm for a variety of UsefulNotes/{{programming language}}s (such as PHP, UsefulNotes/{{Python}}, and UsefulNotes/{{Ruby}}). Cryptographically secure [=RNGs=] are vastly more difficult to build since even if they draw random values from a physical source, they could be compromised by someone tampering with or monitoring that source. Consequently, [=CSRNGs=] typically gather entropy (random information) from a variety of sources, combine it, then use that as a seed for a PRNG.

to:

The modern standard for pseudorandom number generators ([=PRNGs=]) is the Mersenne Twister, which passes numerous rigorous tests of statistical randomness and is the default algorithm for a variety of UsefulNotes/{{programming MediaNotes/{{programming language}}s (such as PHP, UsefulNotes/{{Python}}, MediaNotes/{{Python}}, and UsefulNotes/{{Ruby}}).MediaNotes/{{Ruby}}). Cryptographically secure [=RNGs=] are vastly more difficult to build since even if they draw random values from a physical source, they could be compromised by someone tampering with or monitoring that source. Consequently, [=CSRNGs=] typically gather entropy (random information) from a variety of sources, combine it, then use that as a seed for a PRNG.
Is there an issue? Send a MessageReason:
None

Added DiffLines:

@@[[UsefulNotes/{{Python}} import random\\\
print(random.randint(0, 99))]]@@
Is there an issue? Send a MessageReason:
None


The modern standard for pseudorandom number generators ([=PRNGs=]) is the Mersenne Twister, which passes numerous rigorous tests of statistical randomness and is the default algorithm for a variety of UsefulNotes/{{programming languages}} (such as PHP, UsefulNotes/{{Python}}, and UsefulNotes/{{Ruby}}). Cryptographically secure [=RNGs=] are vastly more difficult to build since even if they draw random values from a physical source, they could be compromised by someone tampering with or monitoring that source. Consequently, [=CSRNGs=] typically gather entropy (random information) from a variety of sources, combine it, then use that as a seed for a PRNG.

to:

The modern standard for pseudorandom number generators ([=PRNGs=]) is the Mersenne Twister, which passes numerous rigorous tests of statistical randomness and is the default algorithm for a variety of UsefulNotes/{{programming languages}} language}}s (such as PHP, UsefulNotes/{{Python}}, and UsefulNotes/{{Ruby}}). Cryptographically secure [=RNGs=] are vastly more difficult to build since even if they draw random values from a physical source, they could be compromised by someone tampering with or monitoring that source. Consequently, [=CSRNGs=] typically gather entropy (random information) from a variety of sources, combine it, then use that as a seed for a PRNG.
Is there an issue? Send a MessageReason:
None


The modern standard for pseudorandom number generators ([=PRNGs=]) is the Mersenne Twister, which passes numerous rigorous tests of statistical randomness and is the default algorithm for a variety of languages. Cryptographically secure [=RNGs=] are vastly more difficult to build since even if they draw random values from a physical source, they could be compromised by someone tampering with or monitoring that source. Consequently, [=CSRNGs=] typically gather entropy (random information) from a variety of sources, combine it, then use that as a seed for a PRNG.

to:

The modern standard for pseudorandom number generators ([=PRNGs=]) is the Mersenne Twister, which passes numerous rigorous tests of statistical randomness and is the default algorithm for a variety of languages.UsefulNotes/{{programming languages}} (such as PHP, UsefulNotes/{{Python}}, and UsefulNotes/{{Ruby}}). Cryptographically secure [=RNGs=] are vastly more difficult to build since even if they draw random values from a physical source, they could be compromised by someone tampering with or monitoring that source. Consequently, [=CSRNGs=] typically gather entropy (random information) from a variety of sources, combine it, then use that as a seed for a PRNG.
Is there an issue? Send a MessageReason:
None


One method commonly employed was to start a timer when the console powered up, then grab the current value from that as required. Another method was to modify the current random value by a number based on the controller input each frame. This would appear random to the user. However, through UsefulNotes/{{Emulation}}, one can actually determine the algorithm in question by reverse-engineering and then provide controller input to get whatever random number you want. In tool-assisted speed running, this is known as "luck manipulation".

to:

One method commonly employed was to start a timer when the console powered up, then grab the current value from that as required. A variant is where the game might start an internal timer when a level loads and use this as a seed, though this has a disadvantage in that if you take an action quickly you can end up with a deterministic result. In practice, this isn't likely to be an issue. Another method was to modify the current random value by a number based on the controller input each frame. This would appear random to the user. user, since the limits of human precision prevent manipulating this (for example, Microsoft's [=XInput=] API uses ~65K discrete values for both the X and Y axis of a controller's analog stick). However, through UsefulNotes/{{Emulation}}, one can actually determine the algorithm in question by reverse-engineering and then provide the precise controller input to get whatever random number you want. In tool-assisted speed running, this is known as "luck manipulation".
Is there an issue? Send a MessageReason:
Disambiguated


Some games look to other sources for a seed value. For example, the [[UsefulNotes/GameBoyAdvance GBA]] game ''VideoGame/GoldenSun'' based its [[RandomlyDrops random drops]] on the enemies you fought, how your party was equipped, the turn order throughout the battle, and so on. That is to say, if a player managed to win an item as a random drop using certain battle tactics – be it VendorTrash or the InfinityPlusOneSword – then repeating the battle against the same monsters with the same tactics would be ''guaranteed'' to give the same reward. This made the random number generator [[GameBreaker far easier to exploit]] than one using the timer as a seed.

to:

Some games look to other sources for a seed value. For example, the [[UsefulNotes/GameBoyAdvance GBA]] game ''VideoGame/GoldenSun'' based its [[RandomlyDrops random drops]] on the enemies you fought, how your party was equipped, the turn order throughout the battle, and so on. That is to say, if a player managed to win an item as a random drop using certain battle tactics – be it VendorTrash ShopFodder or the InfinityPlusOneSword – then repeating the battle against the same monsters with the same tactics would be ''guaranteed'' to give the same reward. This made the random number generator [[GameBreaker far easier to exploit]] than one using the timer as a seed.
Is there an issue? Send a MessageReason:
User's only edits are to plug a (spam) site. Reverting.


The modern standard for pseudorandom number generators ([=PRNGs=]) is the Mersenne Twister, which passes numerous rigorous tests of statistical randomness and is the default algorithm for a variety of languages. Cryptographically secure [=RNGs=] are vastly more difficult to build since even if they draw random values from a physical source, they could be compromised by someone tampering with or monitoring that source. Consequently, [=CSRNGs=] typically gather entropy (random information) from a variety of sources, combine it, then use that as a seed for a PRNG.
Also try this site : https://grammarchecker.net/random-number-generator/

to:

The modern standard for pseudorandom number generators ([=PRNGs=]) is the Mersenne Twister, which passes numerous rigorous tests of statistical randomness and is the default algorithm for a variety of languages. Cryptographically secure [=RNGs=] are vastly more difficult to build since even if they draw random values from a physical source, they could be compromised by someone tampering with or monitoring that source. Consequently, [=CSRNGs=] typically gather entropy (random information) from a variety of sources, combine it, then use that as a seed for a PRNG.
Also try this site : https://grammarchecker.net/random-number-generator/
PRNG.
Is there an issue? Send a MessageReason:
None


The modern standard for pseudorandom number generators ([=PRNGs=]) is the Mersenne Twister, which passes numerous rigorous tests of statistical randomness and is the default algorithm for a variety of languages. Cryptographically secure [=RNGs=] are vastly more difficult to build since even if they draw random values from a physical source, they could be compromised by someone tampering with or monitoring that source. Consequently, [=CSRNGs=] typically gather entropy (random information) from a variety of sources, combine it, then use that as a seed for a PRNG.

to:

The modern standard for pseudorandom number generators ([=PRNGs=]) is the Mersenne Twister, which passes numerous rigorous tests of statistical randomness and is the default algorithm for a variety of languages. Cryptographically secure [=RNGs=] are vastly more difficult to build since even if they draw random values from a physical source, they could be compromised by someone tampering with or monitoring that source. Consequently, [=CSRNGs=] typically gather entropy (random information) from a variety of sources, combine it, then use that as a seed for a PRNG.PRNG.
Also try this site : https://grammarchecker.net/random-number-generator/
Is there an issue? Send a MessageReason:
None


Note that almost all computer systems are incapable of producing truly "random" numbers on their own. Some have [[http://en.wikipedia.org/wiki/Hardware_random_number_generator special hardware]] which can achieve this, but you'd be hard-pressed to find such hardware in a home computer. (It should be noted that one make of x86 [=CPU=], [=VIA=], does have a built-in hardware random number generator that uses line-noise on a certain area of the chip to produce truly random data, but their [=CPUs=] are all designed for use in low-power applications such as netbooks.) 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. Which of course is everything but random.

to:

Note that almost all computer systems are incapable of producing truly "random" numbers on their own. Some have [[http://en.wikipedia.org/wiki/Hardware_random_number_generator special hardware]] which can achieve this, but you'd be hard-pressed to find such hardware in a home computer. (It should be noted that one make of x86 [=CPU=], [=VIA=], does have a built-in hardware random number generator that uses line-noise on a certain area of the chip to produce truly random data, but their [=CPUs=] are all designed for use in low-power applications such as netbooks.) 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. Which of course is everything but random.

Top