ReGoap icon indicating copy to clipboard operation
ReGoap copied to clipboard

More flexible condition comparisons

Open jswigart opened this issue 9 years ago • 3 comments

There seems to be a predicate in the code that might be intended for something along these lines, but it doesn't seem to be exposed to the actions at all.

Something like preconditions.Set("hasLog", 10, predicateGreaterOrEqual);

Perhaps that last parameter takes an IComparer or just a Func like you have the current predicate defined as, and if excluded it is treated as a strict equality comparison.

The overall point is to allow more than equality comparison based action conditions, which are essential for gatherer/builder type planning where many types and quantities of resources might be necessary to complete a task.

jswigart avatar Dec 16 '16 16:12 jswigart

Would be an awesome feature, can probably be done (basically this would break this library from the Strips/Goap's specifications), but need to understand how to do it. I guess only ReGoapState need to be changed.

luxkun avatar Dec 20 '16 15:12 luxkun

I'm also very interested in this use-case.

Could you give some more descriptions on how should I modify the code?

TMPxyz avatar Jan 23 '18 15:01 TMPxyz

Would it be possible to work around this by implementing more complex logic via sensors?

mikeful avatar Jan 24 '18 20:01 mikeful