# Why I Archived My Easy Red 2 Headless Server Mod

> A technical post-mortem on bypassing Unity single-instance locks and FMOD limits—and why host-camera coupling and CPU-bound PhysX made headless hosting the wrong fix.

- URL: https://sudravirodhin.com/writing/easy-red-2-headless-server-post-mortem/
- Date: 2026-11-29T10:16:37.241Z
- Reading Time: 5 min
- Tags: post-mortem, unity, game-ai

## The Hypothesis

In *Easy Red 2*, hosting a multiplayer match normally forces one player's game client to be two things at once: a 60 FPS graphics renderer *and* the single Photon `MasterClient` simulating 100+ AI soldiers, vehicles, and PhysX raycasts on the Unity main thread.

The idea behind [**easy-red-2-headless**](https://github.com/sudravirodhin/easy-red-2-headless) seemed straightforward: strip out rendering and audio in a background headless instance so human players could all connect as pure clients.

## What Actually Worked

Getting two instances running side by side on one Windows PC required solving a string of fun systems puzzles:

1. **Zero-Duplication Staging:** Linking `Easy Red 2_Data` and `MonoBleedingEdge` via Windows Directory Junctions kept the Steam directory 100% vanilla while spinning up an isolated server folder under 150 MB.
2. **Dual-Instance Isolation:** Binary-patching `UnityPlayer.dll` (`-SingleInstanceMutex-` and `UnityWndClass`) allowed the headless host and Steam client to coexist on the same machine, while clearing Photon's same-account join flags let the host's own account join the lobby cleanly.
3. **FMOD Channel Exhaustion Fix:** Muting audio the wrong way starved FMOD's virtual voice channels; keeping `AudioListener.pause = false` at `volume = 0f` let channels recycle silently.

## Why It Still Hit a Wall

Solving boot and networking wasn't enough—because the bottleneck wasn't just the GPU:

- **Deep Host-Camera Coupling:** Even after forcing animator culling off and keeping bone colliders active map-wide, `Creature.CanSee` vision raycasts repeatedly clipped straight through soldiers at `1–7m` whenever the host ran camera-disabled.
- **CPU-Bound Simulation Reality:** *Easy Red 2*'s heavy cost lives on the CPU inside Unity/PhysX and AI updates—not rendering. Spinning up a second process consumed ~1.7 GB of RAM for ~45 FPS headless ticks while giving far less speedup than expected.

## The Lesson

Sometimes the bravest engineering decision is recognizing when you are optimizing the wrong bottleneck. Archiving the headless prototype freed me to channel all of that profiling straight into [**Battle Hardened**](https://github.com/sudravirodhin/easy-red-2-ai) on a clean Listen Server—delivering sharper AI and smooth frame pacing with zero headless desyncs.
