Creating Cellular Automata Maps

Cellular automata is a fun algorithm. It starts with completely random chaos, and order gradually emerges as rules are applied repeatedly. This algorithm is great for producing organic-looking levels, such as a forest with clearings or an old cavern network. It was first popularized in Conway’s Game of Life.[60]

Cellular Automata Theory

Cellular automata was originally designed to simulate organic life. Each map tile independently lives (becomes a wall) or dies (becomes open space) based on a count of its neighbors. You keep running iterations until you have a usable map. You can visualize the algorithm applied to each tile like this:

Now that you know the theory behind the map generation algorithm, you’re ready ...

Get Hands-on Rust now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.