• Register

Gerty is a sci-fi top-down rogue-lite twin-stick shooter with fully destructible environment. Gerty is now available on Steam.

Post feature Report RSS Building procedural level generation

At the heart of most rogue-like and rogue-lite games is a procedural generation system. For the uninitiated, this means generating content using algorithms and rules (i.e. it's not totally random). While it can be used for creating many things (enemies, items, etc) it is most often used in creating levels - which is also the case for Gerty.

Posted by on

This week on our Highlight-series, we're taking a look at how our levels are created.


Building blocks

All levels in Gerty consist mainly of two types of terrain, which in the first world are ice and rock. Ice is more plentiful and softer of the two, which makes it easy to dig and shoot your way through. Rock is tougher, but also mostly found at the bottom of levels near the Teleporter. To make the actual magic happen, we use some weighted Perlin Noise to generate the shapes for each area separately, lay them on top of each other creating the base of a level.


Deeper into the game however, you will start coming across other types of terrain as well. Pits, for example, are a bit more special. You can't dig or explode your way through them, but you can snipe enemies from the other side safely. Unlike ice and rock, we use more hand created functions to generate them so that they don't create game breaking dead ends.

Later on you will also find chunks of obsidian, which are effectively indestructible rock.

In the second world, you will find yourself in a completely new environment, with new terrain to match. Ice has been replaced with sand and thorns.

world2


Level types

Most levels in the game require you to find the Teleporter to advance. These levels come in two shapes: horizontal and vertical. Horizontal levels tend to be more open for exploration while vertical ones are more straightforward. Sometimes you'll also have to complete a secondary objective before you can move on.

vertical


Twice per world you're thrown into a Survival level. While staying in the center gives you more space to maneuver, exploration always has its rewards. Survival levels often feature pits or obsidian chunks.

survival


In the middle of each world you will always face a mini-boss that you have to defeat before the Teleporter activates. As with Survival levels, expect to see pits and obsidian chunks to spice things up.

mini-boss


Objects and enemies

To reward exploration, levels have several helpful objects for you to find. However, throwing them around haphazardly would not make for an engaging experience so instead we use some clever tricks to spread them out more evenly. First, we divide the level into a grid. Second, we place the start and end Teleporters and mark off the nearby areas so that other objects aren't right next to them. Then we keep generating the rest of the content: possible additional objectives like Power Disruptors, interactable objects like Runes and lastly Forges and Chests.

grid


Like with the Teleporters, we mark off areas around each object, so that for example you won't find two Forges right next to each other. The end result is a level that's fairly evenly filled, but natural feeling in structure.

After all the objects have been generated, we finish the level off by spawning the enemies. In each level we randomize the enemies you face from pre-determined difficulty categories, so that you're unlikely to face the same foes on every playthrough. Depending on the game's difficulty, they're placed in either small or large groups, so that you're rarely up against just one at a time.

Putting it all together

To wrap this highlight up, here's a step-by-step recap of how a level is generated:

  • Generate ice and rock with weighted Perlin noise
  • Generate possible pits and obsidian chunks by hand
  • Place objectives and interactable objects all around the level
  • Place enemies in groups all around the level

Play for yourself!

Head on over to Steam, add Gerty to your Wishlist and play the free demo to prepare yourself for the Early Access release on December 3rd.

Follow us on social media for more frequent updates!

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: