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.

by 무한도전러729

7 answers

Oh this looks like it'll be super fun haha but the cost ㅠㅠ

by 알고리즘고수92 · ▲0

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.

by 뉴비탈출484 · ▲0

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.

by 주말개발자677 · ▲0

Is there a source? How do you manage API keys?

by 지나가던행인231 · ▲0

I rather think that unpredictable conversations enhance the fun of the game. If the drawbacks are addressed, it will be a huge hit.

by 밤샘코더543 · ▲0

Using Llama might make it faster, but the quality seems like it will drop... that's something to consider too.

by 월급루팡675 · ▲0

Agreed, we need to introduce caching.

by 클라우드러버46 · ▲0