godot-goap icon indicating copy to clipboard operation
godot-goap copied to clipboard

Tick function

Open DevMagicLord opened this issue 6 years ago • 1 comments

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 ?

DevMagicLord avatar Jan 14 '19 14:01 DevMagicLord

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.

RodZill4 avatar Jan 14 '19 19:01 RodZill4