Roger Firth's Inform NPC tutorial InfAct: A good place to start finding out about Inform programming techniques in this area.
Onyx Ring's tips for conversation implementation in Inform. Fairly advanced, but rigorous and useful.
This page attempts to provide solid, particular advice based on my own experiences, with reference to games that exemplify various techniques, where available. It starts off with things that I consider easiest and moves up to more difficult things; and it is by nature occasionally digressive and anecdotal.
It's doubly true in IF that, because an NPC is perhaps the most difficult of all imaginable gobbets of code to make convincing, a bunch of stand-in objects pointing to that personality is often more successful. Gilles Duchesne's Nothing More, Nothing Less is pervaded by the character of an absent woman; everything that the PC looks at makes him think of something about her.
Memory. If the player character knows the NPC in question, the entirety of the game can become pervaded with memories. See for instance Kathleen Fischer's The Cove.
Evidence. In the absence of personal experience, there can be evidence of what has been — letters, photographs, objects affected in some way by the passage of a person. This sort of technique is used to dramatic effect in works such as Babel. In order for evidence to be useful from a characterization perspective rather than merely as a bit of plot exposition, however, there needs to be a strong sense of the self of the writer lurking in the writing (or whatever it is.)
Overheard Conversation or Observed Action. The player is trapped. His character can't act. Inescapably, he is the mute eavesdropper on some scrap of conversation; or like the Jimmy Stewart character in "Rear Window," he observes something that he can't affect. This sort of thing can easily be achieved if you can think of a reason to immobilize the player for a moment and run a daemon for a couple of turns. Used right, can do beautiful things for the building up of suspense. See:
Like any other object in the game, the NPC needs a physical description. The more important the NPC is — the larger a part of the game he or she is — the more detailed or layered it is probably worth making that description. Sometimes it's worth implementing for the NPC separately examinable clothing, props of various sorts, and even separate body parts (and not just for Adult IF pieces, either.) If you give the player more to look at, you pass on more information and also indicate that the NPC is important.
An NPC who sits still in a chair and does nothing is a lot less convincingly alive than one who seems to be pursuing some sort of personal agenda.
Randomized Messages. The most trivial way to give your NPC some sprightliness is to have the game print one of several random messages periodically while the PC is in the same location. Appending "Mrs. MacGillicuddy vacuums around the sofa." to the end of some other unrelated event is perhaps not the most striking innovation in characterization — but it does at least remind the player that the NPC is alive and moving about. With animal NPCs, this is more plausible and satisfactory. The message can be just about anything ("Mr. Beebe's stentorian snoring distracts you once again.") as long as it keeps the NPC an active presence in the room.
Interaction with Items in the Environment. A step up from this is to have the NPC actually moving or changing the states of objects in the room — dropping things, turning on lamps, picking up items you've left lying around. Considerably more difficult than the foregoing to implement, but it gives the impression that the PC and the NPC are inhabiting and interacting with the same environment, rather than passing each other like a pair of ghosts.
Reaction to Player Actions. As you observe the NPC, so the NPC observes you. It goes a long way toward suggesting a separate, alert intelligence if you have the NPC respond autonomously to things that you do. From my own speedIF A Day for Fresh Sushi, where the evil fish comments on a lot of the things that you can do:
>x telegram
A telegram, apparently. And dated three days ago.TRIUMPH OURS STOP BACK SOON STOP BE SURE TO FEED FISH STOP
"So," blubs the evil fish. "How about it? Little food over here?"
>x table
A monstrosity of poor taste and bad design: made of some heavy, French-empire sort of wood, with a single pillar for a central leg, carved in the image of Poseidon surrounded by nymphs. It's all scaley, and whenever you sit down, the trident has a tendency to stab you in the knee. But Britney assures you it's worth a fortune."That there is MY PA," says the fish, pointing at the scaley triton figure with one fin.
The evil fish begins to butt his pointy nose against the glass walls of the tank.
>x telegram
A telegram, apparently. And dated three days ago.TRIUMPH OURS STOP BACK SOON STOP BE SURE TO FEED FISH STOP
"I'll translate for you," screams the fish in toothy fury. "It says GIVE FOOD TO FISH!! How much more HELP do you NEED???"
>jump
"Er," says the fish. "Does that, like, EVER help??"
(Also, somewhat more seriously, Adam Cadre's Textfire Golf, which does an excellent job of allowing you to interact with the NPCs by doing non-conversational things that subtly reposition you socially; and Leon Lin's Kissing the Buddha's Feet.).
Moving Around the Map. An NPC who has something he or she wants to get done is likely to want to move around the environment a bit. The library module NPC_Engine does a wonderful job of handling options here: it allows you to move NPCs along random or predetermined paths, or to have them find their own ways. It also lets NPCs open and close doors, and allows you to design reactions for them if they get partway to their destination and find themselves blocked. And it handles verbs of following and asking one NPC where another one is. It's really quite a gem of simulationism, with the drawback only that it takes a certain amount of overhead and may run slowly if you're not careful. I've never used it in one of my released games, but this is only because I haven't had occasion to move NPCs around that way.
Even if you don't have recourse to such a sophisticated system, getting your NPCs from one place to another reminds the player that they are not glued into the environment in one place. In Pytho's Mask, I have characters that change locations at certain junctures — walk out of the room as a dramatic response to something that the PC says, for instance, but also just move around over the course of an evening — because I found that leaving them in the same rooms for the whole time gave a kind of sedentary and unsatisfactory feel to the game as a whole.
And there's nothing to stop you from removing NPCs from the game entirely at certain times, either.
Initiating Conversation. Sometimes it's useful to have the NPC start a conversation. Leaving everything in the hands of the player makes the other characters seem passive and bland; if the NPC has an agenda of some sort, or even just gives a sign of recognizing the PC when he enters a room, this is a step.
Pursuing Private Agendas. Discussion has also been given on rec.arts.int-fiction to the problem of writing NPCs who would be able to do (perhaps somewhat simplistic) tasks in a semi-intelligent-seeming fashion. They might, for instance, look for lost keys by systematically searching all the appropriate areas of the room.
Now, you could write this scene by giving the NPC a turn-by-turn demon which has him go through everything one step at a time in a scripted way, but this will only work if everything is going to stay put in the room and the player actions can't have any effect on the order in which the PC looks at things.
More difficult, but more interesting, would be to write an engine that would be able to perform searching routines regardless of what was currently in the room or what the character had moved.
After a certain point, though, this approaches a degree of simulationism that is beautiful in itself but, for gaming purposes, rarely useful. So strike your own balance, and remember that what you're aiming for ultimately is still an NPC that is interesting to play with and tells the story you want to tell.
For a good implementation of some of this see Dan Shiovitz's Bad Machine.
NB. I am talking about the efficacy of various systems in characterization, not about the technical aspects of achieving these effects. For a good overview of this topic, at least in inform, see Roger Firth's tutorial InfAct.
Yes/No Conversation. This is, as they say, a bit of a one-trick pony: Andrew Plotkin did a brilliant job of handling this in Spider and Web, but it's not particularly suited to most games, nor I think would the outcome be as felicitous. Still, I include it here as an example of the most minimal possible form of conversation.
Talk To. When your player wants to communicate, he types >TALK TO JONES and the conversation takes place without further interference from him. The advantages are, first, that you can put realistic, situation-appropriate dialogue in the mouths of both PC and NPC, and that you don't have to worry about parsing anything funny at all, just about disabling (if they're implemented in the language of your choice) ASK and TELL. The disadvantage is that it leaves relatively little power in the hands of the player (whose only choice is either to have the conversation or not to have it.) It also locks the player into whatever characterization you have chosen for the PC. Stephen Granade's Common Ground exemplifies both the advantages and the drawbacks very well, I think. Ian Finley's Kaged, Kathleen Fischer's Masquerade, and assorted others have also made use of TALK TO with varying degrees of efficacy.
Note also here that this is an arena in which the writing skill of the author will make or break the game. If you are a skilled author capable of conveying a fair amount of character and emotion even in these set pieces (as Ian Finley, for instance, does, in my opinion), then you may be able to maintain a sense of immersion despite a certain distance the player will necessarily feel from the PC.
Menu Conversations. When your player wants to communicate, he types >TALK TO JONES and there appears on his screen a menu of three to six sentences he can say at the moment. Perhaps there is also an option to say nothing. Jones then replies, and the player may be given another menu, and so on, until the conversation ends. Photopia worked on a system like this, and some the existing libraries for handling menus in inform are at least partly derivative of the Photopia ones.
The plus here is that again you have control over the form of the communication. You can hand the player a bunch of clever quips to say, which characterizes the player character as well as the NPC. (For player characterization that takes place to a large extent in the library menus and the PC's deployment of them, see Rameses, by Stephen Bond.)
The minus is that it's fairly restrictive; sometimes the menu doesn't contain anything that the player wanted to say, and there's no way to change what's on the menu, or even the illusory feeling of freedom that comes from typing >ASK JONES ABOUT THEOLOGY, even if no response has been implemented. Another problem, and this to me is even more of a killer, is what Duncan Stevens refers to as the lawnmower effect. If you give me a series of menus, I don't have to do any work to get through the conversation, and I can methodically (using undo, for instance) go back and replay different variations, taking now the first and now the second path, until I am sure that I've seen the whole thing. The NPC is then exhausted, finished, with no more thought on my part than I give to methodically mowing a lawn.
From my point of view, this lessens involvement and immersion. If you are writing a highly directed, railroad-esque game like Photopia or Rameses or Being Andrew Plotkin — preferably something so vividly written that the story or the humor of the narrative will make me want to move forward as rapidly as possible — then this may be right for you. If you're writing a game that involves investigating information, allowing the player to shape his own character, or leaving large stretches of the plot in the player's hands, then you may be better off with something more open-ended.
Ask/Tell. The standard built into Inform, at least, and then rendered remarkably irritating to deal with. (I said I wasn't going to talk about implementation, and I'm mostly not, but the traditional ways of handling ask/tell conversations in Inform are, let us be frank, ludicrous. Better ways are discussed on Onyx Ring -- the method outlined here is not exactly the one I use, but similar in many regards.)
From the player's point of view, however, he goes around typing things like >ASK JONES ABOUT UMBRELLA. Usually the game is not sufficiently sophisticated to accept more than one or two words there, so >ASK JONES ABOUT THE TIME OF THE MURDER is likely to fail flamingly. (The 2000 Comp game 1-2-3 tries to get around this, but it does so by prompting the player in an incredibly annoying fashion, and it is remarkably inflexible about WHICH long string of words it will accept. The only thing more annoying than having to guess which one word will work is having to guess which string of four words will be accepted. Boys and girls, don't do this at home.)
The disadvantages are that implementation is sticky and exacting (though there are, as I've said, some ways to simplify this); and that the player character doesn't get very interesting lines. I tried to ameliorate the latter effect in Galatea by following up the player's commands with the actual bit of conversation that goes on:
>ask galatea about godAt least one of the reviewers said that this worked well for him. Of course, at this point you are again taking over a little, forcing a phrasing on the player that may not be what he had in mind at all.
"Do you believe in God? or gods?" you ask. "Or universal forces?""He told me that there are gods, like the ones who lived on Thasos where I was quarried, or on the citadels of the old cities, or in the sea. He told me stories about them: their exploits, and how they went to war, and how they fell in love."
Meta-conversation Verbs. Adam Cadre's Varicella uses a form of modified ask/tell that is, as far as I know, unparalleled elsewhere. The ask/tell system works the same way as ever, but you are allowed to adopt one of three tones of voice: hostile, cordial, and servile. To take an example from the very beginning of the game:
>tone cordialReactions to this system have been, as far as I can tell, mixed. I personally found it entertaining to go around seeing what interesting variations on the various statements I could get by changing my tone of voice, but I also frequently forgot to set the tone correctly and found myself inappropriately bawling out a superior. And the more engrossed I was in the game, the more likely I was to forget about the tone system, which meant that I used it more as a toy than to get at the actually interesting variations that I understand are buried there as a result. To quote from an exchange about this on rec.arts.int-fiction:
You adopt a cordial manner.>ask steward about nails
"How's the manicure proceeding?" you ask."Shouldn't be much longer, sir," the steward says.
The steward expertly attends to your fingernails with an emery board.
>tone hostile
You adopt a hostile tone.>ask steward about nails
"How much longer is this going to take, you mediocre manservant?" you bellow."Shouldn't be much longer, sir," the steward says.
The steward lightly blows on your fingertips.
>tone servile
You adopt a servile posture.>ask steward about nails
You're scarcely about to address a common servant in an obsequious tone. For heaven's sake, where is your self-respect?
Aris Katsaris wrote: > Hmm... But did that one really offer anything new? If I remember correctly > there were few places that this was useful or added anything other than > a few insults in Varicella's question. It's only necessary for solving the game a handful of times. More often, it allows you to pursue drastically different conversational threads -- flipping through the source here, I see a number of background bits that are only accessible via an attitude adjustment. ------ Adam Cadre, Brooklyn, NYIn any case, I suspect that this exact system would not be perfectly suited to most games, but that variations of it might be interesting. The warning to beware of is that players tend to get confused if you give them a large number of new additional verbs. It was possible to keep track of the three tones of voice, but other suggestions I've heard ('what about a >BE SYMPATHETIC' command?) or tried to implement myself (a system including COMFORT, INSULT, APOLOGIZE, FLIRT, SEDUCE, SMILE, LAUGH...) can lead to a sticky mess: massively complicated to write and not much fun to play. So if you intend to extend the verb set in order to take in a richer array of interaction types, I would advise you to do so thoughtfully and sparingly.
Another interesting foray in this general direction is Iain Merrick's 2002 Romance Novel Comp game Forever Always, in which the player is allowed adverbs and a variety of different speech verbs, so that you can, for instance, WHISPER HUSKILY, SHOUT ANGRILY, SPEAK POLITELY, etc. The resulting menu depends on the manner of speech you choose. Unlike the Varicella example, it's possible to see what you're going to say before you say it, so the effects of the different tones are a bit more obvious. The last scene of the game, however, is rather difficult to navigate, as it requires selecting just the right combination of sometimes similar-seeming choices, and there is a bit of a guess-the-verb feel.
Topic Words. Used in games such as J. D. Berry's SmoochieComp game Sparrow's Song and the older comp game She's Got a Thing for a Spring, this functions very much like ask/tell, except that the verbs themselves are omitted. The player simply types a word he wants to bring up and the conversation proceeds accordingly. This isn't so much, in my opinion, a new interface as it is a slight streamlining of an existing one — but it does excuse you from having to program separate reactions to ASK and TELL. It's up to you to decide whether this is an interesting benefit.
Modified Menu/Topic Hybrid. This is a system that I designed for Pytho's Mask, after fielding complaints about the non-specificity of the questions directed at Galatea, and noticing my own problems with menu-based conversations. Simply put, there is a menu associated with each of a large number of topics. When you begin a conversation with someone, you see a menu of the possible things to say listed in the status line, and you may say one of them simply by typing the corresponding letter. If, however, you would like to change the subject, you may also type >TOPIC DIAMOND NECKLACE, and a new menu appears. For instance, >TOPIC JONES might bring up a menu
A. Have you seen Jones anywhere?This gets rid of the lawnmower problem and forces the player to take some initiative in choosing how the conversation will go. It also means that you can allow the player to ask questions much more complex than are available in an ASK/TELL system, but without completely giving the game away by including questions like >ASK THE QUEEN WHETHER IT IS TRUE THAT SHE STOLE THE PRINCESS' DIAMONDS into a single main menu with >QUEEN, HELLO and >DO YOU KNOW WHERE I COULD GET MORE OF THIS SCRUMPTIOUS CAVIAR?
B. What does Jones do here?
C. How long has Jones been working for the company?
D. What is your opinion of Jones?
At a slightly more technical level, it also allows for single-exchange undos. In menu-driven conversations a common problem is that a whole conversation will elapse in a single 'turn'; if you don't like the way it went, you have to undo the whole thing and restart from the beginning. This is somewhat irritating.
Obviously, I'm partial to this system, having come up with it, and I am using it for other games, including (in a slightly modified form) my work in progress City of Secrets. I have yet to release the Inform library for it. A library that does the same thing has been released for Hugo by Christopher Tate, however. It is available from gmd under the name converse.zip.
Thoroughness. If you want to allow your NPCs to hold lengthy conversations, you're going to have to write (surprise) a great deal of text for them.
This difficulty is pared down with ordinary menu-based conversation, in the sense that you only have to write as much text as you want the player to see in the game, and you can be reasonably sure that the average player will see a significant amount of it. If you're working with a topic-oriented system, however, with all the open-endedness that implies, then you may spend a lot of time writing texts for topics that some players will never think of investigating.
There are a couple of points here. One is that it's possible (by having NPCs initiate conversations, by having hints in the game of one sort or another) to give the player some pretty clear pointers about which topics are likely to be the main fruitful ones, the major things they ought to explore first. So you concentrate on writing material for those.
The second is that it's usually better to spend your time implementing topics that lead naturally from what an NPC has already said than topics that are totally from left field. If you implement a working knowledge of the history of the world series and the word baseball is never even mentioned in the game outside of this segment then it's pretty reasonable to expect no one will notice and remark upon the astounding depth. On the other hand, it's possible to give the sense of fairly thorough implementation by taking words that the NPC herself uses and making them secondary topics, as in this exchange from Galatea:
>a godsThe rules that apply here are similar to the ones that apply to implementation of ordinary scenery: if you use words in your primary description of a room that you don't allow the player to examine, he feels he's trapped in a cardboard set. If you not only implement those objects, but the subparts and features of them, the world begins to seem much more thoroughly made.
"Do you believe in God? or gods?" you ask. "Or universal forces?""He told me that there are gods, like the ones who lived on Thasos where I was quarried, or on the citadels of the old cities, or in the sea. He told me stories about them: their exploits, and how they went to war, and how they fell in love."
There's a moment of stillness. "There were nights when he would pour out the first of the wine to one of them: to the Muses, to Aphrodite the Cyprian, to Apollo. He said prayers, and he made me be silent; to say the wrong thing to the gods, he said, is at least as bad as not to speak to them at all."
>a apollo
"What did he tell you about Apollo?""That he is an archer, of course," she says, "and a prophet; the god of the sun, the representative of civilized song, the opposite of Dionysus."
A pause. "He also warned me not to trust Apollo. He said he'd tried, and found it ineffective. Civilization only goes so deep and under that is mere anarchy. As he put it." As an apparent afterthought, she adds, "Dionysus presided at Delphi three months of the year, you know. Apollo did not hold even his most sacred precinct absolutely."
>a dionysus
"Tell me about Dionysus."She turns — not her whole body, just her head, so that you can see one ear behind the cascade of hair. "God of wine and drama," she replies smoothly. "And a dangerous eastern influence, as well. Elusive. Able to create illusions. A breaker of bonds, a bringer of freedom, a force for anarchy and the end of social order."
>a drama
"I only know a little bit about Greek theater. Not enough to interest you — you'd be better off reading a book."
For a game with an impressively huge number of topics implemented, have a look at Suzanne Britton's Worlds Apart.
Abstraction. Descriptions reflect a model world of physical objects in most interactive fiction. Conversations, on the other hand, are usually implemented as pure surface: gobbets of text strung together in some way, with rules for what the NPC can say when and in reaction to what, but with no attempt to attach them to an underlying, abstract representation of knowledge structure.
The reason for this is fairly obvious: creating an abstract representation of knowledge is difficult and consumes resources. Moreover, because we don't have the ability (at the moment) to construct right-sounding natural language, with all the nuances of emotion and shadings of idiom, all of the conversation itself will still probably need to be author-scripted. So if each fact corresponds to some piece of prewritten discussion, why represent them separately?
For my own early work, I found it not worth bothering with this layer. I used flags to mark what information the NPC had "used", if there was some danger of repeating a statement or reasserting the same thing in a new context, but this did not approximate, or attempt to approximate, a systematic representation of the facts contained in a conversation. With Best of Three, however, I found myself wanting to be able to keep track not only of what had been said, but of relationships between ideas: what the NPC knew, and therefore what he was likely to volunteer (about himself) or ask (about the player). And I wanted this system to be flexible rather than hard-linked. With Galatea I did some scripting that allowed her to follow up one statement with another, a turn later, if the player said nothing in between. But if the player said something himself, the opportunity was lost; she had no long-term memory, and forgot that she had had something to add. She never came back to it.
Best of Three's trick was that it structured individual facts as items in a tree, separate from the tree of conversational objects. The conversation tree is organized by topic: rain as a subtopic of weather, mother as a subtopic of family as a subtopic of people. The fact tree, on the other hand, was organized around implications: if fact a implies fact b, fact a is the child of b; when the NPC finds out a (through the player's statement, perhaps), he infers b, giving it a flag called "curious." Items with the curious flag are things that the NPC suspects, but wants to ask about; and he will interject that question right away if circumstances allow, but he is also capable of coming back to it later, possibly much later, if conversation leads away.
The fact tree also contained facts that the NPC might want to tell you: comments, anecdotes, that sort of thing.
The structure of the fact tree was designed to emulate the rudiments of reasoning (not the complex reasoning of the real world, but the specific conclusions that the NPC could sensibly reach within the context of this circumstance.) That was one advantage. The other advantage was that some facts had multiple conversational representations. If the NPC wanted to tell you something or ask you something, he would search for the way to do so that was most relevant to the current topic, the most appropriate to the present mood, and so on. Each conversation object is marked with a list of facts it conveys. [Caching during the initialization of the game stores this information in reverse, too: each fact is indexed with the list of conversation topics that mention it. This makes searching for something to say a little less processing-intensive, though still not as swift as one might ideally wish. Some people complained of the noticeable delay in producing new text between turns.]
Beyond the task of coming up with a bunch of topics is the problem of making the resulting conversation plausible.
Flagging Used Topics. One of the first things I decided about Galatea was that she needed to remember what had already been said. Asking about the same topic multiple times would get different responses. (This issue need not come up in quite the same way in a menu-based conversation, since you could disable questions that have already been asked, whereas there's no good way to prevent the player from typing >ASK JONES ABOUT HAT ten times in a row. But in order to make the menu work you then still need to have the flags.)
At its most basic level, this is just about preventing the NPC from saying the same thing over and over and over again. Real people don't repeat the same words in the same language a hundred times in a row, and it detracts from the feeling of realism if your NPC does.
There have been various conversations on rec.arts.int-fiction about what sort of response is appropriate if the player tries to reask a question. Acceptable options, in my opinion, include: having the parser cut in and say, "You remember that Jones told you..."; having Jones tell you again but in a slightly modified form using some kind of randomization of text (so that over time you would get similar text over and over, but it wouldn't be verbatim identical each time); or describing the conversation without telling you the exact words ("Jones tells you again that...").
Managing Recaps. Another nice thing about having flagged which conversation topics have been used is that you can offer your players, if you wish, some kind of RECAP verb to remind them of what they've already discussed. In conversation-intense games this is apparently helpful. At least, people bugged me about it on rec.games.int-fiction until I installed it for the second version of Galatea.
Making New Comments Available. In the natural course of a conversation, when one thing has been said, new comments become natural. If you're flagging which comments/topics have already been used, you can add new ones to the menu when appropriate, or allow the player to >ASK ABOUT new things (or get new responses when asking about old things.)
One of the things that Galatea tries to do is to build up a sort of conversational context, so that what you say in one situation will be understood differently from the same words in another situation.
Contextually-based Reactions. In real life if you're talking to someone and that person starts to read a book, there's a message in that. Likewise, there are spots in conversations where it may be more or less appropriate to react to the other person with advances (>KISS JONES) or violence (>KILL JONES WITH ROCK). If you have a system of conversation that tracks what the current topic of conversation is, and whether anything is actively going on, you can use it to tailor appropriate reactions for KISS, GIVE, SHOW, HIT, et al.
Gesture. Emotional cues can be buried in a conversation through body language. An upset person may have a nervous tic; a lustful one may cast steaming glances in your direction. Galatea embeds small actions like this in between bits of dialogue, where a pause would naturally occur: so the player sees the words that I've scripted for her in answer to whatever topic has been raised, but he also sees her make small gestures that are cued not to the topic at hand but to her overall mood.
Interaction with Local Objects. A step up from small gestures, but I've found it fun to have NPCs also choose objects in their environment to fidget with, throw, etc. e.g.:
>x seaweed
Fake plastic seaweed of the kind generally bought in stores for exactly this purpose."Nice, hunh?" blubs the fish, taking a stabbing bite out of one just by way of demonstration. "Looks so good I could eat it."
Altering Responses Based on Mood. Obviously an upset person will react to certain topics more vehemently than a calm one would. Inserting switches into the dialogue itself to test for variables is another fine way of handling this.
Major Scenes. I put these in a category of their own because, for all the simulationesque tricks you pull, there are times when you really want to achieve a certain scripted scene. Emotional turning points of your plot are like this, I think: you don't want to encourage — you may not even want to allow — the player to change the subject in the middle of a towering argument.
My own approach to writing Big Scenes is to draft the whole thing in transcript form, complete with what I want the player to be typing at each juncture. If I'm writing for a menu-based system, I put their new options in the menu each turn and perhaps (if I'm using a topic/menu hybrid) turn off the option to change menus. If I'm writing for ask/tell, I place strong hints about what I want the player to ask about next. (This needn't be cheesy. Just give your player character some suggestively-worded 'thoughts' and most players will play along.)
Steering Topics. NPCs give the impression of being much more active and thoughtful if they show signs of having a private agenda of their own — which may include raising new conversational topics, deciding to cut a conversation short, and so on.
Part of this is purely a question of writing — you may find yourself with a bit of dialogue that is really best ended if it concludes with the outraged NPC storming from the room.
You can also, however, set up a system in such a way that a daemon propels the conversation forward if the player lets a turn go without saying anything.
Interaction Balance. It is possible to go overboard with a proactive NPC, however. One of the most frequent complaints I've heard about Best of Three is that it is too easy to get swept along in the conversation, allowing the NPC to make all the decisions and not having to do anything for oneself. So if the NPC is to be more active and to drive an agenda of his own, this should still be arranged in such a way that the PC feels required to steer some of the time.
The more NPCs you have, of course, the more work you have cut out for you. They don't all have to be implemented to exactly the same level of depth, of course, since some may be less important to the story; but they do have to match to some degree. If one of your characters is implemented down to the shoelaces on his hiking boots and knows a thousand facts about Japanese theater and the next one can't answer basic, central questions, you have a problem. If you've got certain basic topics in your game, then you'd better make sure that (if you're using a topic-based system) all your characters either have some response or provide a good reason why they don't. Here again the menu system makes things somewhat easier to control — but only somewhat. There's still a basic aesthetic of evenness that needs to be observed.
On the other hand, you open up the possibility of having NPCs interact with each other in your hearing or presence. I haven't played it myself, but I gather that Kevin Wilson did some interesting things with this in Once and Future. It's something to bear in mind, definitely; and even cooler if the conversation makes room for you to interject or somehow changes based on your earlier behavior. From a project of mine that may never see daylight (especially now that I not only preview it but mention it in a breath with Avalon):
"Has anyone seen Nikolai Petrovich lately?" asks Anna. Kitty gives her a quick look, but Anna is speaking to everyone else; she does not notice. "He looks like a ghost!"(And then, instead of Vassily and Alexei getting into an argument, Anna launches into a discussion of her health.)From over your shoulder, one of the footmen serves you with the soup.
>talk about petrovich
"I saw him," you remark. "Two days ago. Someone should lend him a carriage.""He ought to go home," says Alexei emphatically. "A man in his condition does not belong in the city. He should not be showing himself here."
When the footman is out of the way, the butler fills your white wine glass and then moves away.
>x soup
The soup is cream-based and has little green bits floating in it."What is it that offends you, Alexei?" Vassily asks smoothly. "That the man is poor, or that he is dying? Which is the disease that makes him unfit to be seen?"
Alexei's cheeks flush a dull red. "I merely think he would be better off on his land, at home."
>z
Time passes.Vassily raises his glass, takes a sip. "A three-week journey in the middle of winter would doubtless be bracing to him," he remarks dryly.
(Argument ensues.)
>undo
Previous turn undone.>talk about petrovich
"Perhaps he finds the journey too long," you remark. "It would take three weeks to get to his estates from here, in this weather, even if he were to find the roads in good condition. And then there is the question of expense..."Anna shudders. "I could never endure to travel in this weather. It's so unpleasant."
But what if what you want is not four NPCs in a room talking to each other, but a whole world crowded with people, a constant feeling of movement and turmoil and action and business going on. Then what?
Here are some approaches to avoid making yourself insane:
Random Messages and Ephemera. Make some randomized messages that refer to people who just pass through. The ephemeral is your friend in IF: someone or something who moves through the environment too quickly to be examined, giving the impression of traffic without leaving you with too much to worry about.
First Things First does a good job with the randomized-messages technique, which it borrows, I think, from Rob's earlier game Four in One: there are scenes that feel as though a great deal is going on all around you, because people are moving, carrying things, exchanging quips of dialogue, and so on. They're too busy for you to talk to them, but they are *there*.
If you want to give the impression of real crowdedness, perhaps refer to the crowd in general in passing. Eg:
>NORTH
You squeeze your way through the dense crowd, getting a sharp poke in the ribs from someone's umbrella, before you come to...Times Square
[Lyrical description follows.]>LOOK THROUGH SHOP WINDOW
You have to stand on tiptoes to see over all the people...
So the idea of all the people being there is presented over and over and woven into the descriptions, and you will of course need to make a crowd object for the player to examine, but you don't have to provide fifty thousand pedestrian objects all with their own funky behaviors. Indeed, it would be distracting if you did.
Multiple character levels. Create some lowlevel characters with whom the character is not allowed to interact for a specific reason (in Pytho I made it be for social reasons; in other contexts it might be reasonable to have a message like, "You have no reason to accost the stranger." or "It doesn't seem as though the little old lady is likely to be able to help you."
Create some slightly less-lowlevel characters whose interaction is nonetheless brief and thus limited. If you let the player interact with them only for a few turns, the limits of the NPC don't become apparent immediately. This is obviously no way to treat an NPC who is going to be *important* in the game, but you can give the sense of a real personality who is only fleetingly present to the player this way. (This is what I was trying to do with the waiter in Best of Three, for instance.)
Create some midlevel characters, like shop owners, etc., who have a lot of fallback behavior generated by the class they belong to. (For instance, they are all able to sell you things and they all tend to have access to a common base of knowledge.) Then tweak their descriptions and conversation just a little and give them each some distinguishing quirk so they don't run together. (If you're detecting a trend here, it's because I'm a big believer in this technique. Multiple fallbacks. If you have two levels, Important NPCs and Drone-like Placeholders, then the player can tell instantly what everyone is, and the placeholders will get predictable fast. Which means the player will stop bothering even to try to interact with those when he realizes what they are. If you have several levels, then there is a much richer feel to the world. In my opinion.)
Background. Use additional objects to indicate that the world is a place that is being used and lived in: litter, worn items, dropped or lost objects, things that tell small tales in brief, so that you give the impression that not only are there people here now, but there have been other people here in the past, and will be more in the future.
Variations. Break the player's expectations from time to time by having an NPC turn out to be more interesting, more proactive, or more important than he initially seems to be. For instance, you might have a bunch of randomized messages describing customers in a shop, none of which are especially important, but then one of the NPCs steps forward, or reacts to something the player does. Now by implication all the other customers seem potentially richer.
There's an important caveat here, and that is that the player should always know where to give his attention. I've been describing techniques for making unimportant or trivially-coded NPCs seem as though they're more real than they are, in order to make the world seem deeper than it is; but the trick is that the player should always have at least some sense of what his goal is and where it will be most rewarding to interact. If you take that away, he will get very frustrated trying to talk to all your lowlevel NPCs who are useless, and then give up and stop playing. So you want to strike a balance where there is the feeling that there are many people in the game world, but the ones that are truly important to the plot are evident.
At the bottom of this stack of technical tips, however, is a simple fundamental fact: the better you are at the craft of writing dialogue, the more convincing and effective your NPCs will be, and the more they will stick in people's minds. Adam Cadre is justly known for his non-player characters, not because he relies uniformly on techniques like these, but because he crafts them with distinctive and memorable voices.
This is not the place for a full exposition of a matter that takes professional writers years to acquire. To those who are very curious, I would recommend checking out Orson Scott Card's excellent Character and Viewpoint, whose recommendations for static fiction are often equally applicable to IF.
As an overview, though, I will recommend considering the following, especially if you are aiming for a well-fleshed-out character:
And then observe the other rules of good writing, which are as applicable here as to any other topic: strive for particular and telling details. Choose the evocative over the generic. Surprise the reader from time to time. A sense of style is Yor Frend.