Procedural Caves

Following experiments creating other procedural game levels, the development has switched to caves. Some searching found the very interesting Procedural Content Development Wiki and a fantastic post by Noel Berry about creating procedural caves with waterfalls (above).

Above (and the other images below) are from a first set of tests generating caves using Processing. The forms are created using a random walk, which ensures that all parts of the cave are reachable by the player (drawn in orange). Once the main cave features are formed, Perlin noise is used to set various heights within the cave. The levels are wrapped (going over one edge jumps the player to the opposite side) so that the level doesn’t have smooth edges and, in come cases, can be traversed infinitely.

[ the code (in an early stage) can be viewed here ]

Leave a Reply

Your email address will not be published. Required fields are marked *