Template based level generation

Template based level generation

The template dungeon generation is a versatile procedural level generation algorithm that can be adapted to a wide variety of scenarios.


Idea was taken from the article on roguebasin.roguelikedevelopment.org.

Project on Uneral Engine 4 (4.25.4) is available here.

Short description of the algorithm:

The grid is generated first. A symbol is written to each cell. Blocks are then placed on the grid. Each one has a sample grid fragment and an end result. The pattern is compared with the sections of the grid, and if they match, the block is placed on the level, and new symbols are written in the corresponding cells. Thus, the geometry of the level is formed from these blocks.

The demo project contains two maps on which the generator is configured to generate respectively laboratories and sewers.

Laboratories

Laboratories blocks (short list):

Corridor (straight, L-shape, cross), small room, big room. This configuration can also be used to generate, for example, a village: corridors should be replaced with roads and rooms with houses.

Sewers

Sewers blocks (generator setup):

Start - 1, Cross and Corridor - from 4 to 6, Cap - all available positions.

Start
Reference:
XXXX
XXXX
XXXX
XXXX
Result:
?++?
+##+
+##+
?##?

Corridor
Reference:
XXXX
XXXX
XXXX
?++?
Result:
?++?
?##?
?CC?
?CC?

Cross
Reference:
?XX?
XXXX
XXXX
?++?
Result:
?++?
+##+
+##+
?##?

Cap
Reference:
?++?
?##?
????
????
Result:
?##?
?##?
????
????

Back to the list