Advertisement

Programming Game AI By Example - Question about the goal system

Started by July 13, 2008 05:55 PM
9 comments, last by captain_crunch 16 years, 4 months ago
(GoToItem)               // push Pickup when the item is reached(Pickup, GoToItem)       // pop Pickup, meaning perform the action(GoToItem)               // push Pickup when the item is reached(Pickup, GoToItem)       // pop Pickup, meaning perform the action(GoToItem)               // push ReturnCargo when the cargo hold is full(ReturnCargo, GoToItem)  // pop ReturnCargo, meaning perform the action(GoToItem)               // continue item hunting


As I read your example, it looks like you have at most 2 goals on the stack at a time.

In my approach, I created the complete plan by laying out all the goals before starting the execution. So after going through the for loops the queue contained about 7 goals, and only then would execution begin.

So it may come down to picking the data structure that matches one's way of thinking about the problem...

This topic is closed to new replies.

Advertisement