Map Generation

Figured I’d talk a little bit about how Skytorn makes its maps. Skytorn has 2 types of map generation: island, and dungeon, and each work very differently.

This kind of generation is used in 2 places: for floating islands, and for caverns. Caverns are basically like floating islands, except they have hard edges that you can’t go past. In both of these kinds of map, the camera is free-moving. 

Island generation is built out of “chunks”. The map first creates a template of where important things are, and links tunnels between them. Then, based on the context of all these things, the map is built out of pre-designed chunks. There are a lot of different chunks (ex. Tunnel Chunks, Room Chunks, Surface Chunks, etc), but all of them have pre-designed layouts that are placed depending on their context (ex. Layout 1 which is open to the right, and bottom)

Here you can see all the chunks as they were places in a floating island (with some special Perlin Noise stuff for terrain tile-types)

We wanted dungeons to be much more designed and controlled. For this, we decided to construct the dungeons out of pre-designed rooms, and the camera is contained within one room at a time (much like top-down Zelda games). To keep some randomness, dungeons are generated with random connections and picked from a pool of designed rooms:

Though you can’t see it super well in the above picture, rooms are connected randomly and each room has multiple variations that can potentially spawn. The result is basically a dungeon you’d see in a top-down Zelda game (though this is a platformer), but every time you play the game the generation will be a little bit different