Currently writing in C++, but the first thing I decided was that the
knowledge base should be in LisP. So it's going to have a lisp interpreter
built in.
>My scheme was, basically, as follows: The player needs to get through a
>locked door. The player is too weak to bash it and there is no key. The
>NPC troll, however, (yes, I had a troll, too) was strong enough, and was
>so simply programmed that he would do anything told by someone he thought
>to be a friend. To make friends with the troll, the player had to give him
>something the troll thought valuable (in this case a club). There were a
>few other NPCs and plot twists too.
Well, to start, I think my troll would be about as simple. But since I'm
not sure how you programmed yours, I don't know how comparable our
methods would be. One event, player gives troll cube, would result in
the creation of fact "Player is friend" (for example) in the knowledge
base. Later, if the player attempts to tell the troll what to do, the
existence of this fact would dictate whether or not the troll complied.
Of course, if the player kicks the troll, then we could either eliminate
this fact from the knowledge base, change it to a negative, or just
assert "Player is not a friend" in there as well and give each a weight
(since he kicked him more recently then he fed him).
>Thus, my NPCs (agents) could neither plan nor remember past events.
I'd like to do something with a knowledge base such that the NPC would
store the state (everything it knows about) an object, about itself,
and about it's surroundings. Then it performs an action with the given
object, and looks for changes in each state. This is just wishful
thinking at the moment, though.
>They only had
>their knowledge base which could be added to or retracted from.
This can be a powerful thing, particularly if you add some reasoning based
on known facts. Say it learned fact "Apple is-contained-by tree" by
examining the apple. And say it learned "Apple is-edible" by trying to eat
it and seeing that its hunger went down. Now say it discovered the
same facts about oranges. It should be able to reason that
if X is-contained-by tree, then X is-edible, and he won't have to waste
time learning about bananas when he finds one. Of course, not everything
that is-contained-by tree is necessarily edible, but he'll learn that later.
Duane