CBA_A3 icon indicating copy to clipboard operation
CBA_A3 copied to clipboard

State Machines - Add configurable number of ticks per frame

Open Fusselwurm opened this issue 4 years ago • 2 comments

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.

Fusselwurm avatar Jul 29 '20 10:07 Fusselwurm

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.

PiZZAD0X avatar Oct 10 '20 00:10 PiZZAD0X

@BaerMitUmlaut

jonpas avatar Jul 23 '21 13:07 jonpas