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