Living NPCs —
IA generativa en juegos retro
¿Qué pasa cuando intentas darle memoria persistente y personalidad coherente a los NPCs de un juego estilo Pokémon usando un LLM? Este es el registro técnico de lo que funcionó, lo que no, y por qué el problema es más interesante de lo que parece.
Ver el informe del experimento completo →Los NPCs clásicos son cognitivamente planos — they say the same things, forget every interaction, and have no sense of the world around them. The question was simple: can you fix this with an LLM? And if yes, at what cost in latency, tokens and coherence?
Built a three-module system — episodic memory, personality consistency and world awareness — all running within a constrained token budget. Tested across 220 evaluated conversations, iterating from v0.1 to v0.4 with measurable improvements at each step.
Higher temperature produces more creative, "in-character" responses — but also more repetitiveness. The sweet spot was identified experimentally across 30 samples per temperature value.
LLMs struggle with information buried in the middle of long contexts. Memory architecture had to be designed around this — not just appending history but structuring it for retrieval.
The immersion-breaking threshold was identified at a specific response time. Beyond that, players notice the delay — making latency a harder constraint than token cost in practice.
GPT-4o-mini makes the experiment viable for prototyping. But for production, a local model of sufficient quality would cut cost per session dramatically — and eliminate latency from API calls.