CBA_A3
CBA_A3 copied to clipboard
State Machines - Add configurable number of ticks per frame
CBA state machines are very polite beasts: they each run a single tick on a single element each frame. This is nice for performance considerations, but it makes them slooow to react if you have a lot of elements.
This PR creates an optional additional parameter for CBA_statemachines_fnc_create
that allows users to specify how many ticks the given state machine should run on each frame, defaulting to 1.
To not add yet another indentation level to the clockwork function, I extract the tick logic into CBA_statemachine_fnc_tick
.
https://github.com/PiZZAD0X/Olsen-Framework-Arma-3/blob/732eae4efc878f75e40ddaacddd1cd15d9c39511/modules/headless_ai/cfgFunctions/statemachine/fn_clockwork.sqf#L105
Yup, been using a statemachine with tick system for a while, works well.
@BaerMitUmlaut