zkat / big-brain

Utility AI library for the Bevy game engine
Other
1.04k stars 62 forks source link

Combining scorers produces incorrect behavior #76

Open NiseVoid opened 1 year ago

NiseVoid commented 1 year ago

The predefined scorers in scorers.rs, which can be used to combine different scorers for a single consideration by the thinker, show incorrect behavior when you combine then. Because all scorers get evaluated as systems there is no way to guarantee the ordering makes sense when they depend on other (possibly even the same) scorers. This results in scores lagging behind by an arbitrary number of frames, depending on the execution order and how deep they are nested.

I think the correct solution for combining multiple scorers would be to calculate them when the thinker checks them, this way we also wouldn't need to calculate anything unnecessary with pickers like FirstTo