Home Artists Posts Import Register
Join the new SimpleX Chat Group!

Content

Long post today! Making an effective game based on the Backrooms is difficult for 2 big reasons:

1.) It demands random level generation

2.) It must be realistic

I sat down roughly a week ago and thought of a way to come up with a good solution that would satisfy these two conditions. The tools I'm using is Unity and HDRP, and had great success!

Random Level Generation

The Backrooms prides itself on having maze like rooms with lots of duplication and copy pasted segments.  Being able to get "lost" in a familiar world is unnerving and a core feature of the Backrooms universe. This makes it easy to visualize what kind of assets the game will need. Also tells us the domain of the level generation:  Flat levels with little height variation. However some Backrooms levels do have verticality. So I decided to implement the level generation with a 3D arrays of blocks (length x width x height). Each block would have a different asset (wall, corner wall, empty,etc.). I also decided to implement Wave Function Collapse which is an algorithm that handles random generation. It works for all sorts of problems. Here's an example of the algorithm:

Given a smaller texture, WFC can make an infinitely larger texture that looks like the smaller one. Sounds magical right? It works by comparing small subsets of pixels and figures out which ones fit with other pieces. Like compatible Legos. In the same way, my WFC level generation generates a random map but instead of textures it uses blocks. Here's a demonstration of an early prototype:

Because it's randomly generated, for me to be able to "design" the maps based on the blocks I give it, I have to tell the algorithm the probability of each block so that it conforms to my liking. So if I tell it to randomly generate a map with a high probability of long hallways, it will make a map with lots of hallways.

The problem with random level generation with WFC is that it does not guarantee that what it makes has an entrance and an exit. For example it is possible it generates inaccessible closed off rooms:

The solution for this was implementing A* pathfinding and checking if it was pathable from the center of the map. If it wasn't, then just cut out a random hole and fill it in with a block that allows it to connect to the outside blocks. Solution:

With all of this in mind and interpreting blocks as actual 3D blocks, I achieved Backrooms style map generation:

So now to light it up, that brings me to the 2nd challenge of the Backrooms:

Realistic graphics

This is currently the most difficult aspect of making a game about the Backrooms because when combined with infinitely generated runtime levels, you can't bake lights! Most games (although RTX raytracing says otherwise), like to bake lighting in a map to save your GPU from exploding. Global Illumination, soft shadows, and ambient occlusion is more difficult to do because in Unity you can't bake lights while the game is playing. So in comes The Backrooms demanding every room to be different and also have realistic graphics for that immersive spooky familiar feeling you get when looking at a level.

I threw some lights, nice textures, and got a nice looking completely lit Level 0 map.

BUT. As soon as I randomly turned off lights to make a few randomly super dark corridors, I ran into light bleed!

Light bleed is when a light seems to go through a wall and shine where it should be normally be blocked out by a shadow. The image above should look like this:

The problem is that i can't enable realtime shadows for every single point light as it killed my framerate quickly. I tried all sorts of variations. A level had close to hundreds of lights. Unity HDRP does not allow you to have more than 16 shadows. And framerate suffers after the 8th shadow. Big problem. I can't use shadows and I wanted my dark spooky room! So what I did is I implemented fake baked ambient occlusion. 

Before:

After:

By telling a light to NOT affect a block, I was able to make it look like shadows were being generated. I simply did some physics raycasts.

It works for all sorts of room shapes and sizes. It's not a perfect solution but it gets rid of 95% of bad light bleed. You may still run into a couple weirdly lit blocks but it's worth it.

The last step was to make it infinitely generate. This was achieved by making Minecraft-like chunks that are generated based on a distance from the camera. I haven't made it delete the far away chunks yet but it's very easy! There technically is a generation limit but for our purposes it is PLENTY. 65 kilometers of randomly generated backrooms (with seeds in case you want to generate the same level!).

As you can see, I have a very decent chunk of work already complete. I also hooked up Networking already. There will be a chance that you can run into other survivors in the maze and cooperate or escape together to reach the safe zones in the next Level.

No Documentation

As I said before in the previous devpost, I want everything to be a surprise for this game. Meaning I will try to hold back key details when writing these devposts. For example, I already have 1 entity finished and animated. It is very spoopy and I won't tell you what it does. You'll have to run into it in the Backrooms or talk with other users to learn about it. I will be doing the same for some other things such as map items. I can give a few hints now and then for the sake of Patreon but the point is for you to organically find what and how things work. I'm gunning to have a playable worldwide demo this month (we can all decide on a timezone to have all of us jump in and play at the same time). Join the Discord. We still have the Viva logo but it will be going away soon.


Stay tuned 👻

Files

Comments

NeonSwaglordChen

One of the big problems with the backrooms I find these days is that since it grew popular people have decided to decorate the universe with various factions, detracting from the feeling of isolation by turning it into a diet SCP. Do you plan to do such a thing with the game or will you go for a more limited approach in terms of entities and people?

sgthale

Very limited approach. I think you can really harness the feeling of isolation if you limit the multiplayer element by making other survivor encounters rare enough that it feels like a "treat". I don't want people to think it's a conventional multiplayer game where playing with others is common, it can't be. Say we had 8 players in a level. They will be spaced out enough that only 3/8 will meet somebody. With 1/8 barely meeting 2 other people. The other 5/8 will remain alone by chance of not running into anyone else. That's kind of the ratio I'm gunning for. If they die or something happens, you may come across their corpse. It's kind of like Dark Souls how they have limited multiplayer. You could play with others (if you specify that), but most of the network interactions are blood stains showing previous deaths or leaving behind small "stories", which I think sounds like a critical component for the Backrooms.