Skip to content

How RNG Manipulation Works in Kirby's Dream Land

Loren edited this page Sep 22, 2023 · 2 revisions

Understanding Pseudorandom Number Generators

The random number generator in Kirby's Dream Land isn't random at all (this is true for almost all video games). Most cases of random number generation in computers is done through a pseudorandom number generator (PRNG). Number sequences generated by a PRNG approximate the properties of random numbers, but they're not actually random, since they are completely determined by an initial value (the seed).

Kirby's Dream Land (like many other retro console games) uses the same initial seed when the game starts. This means that KDL will always generate "random" numbers in the exact same order. Because KDL only changes the RNG seed on certain events, we can enter boss fights and other critical moments on a RNG seed that is known to produce a desired behavior.

How RNG Works in KDL

The RNG seed is stored in two bytes of RAM (0xD02F - 0xD031). When the game starts, either from a hard reset or soft reset, the RNG seed is initialized to the same number every time.

The RNG seed changes when the game needs to generate a random number. Random numbers are generated for these in-game actions:

  • The flashing stars on the title screen
  • Star sprites that Kirby creates when he bonks into the scenery.
  • Destroying (most) enemies
  • Enemy behaviors (e.g. boss fights, enemies with random behaviors)
  • Inhaling (causes rapid changes due to the particles Kirby inhales)

Manipulating RNG in Kirby's Dream Land

Now that we know how RNG works in Kirby's Dream Land, we can plan out RNG calls to make sure we enter critical moments at a known RNG seed. The KDL Practice Script will help you find good RNG seeds for boss fights and other moments in the game where RNG matters, and it will allow you to practice hitting those points.

While you are working with the practice script, you will need to find visual cues that will let you know you're on your desired seed. Visual cues can be inhaled particle patterns (like I use to manipulate Poppy Bros Sr.) or specific star bonk patterns (like I use to manipulate curry kill). Once you have your visual cues down, I suggest turning off the script and practice using the in-game visual cues to hit your RNG seeds.

External Links