Map generation was the first major task we tackled during the production of our game. We wanted the map to change between playthroughs, and for the player to have some influence over how their world evolves. Additionally, we wanted even segments with the same path to feel unique, through variations in the height of individual blocks and the presence of neutral buildings.
At that time, we heard a lot about different versions of the Wave Function Collapse algorithm (there are tons of interesting YouTube videos on the subject - we highly recommend them!) and wanted to create something similar. However, after some analysis, we realized that for our needs, we could achieve similar results by using a simplified method inspired by that algorithm.

Ultimately, the map is generated from hand-crafted blocks (8x8) with different road shapes, on which we then apply additional variety. Since each map segment consists of smaller elements, their heights can be randomized according to set rules, as can some visual elements. Once the heights are determined, the game looks at the rule set for that map and generates neutral elements for the segment, such as trees and neutral buildings. When everything is in place, the segment is spawned underwater, and a sequence triggers, raising the entire block. Once all elements are positioned, the entire segment is merged into a single model.

Where the road ends, a space appears where the next block can be generated. The decision of what segment comes next is made in real-time. The game checks which segments are already on the map and which potential segments could be placed there in the near future, then selects the one that best fits the current layout. This prevents situations where two roads would want to continue in the same spot, leading to loops with no start or end. Potential dead ends are blocked with segments containing portals, but the algorithm ensures that at least one path remains open until the final round is reached. Similarly, as the game nears its end, every open path will be closed with a portal segment.
This system is flexible enough that, in the future, it will allow us to create different rules and segment sets to further diversify the worlds we will be conquering!
---
If there are any topics you’d like to hear more about, feel free to let us know here or on our Discord, where you can also find more of this devlogs sooner!
