NPC Creation - Tips for NPC's...

The place to chat about ideas, writing, this forum, or anything related to Interactive Fiction that isn't specific to ADRIFT.

Please also visit the Interactive Fiction Community Forum for further discussions.
Post Reply
Posts: 179
Joined: Mon Jun 24, 2002 2:44 am
Points: 10
Location: Melbourne, Victoria, Australia

Post by Sarazar »

I'm currently working on a list of tips for creating and interacting with NPC's, but if anyone else has got any others in the mean time then by all means post them.
Posts: 2035
Joined: Sun Jun 23, 2002 1:19 pm
Location: England

Post by Woodfish »

Maybe this is more appropriate in this forum?

Make NPCs responsive to everything. There are four main categories I look at when creating any NPC.

1 - Conversation
There are three main approaches to this. First - the 'ask character about subject' method. This is tricky. In one way, it can be realistic, allowing greater freedom for the player to talk about whatever they want. For example, you could ask an inn-keeper about the history of the inn, his family, the drinks he serves, what his favourite music is, literally anything. The huge drawback here is that the author can never code all the responses. So when you ask a circus clown how he feels about the state of welfare for circus animals, you will get 'The clown does not understand what you are talking about', ruining the state of mimeses for the player. So, the pro is that the player can solve puzzles through speech this way (asking about a person will uncover information about them), but more often than not, they will have no idea what you're talking about.

The next type of speech is The Listed Topics. This is the type I usually go for. When you type 'talk to character', you are presented with a list saying something like:

1) Nice weather, isn't it?
2) Have you heard of Jim Bob?
3) Do you happen to hold the key to world peace?
4) <say nothing>
Type either 1, 2, 3 or 4

I think this is the most linear approach, but makes a better game. This way, you don't have to guess-the-verb/subject, and you can take away an option after you have already said it.

The third way, which I go for in certain situations is the Free Style. An example of this is Spider And Web by Andrew Plotkin. I will give you an example of how this could be done (taken from a phone-call, in one of my games in progress).

On the phone

'Hello? Is this James?'


'Thank God you're alright. I've been searching for you everywhere. Did you get to Tony's okay?'


'No? Where are you?'

[At this point, you could either allow the player to type where they want to be ie. at home, in the park, on the moon. Or, as I have done, you could present them with a List.]

1. At home
2. Only joking, I am at Tony's.
3. In my car

[Now, which ever option the player chooses, that is where they will start the game]


'You're at home? But that's the first place the cops will look! Man... Tell ya what, you drive to Tony's as fast as you can, and I'll meet you there. Okay?'


'Right. See ya soon.'

The line goes dead.

See? I think this is the most simulating approach. It can be used in the way where you initiate the conversation by typing 'talk to character', then you ask questions and respond to questions like:

>talk to character

Conversation started

>hi, bob!

'Hello! What have you been up to recently?'

>i went to mars yesterday

'Really? Interesting place, or so I've heard.'

>yeah, it's cool. How is Doris?

'Oh, she died yesterday. Can't say I'll miss her, though.

Okay, well I've realised after typing that, that it would be impossible to implement. Though I think my more linear approach first of all would be possible to do.

There are the three ways to have speech. I'm sure there are others, so please post some of them.

Next subject is...

2 - Player Interaction
By this, I mean the standard verbs such as kiss, kill, hug, push, and so on, as well as more complex ones, and your relationship with them. First, I will talk about ways of interacting with them, then the effects of interacting with them.

In any game, whenever I come across a character, I try and kiss them, push them over, make love with them, trip them up, hit, kill, shake their hand, tickle them, and usually end up with the reply: 'I don't think they would like that.' or 'I don't understand what you mean!'

I beg all of you to allow deep interaction with your NPCs. Make a long list of all the things that come to mind when you meet someone, what you could do to them and what their response would be.

Also, if you have a puzzle that requires you to do something to someone, like 'look in fred's pocket', then make sure you can do that to everyone else too. It is unreasonable to allow the player to do that to one person, but not another.

So code responses for all the verbs you can think of. Even if you just get:

>kill guard
You don't fancy your chances against the muscles on that bloke.

It still makes it more realistic to the player. Even better, allow the player to do these things. In an Inform game I once played, can't remember the name, I tried killing a man working in the supermarket, and he dodged me, and slammed my head on the counter, killing me! In that same game, I tried kissing a lady I saw on the street, and she called the police, where I spent a night in prison. It is things like that, which really improve games, and make you take notice. Which brings me to NPCs relationships with the character...

In the games I make, I have a variable 'relationship' for each character. It starts of at 2. 0 stands for intense hate, 1 stands for dislike, 2 stands for neutral, 3 stands for like, and 4 stands for good friend.

There are things which makes this variable go up and down. For example, being nice to an NPC, giving them useful objects, asking gentle questions, etc, makes it go up, while harming, being brutal, asking awkward personal questions or kissing/hugging them before you get to know them.

It can add depth to your game, by the NPC giving out a piece of information only when their relationship is at 3 or 4, or allowing you to kiss them when you are friends with them.

Of course, there could be other variables too, like 'violence towards player', 'flirting with player' and so on, but perhaps that would be focusing too much on one NPC.

The best game I have seen this implemented in is 'Galatea' by Emily Short. I'm sure it is the best ever NPC, because the whole game just revolves around Galatea, and you interacting with her. Talking with her is the game.

Now, the player interacting with NPCs is important, but so is NPCs reacting with other NPCs.

3 - NPCs with NPCs
This section will be fairly short, but important none the less. I will show an example first. Say you are sitting in a park, next to you is an old man sitting on a bench, reading a paper.

Time passes...

An elderly woman walks slowly up the path behind you, towards the bench. She bends down to speak to the old man sitting there. 'Mind if I sit down next to you?' she asks.

>x bench
There is a man sitting on the bench, currently looking at the old lady standing beside him. 'Not at all,' he says to her. The lady smiles and sits down next to him.

Time passes...

The man turns to the lady beside him, showing her a page of the newspaper. 'Seen the news today? Terrible, isn't it?' She looks closely at the paper. 'My goodness!' she exclaims. 'I really must get a paper, the trouble is, they are all sold out when I get to the shop.'

You are carrying today's newspaper.

>give paper to woman
You hand over your paper. 'Why, thank you, young man! I really am very grateful!' she says, smiling.

You walk north, hearing the lady say to the man behind you, 'What a nice young man.'

Now, in that example, the lady and the man were interacting quite alot, but that would be very hard to do, because the player could mess things up in so many ways. However, it can still be done if you work out what needs to be changed. For example, you may already be sitting on the bench, so she may ask you to move. Then if you did move, her relationship with her would go up, same as when you give her the paper, or if you didn't, she would be cross, walk off, and your relationship with her would go down. Then, maybe, the old man might say 'That wasn't very nice', walk off, and your relationship with him would go down too.

These are all ways of NPCs interacting with you and other NPCs. Maybe that example was a bit elaborate, because it would be very hard to put in a game, so even if you just have NPCs saying hello to each other, it still gives the impression that the whole game world isn't centered around you, and there are actually people who have a life besides helping you.

4 - Interacting with objects
It's most likely that objects will play a big part in your puzzles, maybe even with characters. But the player should be able to use objects with NPCs in these four main ways: GIVE, SHOW and USE. First, let's look at GIVE. Say you are holding stack of fifty-pound notes. You walk up to someone and type 'give stack of fifty-pound notes to man'. What do you get back? 'I don't think the man would be interested in that.' Wait, that's a different parser. But what I'm getting at, is that NPCs will take some things, and not other things.

This shows GIVE:

Woodfish tired of writing. Toddler is here.

You are carrying the crown jewels, your dirty socks, a sandwich and your mobile phone.

>give toddler crown jewels
'Oooh! They shiny!' The toddler reaches up and takes the jewels from you with chubby hands. 'Thank you big man!'

>give toddler dirty socks
'Yuck! Smelly socks!' The child turns his head away.

>give toddler sandwich
He shakes his head. 'Mummy said no take food from strangers.'

>give toddler phone
'What is that?' he asks curiously, taking it from you. He presses, a button and it emmits a beep. 'Wah! Monster!' The toddler runs off south, crying.

This demonstrates how someone can react when they are offered something. The same applies to SHOW too. Also, if you gave someone something dangerous like a gun, they may call the police, if you gave your freind your brothers mobile phone, they would start asking how you got it in the first place.

5 - NPCs and scenery
This section is probably the most easiest to implement, in the same way you make events such as 'A cool breeze blows the grass.' you can do the same with NPCs. Just imagine you are in thier position, and list all the things you would do, even if it is just fiddling around with something, shifting your position, whistling a tune, or muttering to yourself.
Try to not use each one too often - I think it was Andrew Plotkin who said 'I do not expect to see the same line of text more than once in an hour.' Perhaps that is asking a too much, but still use them reasonably and alternate them to a degree.

Edited By Woodfish on 30 July 2002 at 16:18

Post by Sockets »

I want to see you do all that c*** you just described in your new game Woodfish. Because that's a lot of work.
Posts: 2035
Joined: Sun Jun 23, 2002 1:19 pm
Location: England

Post by Woodfish »

Of course I will! That is, if I include any NPCs. At the moment, I haven't planned for one, apart from Krazbozz, your talking sword, who you carry around with you. You just wait and see... :D
Post Reply