메뉴
HN
Hacker News • 33일 전

나와 함께 스카이림을 플레이하는 저지연 AI 동료를 만들었다

IMP
7/10
핵심 요약

개발자가 LLM으로 스카이림 내 NPC '바르코스'를 실시간 음성 동료로 조작하는 시스템을 구축했습니다. 조건부·다단계 명령 수행, 아이템 검색, 숨바꼭질, 전투 등 월드 상태에 기반한 복잡한 행동을 지연 없이 수행하며, 가능한 한 로컬 LLM으로 실행해 프라이버시와 비용 문제를 해결합니다. LLM 게임 NPC의 약점인 세계 개입성(world agency)과 지연 시간 문제를 해결한 사례로 주목받습니다.

번역된 본문

목표는 간단합니다. 실제로 만족스러운, 한 단계 업그레이드된 초강력 게임 동료를 만들어보자는 것입니다. 이미 LLM으로 NPC 대화를 제어하는 프레임워크는 여럿 존재합니다. 롤플레이와 캐릭터 유지에는 훌륭하지만 두 가지 반복되는 문제가 있습니다: 약한 월드 개입성(world agency)과 지연 시간입니다. 말하는 것은 잘하지만 행동 수행은 훨씬 신뢰성이 떨어지고 복잡한 명령 세트에는 형편없습니다. 인기 있는 AI NPC 데모에서 플레이어 발화와 AI 응답 사이를 편집해 지연 시간을 감추려 하는 것도 보셨을 겁니다. 더 잘할 수 있을까요?

제가 원한 동료의 조건은:

유용하고 즉각적이어야 한다. 전투, 물건 가져오기, 전리품 수집, 조사, 운반, 아이템 건네기 등을 하고, 버기하거나 실험적이라는 느낌 없이 복잡한 다단계 지시를 따라야 합니다. 이는 특히 VR에서 중요한데, 메뉴 탐색이 번거롭고 몰입을 깨뜨리기 때문입니다. 그냥 빠른 게 아니라 '진짜로' 빨라야 합니다.

살아 있고 현존감이 있어야 한다. 미리 짜인 로봇 같은 대응이 아니라 재미있고 애정 어린 성격을 가져야 하고, 공유된 경험을 기억하고 시간이 지나며 변화해야 합니다. 세션이 실행되는 동안 마이크는 계속 켜져 있습니다. 대화 메뉴로 바르코스(Varkos)를 소환하는 게 아니라, 그에게 말을 거는 것입니다. 몰입이 시작되면 혼자 플레이하지 않는 것처럼 느껴져야 합니다.

가능한 한 로컬과 프라이버시. 냉정한 현실은 클라우드 LLM 호출이 꽤 비쌀 수 있다는 것입니다(특히 수천 토큰짜리 호출의 경우). 그리고 추가 지연 시간은 경험을 망칠 수 있습니다. 게다가 왜 사적인 싱글플레이 게임을 과금되고 감시되는 경험으로 바꿔야 할까요? 사용자에게 가능한 한 많은 통제권을 주려 합니다(보너스로 재미있는 기술적 도전이기도 합니다).

기본적으로: 혼자 플레이하지 않는 싱글플레이 게임입니다.

복잡한 명령

바르코스는 즉각적인 단일 행동을 넘어서는 명령을 처리할 수 있습니다. 계획은 이벤트를 기다리고, 단계 사이에 대상을 유지하고, 진행 상황을 모니터링하며, 월드 상태가 변하면 수정하거나 중단할 수 있습니다. 미리 스크립트된 것은 없습니다.

몇 가지 예시를 봅시다.

바르코스는 다음 화살과 관련된 조건부 지시를 받습니다. 즉시 행동하는 대신 미래의 트리거를 등록하고, 관련된 발사체 명중을 기다린 뒤 계획을 계속 진행합니다.

긴 다단계 명령: "여기서 기다려. 나는 저쪽으로 갈게. 신호를 보면 — 신호는 내가 하늘로 쏘아 올리는 화살이야 — 이 물약을 집어서 나한테 가져다줘. 알았지?"

아이템 검색: 바르코스는 그라운딩된 월드 상태에서 요청된 아이템을 검색하고, 어디에 있는지 파악한 뒤 게임에 실제로 존재하는 것을 바탕으로 응답할 수 있습니다. "의식용 검이 어디에 있는지 보이니?" 바르코스는 다른 검을 집어 우리에게 가져옵니다. 우리가 그게 아니라고 말하면, 그는 계속 찾아보겠다고 제안합니다.

숨바꼭질: 숨바꼭질은 단일 API 호출이 아닙니다. 이동, 대기, 모니터링, 완료 조건을 갖춘 지속적인 목표가 됩니다. "숨바꼭질 또 하자. 넌 여기 있고 나는 숨을게. 열까지 세고 나서 나를 찾으러 와."

이 상자를 열어 물약을 줘: 이것은 그라운딩된 컨테이너, 필터링된 전리품 수집 단계, 인벤토리 이전을 결합합니다. 각 물리적 결과가 계획의 다음 부분을 진전시킵니다.

모든 아이템 줍기: "모든 아이템을 주워서 나한테 줘"는 실제 참조에 대한 한정된 수집 계획이 됩니다. 바르코스는 그것들을 모으고, 돌아와서 전달합니다. 마법 같은 하나의 행동이 '전부'를 의미한다고 가장하지 않습니다.

전투: 바르코스는 게임으로부터 그라운딩된 이벤트를 받고, 빠른 반사 경로를 통해 플레이어에게 경고할 수 있으며, 네이티브 신체 제어를 사용해 행동합니다. 지시 계획은 전략을 세울 수 있고(예: 이걸 공격한 뒤 후퇴 등), 그의 감정 상태는 어떻게, 싸울지 여부에 영향을 줄 수 있습니다.

성격 진화: 바르코스는 완전히 커스터마이징 가능합니다. 악마 개일 필요도 없고, 런타임이 단일 캐릭터만 제어할 필요도 없습니다. 어떤 시스템이 적용되고 무엇을 하는지는 개방된 설정에 달려 있습니다. 현재 빌드 중 한 부분은 여전히 대형 모델/클라우드 LLM 호출에 전적으로 의존합니다: 느린 성격 진화입니다. 이 작업은...

원문 보기
원문 보기 (영어)
The goal Simple: Let's build a super-charged next-level gaming companion that actually feels good. There are already multiple frameworks that let LLMs control NPC dialogue. They are fantastic for role-playing and staying in character, but they have two recurring problems: weak world agency and latency. Good at talking but far less reliable at performing actions and terrible at complex instruction sets. You may have also noticed how popular AI NPC demos often cut between the player speaking and the AI replying, trying to mask latency. Can we do better? I wanted a companion that: Useful and instant. It should fight, fetch, loot, inspect, carry and give items etc etc, follow complex multi-step instructions without feeling buggy or experimental. This matters especially in VR, where navigating menus is cumbersome and immersion-breaking. it needs to be FAST fast, not just fast Alive and present. It should have a fun, endearing personality, not canned robotic pre-written responses. Remember shared experiences and change over time. The microphone stays active while a session is running: you do not summon Varkos through a dialogue menu, you talk to him. When immersion kicks in, it should feel like you are not playing alone. Local and private wherever practical. The elephant in the room is that cloud LLM calls can get quite pricy (especially with multi-thousand-token LLM calls) and the added latency can be an experience killer. And why turn a private single-player game into a metered and surveilled experience? Let's try to give as much control to the user as possible (bonus it's a fun technical challenge). Basically: a single-player game where you are not playing alone. Complex commands Varkos can handle commands that extend beyond one immediate action. Plans can wait for events, preserve targets between steps, monitor progress and repair or stop when world state changes. Nothing is pre-scripted. Let's see some examples Varkos receives a conditional instruction involving the next arrow. He registers the future trigger instead of acting immediately, waits for the correlated projectile impact and then continues the plan. Long-form multi-step command “I want you to wait here and I’m gonna go over there. Once you see the signal, the signal is going to be an arrow I fire up in the sky, I want you to pick up this potion and come and bring it to me. Okay?” Item search Varkos can search the grounded world state for a requested item, identify where it is and respond using what is actually present in the game. “Do you see the ceremonial sword anywhere?” Varkos picks up a different sword and brings it to us. We tell him that’s not the one, then he offers to be on the lookout. Hide-and-seek Hide-and-seek is not a single API call. It becomes a persistent goal with movement, waiting, monitoring and completion conditions. “Let’s play hide-and-seek again. You wait here and I’m gonna go hide, then count to ten and come and try to find me.” Loot this chest and give me the potion This combines a grounded container, a filtered loot step and an inventory transfer. Each physical result advances the next part of the plan. Pick up all the items “Pick up all the items and give them to me” becomes a bounded collection plan over real references. Varkos gathers them, returns and transfers them without pretending that one magical action means “all.” Combat Varkos receives grounded events from the game, can warn the player through a fast reflex path and uses native body control to act. Instruction plans can strategize (e.g. attack this, then retreat, etc.), and his emotional state can affect how and if he chooses to fight. Personality evolution Varkos is fully customizable. He does not have to be a demon dog, and the runtime does not have to control only a single character. What systems are applied and what they do, is up to open configuration. One part of my current build still fully depends on big model/cloud LLM calls: slow personality evolution. This work happens away from the real-time action path. As the player and Varkos travel together, important interactions become evidence for gradual changes to his personality. My demo Varkos begins as a demon reincarnated as a dog. He considers his canine instincts humiliating, his dog body a prison, and is mistrustful, proud and sarcastic. Through shared experiences he can become more and more domesticated, grow attached to the player and starts enjoying being a dog. Eventually he starts bringing over toys because he wants to play, running off to chase things and seeking affirmation from the player. Only the starting character traits are authored. The system changes both his explicit traits and his emotional homeostasis. How easily he becomes irritated, frightened, affectionate or playful, etc etc. He can overwrite parts of his vocabulary and code. Changes are versioned and reversible. I could make it more bounded, but I think there's something fun about some open world clankiness, so how he evolves is up in the air. Dog in and out of the game - Void mode My plan is to make this system a gaming companion that can follow you across multiple different games, not just Skyrim (Skyrim felt like a good starting point due to its massive modding community, VR support and big open world). For this reason he exists outside the game too. When the game closes, he enters “void mode” and cannot see or feel anything. How he responds to that depends on his personality evolution. This state also works as an in-between for different games. One moment Varkos could be fighting a dragon, then the world goes dark, then he appears beside you in Microsoft Flight Simulator. Maybe he would be shocked, need time to understand the new world and slowly learn what its machines and rules mean, or maybe he knows about it already and overjoyed tries to chase the sun. Let's talk technology now Unfortunately I am bitter-lesson pilled. Big model is better. If we wanted a perfectly intelligent system then letting a council of hyper-intelligent LLMs control impulses, sensory processing, thinking and acting at sufficient refresh rate would be best. In some early experiments this worked insanely well, unfortunately today it is too slow and too expensive. I do believe this will be the approach of some vague future. Until then however we need to hack our way in. Today's games have pretty cool "AI" (not in the llm sense, more in the behavioral graph one), games like Red Dead Redemption and Dwarf Fortress have tons of depth and they can run perfectly on 10 year old hardware. Through this whole AI-craze people have forgotten that we had intelligent systems that could process speech since the 1970s, and somewhat LLM-like behavior with chatbots like SmarterChild in the early 2000s. There's a lost art that is being overlooked today in things like traditional NLP and behavioral graphs. Let's take a quick look at Varkos tech stack. 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), but I do development on the MacBook and I got so deep in that... eeh. Audio: Microphone is always on. Main voice to text engine is (custom kernels) optimized Qwen3-ASR 1.7b. A custom harness is built around Qwen3-ASR, that processes and stitches audio in rolling partials (by default that model does not support streaming). The goal is to process audio in 40ms-80ms be it a tiny utterance like "Hey" on a 1 minute long monologue. VAD-like methods such as turnpipe and Silero (both optimized) are used to distinguish when a turn is open. Lexical analysis also is done on the text trying to decide if the player has made a point or is not done talking yet (eg thinking mid-sentence). In a perfect world of sufficiently fast and smart LLMs, the LLM would perform better, but I have to resort to more rudimentary but fast NLP approaches. This is important as with the microphone always on as we want to start proces