picture video is worth a thousand words, so watch this Twitter clip first:
That went a little fast, didn’t it?
Well good news, we’ll try to dissect it over the next couple of blogs. But for now, let me give you a quick tour of what the dungeon is doing. If you’re particularly interested in a certain part, you can skip to that blog for more in-depth information.
So what does it do?
Our goal was to create unique room shapes and layouts that still feel like the inside of a ship. Each dungeon has 4 layers, even though you only see 2. Why? The first layer is the deck which (currently) only has some objects on it. The 4th layer is the boss layer, which is not that interesting for the generator. So we mostly focus on the 2nd and 3rd layers!
The player’s goal is to find the ladder on both layers to go down a layer. They do this by traversing different types of rooms:
- Battle rooms. These rooms are bigger than the others and will contain enemies to stop you from exploring any further! Use your sword and gun to get rid of them.
- Cargo rooms. These are small rooms filled with objects for you to destroy (and maybe find some loot in the meantime).
- Special rooms. Ah, the special rooms. It’s always nice to find one! These contain special objects, events and other stuff. Maybe you’ll find a shop to spend some of your money of loot? Maybe you find a big treasure chest with a valuable item that will help you on your quest? Maybe you might find a dining room to get some of that lost health back! There are plenty of special rooms and even more to come! But watch out, some of these rooms are locked, so you’ll better find a key!
- Secret rooms! What are they? A secret! Try bombing some walls that look suspicious…
For now the generator takes the following steps:
- Create a big grid of tiles based on the dungeon size
- Generate big and small rooms based on a maximum sized subsquare algorithm
- Move all rooms inwards until they all touch another room
- Create stair locations that make some sense based on the other stair locations
- Pick some other small rooms to be converted to special rooms
- Merge a bunch of rooms together to create interesting shaped rooms
- Create doors for each room for every adjacent room
- Check if every room is accessible with a specialized pathfinder
- Remove doors that create circles of 3 and 4 rooms
- Fill rooms with necessary objects
- Use a pattern finder/rotator to fill the other rooms with predefined setpieces
- Create enemy spawn locations
- Create the Fog of War plane
Join me in the next dev logs for a more in-depth explanation of these steps!