The Making of a Slaughterhouse: A Dead Meat 3D Devlog
Dead Meat 3D version 1.0 dropped this week (so check it out here!), and having reached this pivotal milestone, I thought I’d reflect on a few noteworthy technical aspects.
This devlog provides a closer look at the procedural map generation system featured in Dead Meat 3D.
I. Map Generator
The Grid
Every map starts with a blank, 3D rectangular grid. The map generator algorithm begins by placing “blocks” along the grid. These “blocks” represent the different chambers within the slaughterhouse.
The algorithm processes each floor sequentially until enough floors are generated.
The Rooms
The blocks are replaced with actual instances of pre-made room prefabs.
Next, the algorithm must “clear a path” from one floor to the next. This is accomplished by removing certain geometry from the wall models (which have been specifically designed for procedural generation.)
We now have a functional, procedurally-generated space for the player. Next up: we’ll look at several techniques to improve the look of the map.
II. Refining the Visuals
Baked vs. Dynamic
The lighting of each room prefab is baked beforehand. Each instance of a room reuses the lighting data of the prefab (which reduces the video memory footprint significantly.)
Unfortunately, since the lighting is entirely baked, the room lights have no effect on dynamic objects (e.g. the player).
In a non-procedurally-generated setting, artists typically fix this by placing light probes at various locations around the scene. Dynamic objects would simply sample nearby light probes to simulate lighting changes.
One glaring constraint with light probes is that all probes must be placed and baked ahead-of-time. So how can the light probe method be made compatible with a procedural map generation system?
Lighting of Dynamic Objects
Our solution involves baking the probes once per prefab (since the prefab is in a static position). Then, each dynamic object does the following:
- Determine which room type it’s currently in
- Transform its position relative to the prefab room
- Sample the light probes in the prefab
Here’s how that process looks in action. Notice that as the player moves, the sample point moves exactly with the player, thus ensuring the light probes are being sampled at the correct location every frame.
Reflections
The final step involves enhancing the surfaces of the room by adding reflections. We bake accurate box reflections per room.
As an added bonus, the box reflections provided fake specular highlights from light sources!
In addition to baked reflections, screen space reflections provide realtime (but less accurate) reflections for dynamic objects.
Conclusion
And there you have it folks; with a few simple tricks, we get a procedurally generated slaughterhouse with a nice blend of precomputed and realtime graphical effects!
See these slaughterhouses for yourself by playing Dead Meat 3D for free on itch.io. Don’t forget to follow Tripping House for more trippy content!
Files
Get Dead Meat 3D
Dead Meat 3D
Infinite slaughterhouse running simulator
Status | Released |
Authors | Tripping House, Ice Key Studios |
Genre | Survival |
Tags | 3D, analog, Arcade, Doom, Halloween, haunted-house, Horror, Retro, Third Person, vhs |
Languages | English |
Accessibility | High-contrast |
Leave a comment
Log in with itch.io to leave a comment.