I built a low-latency AI companion that plays Skyrim with me

168 pointsposted 11 hours ago
by pantelisk

33 Comments

Xx_crazy420_xX

an hour ago

Very promising project! The latency is great and looks pretty polished for solo work.

> ALE is designed to be largely invariant to phrasing. You can say pick up, you can say grab, fetch, go get the damn sword you fool - it doesn't matter, it will still understand you > It creates embeddings from the full text as well as its extracted structure

I get how you utilize embeddings, but most interesting part for me is how you decompose multiple commands? You decompose sentences before embedding?

usernomdeguerre

6 hours ago

>The game runs on Windows, the audio processing and brain runs on my M4 MacBook. It could all run on Windows (provided there is dedicated ~12gb or more gpu ram for it)

I do wonder if this is an avenue for console gaming that might be practical in a few years; AI-centric hardware that might be too beefy or expensive for regular users, but can extend new or existing games. Kinda like the expansion paks of old.

unfortunate that the "ALE" design wasn't opensourced (couldn't find a link in their post) but I would be interested in learning more about the design, in particular what sort of data pipeline was necessary from skyrim to give this sort of action flexibility?

pantelisk

5 hours ago

I will be open sourcing it soon :) my code is a bit dirty (the whole system is 3 pieces. The game adapter / a websocket bridge between game and brain / the brain itself) and it runs on 2 different (local) machines currently.

Ale is what makes this work locally, I felt a little conscious about it as I am not sure if it is a novel approach or somebody comes out and claims I rediscovered BERT or something (though ale runs at 1/10 the cost of BERT).

seabombs

6 hours ago

I must say absolutely hilarious video. The "persona" of the dog is great. As someone who is generally pretty "keep your AI out of my art" this looks very fun to play. I can imagine this being cleverly integrated as a primary feature of a game (this must already be in the works). Ideally as a small model able to run locally alongside the game.

The moment where the dog is going on about "something foul in the air" as the player is attacked by a wolf ("F--- dude you could have warned me!") was great comedy.

MattDamonSpace

6 hours ago

New mediums always absolutely knock the humanity organism for a bit

igleria

8 minutes ago

I imagine playing fallout with this and.. please keep at it!

mike_hearn

2 hours ago

This is the sort of thing that the GPT-Live model would excel at when it launches. I'm not sure you'd need the ALE model at all if they launch Live in the API with acceptable pricing as it solves the latency issues with voice entirely. It's an impressive piece of engineering that hasn't been discussed much yet, I guess because it's only a ChatGPT feature and not accessible to developers. The model can dispatch tools asynchronously while speaking which would be ideal for a game.

What you'd want is maybe some kind of Live model with voice warping so it can be given different Skyrim themed 'Nordic' voices, and then custom tools to interact with the game engine.

rao-v

7 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!

pantelisk

6 hours ago

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?

alwaysanoobie

2 hours ago

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?

pantelisk

2 hours ago

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

oscarmcdougall

6 hours ago

Love the concept of void mode. A companion that follows you across games, that's cool.

voidUpdate

40 minutes ago

Does it have any agency of its own, or is it entirely reliant on you commanding it?

> "Maybe it's because Varkos is a dog, and who doesn't like dogs"

Me

pantelisk

5 minutes ago

Yes, the dog has a few levers including a "boredom" counter that will trigger it to do things on its own (like roam around, eat something, chase something (eg a rabbit) if there's one around etc). All connected with its current state (Eg hungry = will probably prioritize eating but not guaranteed). Other things are mapped to game events. Deterministic in nature but its underlying values can evolve over time (both its default "homeostasis value" but also the curve of which it increases). You can think of it as letting an llm design a behavior graph, and then playing that behavior graph until it changes again.

Talking to it alleviates pressure so that mechanism doesn't fire much, but in the void-mode video on the website it chooses to chase down an elk on its own much to my surprise.

After play testing it I had to tone it down quite a bit as it caused continuity issues...

In one scenario the dog was hungry so he went and ate something that was owned (counts as a crime attributed to the player) so we ended up in jail. Being transported to jail fired a new location event and a switch from "exterior->interior" which the dog responded to by saying something along the lines of "Good. Finally indoors, it was getting cold outside". Which made for a very funny moment but a frustrating gaming experience.

toilet

2 hours ago

Great concept and presentation. How much knowledge about the world does the agent have? Does Skyrim accurately model what their in game character can actually see and hear?

Havoc

4 hours ago

Wow that demo video is way better than expected. Well done

big_dave212

2 hours ago

awesome idea and implementation. feels like a game feature that you didn't know that you wanted.

walrus01

5 hours ago

I guess this means you can fus ro dah the LLM off a mountain, so there is that.

mihau

2 hours ago

I expected slop, but this is really good! (both demo and write-up)

aussieguy1234

4 hours ago

Next up: A smart glasses companion that follows you around in the game known as life.

Ive seen something like this in sci fi films.

dosenbrot

2 hours ago

Dennou Coil had this exact same concept.

Hilliard_Ohiooo

7 hours ago

Video game seem like the perfect fit for llm use and I don't understand why it hasn't happened already.

goda90

6 hours ago

It's expensive, early attempts didn't impress, and many gamers are hostile to the tech because it threatens the livelihood of game creators and impacts gaming hardware prices.

nottorp

3 hours ago

It depends on if you want samey games or anything creative.

You could have complex realistic dialogue for innkeeper #28917 in the little hamlet of ass backwards, but:

One: do you really want that? There is such a thing as too much realism in a video game.

Two: do you really want all NPCs in all games to speak nigerian business english?

Reminder for 2: https://www.theguardian.com/technology/2024/apr/16/techscape...

flaunf221

an hour ago

It's a simple thing:

Who wants to read AI-generated articles and respond to AI-generated comments? Probably not many. For same reason gamers mostly don't want to chat with AI-backed NPCs. More is only better when it has meaning.

numpad0

4 hours ago

Because games are entertainment, but outputs generated by current AI are rage inducing and felt hostile, not entertaining. It just isn't past the "make it work" stage.

bbmatryoshka

5 hours ago

at the current token prices, far too expensive, but in medium/long term I think we will see a revolution in this field, the concepts are already there (and the expensive proofs of concept already work)

snowram

4 hours ago

It did, look at the game Suck Up or a variety of Skyrim mods. Problem is gamers are hostile to any obvious trace of IA in their games. Also, consumer hardware is overall too weak to run a convincing llm model.

pphysch

4 hours ago

LLMs have only been really good for a couple years. You can bet that the remaining AAA studios are working hard on figuring this out in current unreleased products.

keyringlight

31 minutes ago

One challenge I see is that to work well and stand above 'easy' implementations the game would need to provide a rich context for the AI to exist in and interact with. Skyrim is a richly detailed world with an engine that allows that level of interaction, especially as it builds upon earlier elder scrolls games. Then there's the factor of whether commercial studios with the capacity to make that world in the first place (which has been a major draw for players) will invest further budget into AI to add more value, and if they have options to see a return on that investment via the main purchase price or additional costs.

igleria

5 minutes ago

just offer a separate subscription to host the companion model. I feel dirty typing this.