This is a screenshot from the Atari 5200 version of the traditional game Berserk. however the review we’re featuring really looks at the original coin-op version. The labyrinth for every level was established on the fly utilizing a seed number fed into a rudimentary algorithm . Here’s a close look at exactly how the labyrinth building code really worked.
Recently we saw a talk by Pitfall creator [David Crane] as part of our Retrotechtacular series. That is a genuine gem of programming history, as well as one of our preferred take-aways was that the levels were not hardcoded, however developed utilizing a random number generator algorithm with a hardcoded seed (so that the game was the exact same each time you played it). This utilizes a similar technique however with a somewhat random seed.
The labyrinth building was reverse engineered by observing the game in a MAME emulator, as well as by digging with disassembled code. Each time the code is “cold started” the seed starts out at zero, however from there the space number is utilized as the next seed. This is fed with a extremely simple algorithm. It produces directions for the walls, which utilize s few bit-wise operations to add the pillars inside the rooms.
It’s a excellent thing to research study if you’re composing games for your embedded projects. By generating the room programmatically you don’t utilize up as much program memory. Of program these days even simple pastime controllers have method more storage to work with than [Alan McNeil] had when he designed Berserk.
[via Reddit]
[Image Source]