Transition to Same State

Forums 💬 NodeCanvas ⚙️ Support Transition to Same State

  • This topic has 0 replies, 3 voices, and was last updated 10 years ago by Gavalakis.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #19070
    noio
    Participant

      What is the reason for disallowing self-transitions?

      Usually, FSM’s allow self-transitions:

      Especially in combination with the “ANY STATE” node, it can be useful to restart the same node if conditions have been met (again).

      Illustration

      I need the DUMMY node here to prevent a “Trying entering same state” error.

      It works. It’s just not super pretty 😉

      #19075
      Gavalakis
      Keymaster

        Hey,

        I’m very sorry for the late reply. Some things required my attention.

        Yeah, self transitions are not possible right now. It is mostly a GUI representation thing rather than not possible functionality wise. I need to find a way to represent the transitions and still be good looking and definetely readable along with their conditions 🙂

        Indeed you could remove the check in FSM.cs line #99 for allowing entering the same state. It will work (the target state will Finish before Starting again). The problem in this case will be that if the AnyState transition codition is continously true, it will keep entering the target state per frame and that might not be desired. Or is it in your case?

        Cheers!

        #19074
        noio
        Participant

          Thanks for your reply! It’s not late at all 😐

          The problem in this case will be that if the AnyState transition codition is continously true, it will keep entering the target state per frame

          That could definitely happen, but I think that is a ‘risk’ with “Any State” transitions in general. I would say that’s up to the user, not something NC should try to solve.

          Any State does mean Any State, not Any State Except The One You Came From. 🙂

          #19073
          Gavalakis
          Keymaster

            Hey,

            Alright. I’m convinced 🙂 I will remove the same state check for the next version.
            If people don’t like that behaviour, I could implement it as a setting in the AnyState node, instead of globaly.

            Cheers!

            #19072
            async0x42
            Participant

              For reference, the animator in Unity has an option for state transitions ‘Allow transition to self’, personally, I think this would work well on a per-node basis rather than a global setting, with it disabled or enabled by default, whichever would be the most common-use scenario (probably disabled, since there hasn’t been more discussion about this I think?)

              (Screenshot attached)

              Edit: Just a thought, but since it’s disabled right now, changing it globally to enabled by default might cause a bit of grief to people who have a ton of work done in NodeCanvas

              #19071
              Gavalakis
              Keymaster

                Yeah this is what I ment by having this as an option in the AnyState node. 🙂

                Cheers!

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