Unpredictable NPCs? Good/bad?


Mon, 20 Feb 1995 15:46:58 GMT

I'm working on an experiment right now to train NPCs how to interact with
a textadventure world. My goal is to create a character that, while it
wouldn't necessarily solve any puzzles or win the game, would act
consistently within the game (i.e. would eat when it gets hungry, would
attack when attacked, etc..) The interesting twist, here, would be that
the NPC is neither random, nor is it pre-programmed to respond a given
way to a given action. Say that there is a room in which the exit to the
north is blocked by a large boulder, that the player cannot move. However,
we've seen a friendly looking troll wandering around the caves who
probably could. How does the player get the troll to help? Probably by
feeding him, and having him follow the player back to the cave, upon
which he is told "Troll, move boulder" and promptly does it.

This is quaint. But this could just as easily have been pre-programmed.

What if the troll isn't hungry when you feed him? What if you can't find
him? What if you already kicked him in the shins once, and he doesn't
like you anymore? What if, in order to get even this far, you needed to
locate the key, which the troll has already decided was particularly tasty?
In the game I envision, any of the above could happen. Probably even more.

Personally, I find it cool to think that there are influences in the game
running independent of my own actions. Makes it more interesting. The
problem, of course, is that this could present unsolvable problems.
(Say that, on the other side of the entrance in the above example, a rockslide
triggers and seals off the passage back. Now imagine if the troll had
gotten to this room first.)

I guess the question, then, is: Is this tolerable? Obviously, there
couldn't be all that many unsolvable problems. (Good writing could
technically make it zero problems, always having a way out that isn't dependent
on the NPCs). And, of course, there would be a number of traditional,
scripted NPCs mixed in as well that could be depended upon to act
deterministically.

I'm a big proponent of alife, and emergent behavior. If I program a
character in such a way that it does something I didn't expect, it's a win.
I like the idea of a learning NPC, because I can lift it wholesale out of
one game, and plunk it down in another, and have it automatically continue
its knowledge gathering. For example, it may have learned in game one,
after lots of trying and failing and reasoning, that objects belonging
to the class is-contained-by-tree are edible (since everything in the
last game that he took from a tree was edible). He now knows this, so
the first apple tree he comes across in the new game, he can pick a few
nice ones. Of course, to be fair, the tree in this game could grow poisonous
doodleberries, and if he eats one, he'll die. Well, yeah. It would
then be the programmer's decision whether or not to give him the gift
of past life learning (such as any human player would have), or just let him
continue to be reborn, eat the damn things, and die again, until something
interrupted the loop. (Of course, this only works if I stay world consistent.
If the NPC has learned something about physics, then the laws of physics
should remain constant.)

Duane