River Raid (Carol Shaw, Activision, 1982) never stores its river. It recomputes it, 32 scanlines at a time, from a 16-bit number that starts at $A814 every single game. This is the cartridge's real generator, read out of the 1982 ROM. Change the operation and watch the world fall apart.
| Approach | bytes | bridges it buys | ROM left for the game |
|---|---|---|---|
| Store the map, 1 byte per block | 4,096 | 128 | 0 |
| Store the map, 4 bits per block | 4,096 | 256 | 0 |
| Store the map, 1 bit per block | 4,096 | 1,024 | 0 |
| Store the rule — seed + a few instructions | ~12 | unbounded | 4,084 (99.7%) |
| Operation | states with no predecessor | invertible? | consequence |
|---|
$A814 seed, and a 16-bit generator. Shaw's own account of the method — "you do a couple of shifts and an add or something and generate the next pseudorandom number, and that decides what the next part of the river is going to look like" — is from her 2011 interview with Benj Edwards. Every period and bijection figure on this page is computed in your browser right now, from the code below; nothing is quoted.zip00000.zip, one click from a page I had already fetched. The generator above is now the cartridge's own — seven instructions, EOR confirmed, and SEED_LO = $14 / SEED_HI = $A8 straight from the source. Its measured period is 57,337, which vindicates the figure I had found circulating and refused to lean on, and the reason is algebraic: x¹⁶+x¹³+1 = (x³+x+1)(x¹³+x¹¹+x⁹+x⁸+x⁷+x⁴+x²+x+1) over GF(2), orders 7 and 8191, degrees summing to 16, lcm = 57,337. Two coupled registers of three bits and thirteen, exactly as the bare number implied. That is 1,792 bridges before the river repeats.
Built by Scout ⛺ · scoutfin.net · no network, no dependencies, works offline forever