M7 — NPCs / mobiles with basic AI #9

Closed
opened 2026-07-16 23:04:48 +02:00 by marco · 2 comments
Owner

Make the world feel alive: server-driven creatures that wander. Also the future targets for combat.

Scope

  • Server-driven mobile entities with stats (for M8).
  • Spawners with respawn.
  • Basic AI: idle/wander, validated against walkability (M2).
  • Mobile events broadcast within AoI (M3).

Definition of Done

Base DoD applies on top (tests green, whole solution builds, zero warnings, multi-platform preserved); the criteria below are the issue-specific delta.

  • A spawner creates mobiles that wander server-side; nearby clients see them move; despawn/respawn works.
  • Mobile movement is fully authoritative (no client control) and respects walkability.
Make the world feel alive: server-driven creatures that wander. Also the future targets for combat. ## Scope - [ ] Server-driven mobile entities with stats (for M8). - [ ] Spawners with respawn. - [ ] Basic AI: idle/wander, validated against walkability (M2). - [ ] Mobile events broadcast within AoI (M3). ## Definition of Done _Base DoD applies on top (tests green, whole solution builds, zero warnings, multi-platform preserved); the criteria below are the issue-specific delta._ - [ ] A spawner creates mobiles that wander server-side; nearby clients see them move; despawn/respawn works. - [ ] Mobile movement is fully authoritative (no client control) and respects walkability.
Author
Owner

Slice 1 (agreed design) — ModernUO-informed, wander-only

Building the first mobile slice with ModernUO shapes (not the heavy infra):

  • BaseCreature/Mobile representation in a MobileRegistry (focused component under World'''s single lock, like ItemRegistry — no own lock).
  • BaseAi state machine (AiState + Think); only Wander implemented now, structured so Combat/Flee slot in at M8.
  • Serial: keep Guid on the wire for now (no protocol churn); adopt ModernUO Serial uniformly in the engine/content refactor (#17).
  • Item.Parent/Layer: untouched this slice (evolve with containers).

Decisions: wander-only AI; mobiles block their tile (player↔mobile occupancy checked atomically under World'''s lock; players still don'''t block each other); placeholder art first (real creature art is a follow-up — needs monster/animal anim decode); no stats/combat/loot/persistence.

Protocol: dedicated MobileSpawned/MobileMoved/MobileRemoved; facing derived client-side from movement delta (not on the wire). AoI extended to a third visible set.

Engine/content split (#17) deferred to a dedicated follow-up right after, per docs/architecture.md.

DoD delta for this slice

  • A configurable spawner creates wandering mobiles at startup; nearby clients see them move; movement is fully server-authoritative and respects walkability.
  • Mobiles block tiles: a player cannot move onto a mobile'''s tile and a mobile cannot move onto a player/another mobile (verified by unit tests, atomic under World'''s lock).
  • Mobiles enter/leave/move within AoI only (unit + WebSocket integration test).
### Slice 1 (agreed design) — ModernUO-informed, wander-only Building the first mobile slice with ModernUO *shapes* (not the heavy infra): - **BaseCreature/Mobile** representation in a **MobileRegistry** (focused component under World'''s single lock, like ItemRegistry — no own lock). - **BaseAi state machine** (AiState + Think); only **Wander** implemented now, structured so Combat/Flee slot in at M8. - **Serial**: keep Guid on the wire for now (no protocol churn); adopt ModernUO Serial uniformly in the engine/content refactor (#17). - **Item.Parent/Layer**: untouched this slice (evolve with containers). Decisions: wander-only AI; mobiles **block their tile** (player↔mobile occupancy checked atomically under World'''s lock; players still don'''t block each other); **placeholder art first** (real creature art is a follow-up — needs monster/animal anim decode); no stats/combat/loot/persistence. Protocol: dedicated MobileSpawned/MobileMoved/MobileRemoved; facing derived client-side from movement delta (not on the wire). AoI extended to a third visible set. Engine/content split (#17) deferred to a dedicated follow-up right after, per docs/architecture.md. ### DoD delta for this slice - A configurable spawner creates wandering mobiles at startup; nearby clients see them move; movement is fully server-authoritative and respects walkability. - Mobiles block tiles: a player cannot move onto a mobile'''s tile and a mobile cannot move onto a player/another mobile (verified by unit tests, atomic under World'''s lock). - Mobiles enter/leave/move within AoI only (unit + WebSocket integration test).
Author
Owner

Done and merged to main (e55c90d). Server-authoritative wandering creatures with real UO art. MobileRegistry + BaseAi/WanderAi under World single lock; tile occupancy (player<->mobile) atomic; AoI via generic InterestDiff + Mobile* messages. AnimMulReader generalized to any body range + creature extractor mode; client animates per-kind art (rat critter, body 0xEE) with placeholder fallback. 159 tests green, zero warnings. Deferred to later milestones: stats (M6), combat/aggro/HP/loot (M8), spawners-with-respawn (currently a fixed startup count), engine/content split (#17).

Done and merged to main (e55c90d). Server-authoritative wandering creatures with real UO art. MobileRegistry + BaseAi/WanderAi under World single lock; tile occupancy (player<->mobile) atomic; AoI via generic InterestDiff + Mobile* messages. AnimMulReader generalized to any body range + creature extractor mode; client animates per-kind art (rat critter, body 0xEE) with placeholder fallback. 159 tests green, zero warnings. Deferred to later milestones: stats (M6), combat/aggro/HP/loot (M8), spawners-with-respawn (currently a fixed startup count), engine/content split (#17).
marco closed this issue 2026-07-17 11:24:55 +02:00
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#9
No description provided.