Putting the "character" back in "non player character"

The other bit I’m liking about it is then, these become in game clues and tips for newer players about the kind of monsters you can run into. Which is why I’m making these stories pretty easy to get from starting NPCs.

Yeah. A “pro tip” not to mess around with spores would have saved me from YASD. But it’s part of the learning. Even if you parse some context clues from NPCs you still receive that gratification.

That’s what I think too. These are more in context than the NPC tips and hints section, and I hope will feel more like an achievement to get and parse and understand.

I posted this to the derail thread that was split off this one, but it’s relevant.


Basically I’m planning to build NPC backstories in these phases:

Phase 1 - hard-coded backstories, assigned to each NPC based on their starting class

Phase 2 - simple procedurally generated NPC stories based on a handful of NPC traits derived from their starting class (in addition to the scripted ones)

Phase 3 - a bunch of personality traits for NPCs that determine more complex stories, giving NPCs a number of fluffy conversation options with persistent personalities and histories bases around it… This is where stuff like sexual preference, liking or disliking violence, and other personality details start entering in

Phase 4 - try to make NPCs capable of having conversations with each other based on the above? I get cloudy at this point because I’ll be impressed if I can make it to 3.

1 Like

I responded jokingly there, but in seriousness are you possibly planning dialogue that references post-recruitment? I feel like setting up a faction camp should pose some reactions from the NPCs besides the camp manager. I imagine tracking player actions and making them flag NPC dialogue reactions would be nightmarish though.

I really want to, but for now I am focusing on making the starting stuff. Somewhere in there I want to get help making it possible to recognize a few in game elements, like how much time has passed and what stage the base is at and things, but since there’s no way I can program that, I’m focusing on what I can feasibly do myself

Edit to clarify: when I say how much time has passed I mean, how long the NPC was alone before meeting the player (so that I can write backstories for NPCs in year 2 that talk about how they survived a full year), as well as how long it’s been since they met the player (so they can mention that in the procedural dialogue)

If we’re going to have a dialogue system at all, it’s going to need to adapt to some of that stuff. We don’t need X variants for every piece of text, but we are going to want them when it’s important.

These look really amazing, as mark pointed out, I think they provide a great deal of value even in the very short term, and I agree these are great ways to warn about some of the more obscure dangers one might encounter.

Okay. I’ve started trying to put this together into a JSON file. The more I parse this though, the more I think maybe it should just be done correctly now, integrating a little more of phase 2 than I planned. If someone is willing to help me code this I think I can have the writing part done by the end of the weekend. Here’s what I’m doing:

Each survivor class (I have about a dozen in addition to the current existing ones) gets a number of “past_life_details”. For example a nurse gets “adult”, “hospital”, “educated”. A burger flipper gets “teenager”, “restaurant”, “service”

Each tag is associated with a number of appropriate survivor stories. For now, most of them are under either “adult” or “teenager” because that’s the number one differentiating factor for which stories are appropriate, but in a few hours I will have written a few stories that take place in hospitals or office buildings that will be gated to the past_life_details with those flags. This will keep a fifteen year old burger flipper from telling you about the tragic loss of his wife, and allow a nurse to tell you about having to go from saving patients to running from them and putting them down without fear of an accountant deciding to do the same.

So basically what I will do is put together a new classes.json that includes the new past_life_details addition. I will also make individual conversation .json files for each of the backgrounds I’ve already created, along with a few more. Those ones will include the “allowed_details” list.

The only problem I see here is that I am not sure that the backstory will be consistent unless it’s coded as an NPC trait in itself. Could the game select the allowed backstory using these criteria at the time the NPC is created, and make it into a hidden trait? If so, how should I put that into the .json?

Is this easily doable? If not I can attach a story to each class, so every accountant you meet is a fema camp survivor, and that would still work okay because I have so many stories and classes that you’re not that likely to run into the same one twice in one game, but it seems to me like it’s relatively little effort to just do it correctly from the start and then I don’t have to rewrite all the files in a week or two. Plus, this ‘details’ framework is what I need to go on to step two and allow NPCs to invent a few new stories of their own.

Unfortunately I have zero coding knowledge and don’t even know whrrr to start. My skills are basically just proof reading and playtesting :cold_sweat:

Well, if you’re keen and want to help, I could use someone who could do a few JSON writing tasks that I really don’t want to get into. For example it’s quite easy but time consuming to code in the starting clothing/gear for each of these classes. I could make a template file that just needs the clothing ID to be filled out.

I could definitely make the attempt if I have a template. My only experience with coding has been minor fixes in notepad that I’ve basically been walked through. Also I’m in the process of packing up my house to move so it’ll be slow going if you wait on me. Just as fair warning.

I’m just happy to see that if I reach phase 3 of my NPC project and code in a random sexual preference for NPCs based on real demographics, I’m not going to get dev pushback.

1 Like

Yessss representative demographics would be wonderful.
The policy until now has been to be gender/race/sexuality agnostic, but I can see that not being an option once conversation trees start getting filled out.

1 Like

Ha, now I’m derailing this back to where it originally derailed from. Basically I’m planning to build NPC backstories in these phases:

Phase 1 - hard-coded backstories, assigned to each NPC based on their starting class

Phase 2 - simple procedurally generated NPC stories based on a handful of NPC traits derived from their starting class (in addition to the scripted ones)

Phase 3 - a bunch of personality traits for NPCs that determine more complex stories, giving NPCs a number of fluffy conversation options with persistent personalities and histories bases around it… This is where stuff like sexual preference, liking or disliking violence, and other personality details start entering in

Phase 4 - try to make NPCs capable of having conversations with each other based on the above? I get cloudy at this point because I’ll be impressed if I can make it to 3.

2 Likes

Can’t wait for the NPC romance branch where I take morale penalties for rejection that still aren’t as bad as being rained on.

“Look you’re a great… guy? But uhhh. Your giant insect mandibles, dead fish eyes, acid blood, and horrible monster voice are a bit of a turn off.”

5 Likes

Ate a hot meal +5
Enjoyed cream soda +8
Disliked popcorn -2
Hot -5
Guilty about killing -8
Rejected by last surviving female of your species -8
Wet -56

3 Likes

Disliked popcorn? We all know the real reason she said no.

1 Like

I get that a lot, because I force feed by player mushy popcorn because dammit man, I know it froze, but it’s still goddamn popcorn. You’re fighting zombies, mushy popcorn is still better than cold wild vegetables!

No worries. I’m just going to give them all generic survivor gear to start. If you have time and you’d like to help me with the tedious scripting later, I’d welcome it.

Currently, responses can key off NPC effects or player traits. It’ll be easy for me to add having them key off an NPC trait. After that is added, you’ll be able to set a trait in the npc class definition and then add a response based on it. NPC traits can be set up as distributions, so you can make them exclusive.

So you’d end up with something like:

{
    "type" : "npc_class",
    "id" : "NC_NONE",
    "name" : "Hunter",
    "traits": [
        [ "NPC_HUNTER_STORY1", 100 ]
    ]
},
{
    "type" : "npc_class",
    "id" : "NC_NURSE",
    "name" : "Nurse",
    "traits": [
        {
            "type": "trait_group",
            "id": "trait_group_NONADDICTIVE",
            "subtype": "distribution",
            "traits": [
                { "trait": "NPC_NURSE_STORY1" },
                { "trait": "NPC_NURSE_STORY2" }
            ]
        }
    ]
},
{
    "id": "TALK_LEADER",
    "type": "talk_topic",
    "response": [
        { "text": "I'd like to know your background.", "topic": "TALK_HUNTER_STORY_1", "condition": { "npc_has_trait": "NPC_HUNTER_STORY1" } },
        { "text": "I'd like to know your background.", "topic": "TALK_NURSE_STORY_1", "condition": { "npc_has_trait": "NPC_NURSE_STORY1" } },
        { "text": "I'd like to know your background.", "topic": "TALK_NURSE_STORY_2", "condition": { "npc_has_trait": "NPC_NURSE_STORY2" } }  
    ]
},
{
    "id": "TALK_HUNTER_STORY_1",
    "type": "talk_topic",
    "dynamic_line": "My twin brother and I were raised by wolves after our mother died in childbirth.",
    "response": [ { "text": "You're kidding, right?", "topic": "TALK_HUNTER_STORY_1b" } ]
},
{
    "id": "TALK_NURSE_STORY_1",
    "type": "talk_topic",
    "dynamic_line": "I always wanted to be a doctor, but I didn't study enough in college to pass the MCATs.",
    "response": [ { "text": "That's a shame.", "topic": "TALK_NURSE_STORY_1b" } ]
},
{
    "id": "TALK_NURSE_STORY_2",
    "type": "talk_topic",
    "dynamic_line": "I got a job as an EMT after high school, but decided trauma medicine was too traumatic.",
    "response": [ { "text": "Ironic, given the current circumstances.", "topic": "TALK_NURSE_STORY_2b" } ]
},
{
    "type" : "mutation",
    "id" : "NPC_HUNTER_STORY1",
    "name" : "Hunter background 1",
    "points" : 0,
    "description" : "This hunter was raised by wolves.",
    "valid": false,
    "purifiable": false
},
{
    "type" : "mutation",
    "id" : "NPC_NURSE_STORY1",
    "name" : "Nurse background 1",
    "points" : 0,
    "description" : "This nurse was a failed pre-med student.",
    "valid": false,
    "purifiable": false
},
{
    "type" : "mutation",
    "id" : "NPC_NURSE_STORY2",
    "name" : "Nurse background 2",
    "points" : 0,
    "description" : "This nurse was an EMT.",
    "valid": false,
    "purifiable": false
}

I may have gotten the syntax on the trait distribution group slightly wrong, but if you look at data/mods/NPC_Traits/ you’ll see how to set it up.

1 Like

Hope this get integrated in the main game. Damn i freaking love this mod / idea :D.