This system was built at the start of 2022 when I was significantly less experienced.
I had to design something simple yet effective and this was my approach.
I had to design something simple yet effective and this was my approach.
Key design focus was to make players feel truly lost while increasing replayability.
Design
Prebuilt tiles
Each tile contains arrays for: possible room, NPC, torch, coin altar, objective, minotaur statue, gate trap... transforms.
Layout Creation Logic
• Tile Connection Logic: Each tile is uniform in Y-axis size. Has a Y-axis length of exactly 6400 units and has three connection points on both Y-axis sides.
• Placement Calculation: Tiles are spawned based on the previous tiles Y-axis location
(lastTile.Y + 6400), for pixel-perfect alignment.
• Tile Rotation: Each tile also have a 50% chance to be rotated 180 degrees in Y-axis after being spawned, to create more variation for when 2 tiles are connected together.
• Closing off the edges: When tiles are spawned they are added to an array. I get the first and last index tiles and send them an interface message so they can spawn walls at the unused connection points.
• Tile Count: Is automatically set depending on the player count but additionally can be overridden by the server owner to create custom sized labyrinths.
There are a total of 5 tile variations and an average sized labyrinth is 4 tiles big. Tiles can't repeat until all tiles are exhausted.
There are a total of 5 tile variations and an average sized labyrinth is 4 tiles big. Tiles can't repeat until all tiles are exhausted.
Mandatory Rooms
Human spawn room, Minotaur spawn room and labyrinth exit.
These are spawned before regular rooms because they have special spawn rules.
These are spawned before regular rooms because they have special spawn rules.
Spawn Rules
• Human and Minotaur spawns: Human and Minotaur spawns must be at least 100 meters away from each other to prevent the Minotaur finding humans quickly due generation luck.
• Human and Minotaur spawns: Human and Minotaur spawns must be at least 100 meters away from each other to prevent the Minotaur finding humans quickly due generation luck.
• Labyrinth exit: There can be multiple exits, so an exit must spawn at least 40 meters away from an another exit to prevent them being very close.
Regular Rooms
5 sizes: 10x10, 10x14, 14x14, 14x18 and 18x18.
The Minotaur is obviously too big to fit through the doorways.
Minotaur Size Problem Solution:
1- Hidden geometry collection at the exact location of doorway is now visible.
2- Intact static mesh is replaced with a broken one.
3- Geometry collection is awakened and applied a force to simulate stones breaking using chaos physics.
4- Dust VFX is spawned made with Niagara for additional visual feedback.
Room Layouts
Rooms spawn a random layout from an array of unused layouts.
Each room size has 5 layouts and there are 5 room sizes, so 25 layouts in total.
Layouts also have a chance to have 3 randomization events each, which are things such as a table becoming a statue or never being there at all...
Layouts also have up to 10 predetermined cabinet, chest or drawer spawn transforms.
Depending on the loot quantity, an adequate amount of loot containers are randomly spawned in.
Loot, NPCs, temples, objectives...
Quantity of loot depends on player count which gets spawned physically in the previously spawned loot containers. All the remaining things spawn at their pre-designated locations and the labyrinth is successfully created.
WWise
Each labyrinth tile is manually separated into many sections to be used with the "Portals and Rooms" feature for physically accurate spatial sound.
These sections are highlighted with random color in the image. Portals are highlighted with green between each section.
Sound travel comparison from default Unreal Engine vs my Wwise implementation. This was very important to create a more immersive experience.