It's used in calling AI for bruteforcing possible actions according to a state that a NPC can use.
I recommend to read it/check it out, the AI of FEAR ( which is excellent) is based on it.
It's used in calling AI for bruteforcing possible actions according to a state that a NPC can use.
I recommend to read it/check it out, the AI of FEAR ( which is excellent) is based on it.
Represent your state space as a graph and run A* over it to find a “path” (or plan) from starting state to goal state. A simple heuristic to use for the A* distance heuristic (which I saw in one of the gamedev talks, I don’t remember if in FEAR but its likely it was) is to simply count how many variables are correct and use that count as the distance heuristic (they used simple boolean variables, if you use numeric values it may be harder, but I suppose you could still just count how many goal variables are met).
I also attempted to use prolog-style logic programming (in clojure’s core.logic) to search for a plan, but I never finished it. I guess I overcomplicated it by being too ambitious. I wanted the actions to be able to have preconditions like “have at least N of X” and the goal to have similar conditions and have the planner keep track of counts. It worked to a degree but I never finished it because it started getting too complex for my limited knowledge of logic programming.