NodeCanvas Forums › Support › Severals problems with nestedFSM
Hello,
We have severals problems with nestedFSM used as SubFSM.
For the moment :
-OnInit for state in nestedFSM is called after OnEnter and it’s very problematic !
-currentState is null for one frame during the transition between FSM
-OnUpdate can be called after OnEnter (don’t know why and when for this last)
Can you fix this in short time ? It’s very problematic to not use nestedFSM. Maybe there is another solution for making SubFSM ?
Thank for the support ! Great plug-in !
(Edit: screen of the behaviour ! The first state of a SubFSM get its call unordered !!!! )
Hello,
Thanks for your positive feedback!
Yes, you are correct. Thanks for spotting this out. It must have been due to a change in last version.
I’ve just fixed this and will include fix in the next version which will be submitted within the next few days.
I can send you the fixed version to your registered email account sooner if you want.
Thanks again.
Join us on Discord: https://discord.gg/97q2Rjh
Hey! Thank you a LOT .
Can you fix an other problem ? The deserialization error that occur when a actionTask/ConditionTask is deleted. It will broke the behaviorTree in certain case.
In Blackboard for example, we can’t delete a variable with deleted class …
Hello, I come with an other bug !
When you first send an event to a NestedDialogueTree it will not work.
But in the second time it work !
The first time the dialogueTree is cloned, and the second time it is used !
Can you fix it ? :p
If you want i can be your official tester <3
Hey!
Can you please clarify what deserialization error you are referring to?
When an action/condition is deleted, it should be replaced by a “Missing Task”.
Within the blackboard when a type is missing, the variable should also show an “X” button to remove it.
Does this not show for you? 🙂
About the dialogue tree / event problem, I am not exactly sure what you mean or figure it out by the screenshots :/ Can you please clarify the issue and your setup? Are you using custom nodes? 🙂
Thanks!
Join us on Discord: https://discord.gg/97q2Rjh
Hum…
I had not this visual in the blackboard when tested… maybe i had an old version =/
For the nestedBehaviorTree I just have the setup in screenshot.
The event (“Inspect”) launched is provided by a simple click on a UI Button. The first time the behaviorTree is not cloned and the event is not treated. The second click is treated in the behaviorTree because the behaviorTree is cloned.
Hello again,
Thank for the new update, BUT :
-You don’t fix the currentState null issue when nestedFSM switch between them.
And, an other thing : can you add : DrawDefaultInspector() in ActionState / SuperActionState and nextState (so ^^ ) in FSM ? 🙂
The first thing is for derivating from State and create custom state with some member variable for example.
Hello,
I will take a look at null state and add nextState, and send a new update soon.
About DrawDefaultInspector(), it should work fine calling it in OnNodeInspectorGUI() of any derived FSMState class already.
Have you tried using is and it does not work?
Let me know.
Thanks.
Join us on Discord: https://discord.gg/97q2Rjh
Yeah thank you.
For DrawDefaultInspector, the problem is in fact that my stateMachine has differents states like ActionStates and SuperActionStates. The specification of the state is just an interface (C# :'( ).
I add the function on OnNodeInspectorGUI for the last and the new version and it work great. But i had to add it at all new update, that’s not really…convenient ? ^^
Hello,
Sorry but I am not sure I understand the problem you are facing with DrawDefaultInspector 🙁
Have you made custom FSMState nodes? Can you post some example code of what/why is not working?
Thanks in advance.
Join us on Discord: https://discord.gg/97q2Rjh
Hello.
Without DrawDefaultInspector, inherited ActionState or SuperActionState not display public field :'(
Another question (yes like all Time :p )
Have you a callBack for Action when the graph is init ?
I want to register something to MessageRouter, but it register only when the state is running for the first time :'(
Hummm….
I come (maybe) with a new problem. But this time for TriggerCheckCondition (and others like that which use MessageRouter) !!!! And the problem seems very weird.
The problem : The registration is done when the task is Init and not at the beginning when the graph is created.
So the problem ? Look the screenshot, the cube is in the trigger of the other cube, but the triggerStay condition is not fired. Why ? Because this condition was registered AFTER the triggerEnter of the collider.
If i move the object (picture 2) the TriggerStay is normally fired.
If you want, i can create multiple topic, or just rest on this one 🙂 say me 🙂
Hey,
Yes registration is done on request which generally should not impose a problem.
The problem here is more in the way I’ve implemented the CheckTrigger condition task, in the sense that I do not actually register it to OnTriggerStay, but rather only use the OnTriggerEnter to determine if stay is true as well.
So probably a better approach would be to actually also register and use OnTriggerStay as well, since that is what we really need to check here in the first place:
1 2 3 |
[EventReceiver("OnTriggerEnter", "OnTriggerExit", "OnTriggerStay")] |
1 2 3 4 5 6 7 8 9 10 11 |
public void OnTriggerStay(Collider other){ if (!specifiedTagOnly || other.gameObject.tag == objectTag){ stay = true; if (checkType == TriggerTypes.TriggerStay){ saveGameObjectAs.value = other.gameObject; YieldReturn(true); } } } |
Join us on Discord: https://discord.gg/97q2Rjh
hummm.. I thank the same things but. Maybe you did not that because of Unity internal loop Update vs FixedUpdate.
I think you did that because it’s totally not accurate, if a physic update say that you exit the trigger you can also have in past physic frame a TriggerStay and thus the yieldReturn(true) is in fact.. false.
so :
1 2 3 4 5 6 7 8 9 |
public void OnTriggerExit(Collider other){ if (!specifiedTagOnly || other.gameObject.tag == objectTag){ stay = false; if (checkType == TriggerTypes.TriggerExit){ saveGameObjectAs.value = other.gameObject; YieldReturn(true); } } } |
In fact, stay serve to nothing, just yieldReturn(false) in case of TriggerStay and True for TriggerExit. But if you have multiple colliders on the same object… that not work. Because some colliders can exit and others can stay…
So, think you, I will modify my own checkTrigger (based on your code :p ), for the moment I use Overlap so it’s fine ^^.
////
////
////
Other things (did i say that i’m on a infinite loop of improvement on your plug-in ? :p ) : I don’t know why you blocked ConditionList in ConditionList … That permit to do : (ConditionA AND ConditionB) OR (ConditionC AND ConditionD) for example. It’s so practical !
Same things for ActionList in ActionList that permit to have some action in parallel and other in sequence !
Maybe improve the GUI to well display this, but it’s totally fine if you authorize this behaviour. <3
Hey !
Another things : OnDrawGizmos are not called for ConditionTask.
You just need to add this :
1 2 3 4 |
#if UNITY_EDITOR public virtual void OnDrawGizmos() { } public virtual void OnDrawGizmosSelected(){ } #endif |
in Condition.cs
And to call this in the graph.cs .
And All Node need to call proper condition.OnDrawGizmos and .. that’s it !
Little fix, but so much cool =)