// ai-systems · local llm · r&d

GenWorld + Ollama.

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.

ollama · local llm unity 2d c# phaser 3 ts → unity port offline mode rule-based fallback
WORLDGENWORLD
GenWorld game world
[ CH.01 ] NPC COGNITION memory · mood · dialogue · skills
// npc cognition

Memory, mood, and skills
are stored per NPC.

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.

NPC_01DIALOGUE
GenWorld dialogue
// dialogue

Dialogue

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

NPC_02MOOD
GenWorld NPC mood
// mood

Mood

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

NPC_03SKILLS
GenWorld skills
// skills

Skills

The set of actions an NPC can perform. The layer that turns dialogue outcomes into game-state changes.

[ CH.02 ] LLM TIMEOUT · OFFLINE
// fallback

If the LLM does not respond,
the game uses rule-based dialogue.

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.

primary path
ollama local
fallback path
dialogue graph
offline mode
supported
[ SHOTS ] WORLD + OBJECTS
S_01WORLD
GenWorld world
unity 2d · world
S_02DIALOGUE
dialogue
ollama-backed dialogue
S_03NPC MOOD
npc mood
mood state
S_04SKILLS
skills
skill layer