Mara Simulator: Web-Based African Savanna Survival
An immersive multiplayer ecosystem you survive in—no download, no sign-in to play
Project Overview
Mara Simulator recreates the savanna of the Maasai Mara and Serengeti as a browser-based survival game. You spawn into a procedurally generated world and stay alive by managing health, hunger and stamina, scavenging and hunting for food, reading the terrain, and—above all—staying clear of lion prides that actively hunt. The long-term vision is a living multiplayer ecosystem where players and wildlife share one world and the food chain runs both ways.
It runs entirely in the browser on Three.js and Cannon-es—no install, no sign-in to play—and takes its camera and aesthetic from Art of Rally: a high overhead angle over clean, stylized low-poly terrain.
This is an ongoing solo project, in active development and built spec-first—every system has a living specification that drives the work and a clear place on the roadmap. The page below describes the full game as designed, with each feature marked for what's playable today versus what's still being built.
The fastest way to get it is to play the live demo—what follows is how it works under the hood.
The Experience
Mara is built around a few design pillars:
- The food chain runs both ways. You hunt to eat, but you're also prey—and a healthy human can't outrun a charging lion. Survival is about awareness and positioning, not reflexes.
- Risk lives where the food is. Carcasses and prey cluster in the same zones the predators patrol, so every meal is a calculated risk.
- Cooperation beats the savanna. Large prey is too much for one player—taking down a buffalo is meant to need a coordinated group, and kills are shared.
- The world is indifferent. Day turns to night, the herds move, and the ecosystem keeps its own balance whether or not you're winning.
Some of this is live today and some is still being built; the breakdown below marks which is which.
Features & Status
Survival mechanics
- Core loop (live) — health, hunger and stamina tick every frame. Hunger drains a full bar in ~10 minutes; at zero it cascades into health, and starvation kills. Death shows a brief overlay, then respawns you with a new name and position.
- Condition-scaled sprint (live) — your top speed scales with your worst stat and decays the longer you run, from full speed to a forced walk. Tuned against lion speed so you genuinely can't stroll away from a hunt.
- Feeding (live) — graze carcasses scattered near the ponds to refill hunger, in the same risk zone the prides work.
- Foraging economy (live) — per-species meal values (an antelope feeds a few, a buffalo a group), edible carnivores that carry a real sickness risk, poisonous plant patches, and meals that refuel sprint energy — the risk/reward loop runs today.
Wildlife & AI
- Lion prides (live) — emergent, rule-based hunting: detection, stalking (you're more exposed from the front), encirclement, and a group-hunt threshold where the pride commits once enough members engage — and prides now also hunt the herbivore herds when no player is in reach, feeding the scavengers. Verified by a unit-test harness and live runs at 150 lions, with male/female lion variants on the stylized low-poly rig.
- The wider cast (live) — herbivore herds with flocking and flee behaviour (antelope, zebra, giraffe, buffalo — most outrun a charge; the buffalo fights back), scavengers racing you to carcasses (hyenas, vultures), and ambush water hazards (crocodiles, hippos) in the ponds.
- Spawn as wildlife (live) — a share of players spawn as prey (a herbivore): faster, unable to fight, hunted by everything, scored on survival alone.
World & environment
- Procedural terrain (live) — a 6 km² savanna (a layered sine/cosine height field plus placed hills), lakes, curving rivers, instanced vegetation, scattered rocks and props, with distance-based culling.
- Day/night cycle (live) — a dynamic sky and a sun that drives directional, ambient and hemisphere lighting (and shadow direction) across a 20-minute in-game day.
- Water (live) — wade the shallows (slowed, sprint suppressed) or swim deep water, with swimming draining stamina.
- Weather (live) — a procedural rain/fog cycle that modulates visibility; more varied terrain biomes remain planned.
Rendering
- WebGL pipeline (live) — ACES filmic tone mapping, 4096² PCF soft shadows, a logarithmic depth buffer, exponential fog, sRGB output, and a capped device-pixel-ratio for performance.
Movement, camera & animation
- Physics character (live) — a Cannon-es convex-hull body that follows the terrain, with WASD/arrow movement, sprint and jump.
- Follow camera (live) — an Art of Rally-style overhead camera that orbits with the player's heading and guards against terrain clipping.
- Animation (live) — an idle/walk/run blend tree with clip speed synced to ground speed, plus terrain-adaptive two-bone foot IK that plants feet on slopes.
- Mobile (live) — touch controls with a virtual joystick; drag past the rim to sprint.
Multiplayer
- Instant join (live) — anonymous-first: a silent session is created on load, so you jump straight in with a random name; no sign-in required to play.
- Remote players (live) — other players sync in real time through a deployed Socket.IO relay (Cloud Run, one shared world), buffered and interpolated ~100 ms behind for smooth motion, with join/leave handling and stale-avatar cleanup. The transport is abstracted (a BroadcastChannel mock for local two-tab testing), and the game falls back to solo play if no server is reachable.
- Authoritative backend (planned) — a server that owns game state and resolves combat, hunting and death, enabling shared cooperative kills and anti-cheat.
Progression
- XP & leaderboards (live) — a per-life score (survival + kills, idle-farming resistant) with a global top-25 leaderboard and persistent personal bests.
Accounts & monetization
- Optional accounts (live) — anonymous-first, with optional Google or email/password linking; progress earned before sign-in carries over, and returning players can sign back in across devices. Firebase-backed, provisioned June 2026.
- Monetization (live — July 2026) — an in-game store selling a one-time ad-removal and superboost power-ups (superspeed, superhealth, superstamina) in KES through my WiraPay payment service (card + M-Pesa hosted checkout), gated behind a permanent account. Entitlements are granted server-side by a small Cloud Run service — signed webhooks, verify-before-grant, idempotent on the payment reference — and applied in-game the moment they land.
Technology Stack
- 3D / physics: Three.js (r0.158), Cannon-es (0.20)
- Language / build: TypeScript 5.2 (strict mode), Vite 5, Tailwind CSS 4
- Networking: Socket.IO client 4 over a swappable transport layer
- Accounts: Firebase (v12) Auth—anonymous-first with Google / email-password linking—and Firestore-persisted scores
- Quality gates: Vitest unit tests (300+ across game, relay, and payments service), ESLint and Prettier,
tsc --noEmit—all enforced in GitHub Actions CI - Workflow: spec-driven development—
docs/specs/*track each system's contract and per-feature status - Deployment: static Vite build on Firebase Hosting; two Cloud Run services back it—the Socket.IO multiplayer relay and the WiraPay payments service (checkout, signed webhooks, entitlement grants)
Technical Implementation Highlights
Condition-scaled sprint
Sprinting isn't a flat multiplier. Top speed scales with the player's "condition" (a weighting of their worst survival stat) and decays with distance sprinted—full speed, then a degraded floor, then a forced walk with a recovery delay. The numbers are tuned against lion speeds so escaping a hunt costs a real, finite resource rather than just holding Shift.
Emergent lion hunting
Pride behavior emerges from per-lion rules rather than a central state machine: directional danger build-up, encirclement slots with repulsion between herdmates, a threshold that pulls the whole pride into a group hunt, and a walk/charge band so nearby lions stalk and circle instead of sprinting in place. It's covered by a unit-test harness and was evaluated live at herd scales up to 150.
Modular, spec-driven architecture
The game is composed of focused managers—world, player (physics, model, movement, camera, state, animation), animals, input, UI, network and audio—each with its own lifecycle. Paired with per-system specs and CI gates, that structure keeps each piece independently testable and turns an ambitious roadmap into something you can build one feature at a time.
Roadmap
- Foundation (complete) — world, rendering, day/night, physics movement and animation
- Survival (complete) — the hunger / health / stamina loop, sprint, feeding, death and respawn
- Predators (complete) — lion-pride hunting AI with male/female variants; prides also hunt the herds
- Ecosystem (live) — flocking herbivore herds, scavengers, crocodiles and hippos, poison, sickness, spawn-as-wildlife
- Multiplayer (relay live) — real-time sync through a deployed Cloud Run relay; an authoritative server (cooperative kills, anti-cheat) is the planned next step
- Accounts & monetization (live) — anonymous-first accounts with optional linking, global leaderboard, and a KES store (ad-removal + superboosts) charging through WiraPay
- Depth (live / ongoing) — weather, the foraging economy, XP and leaderboards shipped; biome variety and new systems keep landing
Skills Demonstrated
- Real-time 3D in the browser: Three.js rendering pipeline, lighting and shadows, day/night, instancing and culling
- Physics & character control: Cannon-es convex-hull bodies, terrain following, and tuning movement for feel
- Game AI: emergent, multi-agent hunting behavior, verified by tests and live evaluation
- Systems design: modular manager architecture, spec-driven development, TypeScript strict mode, and CI quality gates
- Networking: client-side entity interpolation, a transport-abstraction layer, and graceful degradation
A solo project in active development—this page tracks the full design and updates as features ship. The clearest picture is always the running game: mara.ike.work.