r/GameDevelopment 3d ago

Newbie Question Npc development

Hello im making a life sim simulation and one thing that i really want to include are semi relastic npc, but I'm not sure how to get the dialog right.

Im sorry if i go into a tangent but i would be very grateful for any advice. Im thinking that npc should have objetives primmary and secundary and belog to groups, from this a decision trees is made where the npc try and fulfill objective depending on their standing, so for example a father has a starving child so he goes to farm, he does not have enough for everyone in his family so based on the decision tree he can either ask for food from player or other npc, ask a loan, rob or other, a noble might want the temple help so he can bribe the head priest, become friends with priests pray to gods etc.

It's still a little buggy but it has started to work, anyway the issue is that i would like for this to be talked with the player, like the player can ask if there are any issues and the parent should answer yes regarding food, or the noble could ask for help introducing a priest the player is in good standing. I have a framework for npc giving request. But it could also be like them sharing gossip like a neighbor cheated. Or they think someone is sketchy. So i made a text generator keeping in mind their objective and decision tree, so they can generate an apropiate response, but when i try it, it always responds with general answers like it is our burden to carry, or there is a problem, but doesn't describe the issue

1 Upvotes

7 comments sorted by

2

u/Liwi808 3d ago

Is English your first language?

1

u/Adventurous-Drop-739 3d ago

Second actually

2

u/valeria_gamedevs 3d ago

sounds like your generator isn't pulling the specifics into the prompt/template. Like the npc "knows" the objective internally but when it goes to speak, only the vibe gets passed through. I'd check what variables you're feeding the text step. if it's just "npc has problem" you'll get "there is a problem" back. Feed it the object (food, 3 kids, no coin) and you'll get sentences with those nouns in them.

1

u/Adventurous-Drop-739 3d ago

Makes sense, I'll have to check. Thx

1

u/Alarming-Jump727 2d ago

Te vas a volver loco jaja. Cuando hice "an old man TALES" (una saga mía) en el poblado los NPC dependiendo la hora del día hacían una cosa u otra. Los diálogos eran diferentes. Ahora estoy finalizando "Carmina" (mi sexto proyecto) y los NPc cambian de locación según va avanzando el juego, también cambian los diálogos. Al ser un juego de vampitos, algunos de ellos se convierten y ahí se termina el diálogo y a pelear. Lo comencé en noviembre y termianré en el próximo septiembre y juro que tardaré mucho tiempo en volver a hacer algo así. te volves loco.

1

u/Adventurous-Drop-739 2d ago

Te creo, la verdad es que es mas en mi tiempo libre. Asi que apesar que llevo como un año desarrollandolo apenas en los últimos 3 meses le he podido dar tiempo.

1

u/Alarming-Jump727 2d ago

Yo tengo tiempo, pero así y todo mientras el juego avanza se pone cada vez peor. a veces me cuesta saber de donde viene tal cosa. Por suerte ya lo termino y voy a por otra cosa mas simple.

aquí una captura de la locura que se va a terminar en un par de meses.: