Hi, I’ve been very happily using NodeCanvas in my current project but for our next feature I’d also like to add FlowCanvas to the project too. I’ve run into an issue. The latest FlowCanvas (3.2.5) causes a compiler error if I bring it into the project with our older version of NodeCanvas (we’re using 3.2.1).
So I tried to bring our NodeCanvas up to date (3.2.1 -> 3.2.5) but when I do that it breaks at least one of our NodeCanvas graphs. What happens is that some of the condition tasks cause the FSM to appear to be in no state at all (i.e. no highlighted state when the game is running). There are no errors in the console when this happens – the FSM just seems to get stuck and not move into any other state.
Please let me know if there’s anything I can try or any info I can give you that might help.
Edit – More info: It looks like what’s happening is the last nodes (i.e. empty transition list) are still exiting and effectively stopping the whole graph. The previous behaviour was for the last node to stay current – i.e. the last node stays as the current one (as in attached image).
Hmm. The FSM was always designed to work like that, meaning that the FSM stops when a state with no transitions is Finished, unless there is any other node active like an Any State or an On FSM Update (are you using any of those in your FSM please?). If it did stop in 3.2.1 it should be a bug honestly.
With that said, if you want to disable that behaviour, you can delete lines #112-115 in FSM.cs code, but please note that this change will affect how Sub-FSMs work if you use any. This is something I was also considering adding as an option of the FSM in the FSMOwner inspector.
Ok that makes sense. Perhaps I could make my own action state especially for my menu system that has the behaviour of not exiting if there’s no condition tasks?
Edit: Answering your question about Any state or on update – not using either in the problem graph. There are 2 parallel states though that listen for specific events and use TriggerState to force a particular state. One event implements ‘menu back’ and the other allows the state to jump directly to ‘Menus hidden’ when they’re no longer needed on screen.
I think creating a custom fsm state for this would be much of a hassle (and you will need to redesign the FSM … ).
Here are some solutions (apart from changing the code or having an option in FSMOwner):
If the “GoToScreen” action task that is used in all “leaf” states is custom (probably is), then you can change it so that it never finishes (by not calling EndAction).
You can add the “Run Forever” action task in all states that you want to keep running forever and thus the FSM does not finish for those states.
If the reason you want to keep the FSM alive/running is because of the Parallel state (which was replaced by the OnFSMUpdate by the way), I can add an option in the node’s inspector so that it is always running and thus once again the FSM is never considered finished when such OnFSMUpdate node is present.
If the above is not the reason, and you simply want to keep the FSM alive no matter what, following is a custom FSM node code that will keep running forever and will have the same effect as having an option in the FSM as suggested above:
Thank you very much. These all sound like good solutions. I will try these once I circle back to the NodeCanvas upgrade and let you know.
Edit: Just reporting back. Making it so that the GotoScreen option never ends has solved the issue. Now fully upgraded and can look into having FlowCanvas too now – Thanks!