Comment by rao-v

19 hours ago

I like the approach here. It’s cleverer than just “dump context to LLM”. I couldn’t quite figure out if it genuinely runs purely locally though.

If nothing else - this is how NPCs should work in games moving forward!

Hello, author here. I was intentionally a little vague about this because this is kind of the thing that makes the whole approach work.

An LLM predicts the next token. If you're trying to predict the next token in a mathematics competition, or while playing a deep strategy game, being a much larger and more capable model helps enormously. To predict that next token correctly, the model effectively needs to model a bunch of possible future states - even if that is a second order (unintended) effect, it is what is seems to be happening.

This is basically the Ilya (and Dario) argument that prediction, understanding, and compression are the same thing (deep rabbit hole) from a few years ago.

----

In my opinion; this is a beautiful idea, but videogames do not need most of that. Videogames (and games in general) shine when character behavior is predictable, and when NPCs are a little dumb (just a little).

We already have very good small roleplaying models — Qwen 3.5 4B/9B/30B-A3B. Nowhere near frontier models at general reasoning. But they can act and write in a very engaging way. Good at roleplaying but very weak at reasoning. They just need a little nudge at reasoning...

And that's the key. The player has already expressed their intent: attack that guy, go look over there, cover me, find the key that shines and is golden, etc. A constrained world, with a constrained set of actions. Instead of asking the model to reason over an enormous space of possible futures, we're mostly asking it to map: player intent + current world state → a small sequence of plausible actions.

As for the "dump context to an LLM". It's basically. "You are roleplaying as X - you experienced Y - you like/dislike (dispositions) Z, you remember Alpha, your journal says Delta. Player orders you to do Gamma. - "What do you respond and do?"

It kind of works (as you can see in the videos I posted). I am not going against the grain, big models are better, but do we need those models for everything?

  • What I don't understand is how are you passing the world state to the model?

    Say for instance when you ask the dog to do an action when you launch an arrow upwards how is the LLM continuously tracking the state of the game to be able to respond?

    • At that point it's deterministic and doesn't need the LLM. Once a plan has been decomposed and evaluated, it becomes a sequence of actions. Actions can either wait on a trigger or flow from one to another.

      For the arrow example: wait here -> bind: arrow event -> pick_up $target -> goto player -> drop $target.

      A plan can bind to multiple steps and actions. eg you can tell the dog, "when I say apple you say banana" this creates a short lived "player has said %apple%" -> say "banana" rule. Hide and seek does "say: count to 10" (this then gets fed to llm that converts it to "one, two, three"). So, the plan decomposition is fuzzy, but it gets decomposed to concrete steps, these steps might invoke the LLM back if needed so, but mostly for color, not logic.

      Where the LLM is used afterwards, is for evaluating the result. The dog might ask for a treat if it got right or get frustrated is it misses a beat, etc (depending on emotional state, hunger levels, etc).

      Basically trying to use the best of each system (fuzzy/vague/emotional for LLM, "hard" game actions for determinism). You can think of Ale's output as a small flowchart.

      I am using a pretty dumb model. It's great for speaking, terrible for thinking, so there's a need for creativity

      2 replies →