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.
I know neither, and it sounds like a lot of work anyway. However, I would
be interested in seeing your source once you have something workable.
>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.
We're on exactly the same track here. In my prolog database the fact
would have been fact(troll, is(player, friend)) or something similar
('twas some time since I actually worked on this). If the player attacked
the troll, this fact would be retracted (which is where I found one of my
main implementation problems, due to my TurboPROLOG) and fact(troll,
is(player, enemy)) would be asserted in its place. This would cause the
troll to attack the player in turn.
To carry the discussion a little further, I would like to introduce a new
term: The Non-Player Agent (or NPA for short). This is just a special
case of NPC, which differs from other NPCs in that it has all its logics
separate from the main program. This does not necessarily mean that it
has to be knowledge-based. That is another special case of the special
case, so to say.
I would like to base my NPAs on two main features. Firstly on Shoham's
Agent Oriented Programming approach, which I mentioned in my previous
post (will post short summary and bibliographical info as soon as I find
the *&*$@ thing). Secondly on a kind of treat-based principle. Each
NPA has a set of treats, such as preceptiveness, greediness and
talkativeness. Perhaps also variable treats, such as mood. This would
allow the logic of ALL NPAs in one game (in one game engine, even) to be
inherited from the same super-NPA, based on these treats. The calculation
of a result based on the logic and the treats could be slightly based on
chance also to make it less likely that the player figures out the under-
lying processes.
/F