
Dialogue
The prompt includes the NPC state. When Ollama does not respond, the game uses a pre-defined dialogue graph.
local-llm NPC perception / dialogue / world generation
I ported a Phaser 3 TypeScript RPG to Unity 2D C# and added local Ollama dialogue. When the LLM does not respond, the same NPC switches to a rule-based dialogue graph and the game continues.

Each NPC stores memory, mood, and skill values. Those values change the response, and the rule-based dialogue graph takes over when the LLM is unavailable.

The prompt includes the NPC state. When Ollama does not respond, the game uses a pre-defined dialogue graph.

Per-NPC mood state. Directly shapes response tone, priority, and how likely the NPC is to refuse a request.

The set of actions an NPC can perform. The layer that turns dialogue outcomes into game-state changes.
On a response timeout, server failure, or offline mode, the game uses a pre-defined dialogue graph and static responses selected from the NPC's mood value.
When Ollama is available, the NPC uses generated dialogue. When it is unavailable, the same NPC switches to the rule-based graph.



