Fix dungeon state visibility regression and document client follow-ups
- Add safe sprite-config deserialization to prevent DUNGEON_STATE tick failures when mob sprite JSON is invalid - Include definitionId consistently in mob payloads and preserve one-time mob catalog flow for client art preload - Send active portals on every state update to avoid portal disappearance under spatial throttling - Add root pending-clientChanges.md documenting required client handling for spatially filtered mobs, mobCatalog, and portal state
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
# Pending Client Changes
|
||||
|
||||
## Context
|
||||
Server-side dungeon state payloads now support spatial filtering and one-time mob metadata delivery per dungeon session.
|
||||
|
||||
## Required Client Updates
|
||||
1. Support `mobCatalog` on `DUNGEON_STATE` packets.
|
||||
- `mobCatalog` is sent once per dungeon join and contains static mob render metadata:
|
||||
- `id`
|
||||
- `definitionId`
|
||||
- `name`
|
||||
- `spriteConfig`
|
||||
- `tintColor`
|
||||
- `scale`
|
||||
- Client should cache this per-runtime mob `id` and use it to preload/resolve art.
|
||||
|
||||
2. Do not assume all mobs are present every tick.
|
||||
- With spatial filtering enabled, `mobs` in `DUNGEON_STATE` only includes nearby/relevant mobs.
|
||||
- Client entity lifecycle should be "visibility-scoped", not "full authoritative list each tick".
|
||||
- Recommended behavior:
|
||||
- Keep existing mob entities when omitted for a tick (out of range), do not hard-delete immediately.
|
||||
- Remove only when confirmed dead/despawned via explicit state/event signal or timeout policy.
|
||||
|
||||
3. Use `definitionId` when available.
|
||||
- `definitionId` is now included in enter/state mob payloads.
|
||||
- Client can use this for fallback art resolution or future dictionary-based rendering.
|
||||
|
||||
4. Portal rendering should treat payload as authoritative for active portals.
|
||||
- Server now sends active portals each state packet regardless of spatial throttling.
|
||||
- If client currently clears portals aggressively between packets, keep the most recent active set.
|
||||
|
||||
## Optional Hardening
|
||||
1. Handle missing/invalid `spriteConfig` gracefully.
|
||||
- Server now nulls bad JSON instead of throwing.
|
||||
- Client should apply safe defaults (placeholder sprite, default tint/scale) when `spriteConfig` is null.
|
||||
|
||||
2. Add debug overlay for spatial tuning validation.
|
||||
- Show current nearby mob count vs total known on minimap for live tuning checks.
|
||||
Reference in New Issue
Block a user