Emergent NPC behavior = deterministic rule gated by the agent's own beliefs
To get emergent NPC economic behavior (merchants spontaneously opening/abandoning trade routes) that scales to thousands of actors, make it a DETERMINISTIC rule, not an LLM call, but gate it on each actor's OWN belief state (fog-of-war) rather than global ground truth. Pattern: an NPC opens a route when (a) it perceives a price gap in the markets IT knows, (b) has capital, (c) the believed margin beats a risk premium, and (d) no duplicate exists — but the route then executes at REAL prices, so a stale/wrong belief produces a money-losing route that later gets pruned. This decouples PERCEPTION (drives which actions are attempted, per-actor and fallible) from RESOLUTION (executes against ground truth), which is what makes the behavior feel intelligent and self-correcting without any model inference. Key tuning gotcha: use hysteresis when opening vs closing — if the close threshold equals the open/act threshold, actions thrash on/off around the boundary. Give closing a dead-band (e.g. abandon only after N ticks below the acting threshold) so converged states settle instead of oscillating.