The Backrooms Project is a procedurally generated world within the Backrooms universe.
The Backrooms Project is a game where the world is completely procedurally generated, with loads of settings, to create Backrooms looking structures. The Generation is highly inspired by Minecraft.
During the creation of this game, my main focus was getting the Generator to work the way I wanted, but doing so, took many tries and errors, with many iterations of generators.
Release Date: In Development
Versions: None
Started Development: 14-4-2024
Generator V1 was made completely in Blueprints, with help from the EasyNoise Plugin. The system was thoroughly planned out in many graphs, before the system was fully implemented.
Below here is the progression of Generation V1 which started in April of 2024.
Noise Generation Test in Blueprints
1st Iteration of the Generator System
2nd Iteration of the Generator System
After creating the initial system, and testing it, I noticed it ran quite slow and inconsistent. The issue was that the chunks were send from the clients to the server, but data from clients is never trustworthy. Instead, I implemented a system that would put all the chunk generation load on the Server. An early prototype is shown below here. Sadly this system was even slower, and unreliable, as it was difficult to send chunks over the internet, and the server / host had to have a beefy PC with this system in place.
After that with this simple system, I was able to implement a temporary Chunk Unloading system to test performance, which worked as a charm!
For the Threshold / Portal, I worked with portals, which could transfer you from 1 location to the other in an instant. With the help of a little modeling, the Threshold was transformed into a true piece of art!
Generator V1 wasn't the biggest breakthrough for the progress of the game, but it layed a foundation which I could work from to create a more optimized system. To show the work I had done to that point, below is a preview video from 2024 which shows the functionality of Generator V1 (completely coded in Blueprints)
As seen below, the first Generator was fully made in Blueprints. I had some small experience with Procedural generation in Killer in Purple 2 and I experimented with coding Minecraft in Blueprints in the past, but never at this scale.
The system was very experimental, mostly to see if the game I had in mind was even possible, basically a sketch.
At first the idea was to code everything in Blueprints, but as talked about above, the performance was horrible on larger render distances.
To show off the concept I had in mind, I made a preview video to show my followers the rough idea of the Generation System.
Moving on from Blueprints, as it was shown that it was extremely slow, I decided to learn C++ for this project. This is where Generator V2 comes in. Generator V2 is litterately just V1, but copied to C++, with some small changes here and there
A very early prototype with no noise generation is shown below here. To optimize the code, I decided to store the largest and smallest X and Y coordinates, and just generate only 1 line when the player moved in a certain direction by adding or removing from those largest / smallest coordinates. This worked extremely fast, but also brought desyncing issues when the player would go faster than the game could generate, or when a player would teleport over large distances.
With this new Gen V2 in place, I also wanted to implement some more detail like more completed models and better lighting, to already show some promo material to the Discord server.
Experimenting with Thicker / Thinner glowing Cables
I started by updating the Threshold 3D model, and adding some glowing cables into the mix.
The startup process of the Threshold was also implemented to have an amazing introduction to The Backrooms.
In order to make the game slightly creepy, I made some areas in the Backrooms which would not generate lighting, to have a lot of bright areas, but also have large darker sections where you had to use your flashlight to traverse.
The generator however was sadly only 2 Dimensional (X, Y), which limited my options a lot. I would need a seperate generator for each level, which later on would cost losts of performance, so after some initial tests to see how well C++ performed.
As said above, this system is just a C++ version of the V1 system with some small improvements. However the downside was the 2 Dimensional Generation, as can be seen here:
This system also only generated on 1 line. It would check if the player goes left, forward, backwards or right, and just generate in a line of that direction on the chunks that were previously out of reach.
This made this system EXTREMELY fast, without any Multithreading. However this system was also really unreliable, cause if the Player teleports like trough a portal, the system would not re-generate fully.
In the future it would be interesting to look at this system again and maybe mix it in with the current Generation, however, for now, this system was too unreliable and uncontrollable.
While on Vacation, I really wanted to recode the Generator to work 3 Dimensional, and as I had more experience in C++, I decided to start from scratch completely.
With this I re-implemented most systems, a lot more optimized, including Structures this time to add variety to the world generation, below here is a screenshot if the very first Backrooms Structure generated with Gen V3.
Generator V3 is also 1 of the longer lasting Generators, as it took a long time to make, as much as how great it was, it still ran quite slow due to the lack of optimization knowledge I had in C++.
To account for that, I decided to transfer Gen V3 to be multithreaded.
Generator V4 is the biggest generator made, with over 800 lines of code in the generator alone, and 300 lines of code in the multithread task. Generator V4 was extremely complex due to the multithreading, but it ran quite good!
I only had small spikes, which was a limiting factor of Unreal Engine 5. The Generator spawned in Blueprints that cost a lot more data then needed, but it worked at the time.
Lighting however was a major factor that caused the game to slow down by at least 20fps.
During the creation of Gen V4, I also implemented a Rule System which could remove chunks, overwrite chunks, add structures and some other smaller things. This gave me lots of control over certain specific placements like the entrance hall.
To show the progress I made since Generator V1, I decided to make a preview trailer for the game.
For Generator V4 I also did a stress test to show followers in the Discord the progress that had been made.
For Optimizations I made Gen V5, this generator completely removes the multithreading from the game, as it was too uncontrollable to work with when working with large scale procedural generation, and is better used for complex math equations.
Instead, I adress the biggest bottleneck: the spawning of actors. Spawning Actors does give a lot of control, but a lot of data within it is not needed, and the CPU overhead of them spawning in, and rendering chunks seperately on the GPU, is just a giant bottleneck which adds on top of the lighting lag.
Instead of this, I went with Instances, which only cost 1 drawcall per chunk type, going from around 400 drawcalls in a 20x20x1 radius, to only 8 drawcalls, extremely reducing overhead.
The game could now handle over 10.000 chunks at a time, while the old one couldn't even come close to that.
Also this is the first Generator which steps away from generating only around players, which was hard coded in, but instead uses Chunk Loaders which can be expanded infinitely to also load chunks around certain areas, this is useful for stuff like generating around Portals.
This system is currently still in progress of being completed.
For V5 I decided to go with a simpler system, although it is still in the works, the system works by simply filling a Queue and processing it in Batches. It also uses Instances instead of Actors now to optimize the render time.
The Generation Loading / Unloading of course doesn't need to run every Tick, it only runs when the player moves from 1 chunk to the other, which saves a lot of performance. This system is also a lot more reliable compared to V2 where it now always just does a radius around the player, instead of generating in the direction of where the player goes.
Gen V6 is planned to be the last Generator System I have to create. It will take the Performance of Gen V5, mix it with the flexibility of Gen V4, the visual looks of Gen V3, the noise Generation from Gen V2, and the Meshes from Gen V1.
Combined this will be a wonderful Generation System that should give me flexibility for a long time.
The system makes use of Sub-Generators. Every Level van now have a Separate Generator, similar to Gen V2, but different as well. The Sub-Generators already have a base class, and I can even make pre-made Generators before hand to re-use for certain levels, as nothing is completely hardcoded.
The Main Backrooms Generator will decides which chunk is for which level with a boolean function which can be overwritten for each level to sometimes have custom areas in which this level will generator, it will then send a signal to the Generator of this level, process everything, and the Level Generator will return what the Main Generator needs.
After that the Main Generator will process that, and it will visualize this with instances.
This system is still in preproduction phase, and only a prototype has been worked out. It will be planned out fully rather soon as of writing this.