← Back to Projects

Parasite

Parasite is a multiplayer survival action-RPG written from scratch in C11. You wake in a prison cell at the start of an extraterrestrial zombie outbreak, escape through hand-authored zones (forest, logging road, river crossing, gas station, beach), and row out to a rescue ship. The world is persistent and hostile: infection spreads NPC-to-NPC in real time whether or not you play, PvP is always active with no safe zones, and permadeath is the social redemption mechanic. The look is deliberate SNES-era discipline: strict 256-colour indexed graphics at 480×270 internal resolution, upscaled by a fragment shader to any display.

Parasite screenshot
Tech Stack

Core

C11CMakesingle shared core library

Client

Allegro 5.2indexed fragment shader60 FPS

Server

Headless Linux4-thread model20 Hz simRCU snapshot pool

Networking & Voice

ENet (UDP)Opus voicelibsodium

Persistence & Auth

SQLite (WAL)Ed25519 / X25519HKDF-SHA256HMAC-SHA256

Testing & Tooling

µunit + ctestLibFuzzerASan / TSan / MSanclang-tidy
Architecture Overview
  • Single multi-threaded C11 server: Net I/O, Sim (20 Hz), Voice Mix, and DB Write threads share world state under a mutex
  • RCU-style 4-slot atomic snapshot pool lets the voice thread read world state lock-free for spatial mixing
  • Strict 256-colour indexed rendering at 480×270 internal resolution, upscaled by a fragment shader, locked at 60 FPS client-side
  • ENet on UDP 7777 (reliable + unreliable channels) for game; a separate raw UDP socket on 7778 for Opus voice
  • Per-packet authentication: Ed25519 identity + X25519 ECDH → HKDF-SHA256 session keys + 16-byte truncated HMAC-SHA256
  • Q15 fixed-point positions (never floats) and little-endian serialization for deterministic, replayable behaviour
  • Persistence via SQLite (WAL) plus a periodic world.bin snapshot; supports up to 25 concurrent players
  • Python codegen pipeline emits paletted PNGs and C sources from a single master 256-colour palette
Claude Code Usage
5 agents 2 skills

Agents

c-developergame-developernetwork-engineervoice-engineersecurity-auditor

Skills

pre-deployment-validationshell-testing-workflow

Highlights

  • 5 domain-scoped subagents each pre-load their relevant architecture docs: the network-engineer owns the wire protocol, the voice-engineer owns Opus spatial mixing
  • The read-only security-auditor agent produces written vulnerability findings (memory safety, integer arithmetic, crypto misuse) rather than patches
  • Cross-cutting invariants (wire format, crypto handshake, Q15 positions) are enforced through the shared core library so agents stay consistent
  • Verification is local: a pre-commit hook runs the full CMake build, ctest suite, and core/ include-boundary check, with no remote CI
Key Accomplishments
  • Real-time infection that spreads NPC-to-NPC across a persistent world via a cold-chunk SIR model, so the world degrades whether or not you play
  • Server-mixed Opus proximity voice (48 kHz, 20 ms frames) with distance falloff, wall attenuation, and source-address binding against spoofing
  • The Marked PvP system: killing a named NPC flags you map-wide until permadeath, keeping settlements social without mechanical safe zones
  • Four-thread server with an RCU 4-slot snapshot pool feeding lock-free spatial voice mixing at a 50 ms per-tick CPU budget
  • Strict 256-colour indexed pipeline at 480×270 with a Python asset codegen toolchain emitting paletted PNGs and C from one master palette
  • Hardened C networking: per-packet HMAC auth, token-bucket voice rate limiting, and LibFuzzer harnesses over every protocol parser
  • Verified across ASan/UBSan, TSan, and MSan sanitizer build trees with a dedicated TSan wrapper for the kernel ASLR / shadow-layout conflict