Closed Papitoh closed 7 years ago
By the way this can be fixed by adding
if (path.Count == 0) { continue; }
in
Planner:Plan(...) { while (possibleGoals.Count > 0) { .... if (path.Count == 0) { continue; } } }
But a more effective way is to add a check for memory of agent containing goal state at the stage of forming list of possible goals , like:
foreach (var pair in goalValues) { W worldValue; worldValues.TryGetValue(pair.Key, out worldValue); var goalValue = pair.Value; if (worldValue == null || !Equals(worldValue, goalValue)) isGoalSatisfied = false; } ...
if (goal.IsGoalPossible() && !isGoalSatisfied) possibleGoals.Add(goal);
Is there a better way?
I just added a check inside ReGoapPlanner.Plan, thank you for finding out!
Hello. I am using ReGoap and Im wish to thank you for this work! But there are some strange thing for me. When i add multiple goals(simpleones: "go to marker" and "shoot at enemy" for example), planner choose top priority goal and agent execute it. But after planer still try to execute same goal by running 0 actions plan. There are some issue? Or i should procedurally change goals priorietes when some goal achieved? Thanks