feat: creatures leave a decaying corpse on death #29

Merged
marco merged 2 commits from feat/corpses into main 2026-07-17 16:00:44 +02:00
Owner

Stacked on #28 (base branch feat/combat-loop) — merge #28 first, then this retargets to main.

Summary

When a creature dies it now leaves a corpse where it fell, instead of vanishing — even just for the ~30s decay, UO-style.

  • Dedicated entity (CorpseRegistry, owned by World under its single lock), not a repurposed item — this is deliberately the future home of lootable corpse-containers. Decorative for now.
  • Lingers ~30s (CorpseDecayTicks, config) then decays.
  • Rides the existing AoI reconcile as a 4th visible set (players/items/mobiles/corpses) via the generic InterestDiff: enter → CorpseSpawned, leave/decay → CorpseRemoved. So a corpse appears as you walk up and disappears when it decays or leaves your view.
  • Respawn is unchanged and independent: a fresh creature still respawns at the spawn point after its delay; the corpse decays separately on its own tile.
  • Corpses are transient (not persisted) — gone on server restart, as expected.
  • Client renders a dark, flattened placeholder diamond under whatever stands on the tile; real UO corpse art is a follow-up like the rest of the art.

Scope note

Decorative only (your call): no loot, not openable. Making the corpse a lootable container is a clear follow-up once we have a loot system — the dedicated entity is exactly so that lands cleanly.

How it was tested

WorldTests: killing a creature leaves a corpse of the right kind at the death tile, and it decays after its delay. Protocol round-trips for CorpseSpawned/CorpseRemoved. 187 tests green, zero warnings, CSharpier clean.

Needs your eyes (GUI)

Kill a rat → a dark corpse marker should stay ~30s then vanish; walk away and back → it re-appears (AoI). Tell me if ~30s feels right (one-line tunable).

Checklist

  • just lint clean · [x] just test green (187) · [x] whole solution builds, 0 warnings · [x] multi-platform preserved · [x] tests added
**Stacked on #28** (base branch `feat/combat-loop`) — merge #28 first, then this retargets to `main`. ## Summary When a creature dies it now leaves a **corpse** where it fell, instead of vanishing — even just for the ~30s decay, UO-style. - **Dedicated entity** (`CorpseRegistry`, owned by World under its single lock), not a repurposed item — this is deliberately the future home of **lootable corpse-containers**. Decorative for now. - Lingers **~30s** (`CorpseDecayTicks`, config) then decays. - Rides the **existing AoI reconcile** as a 4th visible set (players/items/mobiles/corpses) via the generic `InterestDiff`: enter → `CorpseSpawned`, leave/decay → `CorpseRemoved`. So a corpse appears as you walk up and disappears when it decays or leaves your view. - **Respawn is unchanged and independent**: a fresh creature still respawns at the spawn point after its delay; the corpse decays separately on its own tile. - Corpses are **transient** (not persisted) — gone on server restart, as expected. - **Client** renders a dark, flattened placeholder diamond under whatever stands on the tile; real UO corpse art is a follow-up like the rest of the art. ## Scope note Decorative only (your call): no loot, not openable. Making the corpse a **lootable container** is a clear follow-up once we have a loot system — the dedicated entity is exactly so that lands cleanly. ## How it was tested `WorldTests`: killing a creature leaves a corpse of the right kind at the death tile, and it decays after its delay. Protocol round-trips for `CorpseSpawned`/`CorpseRemoved`. **187 tests green**, zero warnings, CSharpier clean. ## Needs your eyes (GUI) Kill a rat → a dark corpse marker should stay ~30s then vanish; walk away and back → it re-appears (AoI). Tell me if ~30s feels right (one-line tunable). ## Checklist - [x] `just lint` clean · [x] `just test` green (187) · [x] whole solution builds, 0 warnings · [x] multi-platform preserved · [x] tests added
Author
Owner

Update: added the real dead-rat art. Extracted the creature death animation (low-group action 8) into the pack as creature/<kind>/death_<dir>; a corpse now renders the final frame of that death animation (South facing) held static — an actual dead rat, not the placeholder. Falls back to the placeholder when the pack is absent. assets.isoa repacked (37 animations / 157 frames).

Update: added the **real dead-rat art**. Extracted the creature death animation (low-group action 8) into the pack as `creature/<kind>/death_<dir>`; a corpse now renders the final frame of that death animation (South facing) held static — an actual dead rat, not the placeholder. Falls back to the placeholder when the pack is absent. `assets.isoa` repacked (37 animations / 157 frames).
marco force-pushed feat/corpses from f38a509898
All checks were successful
ci / Lint & Test (pull_request) Successful in 1m29s
to 745688bbab
All checks were successful
ci / Lint & Test (pull_request) Successful in 2m14s
2026-07-17 15:46:25 +02:00
Compare
marco changed target branch from feat/combat-loop to main 2026-07-17 15:50:08 +02:00
marco force-pushed feat/corpses from 745688bbab
All checks were successful
ci / Lint & Test (pull_request) Successful in 2m14s
to 669c2bd5d9
All checks were successful
ci / Lint & Test (pull_request) Successful in 1m29s
2026-07-17 15:51:47 +02:00
Compare
marco merged commit 2f25323f2d into main 2026-07-17 16:00:44 +02:00
marco deleted branch feat/corpses 2026-07-17 16:00:44 +02:00
Sign in to join this conversation.
No reviewers
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!29
No description provided.