Comments Off May 11th, 2009 • Posted in GP2X

Procedural Map Generation in ZAM

One of the fun things about writing this game is the procedural map generation, meaning the way the program builds a different level map each time it runs (you can try this in the pre-alpha builds by pressing Select).

This approach to level design is most commonly seen in roguelike games, though it can be found in plenty of other genres too. My approach to map generation is simpler than that in rogues, because the requirements are different. ZAM levels are natural islands without any need for precise architecture, so looser designs fit well. Here’s how maps are currently made:

  1. The entire map is filled with water
  2. A cellular automata of land starts in the middle, and grows outwards.
  3. A number of cellular automata of grass start at various points on the land.
  4. Until now, stone placement was also a random process, but that didn’t make for very interesting levels. Stone patterns are now randomly picked from a collection of predrawn submaps like these
  5. These submaps are rotated by 0-90-180-or-270 degrees and then tiled over the large map. Levels’ randomness now depends on how many different submaps there are, so I’ll get drawing…
  6. In the future, submaps will also hold more interesting information, like points for building mutant bases or locations of special items.

Comments are closed.