NPCs and characters
A market district where the traders notice what is happening around them.
Scripted stall keepers repeat the same loop regardless of context. Adding one condition — a theft, a rush, a rival undercutting them — means editing every state machine that might care.
Setup
- Adapter
- humanoid/biped
- Role
- market.trader
- Goal
- market.maintain_stall_revenue
- Pack
- domain/retail
What the runtime does
Traders restock, adjust pricing within a declared band, call for security, and close early when the district is unsafe. Each of those is an action they were granted, chosen by the planner against what they can currently observe.
What it cannot do
- Cannot price outside the band their role declares
- Cannot move stock they do not hold in the ledger
- Cannot see the inventory of a stall they are not adjacent to
- Cannot take a security action — that capability belongs to a different role
What a test asserts
- A trader with no stock never proposes a sale
- A theft event produces a call-for-security within four ticks
- Prices stay inside the declared band across a thousand seeded ticks