OFFSET
0,2
COMMENTS
From Simon Howard, Oct 25 2024: (Start)
The same table of numbers is also used in earlier games by id Software, including Catacomb 3D (1991) and Wolfenstein 3D (1992), but was used as early as the Commander Keen series. Due to code reuse, the table subsequently found its way into games from other companies: Apogee Software's Rise of the Triad (1995) and Raven Software's Heretic (1994) and Hexen (1995) among others.
The sequence is bytes from a 32-bit linear congruential generator using a multiplier of 134775813 and an increment of 1; these parameters were used in the pseudorandom number generators shipped with various compilers produced by Borland International, Inc. in the late 1980s. This suggests that a program built using one of these compilers was used to generate the table. (End)
LINKS
J. Hufford, Table of n, a(n) for n = 0..255
GitHub, Source
The Doom Wiki, Pseudorandom number generator
Video Game Preservation, Table in the source code to "Commander Keen in Keen Dreams"
Video Game Preservation, Table in the source code to "Rise of the Triad"
FORMULA
a(n) = floor((134775813^(n+1) - 1) / 8832667615232) mod 2^8 (by sum of a geometric series). - Simon Howard, Nov 04 2024
PROG
(Python)
state = 1
for _ in range(256):
print(state >> 16, end=', ')
state = (134775813 * state + 1) % (1 << 24)
# Simon Howard, Nov 01 2024
CROSSREFS
KEYWORD
nonn,dumb,fini,full
AUTHOR
J. Hufford, Jun 29 2015
STATUS
approved