X hits on this document

PDF document

Enhanced NPC Behaviour using Goal Oriented Action Planning - page 39 / 110





39 / 110

the open list if such a tie occurs. This means high precedence actions will later be selected from the open list before the lower precedence actions.

Once an action has been selected for execution, a means of sending commands to the blackboard or subsystems was required in order for it to have an effect on the virtual world. This was performed by the ActivateAction function which every action implemented differently. A mechanism to determine when an action has completed was provided by the IsActionComplete function which returns true if the action has finished and false otherwise. When finished, an action must be deactivated which can also place information on the blackboard. As recommended by Orkin (Orkin, 2004) action’s context preconditions and effects were designed to be functions that return true or false by querying the working memory or blackboard.

When the planner is searching to find a solution to a goal, two world states are maintained. The goal or desired world state along with the current world state are stored, both of which are altered as actions are applied during planning. If the planner recognises that an action can solve an unsatisfied world state property, the action’s preconditions are added to the goal world state and the action’s effects are applied to the current state that is being maintained.

To illustrate this concept and to introduce the actual planning process involved in the GOAP system a little further, figure 7 below depicts how the planner’s world states are affected when planning. The current goal for the planner is selected to be KillEnemy (how this is done is explained in the next section). When a KillEnemy goal is selected, the planner then knows that the goal is satisfied if the world state symbol targetIsDead is set to true in the current state. The planner’s goal world state is setup having just a single world state symbol defined, targetIsDead = true. This is performed in step 2 in figure 7. The planner’s current state begins not having any world state symbols defined. Whatever symbols that are in the goal world state and aren’t in the current world state of the planner are then added to the


Document info
Document views208
Page views212
Page last viewedWed Oct 26 04:45:32 UTC 2016