FSM Transitions – frequency of checks

Forums 💬 NodeCanvas 🗨️ General Discussion FSM Transitions – frequency of checks

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #14523
    adbourdages
    Participant

      Hi,

      Just got NodeCanvas and evaluating it for implementing element’s logic in pinball tables. I’m mostly interested in FSM here. The first question I have is about the frequency of the transition checks. I haven’t looked extensively in the source code yet (huge thanks for providing that, it was a deciding factor in getting the asset), but nonetheless:

      – when are the transitions checked? Update()? LateUpdate()?
      – is it possible to create a type of transition that is checked multiple time per frame (on a callback for example). The use case here is to plug the condition in an external physics system (for pinball).
      – finally, how “fast” are the state change. If a transition is triggered, does the state changes *immediately*, or more precisely, by the time call on CheckTransition returns, has the state changed?

      Cheers,
      Alain-Daniel

      #14524
      Gavalakis
      Keymaster

        Hello and thanks for getting NC 🙂

        To answer your questions,

        – Transitions are check in an Update(). Graphs that need updating are registering into MonoManager and it collectively calls them all. In Update.

        – Currently this is not possible out of the box. A transition’s condition is checked once per frame in an Update call. There is a workaround though. You can use FSM Callbacks to see when the state at question has been entered, and then manualy call CheckTransitions whenever it is required, although this might get a bit confusing depending on what exactly you want to do.
        Please take a look here and let me know if you need further directions:
        http://nodecanvas.com/documentation/graphs/state-machines/fsm-callbacks/

        – Yes, by the time the CheckTransition returns, the transition has already been made. The next state’s actions are already active.

        Cheers,
        Let me know if you have any more questions

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.