Imported from goldflag/ship-game (
crates/AGENTS.md). Install upstream withnpx skills add goldflag/ship-game --skill crates. Copyright stays with the author.
Working on the Rust simulation
naval-simis the only simulation.naval-protocoladds wire types,naval-wasmis the browser worker build andnaval-serverthe multiplayer server; dependencies run in that order.- In
naval-sim/src:battle/andbattle.rsare the tick;vessel.rs,hull.rs,motion.rs,maneuvering.rsandmobility.rsmove ships;weapons.rs,gunnery.rs,shell.rs,impact.rs,damage.rs,flooding.rsandfloodwater.rsare combat;aviation/is carrier operations;bots.rs,captain.rs,admiral.rsandpve.rsare AI;construction*.rscompile player designs;frame_delta.rs,snapshot.rsandteam_view.rsare what clients see. - cargo is not on PATH.
bun run rust:test -- <test-file-stem> [filter]runs one integration test on the fast profile (seconds, not minutes); with no arguments it runs the workspace.cargo fmtis safe to run; the workspace is format-clean and CI checks it. More in README.md. definition.rsis generated fromsrc/ships/blueprint.tsbybun run multiplayer:definitions. Frame and command types are exported tosrc/multiplayer/generatedbybun run multiplayer:types; a new root type also needs a line innaval-protocol/src/bin/export.rs.tests/frame_types.rsandsrc/game/session/frameDelta.test.tsgate the frame shapes.- After a Rust change the client needs
bun run multiplayer:prepare:dev(warm: a few seconds);bun run checkdoes this and then runs every TypeScript test, because they run the simulation as WASM. - The simulation stays renderer-free and deterministic: seeded randomness only, no wall-clock time.
- Performance work uses the native profiling harness and equality gate in docs/sim-performance-plan.md; prove behaviour-neutral changes by equality, not by eye.