Commit Graph
5 Commits
Author SHA1 Message Date
irrlichtandClaude Opus 5 b64c83fce0 Add bump-to-attack, death and a sim event queue
A step onto an occupied tile is now an attack: the geometry rule is checked
against terrain only and the target tile decides between move and bump.
Entities carry an attack stat; at zero hp they are removed. The sim reports
Attacked/Died through an event queue the game drains after every movement
window — the seam for sound, log, camera effects and spawns. Click-to-move
treats an occupied goal as a target but detours around entities in the way;
the player's death ends the game.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 10:59:14 +02:00
irrlichtandClaude Opus 5 7ea351f8e5 Add entity blocking and a wandering NPC
Occupied tiles now block movement through World::blocked, the one predicate
the sim and the pathfinder share. Entities carry an EntityKind so the sim
knows which ones to think for; Sim::think gives each NPC a random king move
one window in four. Intents execute in id order so contested tiles resolve
deterministically.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 10:51:44 +02:00
irrlichtandClaude Opus 5 1d14076468 Drop the chunk palette; chunks are plain u16 tile arrays
The 64-entry per-chunk palette was a wire-format artifact and capped a chunk
at 64 distinct tiles. A Chunk is now Box<[u16; 1024]> with flags derived from
the id on lookup — the same layout a binary on-disk format would use.

Map path becomes the first CLI argument; assets/map_large is a generated
256×256 stress map (loads in ~0.5 ms release). The snapshot test takes
SNAPSHOT_MAP.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-18 23:40:52 +02:00
irrlichtandClaude Opus 5 f594f12f35 Embed the sim in the game binary; drop networking
The client becomes the game: it owns a Sim instance and advances it with a
fixed-timestep accumulator (24 Hz ticks, rendering at frame rate). Rendering,
pathfinding and collision read the World directly instead of a chunk cache.

Sim::pending (window slot maps, late rule, horizon) is replaced by one intent
per entity for the next movement window — set_action replaces, executing the
window consumes. The whole client prediction/reconciliation machinery
(tick estimation, RTT lead, retraction, replay) is gone with the latency it
was built for; click-to-move now syncs the route against the sim position
after every window.

Removed: server, netsim, shared (wire types), client/net.rs. client renamed
to game. Headless tests cover the intent model.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-18 22:56:30 +02:00
irrlichtandClaude Opus 5 303c587aee Extract headless sim crate from server
Move chunk, entity, world, map, sim and load_world into a new sim library
crate together with the game rules from shared (player_action, action_delta,
delta_action, step_allowed, tile_collidable, tick constants). shared keeps
only the wire types and re-exports the rules, so server and client compile
unchanged. First step toward a local single-player build.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-18 22:52:10 +02:00