1 player snapshot assembly and durable row normalization
forgejo-actions edited this page 2026-07-11 12:38:13 +00:00

Player Snapshot Assembly And Durable Row Normalization

Player snapshot assembly converts durable character rows into the bootstrap state a game session needs: placement, appearance, stats, inventory, currency, and runtime identity.

How It Works

The game server loads character data, resolves the target zone, clamps or repairs placement, decodes appearance, derives stats from level and experience, and loads inventory and currency snapshots before sending realtime bootstrap data.

Normalization hides older row shapes from the client while preserving enough detail for the server to repair durable state safely.

How To Use It

When adding a durable character field, decide whether it belongs in the bootstrap snapshot, a later runtime message, or a system-specific table. Add defaulting rules for older rows and keep wire snapshots compatible with existing clients.

If placement is repaired during activation, make sure the database update is intentional and observable.

Invariants

Bootstrap state must not expose invalid placement. Appearance decode failures should fall back safely while preserving diagnostics. Inventory and currency snapshots must be normalized before the client sees them. Stats must be derived from the authoritative progression source.

Debugging

Mismatches between database rows, bootstrap sections, and client state usually come from placement fallback, stale appearance JSON, inventory/currency normalization, or progression-derived stat changes. Compare the snapshot builder output with durable rows before changing client logic.