Skip to content
roughcut-worksPublic

About

1v1 tactical browser FPS with anatomical trauma simulation (no HP bars), 64Hz authoritative Python server, and Three.js client.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

Depot — a 1v1 tactical FPS with no health bar

CI Python 3.12+ License: MIT Zero Build Step Tickrate: 64Hz

Real-time 3D in the browser. Two players, one arena. What makes it different is that damage is not a number — it is an anatomical simulation.

A round through the skull ends you instantly. A round through the right forearm severs the flexor tendons, and your hand stops working: you cannot hold a weapon, and you cannot work a tourniquet with that hand either. A round through the front of the thigh clips the femoral artery and starts a two-minute bleed-out clock; the same round through the back of the same thigh takes only hamstring and you survive it. Nothing about that asymmetry is special-cased — the artery is simply anterior-medial, and the geometry decides.

There is no HP, no armour value, and no damage number anywhere in the codebase.


Requirements

Python 3.12+ and a Chromium or Firefox browser. No Node.js, no npm, no build step. Everything is free and permissively licensed; the project costs nothing to develop or play and runs fully offline after setup.

Setup

Windows (PowerShell):

powershell -ExecutionPolicy Bypass -File tools\bootstrap_venv.ps1

Linux / macOS (Bash):

chmod +x tools/bootstrap_venv.sh
./tools/bootstrap_venv.sh

That creates .venv, installs four dependencies, vendors three.js (pinned and sha256-verified), and generates a self-signed TLS certificate.

Running

The server is never started automatically.

.venv\Scripts\python.exe run_server.py --no-tls     # same PC, two windows
.venv\Scripts\python.exe run_server.py              # LAN, TLS for the 2nd machine
.venv\Scripts\python.exe run_server.py --no-spin    # cooler on battery

Same PC: open http://localhost:8443 in two windows. No certificate needed — http://localhost already counts as a secure context, so mouse capture works.

Over LAN: run with TLS and open https://<your-lan-ip>:8443 on the second machine. Accept the certificate warning once. This is not optional decoration: the Pointer Lock API requires a secure context, and a plain http:// LAN address is not one, so mouse capture will silently fail without TLS. The certificate script prints the correct URL.

Controls

W A S D move — backpedal and strafe are slower than forward
Shift sprint (costs stamina; stamina loss widens your sway, not your speed)
Ctrl / Z crouch / prone — both are latches, not holds
Q / E lean around cover
Space jump; against a ledge, mantle
Alt (right) free-look — check your flank without changing course
Right Shift hold breath — steadies the sights for up to 6 s, then costs you
Mouse 1 / 2 fire / aim down sights
R reload
1–4 rifle, SMG, pistol, knife
V shoulder swap
H medical panel
5–0 tourniquet, gauze, bandage, chest seal, splint, pill pack
F1 hitbox view — draws the server's actual collision volumes
F2 performance and prediction-divergence overlay

The wound model

Blood volume, per-organ involvement, named arteries, limb motor integrity, pain, shock and consciousness, all integrated continuously. Representative outcomes, all verified by the test suite:

Wound Outcome
Cranium, brainstem, cervical cord instant, untreatable
Heart unconscious ~5 s
Abdominal aorta unconscious ~21 s
Carotid unconscious ~7 s — at 80%+ blood remaining, because it starves the brain directly rather than draining you
Iliac artery ~59 s, and no tourniquet reaches it
Femoral artery ~112 s untreated; survivable with a tourniquet inside the first minute
Liver ~70 s
Gut, kidney, single lung survivable — conscious, in agony, badly degraded

Limb consequences: right arm disabled forces the left hand (accuracy ×0.45, sway ×2.2, rifle ADS impossible). Both arms disabled means no attack at all — but movement is completely unaffected. A destroyed leg forces prone and a 0.65 m/s crawl, which is deliberately not zero: you need to be able to drag yourself to cover and get a tourniquet on, and that decision is the whole point.

Field medicine

Constrained to what a soldier with an IFAK can actually do. A tourniquet works on limbs and nowhere else — attempting one on the abdomen is rejected with a reason, not silently ignored, because a treatment that quietly does nothing teaches nothing. Nothing in the kit reaches the brain, spine or heart. One of each item per life, so treatment is triage.

The morphine is a trap, and a real one: it cuts pain 70% and steadies your aim while doing nothing whatsoever about the bleeding, and it costs consciousness margin you may need.

Testing

.venv\Scripts\python.exe -m pytest

217 tests. The suite covers physiological trajectories against documented realistic bands, TCCC eligibility rules, the character controller (asserting the capsule never ends a tick inside geometry), collision primitives against brute-force intersection, wire-format quantization, and a full headless integration pass driving the real world through the real codec.

Cross-language parity is the one thing pytest cannot check. movement.py and movement.js implement the same controller in two languages, so tools/gen_movement_golden.py records a 1275-frame trajectory from the authoritative Python and client/tests.html replays it through the JavaScript, reporting the worst divergence against the 10 mm reconciliation tolerance. Open that page through the server to verify it.

.venv\Scripts\python.exe tools\check_client.py    # static client wiring check

Architecture

server/physio/   the wound model — pure, no I/O, no clock, no RNG unless passed one
server/sim/      trace, movement, ballistics, rig, hit registration, knife, lag comp
server/net/      wire codec, transport, sessions
shared/*.json    read verbatim by BOTH sides — the anti-drift mechanism
client/js/       three.js renderer, prediction, HUD, WebAudio

Three decisions shape everything else:

Wound state is authoritative-only. It is never predicted and never replayed, so the entire physiology model carries no cross-language determinism burden and can be pure, deterministic Python that is exhaustively unit-tested.

The rendered player model is the hitbox rig. The same 22 boxes the server ray-tests are the ones three.js draws. Hitbox/visual drift — the dominant source of "that was bullshit" in shooters — is structurally impossible. Press F1 to see them.

Every shared constant lives in shared/*.json. Neither movement.py nor movement.js may hardcode one; a test enforces it. That is what keeps prediction and authority in agreement.

Footprint

~50 MB total (37 MB of it the venv), zero binary assets — every texture is procedural, every sound is WebAudio-synthesised, all geometry is generated from JSON. Server load is around 1.6 ms per tick with both players firing, about 10% of the 15.6 ms budget at 64 Hz. Snapshots are ~110 bytes, roughly 7 kB/s per client. The renderer targets the integrated GPU at a 60 FPS cap and pauses on window blur.

Licences

This project is licensed under the MIT License.

Component Licence
Python 3.12 PSF-2.0
websockets BSD-3-Clause
cryptography Apache-2.0 OR BSD-3-Clause
pytest MIT
pytest-benchmark BSD-2-Clause
three.js MIT

All permissive. No account, API key, subscription or hosting bill, ever.

Contributing

We welcome contributions! Please review our Contributing Guide and Code of Conduct before submitting pull requests or opening issues. Security concerns should follow our Security Policy.

About

1v1 tactical browser FPS with anatomical trauma simulation (no HP bars), 64Hz authoritative Python server, and Three.js client.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages