Back to Blogs
#flutter#ai#gamedev#showdev

Llama Village: a virtual world powered by local AI with llamadart

Llama Village in motion. The characters’ dialogue is generated by an on-device model. Watch the...

6 min read
Cover for Llama Village: a virtual world powered by local AI with llamadart

Animated gameplay showing llamas conversing in the village while Dash flies nearby.

Llama Village in motion. The characters’ dialogue is generated by an on-device model.

Watch the full trailer on GitHub

I wanted to try building a 3D game with flutter_scene. 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.

Finding a reason for the AI

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.

These were two of my messages in the Claude Code session:

“Btw the game isn't fun.”

“What's the point of ai?”

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.

An overhead view of the colourful huts, bakery, paths and pond at golden hour.

The village at golden hour, with the bakery in the centre and the festival stage in the foreground.

Who lives here?

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 says “Oh, real poems now. Tell me more about them.” while talking with Bramble.

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.

June’s inspector lists facts and marks whether she saw them or heard them from another llama.

The inspector shows what June knows and who told her.

How a conversation changes the village

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.

A llama knows → they talk → the game checks → a neighbour learns.

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.

Enter Dash

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.

Dash visits Pip beside the pond. Four choices offer teasing, news, a compliment and gossip.

Dash can tell Pip the bread rumour is false, or start another rumour about Mo.

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.

Making the village in 3D

I had a lot of fun building this with flutter_scene. I kept asking for changes to the characters, especially making the llamas look different from one another and getting Dash’s face right. Then came the weather, animals, music, and cutscenes for skipping the night.

Fireflies glow around a pond with ducks, a small boat and warm lamps at night.

Fireflies and lamps around the pond at night.

Clover and Bramble run along a village path in the rain.

Clover and Bramble heading home during the storm.

The models and the 3D renderer share the same machine, which makes performance a concern. The scene needs to keep running while text is generated. Some work can happen ahead of time, like writing Dash’s options during his flight.

Llamadart provides the cross-platform local AI foundation. The game shown here is the macOS preview, running inference locally with the model files already on the machine. Bringing the same experience to other devices still requires working through their memory, inference, and rendering budgets.

When I started thinking about mobile, I even asked whether we could make a version without an LLM. That is still an open design question. Generating everything live has a cost, and I would want to reconsider how much of it a mobile version needs.

A festival, then a storybook

I also wanted the game to have a goal and different endings based on what Dash did. The Berry Festival gives the week a destination. The llamas perform, a winner is chosen, and the ending reflects the relationships, rumours, and trust built up during play. The winner and ending are determined by game rules.

Mo stands in a warm spotlight beneath the Golden Bell, with June and Pip on stage.

Mo wins the Golden Bell in this recorded playthrough.

Afterward, the game turns the week into a picture book. A journal records notable events, conversations, rumours, and Dash’s visits. The model uses a digest of those events to write the pages, alongside pictures captured during play.

An open picture book titled The First Day, with a village image and a narrative about the day.

The first day, retold using the game’s journal and a picture captured during play.

This was something I asked for after the game had taken shape: a fairy-tale book about what happened during the run. It is a nice way to look back at conversations and events you may have missed while following Dash.

Where I would take it next

I would like to try a lighter version that works well on more devices. Llamadart’s cross-platform support gives me a starting point, but this game still needs its own performance work and testing on each platform.

For this version, I got to build the experiment I wanted: several characters talking and acting in the same world, with local models doing different jobs. I also spent far more time adjusting llama faces and village lighting than the original idea suggested.

If you try it, I would be interested to hear whether you prefer watching the llamas or getting involved as Dash.

Explore Llama Village on GitHub · Watch the preview trailer · Explore llamadart

Writing assistance: this article was drafted with AI assistance using my development notes and project documentation. Gameplay images and animation are from Llama Village.