Game Development Reference
In-Depth Information
A farmer who stands at the door of his house wants to go out into the night to
find out what is making noise in the barn. A single action, ''GOTO,'' would take
him to the barn. That action has a precondition, ''has light to see by,'' that is
unmet. The lantern has the capability to change that condition, but it also has
preconditions for being in hand, for fuel, and for being lit. Since the lantern has
fuel, the precondition for fuel does not count. The precondition of being lit does
count because the lantern in not currently lit. The matches have the capability to
light things on fire, and they carry the precondition of being in hand. So the final
plan will have grown to get matches, get the lantern, light a match, light the
lantern, and finally go to the barn. The designer might have included a flashlight
object that has a much lower cost than the lantern, making it preferable because a
dropped flashlight is less likely to cause a barn fire than a dropped lantern. In this
case, the flashlight has no batteries, and there are no batteries in the house, so the
A* stopped progress on the path using the flashlight when it hit the high cost of
driving into town to get more batteries.
A* connected the dots to form a plan to meet the goal. The AI programmer did
not have to do it himself or herself the way he or she would have for an FSM. The
programming paradigm shifts to something like, ''Toss in capabilities in the form
of actions and stir them with goals to see what plans you get.'' The simplicity of
the actions is supposed to make programming the set of them simpler in total
than trying to program the equivalent capability in an FSM or a behavior tree.
Knowledge representation is critical to the success of the method. The actions
have to be able to get all the inputs they need from the state representation and
make concrete changes to it. Notice that many of our preconditions and
postconditions are simple Booleans that can be represented by one bit of a bit
field. Performance of the knowledge representation is critical, and bit fields are a
common way to help achieve it. Goal-oriented agents coded this way resemble
goal-driven people; they do not stop to smell the flowers along the way, but they
do get the details right.
HTN
''Don't we have a plan for that? Or something close?'' One of the caveats that we
gave about A* is that although we appreciate its performance, we know it is not
free. A* connects the dots for us in GOAP. Maybe there is a way to save and reuse
chunks of plans the way we might pre-compute popular paths. Each of the
travelers who passed through the Cumberland Gap or crossed the Rocky
 
 
Search Nedrilad ::




Custom Search