Llama Village in motion. The characters’ dialogue is generated by an on-device model.
I wanted to try building a 3D game with flutterscene. I was already working on llamadart, so I thought it would be fun to use local AI in the game too. My starting idea was fairly loose: make it look good, keep it simple, and put Dash, the Flutter mascot, in a scene with some llamas.
I wanted to show different kinds of AI working together, including multiple characters acting on their own. But I did not have a game concept I liked yet.
I spent quite a while on the visuals. I tried a hand-drawn look, asked for something closer to Borderlands, and eventually switched to a softer film style because the earlier renders kept looking glitchy. Meanwhile, we tried several game ideas. I was not happy with how they played.
Eventually I asked for a village where the llamas would live and interact on their own. I wanted to give them personalities, see their thoughts and conversations, and control Dash to interact with them. That was the idea we went ahead with.
The village at golden hour, with the bakery in the centre and the festival stage in the foreground.
Pip, Mo, June, Bramble, and Clover each have a personality, needs, relationships, goals, and things they know. They make plans, walk around the village, and stop to talk. A missing scarf, a bread rumour, a secret crush, and the upcoming Berry Festival give them things to care about.
June and Bramble talking. Each line is written from the speaker’s situation and the conversation so far.
They do not all know the same things. In the inspector below, June knows that Mo knocked Pip’s scarf into the pond because she heard it from Mo. Other entries are things she saw herself. The game keeps track of both the information and how she got it.
This is what I mean by a multi-agent system in this game. Each llama has its own knowledge, goals, and relationships. They use the same underlying language model, with different context for each character.
I wanted to try more than one kind of AI. The language model writes dialogue and thoughts. Embeddings help compare the meaning of the dialogue with facts the listener could have learned. An optional Laya decision model helps choose casual conversation topics from the options the game allows.
Movement, needs, knowledge tracking, and endings are handled in code. After a conversation, the model reports which facts were mentioned and suggests changes to mood and friendship. The game checks the fact claims before accepting them.
Secrets require explicit keyword evidence; embedding similarity alone is not enough.
For example, imagine one llama passing along news. The speaker needs to know it first. The model writes the exchange, and the game checks whether the words support transferring that information. If accepted, it becomes something the listener knows and may discuss later.
The llamas can keep walking and going about their day while the model is busy writing.
You play as Dash. Click a llama and he flies over to visit. The game generates four things he could say while he is on the way. I specifically wanted selectable options here, so you can play without stopping to type a message.
The game chooses the available intentions and facts; the model words the options for the character. You can encourage someone, help them, pass along news, or stir up gossip. The llama’s reaction and the resulting changes to trust or mood are governed by rules, while the model gives the reply its voice.
Passing along a correction can help. Gossip can leave a llama believing something false. Those changes carry into later interactions and count toward the ending.
