Creating NPCs who "remember" & NPC death

So, I’ve been thinking about/planning a CS game.

However, I’ve gotten stuck on how to develop better ‘reactive’ characters. In my ideal CS game, I want my characters to be more fluid in how they interact with the MC.
Rather than reacting to the magnitude of the MC’s personality stats or relationship stats, I thought about having the characters remember and interact with the MC’s visible choices (dialogue or actions taken around the NPCs). This, I think, would result in a lot more variables and subsequent management, but also provide more immersive interactions with the characters.

For example, if MC makes a choice to suck up to an NPC, but then disses the same NPC later, the NPC will specifically remark upon the MC’s treatment. I feel that scenarios like these are usually recorded in a stat change (i.e. relationship gain and loss), but while the NPC may be indignant at the diss, they won’t address the MC’s previous (opposite) behavior.

But to all the experienced writers/coders out there, how plausible is it to actually do this?

In a quest to create NPCs that ‘remember,’ will I actually end up generating too much clutter for myself in the code, trying to assign variables and specific flavor texts, ultimately ending up with a big waste of time? Or is this mechanic, while probably difficult, still somewhat feasible? Please enlighten me.

Secondly. less complex but controversial(?) question: How do you feel about killing off important ROs and/or NPCs? (The death is scripted and unpreventable). In the case of the RO, if I plan on killing that character, is it better to just make them a plain NPC, and not an RO, to spare readers the heartache?

Of course, CoG is all about molding the story through the choices you make, and being able to change the outcomes of the story.

So I guess what I’m struggling with is: At what point is it okay to have scripted elements, such as NPC death, and to deny the reader that agency of choice? Is it possible to make it so the reader doesn’t feel cheated if I decide to push the story a certain way (killing NPCs/ROs or making other drastic plot decisions)?


So, this was actually something I originally planned to do with my story. There were a lot of choices that changed things in tons of different ways and affected all kinds of different things. One of my chapters’ variable list looked like this:

(This is not the complete list - there’s way more)

At the end of the day, I barely ended using more than 10 of these variables, and they were only incredibly small changes. I’m now rewriting my story to include less of these variables but include bigger changes. My point for this is, unless you have a small number of choices, it’s better to not make nearly every choice create major/minor changes. They’re hardly noticeable and most readers won’t care unless it’s glaringly obvious that the character should have a different reaction to a specific combination of responses.

Second question: It depends entirely on the context and the execution. If a cool NPC is hardly developed and is killed off and it doesn’t play into the rest of the story, then I’d be annoyed. However, if they get decent development and their death has an impact, then I’d be okay with it. I’d be less okay if it happened to be an RO I was romancing, but it would definitely be an interesting approach if you handle it well.


I can’t offer any advice on the first question - trying to figure that out myself - but one thing I’ve been thinking about the second one is that it might work if the character dies because of the consequences of their actions, not yours. For example, if a character decides to charge into a melee against an opponent they aren’t able to beat, they die because you aren’t able to make the choice to force them not to. There’s probably more to it than that, but that’s the thing that comes to mind for me. If it makes sense for their character to make the decision that gets them killed (and makes sense that the decision should have lethal consequences), then I’d probably be willing to accept it.


First, I have managed to do well with the relationship stat so far, plus some, but not much, variables for specific things that change the dialogue a lot on further dialogues, I guess that my book don’t have much interaction also, so I’m not a great model to follow, however, I don’t think that there is a specific yes/no answer for what you ask, but you should figure out how important that amount of extra work adds to your story, maybe try to stick just with the stat variable and if you see that you need a specific change add another variable. Just have in mind that if you keep adding variables the work would be exponentially increased, so it better worth it.

Second, in my opinion, I can lend you any weapon you need. No but seriously, if you are going to kill someone, take advantage of that, make it hurt as much as you can, make the reader feelings hurt like if it were real, That’s what good writers do right? I mean, if it serves your interest, if you are just trying to do it softly I think you are wasting an opportunity to add some shock, evoke emotion, all those things that we are supposed to do.

It’s okay if you don’t like what I say, just my humble thinking.

1 Like

Welcome to the world of variables! Having PCs that remembers particular situations is a really nice touch. I’d recommend being choosy about it though, otherwise you could end up with hundreds of variables to track. Something I find helpful is to *comment below a stat in the startup so I remember what each are for and don’t have to find them in the text each time.
ie *create johnargument “”
*comment when John spoke to you after the argument you responded with: forgiveness, anger, hurt.

That’s going to vary a lot. I don’t mind if there’s a good reason for it and not just done for shock value. Sometimes certain story points may need to happen to keep the story focused IMO. Just like in real life, some things you can easily change with your actions, some you’re unlikely to.


If it’s major ROs that are at risk of being killed, the outcome should be avoidable, not scripted. Even if a romanceable character is scripted to die, it should not be the one(s) that PC is romancing unless they botch the choices leading to the encounter, or the themes of the game include death and grieving.

Major NPCs can (and if it fits the story, should) have scripted deaths, IMHO.


I can’t really help you with the first question, but boy do I have opinions on the second.

Rant about NPC/RO death
  1. First of all, I think unavoidable NPC deaths are acceptable, though it will be hard, in my experience, to make it feel natural rather than “oh boy, the writer’s at it again, trying to tug my heartstrings by killing [character]” (and I say this as a writer myself). Romance options are much more fraught. They usually tend to be quite plot important and part of the MC’s group, making that balance between anger at the author vs. anger at the circumstances/sadness at the character’s death harder to balance. But it’s also more fraught in other ways.

  2. Before you kill off that romance option, you need to think hard about who you’re killing off, because we all have bias and if killing a character off would be in some way problematic, you should think twice about doing it. Ask yourself some questions. If you characters have set orientations that will lock people out, are you killing the only option for players interested in a gay romance? The only gay person in general? Are they a person of color? The only one or one of the only ones? If so, how do they die and does this play into a) racist tropes or b) potential real life experiences for people who play your game? Etc.

  3. Do also note that by giving players agency within the story, you’re also giving them an opportunity to feel slighted by the fact that other players are out romancing characters that don’t die, while they’re stuck with a dead RO that they put time into romancing, probably expecting them to survive until the end of the story, like they might assume the other ROs do.

TL;DR: NPCs are fair game for unavoidable death, but RO options in particular are fraught and need to be handled carefully. You’ll also probably upset people regardless by virtue of (presumably) the other ROs being alive while theirs isn’t.


Thanks for the insightful replies everyone!
As @trevers17 and @Jacic mentioned, the giant number of variables that could crop up is what worries me, because having so many combinations but each combination only contributes one or two lines of flavor text is, essentially, a waste of time when there are greater things to be writing and focusing on. (Especially as trevers pointed out that most readers won’t notice anyways T_T)
It seems that I’ll just have to pick and choose my variables, making sure the choices the NPCs react to are impactful enough that it’s noticeable.

As for RO death, my conflict was between that emotional impact vs. giving readers the ability to sidestep it. In the end, I suppose I was being silly, because I’m sure I can find ways for me to still wring the reader’s heartstrings without eliminating their RO. I also do acknowledge that implementing NPC deaths requires a finesse that I may not have haha.
@QuixquillianParadise I really appreciate your response, because points 2 and 3 are things that I’ve been mulling over when considering my character’s death.


The MC and company find themselves in a situation that’s quite impossible to get out of; one of the main/only solutions is for NPC A, who could also potentially be an RO, to use their powers to help the MC escape. However, in the scope of the story, A’s powers have an extremely high chance of harming/killing them upon use. Naturally, this led me to the sacrifice of A as a critical point for the story to advance. Of course, if A is an RO, this leads to various problems, namely those that you mention in point 3.

From the responses you all have wonderfully given me, I suppose it could be in better interests to rework the flow of the story such that the readers can avoid a tragic death from A, but still face consequences to their escape that are emotionally challenging.


The first question is one I’m still trying to formulate a reply to for my own work.

For the second though, I would suggest thinking of it in terms of the pc’s experience rather than the story as a whole. It sounds like you already are to a great degree, but that can’t be over emphasized. Consider what the emotional experience you want the player to have is, and whether the story as outlined provides that. Maybe even do some playtesting with questions about the emotional response to the scene, more so than whether the player LIKED it.

1 Like

You can always create a *temp on the spot. Later, edit out choices you dislike and optimize the code. Move all the temporaries to the top of the scene.


I think that unavoidable, scripted death of a minor NPC is okay for a plot point — like Napoleon’s in The Eagle’s Heir, but when it comes to major NPCs that the player has come to care about, or ROs, in an interactive medium like COG it just feels like such a waste to have the death be unavoidable. After all, if the goal is to create emotional impact on the player, doesn’t it hurt that much more to know that there was something you could have done to prevent this from happening?


I read this part and Alan Wake popped up in my mind. There’s an entire sequence where one of MC’s friends dies, and the MC just keeps resetting things to save him (Spoiler: He does).


This looks like you are trying to record many individual choices without even using personality and relationship stats. There are 2 problems with it:

  1. As both you and some commenters noticed, this increases your workload dramatically. That’s why this article recommends using stats instead of recording individual choices.
  2. Realism: while it is realistic for people to refer to indovidual events, they can’t remember every little choice you made around them. It’s also realistic to form a general opinion on your character without referring to every single event that formed it.

It doesn’t mean you can’t refer to past choices at all, however. You can combine 2 approaches, using relationship/personality stats with variables recording important/interesting decisions.
Think about things your NPCs can react to.

  1. How important they are?
    Little things, like always being polite to a character, add up to a bigger relationship stat, but each individual “Good day!” instead of “Oh, no, it’s you again!” doesn’t warrant a separate variable. But if you broke an NPC’s family heirloom, it should both affect the relationship stat greatly, and be recorded as broken_heirloom true, and referred to in the future.
  2. How long will an NPC remember this? Is mentioning this event much later likely, even if an NPC does remember?
    Some events are only referred to during a single day, or a single conversation. They can be recorded with a temporary variable and not mentioned in later chapters. Others events are remembered for a long time and used in multiple chapters.
    For example, you can create a temporary variable at the beginning of a chapter, to record you greeting a character:
*temp greeting "none"
You meet Mr. Borington at work. How do you greet him?
		*set borington_rel + 5
		*set greeting "hello"
	#"Oh, no, it's you again!"
		*set borington_rel - 10
		*set greeting "you again"
	#You give him an understanding, "only Monday, but already tired from work" look.
		*set borington_rel + 5
		*set silent + 5
		*set greeting "look"

At the end of the chapter, this character says you goodbye, mirroring your earlier greeting:

You see Mr. Borington when you leave.
*if greeting = "hello"

	"Bye, ${mc_name}," he says politely,
*if greeting = "you again"

	"Ugh. You again," he says with irritation,
*if greeting = "look"
	He looks into your eyes, conveying all the sorrow of long over-time hours directly into your soul,
and leaves.

The greeting is forgotten after that chapter, but borington_rel and silent stay. This way, you get realistic reactions from NPCs without overloading your variable list too much.

Hope that helps!


In the words of the immortal Tumblr post, pick your battles. Pick… pick fewer battles than that. Put some battles back.

All jokes aside: I get the impulse to track specific interactions, and I certainly think there’s value in letting the player experience a change in personality or relationship, of the kind that would require duplicating variables, or else a deluge of boolean switches. It’s a cost/benefit equation, and it’s harder to calculate for variables that don’t represent “branches” but specific pieces of, let’s call it flavor text.

So how do you sort the complexity that’s worth the extra challenge, versus clutter that exists only to prevent you ever finishing your game? Let’s look at some examples.

Example 1. A potential RO has a Deep Dark Secret, as one does, and your MC needs to be a level 4 friend to unlock their tragic backstory. You create three variables, mc_sexypants_friendship to track the percentage-based relationship (at 70%, you trigger their loyalty quest), mc_sexypants_love a boolean to track whether they’re the active RO or “just” a friend, and sexypants_backstory_convo a boolean that’s turned on after the big scary conversation was had. That way, if your MC loses and then regains the necessary level of friendship, they won’t end up having the same conversation twice.

Example 2. An important NPC has three possible scenarios for meeting them for the first time, where the first two occur during optional side-quests, or require specific skills, or are in some other way locked to some players. The third and final meeting is the “scripted” introduction, but you want that scene to have some optional extra dialogue for the MC who’s already encountered this NPC. In addition to the variables met_npc (a boolean) and npc_relationship (percentage), you add another (string or integer) variable to track which first meeting they had, for example, met_npc_at which takes numeric codes (I use these, by long ingrained programmer habit) or a very simple, short string, if you’re looking for something more intuitive.

Example 3. Your game features an MC with morality variables, and you want to track not only where the MC ended up, but whether there were major fluctuations in their morality. Instead of just creating the opposed pair variable purity_corruption, you also add variables purity_initial, purity_highest and purity_lowest. Instead of changing the first variable inline, you call a little utility subroutine, that changes the value but also checks it against the max and min values that you recorded before. You could probably get away with using this system for two, maybe three personality variables, so you want to pick the ones that are most central to the story’s theme.

As for how often you refer to these variables in the text… that’s another case of “pick your battles”. Which NPCs are the most invested in specific changes the MC undergoes? Who cares most about this specific interaction? How often is it likely to come up? I have found myself removing flags because the interactions they were marking panned out to be less important than I thought. Just lately, I removed a minor option from a choice menu, because there was no elegant way to integrate it into future conversations. Finding variables that have been obviated is a lot harder than you might think, the more so the longer your variable list is, and the more text files you have to search for.

If you’re not certain whether you’ll want to add a flag variable to a certain choice, leave yourself a little *comment (in general, leave yourself a lot of comments, they’re invaluable). Tag the comment with some short searchable word, and periodically, search through your older files for that tag. With the benefit of hindsight, you’ll be better able to judge whether the choice is as significant as you speculated it might be. For example, if people in your game thread have asked, “when will X bring up Y?”