Update #11 - RNG Dungeons!


Why I believe in evolution? Well if I were god, I wouldn’t do it all by hand. 

Procedural generation rocks! As Eidolons are moving towards openworld gameplay, it seems obvious that some way of adding massive replayability and variety will be needed. Many things will be randomized on top of the map of Ersidris, but of course, most of the time will be spend exploring and fighting in dungeons, so my focus now is on making a Random Level Generator! 

Just for those who are curious, here is what the *old* level generator could output, not horrible, but pretty bad I think... 


So I set out on the quest to improve this mess! 

In fact, I find it a fascinating occupation, writing such software - hard to compare to the work I have to do on the UI,  trying to keep the layout from falling apart completely on different resolutions. I am wondering if there is a way to apply Machine Learning to the RNG business, that would be the ultimate sophistication...Why bother? Well, dungeons in Eidolons are a bit special*, and there will be a lot of them! 

(*many things have to be considered - levels of illumination, placement of (locked) doors (and keys for them))

For now, of course, I would be happy just to make some basic tests work - like "paths are always traversable"... In any case, here is a piece that  shows the level generator in action:

The steps are as follows: 

  1. Create a Graph where vertices are Rooms and edges are 'Links' (also rooms actually, just of "Link" type).
  2. logical model with ASCII-based room templates for each node of the Graph
  3. TileMap with symbols for each cell, to be parsed into real objects for the Dungeon

How does this graph to model alg work you might ask? Here's a gist: 

> Gets the 0th (entrance) node and calls build(node)

> build(node) goes through adjacentcyMap of the Graph and collects the list of Edges the node has

> depending on the number and type of Edges (some may be merged into a single link!), a Room Model (template) is chosen for the node

> iterate over the Edges and try to first attach a Link Room properly, then build(secondNode) at the right point (which enters recursion)

Arcane... But it works! 

Each dungeon has its own 'room style', a set of templates to use after rotating them properly. This way, at the very least, caves will have to be a lot different from dwarven dungeons or elven crypts! A single level can combine various styles by getting split into Zones, too.  As a result, I hope that each place will have a unique feel to it!

Populating dungeons with enemies is a whole different story - I will be using a lot tricks there to make them both balanced and varied. 

Leave a comment

Log in with itch.io to leave a comment.