Viktor PennskogViktor Pennskog
VOICEBOX still

VOICEBOX

A 2D co-op game set in a dangerous amusement park, featuring a deterministic, segment-based procedural level generator.

Team
5 students
Duration
10 weeks
Scope
Procedural generation + core systems
Status
Released on Steam
Tech
UnityC#PCGScriptableObjectMultiplayer

Procedural Levels for VOICEBOX

VOICEBOX is a 2D top-down co-op game for up to six players. Players explore an amusement park, solve puzzles, and avoid monsters that can hear them speak.

I was one of two programmers on the project. My main responsibility was the procedural level generator, alongside work on networking, Steam integration, audio, and other core systems.

Segment-Based Generation

The generator builds each level from LevelSegment prefabs rather than individual tiles. This gives the game procedural variation while allowing every room and corridor to be deliberately designed around puzzles, enemies, and co-op interactions.

Each segment contains the data needed by the generator:

  • Connectors define where other segments can attach
  • Bounds prevent rooms from overlapping
  • weighted selection controls which segments can appear
  • usage limits prevent individual segments from appearing too often
  • item spawners provide positions for interactable objects

When placing a segment, the generator aligns two compatible connectors and checks the new segment's bounds against the existing layout. If it overlaps, another option is tried.

Unity Scene View showing segment connectors and bounds with Gizmos

Unity Gizmos visualize the connectors, their directions, and segment bounds. These debug tools made incorrectly configured rooms much easier to identify without inspecting the generator code.

Generation Pipeline

As the generator grew, I split it into a configurable GenerationStage pipeline. Each stage has one responsibility and builds on the result of the previous stage:

  1. Place the starting room and generate the main layout
  2. Add a specific end segment
  3. Place puzzle content
  4. Open doors between connected rooms
  5. Close unused connections with walls
  6. Place items throughout the finished level
Flowchart showing the level generation stages

This structure kept room placement separate from gameplay content and made the system easier to extend, debug, and configure in the Unity inspector.

The generator can run instantly during gameplay or slowly while debugging, making every placement decision visible in the Scene View.

Deterministic Multiplayer

Levels are generated from a seed. With the same seed and segment data, every client can independently recreate the same layout instead of receiving the entire map over the network.

Deterministic generation was also valuable during development. When a layout exposed a bug, I could save its seed and repeatedly test the exact same level.

Result

The finished system generates connected layouts, adds end rooms and puzzles, resolves doors and walls, and places items. Its data-driven setup also allows new rooms to be added and balanced without modifying the generator itself.

The biggest lesson from the project was that procedural generation needs more than randomness. A useful generator also needs clear rules, strong debugging tools, and enough control for other team members to create content confidently.