Skip to content

Multiple Agents

Each resident is treated as an agent.

An agent has:

  • id and name,
  • role,
  • personality,
  • goals,
  • relationships,
  • memory,
  • current position,
  • pending visitor task,
  • speech bubble / emote state.

Agent loop

Each tick:

  1. Perceive nearby residents and location.
  2. Check sleep/viewer state.
  3. Prioritize visitor tasks.
  4. Use local ambient behavior when alone.
  5. Use the LLM when social context or task complexity needs it.
  6. Execute one action.

Time-aware speech

The town day is split into six periods: dawn, morning, midday, afternoon, evening, and late night. LLM decisions receive a topic hint for the current period, and the no-LLM ambient lines are also written per period, so a baker talks about warming ovens at dawn and drifts into quiet reflection late at night. Topics exist in English and Chinese.

Actions

Supported actions include:

  • SPEAK
  • MOVE
  • IDLE
  • EMOTE

Visitor tasks

Visitor instructions can become structured pendingTask objects. The task drives follow-up actions such as moving to another NPC, notifying them, gathering at a location, or returning to normal routine.