Maxim's project vault

Alt3r Rooftop Run: Generation

Contract work (in team of 3)
Game developer (Unity, C#)
10 Jun 2023

Source code for this project can be found here: Github
You can play the game here: GooglePlay

At the heart of Alt3r RooftopRun is the level generator. To ensure endless gameplay, it has to be reliable, but also flexible enough to provide the player with fun and never repeating challenges.

Generator is working on the wave function collapse algorithm, which is inspired by the marian42 implementation. I used Unity’s ScriptableObject as a container for my prototypes, which in hindsight was a terrible decision because it got messy really quickly. In retrospect, I should have used a json file for this.

shapes

Early tests were made with only 7 shapes (excluding their rotations). Here’s canvas build by wave function collapse algorithm. In this example i forgot to allow prototypes to be neighbors with themself.

result

The level itself is separated on two interchangeable chunks, while you are running on one, the other is generating. Heres how it looks with height of 3 and length of 40:

The game used 21 images and the collection has 47 prototypes in it. The difference is that there are a bunch of prototypes that are only used to make sure that the generation doesn’t brake.

buildings

This configuration of the wave function collapse algorithm with gameplay elements like obstacles and trampolines (to get to the upper or lower level) is doomed to have critical sections, like right after the trampolines, to make sure the player doesn’t bump into an obstacle while the animations are playing. To ensure reliability, I had to make a bunch of prototype plugs just to keep things working. It was tedious, but the result was worth it.

Once again, you can play the game here: GooglePlay

Thanks for reading.
Maxim.