godot-goap
godot-goap copied to clipboard
Tick function
Great Goap implementation.
I did not tried it, but i already have a question : Would some tick function running in the process(delta) optimize performance ?
When the character is doing some action like running to some position, it does not need to evaluate Goap. Goap process evalutation could be checked each 0.2 seconds instead of each frame ?
The action planner is not called every frame, but only when a plan (a sequence of actions) is completed or an action fails.
In the example, there is a problem when the guy cuts a tree and immediately tries to grab wood or a fruit, and fails (due to the object being too far in the air). The planner is called repeatedly when this happens, and consequently, the planner is called on average once per second.
Fixing the problem (by setting the "sees_fruit" or "sees_wood" to true only when the corresponding object can actually be picked up) would make it call the planner every 2 or 3 seconds.