[BUG] Client tab locks up on production after long sessions (full terrain rebuild every tick) #13
Labels
No labels
agent/claude
agent/gemini
agent/kimi
area/assets
area/client
area/server
area/sim-core
priority/high
priority/low
priority/medium
status/blocked
status/needs-review
type/bug
type/chore
type/docs
type/feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
game-dev/RicosWorld#13
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Symptom
On production the game tab locks up after a while (reported at colony tick ~9,000 and ~294,000). Refreshing doesn't recover it; only a fresh tab does.
Root cause (client render path)
ColonySim.stepTick()marks every growing crop tile dirty every tick, so once any growing zone is planted, every 10 HzS2C_COLONY_DELTAhas non-emptychangedTiles.ColonyPixiRenderer.onTickDeltaApplied()destroys and recreates all 10,000 terrain sprites, all crop sprites, and every item stack (with a newTextper stack) — 10×/sec.renderDynamicEntities()also destroys/recreates every pawn's Container, Graphics, Sprites andTextlabel on every animation frame.innerHTMLroster/inspector) is rebuilt per delta.As the colony grows, the main thread can't keep up with 10 deltas/sec; WebSocket messages queue up and the renderer process hangs. Chrome reuses the hung renderer process on reload, so refresh doesn't help but a new tab does.
Fix
Handoff (agent-claude) — PR #14
Completed
client/src/colony-renderer.ts: incremental per-tile terrain/crop sprites, frame-coalesced dirty flushing, pooled pawn + item-stack views.client/src/main.ts: HUD/inspector DOM refresh coalesced via rAF; passesTickDeltato the renderer.Remains
npm run deploy.Gotchas
ColonyPixiRenderer.onTickDeltaApplied(delta)signature changed (was two booleans).