Watch
1
0
Fork
You've already forked ZST
0
forked from Antoine/ZST
No description
  • Rust 52.1%
  • TypeScript 33.5%
  • Python 9.3%
  • CSS 3.4%
  • HTML 0.9%
  • Other 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-05 21:11:58 -10:00
.cargo M1 combat prototype: Rust/WASM core + Three.js client 2026-11-04 23:17:04 +01:00
crates Correction bug detection de lancement mission 2026-11-05 21:11:58 -10:00
data Portraits: drop the frown mouth and worried brows 2026-11-05 20:58:00 +01:00
docker Docker setup, low-poly Blender models and animations for units, props and places 2026-11-05 21:01:39 -10:00
docs Docker setup, low-poly Blender models and animations for units, props and places 2026-11-05 21:01:39 -10:00
scripts Docker setup, low-poly Blender models and animations for units, props and places 2026-11-05 21:01:39 -10:00
web Docker setup, low-poly Blender models and animations for units, props and places 2026-11-05 21:01:39 -10:00
.dockerignore Docker setup, low-poly Blender models and animations for units, props and places 2026-11-05 21:01:39 -10:00
.gitattributes Full campaign client: overworld, screens, saves, campaign battles 2026-11-05 00:15:05 +01:00
.gitignore Docker setup, low-poly Blender models and animations for units, props and places 2026-11-05 21:01:39 -10:00
Cargo.lock Full campaign client: overworld, screens, saves, campaign battles 2026-11-05 00:15:05 +01:00
Cargo.toml M1 combat prototype: Rust/WASM core + Three.js client 2026-11-04 23:17:04 +01:00
docker-compose.yml Docker setup, low-poly Blender models and animations for units, props and places 2026-11-05 21:01:39 -10:00
Dockerfile Docker setup, low-poly Blender models and animations for units, props and places 2026-11-05 21:01:39 -10:00
README.md Docker setup, low-poly Blender models and animations for units, props and places 2026-11-05 21:01:39 -10:00
rustfmt.toml Full game core: campaign, overworld, characters, items, bases, towns 2026-11-04 23:58:58 +01:00

Zombie Survival Tactics (working title)

A web-based, top-down 2.5D tactical survival RPG. You lead a squad of up to 6 survivors through an endless, procedurally generated world overrun by the infected, mutated animals and raiders. The farther you go from the shelter, the deadlier it gets, and the better the loot.

Design and requirements live in docs/: GDD · functional requirements (with an implementation-status table) · technical requirements.

World

What's in the game

Area Highlights
Overworld Infinite chunked world with 5 biomes, roads, lakes, and a danger tier that grows with distance. Click-to-move travel with a day/night clock. Roaming groups chase you if they spot you. Night hordes. Search houses, stores, hospitals, police stations, military checkpoints, factories, nests and raider camps.
Battles Grandia-style initiative timeline (WAIT → COM → ACT) with delay and cancel, move-then-act on a height grid, cover and line of sight, shared vision with "?" markers for hidden movement, downed/revive/bleed-out, squad retreat, and ambushes (who engaged first matters). The arena matches the biome you fought in.
Enemies Infected (walker, runner, brute, spitter, screamer, bloater, armored), mutated animals (dogs, boars), raiders (thugs, gunners, marksmen), elites, and nest bosses (the Matriarch, the Raider Warlord).
Characters 6 classes (Brawler, Rifleman, Medic, Sniper, Engineer, Scout), each with 2 specializations at level 5 and a mastery skill at level 10. 6 attributes with randomized growth, traits (innate and earned), injuries (light, serious, permanent), infection, and permadeath. Characters left behind go missing and can be rescued.
Items Base item × tier × rarity × affixes, with stat and class requirements (PSO-style), weapon proficiencies, sidearms, shields and tools. No ammo, no durability.
Forge Grinding (+N), forge effects in rarity-based slots (incendiary, toxic, shocking, piercing, leeching…), and salvage.
Base Free grid building (shelters, farms, water, workbench, forge, chem lab, infirmary, research desk, radio, walls, watchtowers, turrets), jobs for residents, a construction queue, crafting, and a research tree with blueprints found in the wild.
Raids A threat meter leads to announced raids. You fight them on the actual base layout (turret posts join in) or let the defenders auto-resolve. Outposts can be overrun.
Settlements Shops whose stock depends on the tier, a materials market with local prices, tavern recruits, and job boards (bounties, caches, supply runs, rescues). Visitors also come to the base.
Survival Food and water upkeep, starvation, healing over time, autosave with a rolling backup, and save export/import.

More screenshots are in docs/screenshots/: title, roster, inventory, base, research, crafting, town (shop, tavern, jobs), battle, raid, report, night, skirmish.

Architecture

  • crates/game-core: all the rules, in pure, deterministic Rust (seeded RNG, integer math, no I/O). The campaign, world, battle, items, characters, bases and towns all live here. There are 163 tests, including multi-day campaign bots and save round-trips.
  • crates/game-wasm: a wasm-bindgen bridge. The CampaignHandle.call(method, json) dispatcher handles the campaign, and Game runs skirmishes.
  • web/: Vite + TypeScript + Three.js. It renders the overworld and battle scenes, the HTML screens, and the IndexedDB saves. The TypeScript types in web/src/generated/ are generated from the Rust types with ts-rs.
  • data/*.json: all the content (classes, skills, items, affixes, effects, enemies, materials, traits, injuries, buildings, tech, recipes, names). It is validated when the game loads.

Prerequisites

  • Rust stable with the wasm target: rustup target add wasm32-unknown-unknown
  • wasm-bindgen-cli at the same version as the crate: cargo install wasm-bindgen-cli --version 0.2.130 --locked
  • Node.js 20+. On this machine, a portable Node 26 lives in .tools\node-v26.13.0-win-x64 (git-ignored). From the project root, start the dev server with: & .\.tools\node-v26.13.0-win-x64\node.exe web/node_modules/vite/bin/vite.js web --port 5173 --host

Run it

cd web && npm install
npm run wasm
npm run dev

Open http://localhost:5173. Useful URLs:

  • /?seed=123 starts a fresh campaign on a fixed seed, skipping the title.
  • /?skirmish=1 starts a quick battle.
  • In the Claude desktop app, the web entry in .claude/launch.json starts the dev server. It listens on the LAN with --host.

Controls

  • Overworld: click to travel, click a group to attack it, right-click to stop. R opens the roster, I the inventory, B the base, T research, K crafting and J jobs. Esc opens the menu, Space pauses, C recenters, and Q/E rotate.
  • Battle: click a blue tile to move, pick an action, then click a target. Esc backs out, Space pauses, 1 2 3 set the speed and F3 toggles debug.

Test it

node scripts/check.mjs

This runs fmt, clippy -D warnings, the Rust tests, the WASM build, tsc and vitest.

cargo test -p game-core --release -- --ignored balance --nocapture

This runs a 30-day bot campaign on 6 seeds and prints survival stats.

node scripts/screenshots.mjs

This regenerates docs/screenshots/ with headless Chrome. The dev server must be running.

3D models

The low-poly unit models (6 classes, infected, animals, raiders, turret) are web/public/models/*.glb. Each model is a small hierarchy of rigid parts (hips, torso, head, arms, legs; body, head, legs, tail for animals) with four animation clips: idle and walk (loops), attack and hit (one-shots). web/src/render/models.ts plays them (AnimatedModel); the battle scene triggers walk / attack / hit, the overworld walk / idle. They are generated by a Blender script; edit it and regenerate, there is no .blend file to maintain:

/Applications/Blender.app/Contents/MacOS/Blender --background --factory-startup --python scripts/blender/build_models.py -- web/public/models

scripts/blender/preview_models.py renders all of them side by side into one PNG (... --python scripts/blender/preview_models.py -- web/public/models sheet.png). A unit kind without a model falls back to the old procedural shapes in web/src/render/scene.ts.

The terrain props are built the same way by scripts/blender/build_props.py into web/public/models/props/ (static, no animation): trees (pine, oak, dead), bushes, rocks, cars (sedan, pickup, wreck; the body uses a paint material recolored per car), barrels, crates, sandbags, fences, low walls, walls and buildings (scaled to the prop height), plus the overworld pines, oaks and ruins, and one model per overworld place (poi_<kind>: house, cabin, store, gas station, hospital, police, military, factory, farmstead, nest, raider camp, town, cache, and poi_shelter for the base; searched places turn grey). web/src/render/props.ts loads them; the battle scene picks a variant per tile (and by ground type: dead trees on mud, toxic barrels on pavement), the overworld merges them into instanced meshes. Contact sheets: docs/screenshots/props.png, docs/screenshots/places.png.

/Applications/Blender.app/Contents/MacOS/Blender --background --factory-startup --python scripts/blender/build_props.py -- web/public/models/props

Tuning

  • Content: all content numbers are in data/*.json.
  • Battle: timeline and battle constants are in crates/game-core/src/types.rs; combat math is in combat.rs.
  • World: danger scaling is TIER_DISTANCE in world.rs.
  • Survival and raids: upkeep, threat and raids are in base.rs.