Saturday, January 28, 2012

Level generation by creatures

Since I plan to have a working ecosystem, digging out the levels is a continuous process that is done by creatures rather than by a level generation algorythm. Towards that goal I tested out several digging behaviors.

The first I behavior, I call dwarves, is really two sets of behavior. the head dwarf digs long straight tunnels an occasionally changes direction. The secondary dwarves occasionally place doors when they are about to enter a larger space, and also dig away corners that are not next to doors. This builds a room and corridor like map with only local knowledge.


A second set of behaviors I call Ants. It makes sure that certain tiles ahead and to both side of it are occupied by walls. This makes it leave islands of unexcavated material behind.


Finally because it was so easy, I implemented a maze digging creature. It can only dig into tiles that do not create a new connection.

Because different layouts effect hunting effectiveness and what kind of plants can grow, the digging creatures that are on a level really effect the types of species that survive on that level and therefore it's resistance to invasion.

No comments: