Dead Ends
8-player Unity horror game • P2P networking • Proximity voice chat
A multiplayer horror game built in Unity. I designed and implemented core gameplay systems, peer-to-peer networking, and proximity-based voice chat with a focus on responsiveness, stability, and clear player feedback.
How I Built This
Networking Architecture
- Built a Steam lobby flow (create/join via 5-digit code + invites), then used lobby state to coordinate match start and scene transition into gameplay.
- Wired the lobby host as the network host (Facepunch/Steam transport), and started Host/Client cleanly with safety checks + fallbacks to avoid “double start” or invalid states.
- Implemented a player initialization pipeline (SteamID + name sync, “ready” gating, and spawn handling) so clients don’t spawn until core managers and network state are valid.
- Handled asymmetric roles by spawning the monster server-side and transferring ownership to a randomly selected client, while enabling/disabling the correct local components per owner.
- Synced movement/animation reliably using client-authoritative transforms where appropriate and networked animator state updates, with despawn/death safety checks to prevent null spam during disconnects.
Proximity Voice Chat
- Integrated Vivox positional voice chat and tied channel lifecycle directly to the multiplayer lobby (join/leave synchronized with match state).
- Registered players into the voice system using Steam identity, dynamically attaching voice taps and audio sources to spawned networked player objects.
- Implemented true proximity-based audio by combining Vivox 3D positioning with custom AudioSource rolloff curves to control volume falloff and max speaking distance.
- Kept voice state stable across joins, leaves, deaths, and scene transitions by explicitly updating player 3D positions each frame and re-binding ownership as needed.
- Built player-facing voice controls (mute self, mute others, per-player volume sliders, input device selection) with settings persistence across sessions.
Gameplay & Systems
- Built a physics-driven first-person controller (walk/sprint/crouch/jump) with stamina and state-driven animation hooks for readable player feedback.
- Implemented slope-aware movement (surface-normal projection, velocity clamping, gravity handling) to keep movement stable across uneven geometry.
-
Designed modular interactions using an
Interactablesinterface and a playerInteractorso gameplay objects remain decoupled and easy to extend. - Built an inspection mechanic that moves objects into a camera-space view, supports rotate/zoom, and safely disables/re-enables player + camera input while inspecting.
- Added environmental readability systems (spotlight detection + smooth fade/flicker) to support stealth and communicate visibility to players.
Performance & Player Readability
- Designed a player-centric lighting system that enables and disables spotlights dynamically based on proximity, significantly reducing active light count during gameplay.
- Avoided per-frame lighting cost by fully disabling lights outside the player’s influence instead of leaving them active at zero intensity.
- Implemented smooth fade-in/out with coroutine state tracking to prevent overlapping transitions and visual popping when entering or exiting lit areas.
- Added subtle, low-cost flicker to active lights to preserve horror atmosphere without impacting performance.
- Used lighting as gameplay feedback to communicate visibility and danger to players, improving stealth readability in dark environments.
Note on source: Code is private due to commercial/game IP concerns. I’m happy to do a code walkthrough or share a limited private repo on request for recruiters/hiring teams.
Results & Next Improvements
What shipped, what I learned, what I’d do next.
What Shipped
- A complete 8-player multiplayer horror experience with proximity-based voice chat integrated directly into gameplay.
- A stable core gameplay loop (hiding, seeking, traversal) supported by responsive movement, readable interactions, and consistent player feedback.
- A working end-to-end multiplayer flow: lobby creation, joining, role assignment, gameplay, death/spectating, and match completion.
- Performance-aware systems (dynamic lighting, controlled replication, audio attenuation) that kept gameplay smooth during real play sessions.
If I Had More Time
- Expanded content variety with additional maps, monsters, and cosmetic customization to increase replayability.
- Built a more robust lobby UI allowing players to select roles (e.g., choose the monster) and configure match settings before starting.
- Improved lobby and matchmaking UX with clearer state indicators and smoother transitions between menus and gameplay.
More Projects
Want another example?