Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] NPC Dialogue, Phase 1: Survivor Stories #26834

Closed
wants to merge 27 commits into from

Conversation

5 participants
@I-am-Erk
Copy link
Contributor

commented Nov 25, 2018

This is my first PR, be gentle.

Update: fixed some basic stuff
Reviewers feel free to disregard the "talk_professions" file for now. It just adds more stories. In terms of how things are actually done, talk_common includes examples of everything I'm trying to do.

Update2: OK. This should be about ready for prime time.
There is still stuff to go, some of the conversations are bare-bones, but overall it's at a point where - content wise - it could be added to master safely. I'm sure I have messed something up that will get in the way...

Summary

SUMMARY: Content "NPC Dialogue - survivor stories"

Purpose of change

This will introduce 'background survivor stories' (BGSS) for NPCs.

I see this as the first phase in a wider project to give party member NPCs more personality and uniqueness, and as a side effect, to give NPCs dialogue that will flesh out the background to the cataclysm as it is seen to survivors (rather than the current rather high concept science/political stuff we mostly get).

Describe the solution

Each NPC is assigned a story trait at creation, grouped loosely based on the presumed origins of the current NPC classes.

Once in the party, NPCs gain an additional dialogue option "Let's just talk." - under header TALK_LEADER. This will open the option to ask them about how they survived the cataclysm.

Additional context

I'm submitting this as a work in progress. Not all survivor stories are complete and I am still editing them in, particularly in NPC_talk.json. This is my first JSON adventure so I am sure the coding could use some cleanup, but I have been able to get it running correctly in my home copy.

At a later date (possibly by the end of this PR) I will add more NPC classes as well to allow a wider range of survivor types and stories.

Some features that I would like to see as part of this project (not necessarily this PR):

  • being able to test how long it has been since the cataclysm in JSON, so that I can have NPCs spawned after the first year get special background stories that describe a longer interval since the apocalypse
  • being able to code dialogue gender tags, so that if the NPC is female she can talk about her husband and if he's male he can talk about his wife
NPC dialogue phase 1
Create "survivor stories" backgrounds for NPCS
These are governed by traits selected at NPC creation
Classes have access to a group of traits that are loosely appropriate for the type of NPC, so doctors get hospital stories and hunters get rural stories.
@mlangsdorf
Copy link
Contributor

left a comment

It's a great start, and kudos to you for doing this.

A couple of overall comments:

  • you'll need to run all of this through the JSON linter before final submission. You should probably start getting used to writing in CDDA's JSON style.
  • CDDA manual style requires two spaces after '.' in displayed text.

This probably too large a PR for sensible review. I burnt out around BGSS_HOSPITAL_1_STORY1. I recommend splitting it up some more - just do a single variant of each story for now, let people review it, and then come back and write some more.

But all of that is relatively minor. Overall, this is great stuff and keep working at it.

Show resolved Hide resolved data/json/npcs/BGSS_talk.json Outdated
Show resolved Hide resolved data/json/npcs/BGSS_talk.json Outdated
Show resolved Hide resolved data/json/npcs/BG_trait_groups.json Outdated
Show resolved Hide resolved data/json/npcs/BGSS_talk.json Outdated
Show resolved Hide resolved data/json/npcs/BGSS_talk.json Outdated
Show resolved Hide resolved data/json/npcs/BGSS_talk.json Outdated
Show resolved Hide resolved data/json/npcs/BGSS_talk.json Outdated
Show resolved Hide resolved data/json/npcs/BGSS_talk.json Outdated
Show resolved Hide resolved data/json/npcs/BGSS_talk.json Outdated
Show resolved Hide resolved data/json/npcs/BGSS_talk.json Outdated

@mlangsdorf mlangsdorf added this to In progress in NPC dialog overhaul via automation Nov 25, 2018

@mlangsdorf mlangsdorf changed the title NPC Dialogue, Phase 1: Survivor Stories [WIP] NPC Dialogue, Phase 1: Survivor Stories Nov 25, 2018

@mlangsdorf

This comment has been minimized.

Copy link
Contributor

commented Nov 25, 2018

Also, about your feature requests:

  • dynamic lines can be filtered against "npc_male" and "npc_female". I can add that as a response condition very easily.
  • filtering dynamic lines against time since cataclysm will also be pretty easy to add.
Numerous fixes
Style fixes, comma fixes, typo fixes
Split NPC_Talk into two files because it was getting way too long
Added all the stories I had changed to JSON because I had uploaded an outdated file.

NOT INCLUDED  YET:
Any more 'programmy' fixes like adding NPC reactions and items
Minor fixes
Mostly punctuation and line placements.

Night-Pryanik and others added some commits Nov 25, 2018

Update data/json/npcs/BGSS_talk_common.json
Darn yankees

Co-Authored-By: I-am-Erk <45136638+I-am-Erk@users.noreply.github.com>
@mlangsdorf
Copy link
Contributor

left a comment

Looking good, just some more minor nits.

Show resolved Hide resolved data/json/npcs/BGSS_talk_professions.json Outdated
"id": "TALK_LEADER",
"type": "talk_topic",
"responses": [
{ "text": "<BGSS_intro_question>",

This comment has been minimized.

Copy link
@mlangsdorf

mlangsdorf Nov 25, 2018

Contributor

Response lines for all the other STORY1 topics needed.

It might be worthwhile for me to build some smarts into npctalk.cpp, so that these copy-paste response lines are autogenerated. Something like you add a tag to the story1 topics with the required trait, and then TALK_LEADER reads through all off them and adds the appropriate one.

This comment has been minimized.

Copy link
@I-am-Erk

I-am-Erk Nov 26, 2018

Author Contributor

I'd appreciate that...
If I set it up like this:

`"id": "BGSS_CONFUSED_1_STORY1",

"type": "talk_topic",

"parent_topic": "TALK_LEADER",

"trigger_on_trait": "BGSS_confused_1",

"dynamic_line":`

would that provide the infrastructure you'd need to set it up?

Show resolved Hide resolved data/json/npcs/BGSS_talk_common.json Outdated

I-am-Erk added some commits Nov 26, 2018

Snippet changes
This part adds snippets to the existing dialogue, because I should have done that from the start, and while I'm at it I broke up the snippet json files a bit to make them easier to navigate.

Going forward I would like snippets to be more widely used in conversation parts - this will be important later, so that I can have NPC personality traits affect their word choices. Sorting the files a bit now makes that easier later.
@I-am-Erk

This comment has been minimized.

Copy link
Contributor Author

commented Nov 26, 2018

All the stories I have planned for this PR are entered at least enough to be publishable in an initial state. I will go about the legwork of adding in all the traits and the initial conversation calls next. After that, some of the details like NPC reactions (negative reaction for religious insult or for failing a persuasion check, adding a timer for failed persuasion checks, etc), NPC offers to sell items, and a few other little things.

Things I will probably leave to future PRs:
-Differentiating partner gender in talks about spouses/significant others.... I am still debating if I want to roll sexual preferences into that as well since I have a solid idea how I would like to do that now, and it's pretty straightforward (no pun intended)
-Adding in more classes, because I have enough stuff to do without making more work for myself just yet
-Adding in stories only available after x amount of time has passed, same as above
-More story variety. I actually have a significant stockpile of partly written stories still, but this is too bulky already.

Things I'd love to see done before finishing this PR, but are still outside my skillset:
-some autogenerated responses from npctalk to reduce the giant table of contents at the start
-the ability to make traits hidden from the '@' screen so that players don't see the NPC's backstory of choice

I-am-Erk added some commits Nov 26, 2018

snippet improvement
Just a few more words. I should probably stop playing with these, just wanted to fix some minor things before bed.
End conversation, and player offense prototype
1. Added an 'end conversation' snippet and talk option to pretty much every part of the conversation.

2. First pass at using NPC effects to define conversation parts - in this case being offended about a somewhat offensive religious question. Will be adding more of these shortly provided I am doing them correctly.
Effects
-Failed persuasion makes the NPC not want to pursue the topic for a while
-Prepper2 might sell you a survivor map for an exorbitant fee

Upcoming: Finish indexing traits, and then this might be near completion.
Trait setup
Traits added and indexed
I'm sure I've missed a bunch of commas and such but otherwise this should be functional now.

@Leland Leland self-requested a review Nov 27, 2018

@Leland

This comment has been minimized.

Copy link
Contributor

commented Nov 27, 2018

Want to do a once over of the prose before this gets merged

@I-am-Erk

This comment has been minimized.

Copy link
Contributor Author

commented Nov 29, 2018

I'm not certain, but I think this is about ready for review. There are two things I just remembered it needs, before merging:

  1. I have to go in and add a double space after every period, which is easy enough.
  2. I need to run it through a de-linter. I've heard of this but I don't know what it is or how to do it. Can anyone help there?

Aside from this, are there any outstanding things before it can be merged?

I-am-Erk added some commits Nov 29, 2018

Add gender specificity to some stories
Also clean up some commas, yet again
@I-am-Erk

This comment has been minimized.

Copy link
Contributor Author

commented Nov 30, 2018

Travis is giving me the following error:
Makefile:1071: recipe for target 'data/json/npcs/BG_trait_groups.json' failed
make: *** [data/json/npcs/BG_trait_groups.json] Error 1
make: *** Waiting for unfinished jobs...

Does anyone know what this means?

@cainiaowu

This comment has been minimized.

Copy link
Contributor

commented Nov 30, 2018

It says this
Formatted data/json/npcs/BG_trait_groups.json

Which means you need to put this file though the web linter.

I-am-Erk added some commits Nov 30, 2018

De-lint 3
This de-lints the entire npc classes json file, because why not.
de-lint and double spaces
somewhere in here i seem to have also fixed a syntax error, though I can't find it now.
Redo delint
Accidental file duplication fixed
Add monster_warning back
Recent commit to the original talk_tags file
@I-am-Erk

This comment has been minimized.

Copy link
Contributor Author

commented Nov 30, 2018

All checks passed! I will test this out one more time in my home copy this evening, and if anyone else wants to give it a whirl, I'm hoping it's ready to commit so that I can start making more background stories and my next step - personal histories (where did you work, who was your family).

@Leland

This comment has been minimized.

Copy link
Contributor

commented Dec 1, 2018

There are >7,000 words of dialogue in this PR, for the ease of review I'd recommend splitting it up.

@I-am-Erk

This comment has been minimized.

Copy link
Contributor Author

commented Dec 1, 2018

I feel like you don't appreciate my nanowrimo efforts.

Do you want it split up simply for prose review, or for code? I can give the prose in a much more legible format pretty easily

@mlangsdorf

This comment has been minimized.

Copy link
Contributor

commented Dec 1, 2018

Consider splitting it up because its 3K lines of changes, and 1-1.5K lines of changes is around the limit for sensible review.

@I-am-Erk

This comment has been minimized.

Copy link
Contributor Author

commented Dec 1, 2018

Ok. I'll see what a logical way to split it up would be.

@I-am-Erk

This comment has been minimized.

Copy link
Contributor Author

commented Dec 3, 2018

This PR can likely now be safely closed, as I have split it into four different ones that each do a single thing.

@I-am-Erk I-am-Erk closed this Dec 3, 2018

NPC dialog overhaul automation moved this from In progress to Done Dec 3, 2018

@Leland

This comment has been minimized.

Copy link
Contributor

commented Dec 3, 2018

Thanks for the split @I-am-Erk

@I-am-Erk I-am-Erk deleted the I-am-Erk:NPC-Dialogue branch Jan 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.