Aulafy
Courses/Games, 3D and simulations with AI/NPC with Local LLM and Memory in Godot

NPC with Local LLM and Memory in Godot

An AI NPC doesn't need to be infinite. It needs character, lore, a small memory, clear boundaries, and a safe fallback when the model is slow or invents too much.

  • Design an NPC that responds with lore and quest state.
  • Connect Godot to a local server that supports HTTP.
  • Avoid slow, contradictory, or off-tone dialogue.
TerminalCode
npc_memory:
  npc_id: "herrera_lina"
  player_name: "Ada"
  facts:
    - "Ada encontró la llave del molino"
    - "Lina no confía en el alcalde"
  quest_state: "buscar_mapa"
  tone: "directa, rural, algo seca"
  forbidden:
    - "revelar final"
    - "inventar ubicaciones fuera del mapa"
TerminalCode
Prompt de sistema para el NPC:
Eres Lina, herrera de Puerto Bruma.
Responde en máximo 2 frases.
Solo conoces lugares del mapa: molino, puerto, mina y plaza.
Si el jugador pregunta algo fuera del lore, redirige a la misión activa.
No reveles soluciones completas; da una pista verificable.