Skip to content

WorldState.npcs and WorldState.locations are declared but permanently unpopulated dead state #425

Description

@The-Running-Dev

Found while auditing W103.1 (the GameOfLife S6/S7 concept mirror) against shipped simulation-kind code.

design/20-contract.md declares NPCState/LocationState as part of WorldState (§3.3-ish, listed around line 3444-3446), mirroring GameOfLife's 5.3.3 lifecycle: npcs seeded one-per-NPCDefinition and locations seeded from the LocationDefinition graph reachable from startingLocationId, both at game creation.

But buildWorld in src/engine/src/kinds/simulation/initial.ts:318-330 initializes npcs: [] and locations: [] unconditionally — never seeded from campaign content. No other code path writes to state.world.npcs or state.world.locations (checked endOfWeek.ts, startOfWeek.ts, advance.ts, resolvers.ts): the travel/location resolvers (resolvers.ts:287,411,1431-1441) and the socialize/NPC resolvers (resolvers.ts:1505,1514) read campaign.locations/campaign.npcs (the content definitions) directly, bypassing kind state entirely. view.ts:209-210,293,306 projects state.world.locations into PublicLocationState[], which is therefore always [] regardless of what a campaign declares.

Unlike the acknowledged-open EconomyState/DifficultyDefinition gaps (commented as deliberate/deferred at initial.ts:73-90,228-229), there's no comment near npcs: []/locations: [] marking this as intentional.

Done when

  • Decide whether WorldState.npcs/locations should actually be seeded from content (matching the contract and GameOfLife's lifecycle) or the contract/types should be narrowed to match what's shipped, and record which.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions