Sponsored By
Guy Hasson, Blogger

July 6, 2012

9 Min Read

Towards Better NPC’s

This is the second in a series of three articles, which will hopefully lead to richer NPC interactions, interactions that looksmore human.

  • The first article talked about redefining NPC interaction by treating a dialogue line as an action (positive or negative) of one character on another.

  • The second article (this one) talks about changing the basic build-up of an NPC. 

  • The third will show how new puzzles can be created that stem from the fact that NPC’s are now more ‘human’.

Doing Away with Dialogue Trees, Not Dialogue

Before we begin, I’d like to clarify a point about the last article. Judging by the response in the comments and the emails I’ve received, many people understood that by doing away with dialogue trees I want to do away with dialogue. Not so.

The whole point is this: The player knows what kind of information or action he wants to get, and he chooses how to try and get the information out of the NPC (intimidate, befriend, sweet-talk, etc.) Once the choice is made, the player sees/hears his own line as well as the NPC’s response – all in words and dialogue. However, the purpose behind these three articles is to have that response not be part of a dialogue tree, but part of another type of system altogether.

Now we’re getting to how that system should work.

The Basic Build-Up of the NPC

 

As I stressed last time, a person in real life responds from his own personality as well as from his own mood. Those two are different.

Two different people would respond to the same stimuli completely differently, even if their mood is the same.

At the same time, one person in mood A would respond to the same stimuli one way, but in mood B would respond in a totally different way. This is despite the fact that his personality is exactly the same in both instances.

Step #1: Create a Personality for Your NPC

Say you’re creating a new NPC. Suppose it’s a guard that you have to convince to let you through into CIA headquarters, even though the CIA fired you last week.

Give your NPC some character, a personality. You know how to do this. And if you don’t, you’ll find helpful advice in every book about writing.

Step #2: Create a Mood Scale for Your NPC

You can choose how many points are on the scale. For example, say the scale has 10 points on it, from 1 to 10: one is a deep depression while ten is complete happiness. You choose how low the character can ever get in the game as well as how high and happy he can become.

Step #3: Create Responses for Each Point on the Mood Scale

For each mood, under circumstances X, write a different response. Did you try to intimidate the guard? If he’s in a good mood, he’ll give you response A, but if he’s in a bad mood, he’ll give you response B. Each mood carries a different response (which is also a positive or negative action).

Step #4: Create Different Responses According to the Character’s Personality

Don’t forget that each response, in every mood, has to fit the character’s personality. If the guy’s a wiseass, for example, then all his responses, regardless of mood, should be wiseassy. However, if you want to build a complex character, you don’t have to be consistent. The guard may be a wise-ass, but if his mood is 10 right now, he’ll just ignore you rather than take the trouble to crack a joke. If his mood is 2, for example, something will click inside his head, and he’ll give you an honest moment of truth. But if his mood is 1, then he’s too depressed for a moment of truth, and he’ll just be a heavily depressed wiseass.

You can hide behavioral surprises like that one inside the mood scale responses. The more you hide, the more real your NPC and the more intriguing the NPC interactions (and, as we’ll see next time, the NPC personality-based puzzles).

 

Step #5: Define Mood Changes According to the Player’s Behavior

Remember that every action the player makes is either positive or negative? You now need to define how your NPC’s mood scale responds to each of the actions the player chooses from. For example: A regular negative action (doesn’t matter which) could bring the NPC’s mood scale down one (a reaction you see on them before they speak), and then, after reacting, they act back from their new mood with the action (meaning ‘dialogue’) you’ve inserted for that location on the mood scale.

Keep in mind that one action that seems negative (intimidate, for example), can be negative for one character but positive for another, depending on the personality. For example: There are people who take encouragement badly and respond to a good word as if they’ve been spat upon. There are people for whom scolding is the only way to get them to actually do something and improve their mood. People are complicated. Make sure that the way you structure your NPC’s personalities is as complicated as the people you know.

You should also keep in mind that a positive or a negative action can be taken one way in a certain mood and another way in another mood. For example, say the guard has a lot of self-confidence. If he’s in a bad mood, his self-confidence is tattered, and a negative action performed on him would lower his mood. However, if his mood is 6 or above, then his self-confidence is so high that a negative action performed by the player would elicit the following response: It doesn’t faze him, and his mood improves by one, since he realizes how powerful and unfazeable he is. So a negative action can get different mood changes depending on the character’s personality.

Sometimes, one action can make the NPC’s mood go down one point, but a real negative action would make it go down two points (you don’t need to limit yourself to a change in mood of plus or minus one). In this way, you can also have the NPC react to a mild negative action by dropping one mood point if his mood point is 5 and above, but if his mood is lower than 5, then the same action elicits a drop in 2 mood points, because he’s already depressed and everything hurts him.

Another example: If the player finds the NPC’s weakest point and hits it (say the player has found a piece of information about the NPC), then the mere use of it would drop the NPC’s mood to 1, no matter what his mood was a second ago. In the same way, you can find an action and a piece of information that can make the NPC’s mood jump to 10, no matter where he was on the scale.

Note that it doesn’t matter what the action is, only if it’s mild positive, strongly positive, mildly negative, strongly negative.

Our Example

So, in our very basic example, we’ve got the player facing a guard that can either snitch him out or allow him to get into the CIA secretly. The player needs to find how to manipulate the guard’s personality to do the latter and not the former. In mood 3 or down and facing a negative action, the guard would snitch on the player. In mood 9 (not 9 and above) and facing a mild negative action, the guard will be amused enough to let the player in. The player gets clues to let him know he’s getting close to one or the other: The lower the NPC’s mood gets, the more he talks about calling the guards on the player; the higher the NPC’s mood gets, the more he acts positively to a negative response; and each interaction clues the player in on what gets the NPC’s mood up or down, without the player ever knowing that this is about a mood scale or mood manipulation. The player will only think it’s about person-manipulation.

Now the guard could also have a few ‘Easter Eggs’ hidden in his behavior, leading to the revealing of secrets or other things – if the mood is correct and the action just so.

What does the gameplay look like? The player could try different actions (or the same actions) with the NPC, always getting different responses, because the NPC’s mood is always slightly different. Theoretically, the player could chisel away at the NPC, the NPC’s mood going up or down, for quite a while, until the player finally gets the right response.

What if We Add More NPC’s?

When there’s more than one NPC in the same place, the possibilities become vast. Imagine one possible scenario: The player manipulates one guard to talk to another guard (in the player’s presence, but without his interference), to get something done. The NPC’s could actually talk (act and react) to one another, always differently because they are each at a different place emotionally. The player will need to figure out how to manipulate one NPC so that NPC can manipulate a second one.

An NPC can react (from a ‘what-changes-his-mood’ point of view) differently to different NPC’s or players. If it’s his boss, he will react one way to the same action in the same mood, and if it’s his wife, he will react in a totally different way to the same stimuli. NPC interacting between themselves, with the help and without the help of the player, can become a trove of endless possibilities.

 

So What Have We Got?

Now your NPC’s are now much more similar to people. They each have different moods, a personality that is exhibited in everything they say, in how they react to every action (what we used to call ‘dialogue’) performed on them, in the fact that their behavior is not uniform, but changes depending on their mood and actions performed on them.

Next time we’re going to delve deeper into how we can use this new behavior to create new NPC interactions, personality-based games and personality-based puzzles.

 

[If any of you have any questions for future Story Design Tips columns, please write them in the comments or send me an email to guyhasson at gmail dot com.]

Read more about:

Featured Blogs

About the Author(s)

Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like