Adopt lazy operations in state machines rather than frequent real-time transition checks.

KPDN

Member
First issue: I’ll lay out my requirements upfront. I have a set of interconnected states. I don’t want high-frequency condition checks to trigger state transitions. Instead, I only need to evaluate transition conditions once after each manual state Tick. Whether it’s external signals or other logical prerequisites, all I need is to invoke a manual Tick externally once. All state changes within the state machine shall only respond to this Tick call.
StateDesigner works excellently for moving scene entities, but my use case only requires processing standalone data blocks with no need for frequent checks or runtime processing. During my internal testing, I tried making the OnUpdate function immediately return StateStatus.Finished at its entry point, then use toggle switches to manually gate condition evaluation. The outcome was suboptimal: the Continuous mode runs checks every frame, while the On State Finished mode halts execution entirely.
To sum up: StateDesigner performs well for entity logic that demands constant polling, yet it cannot accommodate my workflow of purely data-focused, extremely low-frequency conditional operations. I have yet to figure out a way to throttle StateDesigner’s execution speed to match my needs. It’s possible StateDesigner is overly heavyweight for simple low-frequency data processing tasks. I am also considering an implementation based on DOTS, though this would require solving how to implement a state machine that supports ultra-infrequent manual Ticks and conditional evaluations.

In short, I want to trigger condition checks only after manually invoking the internal Tick of the states, eliminating unnecessary high-frequency polling and allowing the state machine to remain completely dormant when no Tick is called.
 
It just occurred to me that BehaviorDesigner might be a better fit for the processing flow I have in mind. All judgments for selecting operations rely on parameters inside a single data block, and the behavior tree only needs to execute once on each manual Tick. The tree branches will match and execute the corresponding operations as needed, which seems superior to StateDesigner.
 
Got it. I’m new to SD, so I’m not familiar with many of the detailed APIs. Thanks for your guidance.
 
Back
Top