Game Development Reference
In-Depth Information
Planning
''Can't the AI just work out all of the steps it needs to pull this off by itself?'' is the
essential question that brings us to planning. We got a taste of planning in
Chapter 6, ''Look-Ahead: The First Step of Planning.'' In general terms, our AI
searched for things to do that would take it to some goal. The preceding sentence
seems pretty innocuous, but if we analyze it in careful detail, we can examine any
planning system.
Note that we used the term search. Recall the astronomical numbers we com-
puted in Chapters 6, ''Look-Ahead: The First Step of Planning,'' and 7, ''Book of
Moves.'' Planners do searching as well, so it should come as no surprise that their
computational complexity is a serious issue. Writing a planner is no small task,
either, but their novel capability of sequencing steps together at run-time make
them well worth examining.
You may recall from Chapter 6 that systems that think about the future need a
way to represent knowledge that is independent from the game world. This is
especially true for planning systems. Good knowledge representation needs to be
designed in from the start. The AI is not allowed to change the world merely by
thinking about the world; it can only change the world by acting on the world.
Planning AI emphasizes capability instead of action. The elements in a planning
system are couched in terms of their results on the world instead of the actions
they will perform. Planning elements declare, ''This is what I make happen,''
instead of emphasizing procedure by saying, ''This is what I do.'' They are
declarative instead of procedural . The overall system is tasked with meeting goals
instead of performing actions. With planning, the system is given a goal and
given the command, ''Make it so'' instead of telling all the elements what they are
supposed to do.
Consider a visitor to a large city who is talking with friends, some old and some
recently met. ''I need a place to sleep,'' the visitor says. This is declarative. ''You
can sleep on my sofa,'' one friend says, which is the only thing the visitor was
expecting. ''You can sleep on the other half of my king-sized bed,'' another friend
offers. ''I'm the night manager of a hotel; I can get you a room at cost,'' says a
third. None of the other friends speak up. All three options meet the goal, and
two of them were unexpected. The visitor decides the best plan. The visitor could
have said, ''Can I sleep on your sofa?'' to the one friend and left it at that. This is
procedural. While planners deal with dynamic situations gracefully, other,
 
 
Search Nedrilad ::




Custom Search