How do you stop FSMs from returning Success

Forums 💬 NodeCanvas ⚙️ Support How do you stop FSMs from returning Success

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #16466
    lunin
    Participant

      I recently revisited some simple AI logic I wrote in an earlier version of NodeCanvas, and I noticed things breaking that I didn’t expect.  Upon digging into it I found that some of my nested FSMs were returning Success and therefor stopping evaluation prematurely.

      This seems to be because the FSMs in question use FromAnyState and events rather than direct connections to change states.  The lack of a direct connection seems to trick the FSM into thinking it has “ended” and thus Success gets thrown.

      So far I’ve been able to work around this by putting an action that does nothing and loops to itself when I’m done handling whatever I’m handling to keep the graph alive, but I’d like to know if there’s a better way to keep a nested FSM from going to Success prematurely 🙂

      #16470
      Gavalakis
      Keymaster

        Hello there,

        Hmm… In recent versions, the FSM will not stop (and thus return true/false) if an AnyState node exists in the FSM.

        What version are you using? 🙂

        Let me know.
        Thanks,

        #16469
        lunin
        Participant

          Not sure where to find the version number but the person who set it up for our project said it should be the latest and they think it’s v3.03

           

          #16468
          Gavalakis
          Keymaster

            Hello again,

            The version can be seen on the top right of the Graph Editor toolbar.

            Can you share some screenshots of your setup? I specifically don’t understand what you meant by saying “…use FromAnyState and events rather than direct connections to change states.  The lack of a direct connection…” 🙂

            Do you have AnyState node without connections?

            #16467
            lunin
            Participant

              No, the AnyStates are connected, just the start/hub has no outgoing connections (in one case the actions off the any state also have no connections, but that doesn’t seem to matter)

              I’ve attached images of the two nested FSMs that had this problem, returning success immediately to the tree above them.  If I connect the states to themselves the problem goes away (v3.03).

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