Procedural generation of meta-level layout

17 August 2021 gamedev

I really enjoy games like Slay The Spire, Monster Train, Faster Than Light, Spelunky and more. They’re all quite different roguelike games (deckbuilder card games, spaceship combat simulator, adventure platformer) but they all share something similar: randomly generated “meta-level” maps: The spire of Slay The Spire. The sectors and beacons in FTL. The railway in Monster Train.

I’m working on something similar for my platformer (maybe). No details yet besides this quick WIP demo to show a few friends.

This content does not resize on smaller browser widths. Try using the fullscreen button below (after loading the game).
WebGL builds are not supported on mobile devices.

Controls

[Space] to generated a new dungeon layout. Click on levels to “select” them (does nothing right now except for dimming out unreachable levels).

Click on “DungeonTester”, then “DungeonTester component” to change some of the generation paremeters. Not seen here are the settings for “level event” placement logic (marked as colours in this build) and the visual representation options like position-jitter and path movement.

Notes

JavaScript doesn’t support multiple threads (experimental webassembly notwithstanding), so this WebGL build has async threading disabled. Expect it to lock-up during generation if you push the sliders into certain ‘tougher’ generation configurations.

It’s also not performance optimised yet. In particular, I am not yet converting the Directed Acyclic Graph’s I’m generating into a simple integer representation and then using a lookup table to convert into the actual Dungeon Level object types once a valid generation is created. Note to self: do that.

Console log has some interesting info, like how many unique journeys there are through the generated dungeon.

comments powered by Disqus