A Game Developer's Review of Applying LLM to Game NPCs
As a company side project, I tried connecting GPT to an open-world RPG NPC.
1. Implementation method: Generate dialogue via OpenAI API, set NPC persona prompts
2. Advantages: Unexpected player responses, maximizes quest diversity
3. Disadvantages: Cost higher than expected ($0.01 per API call), response time 2-3 seconds
4. Improvements: Introduce caching, considering switching to local LLM (e.g., LLaMA)
If anyone in the game industry is considering applying LLM, let's share information.
7 answers
Oh this looks like it'll be super fun haha but the cost ㅠㅠ
Even a 2-3 second delay is too frustrating to play the game. It's especially critical if it's an RPG where real-time conversation is important.
I've tried something similar before, and it turned out to be pretty decent if you cache well. Also, fine-tuning a local model is quite useful.
Is there a source? How do you manage API keys?
I rather think that unpredictable conversations enhance the fun of the game. If the drawbacks are addressed, it will be a huge hit.
Using Llama might make it faster, but the quality seems like it will drop... that's something to consider too.
Agreed, we need to introduce caching.