The basic object is a "factoid". It can be attached to any object. If
you ask an actor about the object, the code looks at the list of factoids
on the object and randomly picks one to tell you. To make sure the factoid
is not repeated, the factoid is put on a list of "facts told" by that actor,
and the random pick function makes sure that a randomly picked factoid has
not already been told by that actor.
Each actor can define a method to decide whether or not to reply to an
ask about. For example, an impatient actor could only reply to two ask
abouts and then refuse to answer any more. Or could hint that they have
more information but you have to give them something first.
Each actor can define a method for the response when they have told you
all the factoids they know, and a method for the response when there are
no factoids about the object.
To make sure that factoids occur in a reasonable order, each factoid has
a method which determines whether it is "available yet". Mostly, this method
is used to give general information first and more specific information only
later. For example, one factoid could state that Bill has a tattoo, and a
second, later factoid could state that the tattoo is a butterfly. The second
factoid is only "available" if that actor has told you the first one already.
This method can also be used to restrict which actors "know" a factoid; for
example, only Joe and Bill know that Bill saw the assassin escape.
A final feature could be called "class words" -- if there is a blue rock
and a red rock, you might want to ask an actor about "rocks", in which case
the list of possible factoids is the union of the factoid list for each rock.
That's especially handy for, say, a murder mystery, where you could ASK ABOUT
SUSPECTS. I don't know how complex to make this. The text of the factoid
needs to be different if the rock isn't present, or if there are multiple
rocks present. The actor needs to tell you which rock he is referring to,
and it's complicated if it isn't present or if you haven't seen that rock yet.
So, what kinds of things are missing? Do you have something in your game
that works like this, only better? Let me know.
- Dave Allen: al...@viewlogic.com