feat(gameserver): persist GM-placed creatures, remove seeding + respawn #64
No reviewers
Labels
No labels
alpha:wave-0
alpha:wave-1
alpha:wave-2
alpha:wave-3
area:assets
area:combat
area:ecology
area:infra
area:render
area:scripting
area:ui
area:world
enhancement
epic
migration
post-alpha
roadmap
tech-debt
type:bug
type:chore
type:design
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
marco/IsoMmo!64
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/persist-creatures"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Creatures are now GM-placed and persisted — the save is the source of truth. The old seed-at-startup + factory-respawn stub is gone; a real spawner system is a deliberate follow-up (agreed direction).
What changed
world.sav:CreatureSerializerwrites each creature's type name + position + HP as one blob (a new section after the player blobs).WorldSaveFilegains that section (format v2),PlayerStoreholds it, and it is restored at startup (World.RestoreCreatures, single-threaded before the sim host) and saved by the periodicPersistenceService+ shutdown flush. A creature reconstructs by type name throughCreatureRegistry.MobileSpawnCountseeding, noSetCreatureFactory, noScheduleRespawn/ProcessRespawns, noRespawnDelay. A killed creature is removed for good (corpse, no respawn);Slayis a pure remove+corpse. A fresh world starts empty; the GM populates it and it survives restarts.Why (agreed with owner)
The old respawn was a throwaway stub (single-kind, respawns at the map spawn, not where it died). A ModernUO-style spawner (a placed object maintaining N of a type in an area) will replace it. Persisting everything through the same per-entity mechanism is consistent and removes code.
Verification
just lint-> 0 warnings.just test-> full suite green (GameServer 144, stable 6s). New tests: creature serialize/restore round-trip, unknown-type skip, empty-blob,PlayerStorecreatures reload, and a persister save with creatures but no players.Definition of Done (delta)
/spawn dummy, restart the server → the dummy is still there, same position.world.sav, saved by the periodic/shutdown flush and restored at startup.Docs: CLAUDE.md persistence section updated (creatures persisted, no respawn/seeding, spawner is a follow-up).