Ecology: make natural nodes physical (enforce BlocksWalk/BlocksSight in movement + LoS) — before F5 #255

Open
opened 2026-08-02 14:23:53 +02:00 by panda · 1 comment
Collaborator

Gap surfaced by the F4 whole-branch review (ecology AoI slice, #251 / epic #250).

Natural nodes now travel to clients over AoI (F4) carrying each node's BlocksWalk/BlocksSight, and the client stores them — but the authoritative server never enforces those flags. MovementSystem walkability and line-of-sight consult only the tile map (IsWalkable / HasLineOfSight / tiledata), never the NaturalNodeRegistry. So a mature pine or a rock outcrop (both BlocksWalk = true) is walk-through and see-through on the server.

Harmless while nodes are invisible, but the moment the client renders them (F5) a solid-looking tree the player walks through is a visible authority desync — so this is due before F5.

Scope

  • Movement walkability consults the node at the target cell: a cell holding a node whose current stage BlocksWalk is rejected (like an obstacle static).
  • Line-of-sight consults nodes whose current stage BlocksSight along the ray.
  • Keep it server-authoritative + single-threaded (the registry is sim-thread-only); reuse the node's current-stage flags (NaturalNode.CurrentStageDef).

Definition of Done

  • A player cannot step onto a cell occupied by a BlocksWalk node (rejected server-side, like a blocking static); a walkable-stage node (e.g. pine uprooted, rock depleted) is passable.
  • Line-of-sight is blocked by a BlocksSight node between two cells.
  • Unit tests against World for both (blocked + passable stage); base DoD (tests green, 0 warnings).
  • Docs: drop the "nodes are not yet physical" caveat from docs/architecture.md once enforced.
**Gap surfaced by the F4 whole-branch review** (ecology AoI slice, #251 / epic #250). Natural nodes now travel to clients over AoI (F4) carrying each node's `BlocksWalk`/`BlocksSight`, and the client stores them — but the **authoritative server never enforces those flags**. `MovementSystem` walkability and line-of-sight consult only the tile map (`IsWalkable` / `HasLineOfSight` / tiledata), never the `NaturalNodeRegistry`. So a mature pine or a rock outcrop (both `BlocksWalk = true`) is **walk-through and see-through** on the server. Harmless while nodes are invisible, but the moment the **client renders** them (F5) a solid-looking tree the player walks through is a visible authority desync — so this is **due before F5**. ## Scope - Movement walkability consults the node at the target cell: a cell holding a node whose current stage `BlocksWalk` is rejected (like an obstacle static). - Line-of-sight consults nodes whose current stage `BlocksSight` along the ray. - Keep it server-authoritative + single-threaded (the registry is sim-thread-only); reuse the node's current-stage flags (`NaturalNode.CurrentStageDef`). ## Definition of Done - A player cannot step onto a cell occupied by a `BlocksWalk` node (rejected server-side, like a blocking static); a walkable-stage node (e.g. pine `uprooted`, rock `depleted`) is passable. - Line-of-sight is blocked by a `BlocksSight` node between two cells. - Unit tests against `World` for both (blocked + passable stage); base DoD (tests green, 0 warnings). - Docs: drop the "nodes are not yet physical" caveat from `docs/architecture.md` once enforced.
Author
Collaborator

Movement half done in the PR above: players + creatures can't walk through a BlocksWalk node (MovementSystem/CreatureSystem consult NaturalNodeRegistry.BlocksWalkAt). Remaining for #255: (1) node-blocked line-of-sight (HasLineOfSight is in Shared/TileMapRules, can't see the GameServer registry); (2) cosmetic — GM/scripted placement (ResolveStart/Teleport) doesn't node-check, so a scripted spawn could visually overlap a tree (not a correctness bug).

Movement half done in the PR above: players + creatures can't walk through a BlocksWalk node (MovementSystem/CreatureSystem consult NaturalNodeRegistry.BlocksWalkAt). **Remaining for #255:** (1) node-blocked line-of-sight (HasLineOfSight is in Shared/TileMapRules, can't see the GameServer registry); (2) cosmetic — GM/scripted placement (ResolveStart/Teleport) doesn't node-check, so a scripted spawn could visually overlap a tree (not a correctness bug).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marco/IsoMmo#255
No description provided.