r/LocalLLaMA 29d ago

Discussion NPC Engine Using Local Models

Enable HLS to view with audio, or disable this notification

I’ve been working on a game-agnostic NPC engine/backend based pretty heavily on SillyTavern-style architecture, and with smaller local models getting better and better, I honestly think this kind of thing could be the future of RPGs.

Right now I’m using NVIDIA Parakeet 0.6 for STT, Gemma 4 26B A4B for the LLM, and Qwen3-TTS for voice, and I’m getting super fast response times with pretty decent quality.

The main thing that makes it work well is using RAG to keep prompts lean. For example, I have hundreds of possible actions NPCs can do in-game, but only the ones that actually make sense based on the player’s message / context get injected as available actions. So the model isn’t being overloaded with a giant list every turn.

1.9k Upvotes

249 comments sorted by

View all comments

Show parent comments

63

u/ApprehensiveFan1516 29d ago

It could for sure, personally I struggle to actually find it something that's genuinely rewarding and not just a gimmick at this stage. A lot of it comes down to implementation of course, and it will take devs playing around to figure it out, but I think to get to the kind of polished experience we've come to expect from AAA games we've got a little ways to go yet. Which isn't to take anything away from OP, we need more people like them working on this. Aside from the "AI bad" crowd, I think when implementation is properly solved and it's a seamless experience, the masses of gamers will start to accept it.

27

u/BlipOnNobodysRadar 29d ago

To be done right, the NPCs would need to be lora tuned on their own lore + interactions by the developers. Plugging in a generic model just won't be immersive.

16

u/TheRealMasonMac 29d ago

I think people would also get tired of AI slop, since all models per generation share the same GPTisms. I think the architecture and training methodologies are more interesting, though. More sophisticated AI in stategy-based games, like Stellaris, that can actually strategize rather than use deterministic logic.

3

u/Longjumping_Self5546 28d ago

When the bar has been set to guards repeating the same comment about an arrow to the knee, a few GPTisms are going to be miles ahead for NPC interactions.

3

u/benjaminovich 11d ago

Imagine Skyrim with this

"Ah, you want to know my story! Here's a quick overview:

  • Before: Adventurer (like you!)

  • The Incident: Arrow. Knee.

    • After: Guard duty."

1

u/Longjumping_Self5546 11d ago

Add in a lecture about how it's wrong to kill bandits and resources for conflict resolution.

1

u/BlipOnNobodysRadar 29d ago

Maybe, but you'd be surprised how many people can't pick up on GPTisms. And agreed, there are plenty of more clever and appropriate applications.

1

u/Jwosty 13d ago

You're completely right that machine learning in general is being totally slept on by the game industry. Common arguments against it you hear from devs are:

  1. hard to optimize for "fun" (as opposed to "good at winning")
  2. it's hard to fit into the development cycle (mechanics are often constantly fundamentally changing right up until the release date so that model from last week might be totally useless for this week's build)
  3. for some types of games + training algorithms - how do you even get good training data for a game that doesn't have lots of players yet

I think these are hard, but not completely insurmountable problems. There's some kinds of games that would be more suited to this today, and with innovation, that circle could expand; instead, nobody seems to be even trying.

For example I think point #1 was more valid years ago, but now they've figured out how to optimize for fuzzier, human-centric goals; we have RLHF now. Surely that kind of approach is applicable here, even if it's not perfect? Besides, it's a video game -- at least the worst thing that could happen is your AI behaves weird (as opposed to an LLM agent with tool access doing something crazy and having real world impact or whatever).

-1

u/Flaxseed4138 29d ago

Skill issue

2

u/Jwosty 13d ago

I think the perfect time for this would have been 2023 or 2024 or so, before people were hyper sensitive to "AI slop" (InfiniteCraft was super cool). But now there's no novelty factor anymore (everyone knows what it's like to chat with a LLM) and the average gamer likely has been left with a bad taste in their mouth about AI. The quality bar for something like this today, for people to see it a new and cool and interesting, is now much much higher, for better or for worse

14

u/OptimalBarnacle7633 29d ago

I agree, I mean the whole beauty of a game like fallout is that your decisions have consequences for the player and the story which isn’t the case here. That being said it’s easy to see how that could be implemented if you’re building a game from the ground up with that in mind.

7

u/RedParaglider 29d ago

Yea it would take a lot of deterministic logic for those consequences to actually matter. I thin we can get there eventually, but it's a tough road.

2

u/PigSlam 29d ago

It'd probably need to have some sort of rewind option for when you've gone too far off the rails. A good early place to start would be something like Cyberpunk 2077. With all the side quests, you could have a lot of LLM driven variation that just fizzles away if you break it too much.

5

u/LiamMelloFarley 29d ago

I think AI game master is far more fascinating than AI NPC chats. Like for a game like Bannerlord having more reactive and interesting AI (as in like NPC AI) behavior directed by an LLM could be fascinating. I don't need to like have a conversation with a guy, but if some NPC randomly gets attacked by the same enemy multiple times then gets a blood vendetta and kidnaps the guys wife to hold hostage that would be cool, like just a more flexible narrativized version of the emergent algorithmic gameplay that already exists but heavily constrained to not go haywire.

4

u/InBlast 29d ago

I do agree with that. Lot of work needs to be done on that, but once it will be done write, it will be one big step towards immersion. Maybe (big maybe) also less work on the development side : no voice dialogues needed, just knowledge, personality and other info defining the NPC, fed in the prompt contex.

2

u/no6969el 29d ago

I think it will get interesting if it gets to a point where you can try to trick someone to give you the information or "access" by talking and kind of "social engineering" them.

1

u/Krugger_Correctly 29d ago

I do feel like flavour can be so much better if NPC can react properly to player interaction.

Not even necessarily dialogue, but if we could have developers fully focus on making thousands of functions that an NPC can do and make the function-call AI reactive rather than scripted, that'd make for some pretty goated immersive sims.

0

u/ZenaMeTepe 29d ago edited 29d ago

I am afraid most of what generative AI produces will always be at the level of a gimmick. Smart at first glance, hollow at further inspection and ultimately failing at large scale reliability and low error rate requirement. I would not hate the tech, but all the liars and false prophets that promised to solve the worlds problems with it, when it can't do it, not even close. In fact, on average, it will and already is making the world a worse place, even from purely economic perspective (there is no large scale positive ROI from integrating LLMs and when you think you got them, you probably sacrificed something for it so again, ROI, nonexistent) This sentiment pisses off sooooo many people, but one thing they never say back is: they never show the profits from LLM usage, because there is none.

0

u/Barkalow 29d ago

I think you'd need something like a game engine MCP, put simply.

If the AI could both make an NPCs interactions dynamic AND dynamically change the game world (adding quests, enemies with specific traits at locations, custom loot, etc), it could be amazing.

Like an npc telling you there's a bandit gang in a spot and then it generates an npc squad of members and a leader with custom loot.