Search Unity

NodeCanvas - (Behaviour Trees | State Machines | Dialogue Trees)

Discussion in 'Assets and Asset Store' started by nuverian, Feb 8, 2014.

  1. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    I am sorry to hear that :/ If you are referring to the Behaviour Trees aspect of NodeCanvas, there are some fantastic online material, but probably the best in my opinion is this article on Gamasutra written by Chris Simpson "Behavior trees for AI: How they work", as well as this video on AiGameDev (and further resources on that website) at explaining nicely how Behaviour Trees work design wise mostly. All the information can also be applied to NodeCanvas Behaviour Trees as well of course.

    Furthermore if you have any kind of questions, I would be glad to help you with them. Just drop a support post in the forums :)

    Thanks!
     
  2. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    137
    Hey, node canvas is a beautiful thing! I haven't used it in a while but it looks like it's improved even over how great it was a year or two ago.

    There's probably an easy way to do what I'm trying to do, but right now it's eluding me.

    I'm using a sequencer in a behavior tree to run basic level manager type logic, like spawning enemies. The sequencer connects to a series of actions with Conditional decorators that check things like how many enemies are alive and how long the level has been running. I'm wondering if there is any way to set the conditions so that once they are found to be true, they always returns true -- so for example, if a condition requires there to be less than five enemies left alive, and that condition decorator leads to an action that spawns 20 more enemies, The condition would still show up as green in the runtime visual debugging even after 20 more enemies have been spawned. That condition and action node would effectively be used up and no longer evaluated each frame.


    It seems like a sequencer that remembers where it was and continues from that point would work. Is this possible? There are probably plenty of other ways to do it too. Trying to get back into behavior tree thinking mode. Thanks for your time!
     
  3. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    137
    It seems like a filter decorator set to "limit number of times" could also work, if filters could be set to only count up when successes is returned. That would require creating a lot of extra nodes though, which would clutter up the tree. It would be cool to do it in a way without a lot of repetitive obligatory node creation.
     
  4. BoboShu

    BoboShu

    Joined:
    Nov 20, 2014
    Posts:
    38
    here is a bug ,when i use nodecavas. and building WebGL Porject.

    Before i used api compatibility level for .net 2.0 subset is ok.

    but now I only set api compatibility level for .net 2.0 ,it can resolved.

    In my project early, it not problem.


    I add SLATE Cinematic Sequencer Addons . is it cause this bug?


    Sorry for my English bad


    Here is my log .


    Platform assembly: E:\S1\Build\StandaloneWindows\S1_2016-08-30_14-48-16__Data\Managed\Mono.Security.dll (this message is harmless)

    Platform assembly: E:\S1\Build\StandaloneWindows\S1_2016-08-30_14-48-16__Data\Managed\System.ServiceModel.dll (this message is harmless)

    Platform assembly: E:\S1\Build\StandaloneWindows\S1_2016-08-30_14-48-16__Data\Managed\System.Runtime.Serialization.dll (this message is harmless)

    Platform assembly: E:\S1\Build\StandaloneWindows\S1_2016-08-30_14-48-16__Data\Managed\System.Xml.dll (this message is harmless)

    <b>(Deserialization Error)</b>: The classes in the module cannot be loaded.

    at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)

    at System.Reflection.Assembly.GetTypes () [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/Assembly.cs:371

    at ParadoxNotion.Serialization.FullSerializer.Internal.fsTypeCache.TryIndirectTypeLookup (System.String typeName, System.Type& type) [0x00025] in E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\Reflection\fsTypeCache.cs:105

    at ParadoxNotion.Serialization.FullSerializer.Internal.fsTypeCache.GetType (System.String name, System.String assemblyHint) [0x0001f] in E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\Reflection\fsTypeCache.cs:151

    at ParadoxNotion.Serialization.FullSerializer.Internal.fsTypeCache.GetType (System.String name) [0x00000] in E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\Reflection\fsTypeCache.cs:133

    at ParadoxNotion.Serialization.FullSerializer.Internal.fsTypeConverter.TryDeserialize (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Object& instance, System.Type storageType) [0x00016] in E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\Converters\fsTypeConverter.cs:33

    at ParadoxNotion.Serialization.FullSerializer.fsSerializer.InternalDeserialize_5_Converter (System.Type overrideConverterType, ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type resultType, System.Object& result) [0x0001d] in E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:860

    at ParadoxNotion.Serialization.FullSerializer.fsSerializer.InternalDeserialize_4_Cycles (System.Type overrideConverterType, ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type resultType, System.Object& result) [0x00035] in E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:852

    at ParadoxNotion.Serialization.FullSerializer.fsSerializer.InternalDeserialize_3_Inheritance (System.Type overrideConverterType, ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType, System.Object& result, System.Collections.Generic.List`1& processors) [0x0010e] in E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:831

    at ParadoxNotion.Serialization.FullSerializer.fsSerializer.InternalDeserialize_1_CycleReference (System.Type overrideConverterType, ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType, System.Object& result, System.Collections.Generic.List`1& processors) [0x0004c] in E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:723

    at ParadoxNotion.Serialization.FullSerializer.fsSerializer.TryDeserialize (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType, System.Type overrideConverterType, System.Object& result) [0x00039] in E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:685

    UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)

    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])

    UnityEngine.Logger:Log(LogType, Object)

    UnityEngine.Debug:LogError(Object)

    ParadoxNotion.Serialization.FullSerializer.fsSerializer:TryDeserialize(fsData, Type, Type, Object&) (at E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:695)

    ParadoxNotion.Serialization.FullSerializer.Internal.fsReflectedConverter:TryDeserialize(fsData, Object&, Type) (at E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\Converters\fsReflectedConverter.cs:88)

    ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_5_Converter(Type, fsData, Type, Object&) (at E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:860)

    ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_4_Cycles(Type, fsData, Type, Object&) (at E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:852)

    ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_3_Inheritance(Type, fsData, Type, Object&, List`1&) (at E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:831)

    ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_1_CycleReference(Type, fsData, Type, Object&, List`1&) (at E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:723)

    ParadoxNotion.Serialization.FullSerializer.fsSerializer:TryDeserialize(fsData, Type, Type, Object&) (at E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:685)

    ParadoxNotion.Serialization.FullSerializer.fsSerializer:TryDeserialize(fsData, Type, Object&) (at E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:659)

    ParadoxNotion.Serialization.JSONSerializer:Deserialize(Type, String, List`1) (at E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\_Commons\Runtime\Serialization\JSONSerializer.cs:87)

    ParadoxNotion.Serialization.JSONSerializer:Deserialize(String, List`1) (at E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\_Commons\Runtime\Serialization\JSONSerializer.cs:61)

    NodeCanvas.Framework.Graph:Deserialize(String, Boolean, List`1) (at E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\Runtime\Graphs\Graph.cs:131)

    NodeCanvas.Framework.Graph:OnAfterDeserialize() (at E:\S1\S1_Client_PC\S1\Assets\ThirdParty\ParadoxNotion\NodeCanvas\Framework\Runtime\Graphs\Graph.cs:63)


    (Filename: E:/S1/S1_Client_PC/S1/Assets/ThirdParty/ParadoxNotion/NodeCanvas/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs Line: 695)




    Mail for Windows 10
     

    Attached Files:

  5. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    137
    Hey nuverian,

    Ignore my last few posts -- I realized that I should be using a state machine instead of behavior trees for a much more intuitive set up.

    Have a much more basic question, I've tried a bunch of things but can't find anything that works: how do I, in a script, restart a fsm to its original starting state?

    if I try something like triggerstate("IntroState"), or if I try FSMOwner.StopBehaviour() and then FSMOwner.StartBehaviour(), once I return to the starting state, there are condition connections which seem to be disabled. Specifically, conditions inside a condition list all become unchecked the second time through the state machine, and the conditions count as already being met and a whole bunch of states are instantly skipped.

    How can I return the fsm to its true initial conditions in a script?
     
  6. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    137
    It looks like this is only happening with condition lists. Is this just a weird bug?
     
  7. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,

    Thanks! I am glad you like NodeCanvas :)
    The Filter Decorator is indeed the way to limit a branch from executing more than a specified number of times.
    With that said, creating custom decorators or composites can of course be an alternative way of tackling with this. Bellow, is a quick composite I've created ("MemorySequencer" hence for a better name), which pretty much works how you initially described...Once a child has returned Success, it no longer checks that child ever again, until the Behaviour Tree is restarted (stop/start).
    Code (CSharp):
    1. using NodeCanvas.Framework;
    2. using ParadoxNotion.Design;
    3. using UnityEngine;
    4.  
    5. namespace NodeCanvas.BehaviourTrees{
    6.  
    7.     [Category("Custom")]
    8.     public class MemorySequencer : BTComposite {
    9.  
    10.         private int currentIndex = 0;
    11.  
    12.         public override void OnGraphStarted(){
    13.             currentIndex = 0;
    14.         }
    15.  
    16.         protected override Status OnExecute(Component agent, IBlackboard blackboard){
    17.  
    18.             for (var i = currentIndex; i < outConnections.Count; i++){
    19.  
    20.                 status = outConnections[i].Execute(agent, blackboard);
    21.  
    22.                 if (status == Status.Success){
    23.                     currentIndex ++;
    24.                     continue;
    25.                 }
    26.  
    27.                 return status;
    28.             }
    29.  
    30.             return Status.Success;
    31.         }
    32.     }
    33. }

    Let me know if that works for you.
    Cheers!

    Hello,
    Please set API Compatibility Level to ".NET 2" instead of ".NET 2 Subset".
    Is there a reason you don't want to do that? Let me know.

    Thanks.

    FSMs can also work depending on what you are after :)
    FSM can indeed be restarted by StopBehaviour -> StartBehaviour. The fact that the conditions in a ConditionList are uncheched is purely a UI thing (and something I need to improve), but once the State which has that outgoing transition becomes active, all of those conditions in all of it's transitions will be enabled again to be evaluated. If of course those transition conditions evaluate to true, the transition will instantly happen, but they do evaluate correctly.
    Are you sure that your conditions evaluate true, when they should not?

    Let me know.
    Thanks.
     
  8. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    137
    Hey, you're absolutely right. Was just going to post -- I was fooled by the UI making it look like they were disabled -- the real issue was with a custom action I created! Thanks.
     
    Last edited: Aug 30, 2016
  9. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    You are very welcome.
    Partially my fault due to the UI of course. I really need to improve that part.
    Thanks!
     
  10. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
  11. BoboShu

    BoboShu

    Joined:
    Nov 20, 2014
    Posts:
    38
    nuverian ".NET 2 " is big and it has a loft of Unused .net Framework. i think maybe .net subset maybe is the optimize choise. just my hope .

    Unity - Manual

    API Compatibility Level See below
    .Net 2.0 .Net 2.0 libraries. Maximum .net compatibility, biggest file sizes
    .Net 2.0 Subset Subset of full .net compatibility, smaller file sizes
     
    Last edited: Sep 12, 2016
  12. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    If someone is trying to use it with 5.5: move ParadoxNotion/NodeCanvas/Design/Editor/Resources to ParadoxNotion/NodeCanvas/Design/Resources
     
  13. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    137
    Hey nuverian, I've really been enjoying using node canvas the past couple weeks. I've owned it for a long time but this is the first time I've been using it to prototype and it's great!

    I was showing it off to an artist friend of mine and they commented that it would be really nice to be able to use nested graphs that are still bound to the scene, just for visual/organizational purposes. Have you thought about implementing this? (Or is it already there, and just something I missed?)
     
  14. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,

    The new version send to the asset store a couple of minutes ago can now work with ".Net 2 Subset". Tested in WebGL to confirm it's working :)

    Cheers!

    Hey!
    Thanks for letting everyone know. Unfortunately there are some more changes that are needed for NC to work with Unity 5.5 and those will of course be done in time :)
    Thanks again!

    Hey Alic,

    Thanks a lot! I am really glad you like NodeCanvas :)
    The ability to have nested graphs bound to the scene is something that currently is not possible and even though a feature that has been requested in the past a couple of times, there are some serious difficulties in implementing it "right". Although I can't promise for a certain, I hope it will be possible in a future version :)

    Thanks again for your suggestion and your feedback!
     
  15. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    137
    Cool, glad to know it's been talked about, and thanks for the reply.
     
    nuverian likes this.
  16. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    The new version 2.6.0 is live on the asset store. :)
    Following are the changes.

    • New: When a node or connection is selected, used Blackboard variables by that selection will now be highlighted.
    • New: Improved Variable Separators and it's now possible to have a custom name for them (double click to edit).
    • New: Dynamic and missing parameter variables will now show in red within the Node & Task information UI.
    • New: Added button to 'Promote' a dynamic or missing parameter to a Blackboard Variable.

    Variables.gif

    • New: Added AutoCast between convertible types (eg bool, float, integer, string), on top of existing AutoCast list.
    • New: AutoCast assigned Parameters will now show information of the cast/convertion that will take place. For example AutoCast: ("Integer" > "Float") as shown bellow.
    AutoCastInfo.png

    • New: Added ability to colorize Nodes and it's associated icons through their inspectors.
    • New: BT Icons are now colorized by default (dark skin only).
    NodeColoring.png

    • New: Added ability to colorize Canvas Groups through their right click context menu.

    CanvasColoring.png

    • New: Added new Behaviour Tree composite node "Binary Selector". (Based on a condition it simply either executes left or right child node). This is mostly added for people not yet familiar with BTs looking for a more "direct" approach.
    BinarySelector.png



    Further New:
    • New: Script Control Task & Variables Binding now work with base definition of method and properties (The lowest implementation in class hierarchy is used). @calebc01 :)
    • New: FSMs will now not be Finished/Stopped if there is an AnyState node active.
    • New: Changed FSM SuperActionState behaviour to not Finish when the OnEnter list actions are Finished. Instead it will continue calling OnUpdate actions until a transition is made.
    • New: Mecanim Set Parameter actions can now also be used the hashID instead of name.
    • New: Added breakpoints in FSM States and Dialogue Tree nodes that were missing.
    • New: Added NC Preference to optionally Pause Unity Editor when a breakpoint is reached.
    • New: Right Click in the Node/Task Browser window now goes back one step.

    Fixes:
    • Fixed: Breakpoints in SubTrees correctly pause the root Behaviour now.
    • Fixed: OnGraphStarted callback that was not called in SubTrees.
    • Fixed: Status visual debugging for BT Repeater Decorator node.
    • Fixed: Inability to Bind Blackboard Variables when editing a prefab.
    • Fixed: "Send Global Event" from sending multiple events in graphs of the same gameobject.
    • Fixed: "Create Defined Blackboard Variables" command, that was incrementaly adding Global BB name (eg "Global/") for global variables.
    • Fixed: Task agent resolving to first component instance when multiples of the same type are on the gameobject and when agent is override instead of always resolving to the override agent assigned.
    • Fixed: NC ObjectDrawer and PropertyDrawer that were not utilized when placed under an "Editor" folder.
    • Fixed: OnUpdate is now called once in the same frame (and after) that OnExecute is called for ActionTasks.
    • Fixed: FSM Transitional Condition List Information UI from disappearing in runtime when parent state is not active. @Alic
    • Fixed: Unnecessary allocation when restarting FSM.
    • Fixed: FSM Nested BT State that was not sending events correctly back to the FSM.
    • Fixed: Added missing Task information texts.
    • Fixed: AOT Classes Generator for non-namespaced classes.
    • Fixed: When duplicating or pasting nodes, they will now be auto selected.
    • Fixed: Win Universal Apps 10 support.
    • Fixed: IOS EXE_BAD_ACCESS in Task.cs (thanks to emilio.saffi).
    • Fixed: Requirement of ".Net" backend (instead of ".Net Subset").

    Cheers! @everyone
     
    Last edited: Sep 15, 2016
  17. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    I just noticed this, but check out the fantastic Ghost of a Tale early access game on Steam, where NodeCanvas was used.

     
    TeagansDad and hopeful like this.
  18. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello everyone,

    There is a critical runtime bug introduced in recent version 2.6.0 causing null reference exceptions within Tasks, that unfortunately slipped by my attention.

    I have already send out a new update to the asset store to fix this, but meanwhile you can easily fix this by doing the following:

    – Please open up Task.cs file.
    – At line number # 390 (Initialize method), please replace the piece of code as shown bellow:

    Code (CSharp):
    1. /*            /// REPLACE THIS:
    2.             if (!agentIsOverride && newAgent != null && newType != null && ( newType.RTIsSubclassOf(typeof(Component)) || newType.RTIsInterface() ) ){
    3.                 newAgent = newAgent.GetComponent(newType);
    4.             }
    5. */
    6.          
    7.             /// WITH THIS:
    8.             if ( newAgent != null && agentType != null && ( agentType.RTIsSubclassOf(typeof(Component)) || agentType.RTIsInterface() ) ){
    9.                 newAgent = newAgent.GetComponent(agentType);
    10.             }
    11.  
    If for any reason, you are having trouble with this, just send me an email (support@paradoxnotion.com) along with your invoice ID, and I will send the fixed version back to you ASAP.

    Sorry for the inconvenience this bug might have caused.
     
  19. BoboShu

    BoboShu

    Joined:
    Nov 20, 2014
    Posts:
    38
    Hi numverian..
    I updated 2.6.0 today. but my game is can't use .Net Subset, the Fixed is
    • Fixed: Requirement of ".Net" backend (instead of ".Net Subset").
    But i creat a new empty project with only nodecanvas and run the demo. is ok .

    i add a log in fsTypeCache:TryIndirectTypeLookup , for typename is NodeCanvas.BehaviourTrees.BehaviourTree

    why ?! can you help me ?

    i compare the log

    my project is more log is :

    Platform assembly: E:\S1\Build\StandaloneWindows\S1_2016-09-18_15-54-17__Data\Managed\Mono.Security.dll (this message is harmless)

    Platform assembly: E:\S1\Build\StandaloneWindows\S1_2016-09-18_15-54-17__Data\Managed\System.ServiceModel.dll (this message is harmless)
    Platform assembly: E:\S1\Build\StandaloneWindows\S1_2016-09-18_15-54-17__Data\Managed\System.Runtime.Serialization.dll (this message is harmless)
    Platform assembly: E:\S1\Build\StandaloneWindows\S1_2016-09-18_15-54-17__Data\Managed\System.Xml.dll (this message is harmless)

    ServiceModel?Serialization?

    i found the prolblem . i import protobuf-net.dll .. thanks
     

    Attached Files:

    • Log.txt
      File size:
      12.5 KB
      Views:
      947
    Last edited: Sep 18, 2016
  20. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    Thanks for letting me know that the problem was protobuf-net.dll
     
  21. BoboShu

    BoboShu

    Joined:
    Nov 20, 2014
    Posts:
    38
    i change a new protobuf-net.dll . it fixed!
     
    nuverian likes this.
  22. TSabos

    TSabos

    Joined:
    Mar 8, 2015
    Posts:
    94
    I have an FSM that uses a lot of OnFinish as the transition. Before 2.6.0b (think we were on 2.5.3?) these all worked correctly and now they get stuck in the state. The custom action uses EndAction(true) and gets called correctly but the transition never occurs. Let me know if you need more info but this is super breaking ;)

    The EndAction is in protected override void OnUpdate() and this is in a class that inherits ActionTask<Transform>
     
    Last edited: Sep 27, 2016
  23. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    Hmm. I can't reproduce a case where the state is finished, but the OnFinish transition is not called. Do you maybe have the state set to Repeat? Can you please send me such a reproduction case (support@paradoxnotion.com) or provide more details?

    Thanks!
     
  24. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    RDeluxe and TeagansDad like this.
  25. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    117
    Hey ! Thank you for your support ! :p
     
    nuverian likes this.
  26. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
  27. Dean-Kuai

    Dean-Kuai

    Joined:
    Jun 17, 2013
    Posts:
    24
    Hello, I searched all over the internet but failed to find any topic about "NodeCanvas and Object Pooing". Does NodeCanvas support object pooling? How do you re-initialize a game object when re-enable it? Thanks.
     
  28. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    Please update for compatibility with Unity 5.5 Beta.
     
  29. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello and sorry for the late reply, but I was ill for the last couple of days.

    When a NodeCanvas Graph is Stopped/Restarted (which by default is done when the NodeCanvas component GraphOwner is disabled/enabled), it will reset to it's initial state, but Blackboard Variables used do not.

    Having said that, it's very easy to manually re-initialize variable to initial state, by creating a simply script that OnEnable stores the variables' state and OnDisable restore them, by using the existing methods provided (Serialize and Deserialize).

    If you want a code example, please let me know.
    Thanks!

    Hey,
    The new version supporting Unity 5.5 is on the way :)
    It was a bit harder than I expected, but it's almost done!

    Thanks!
     
  30. Dean-Kuai

    Dean-Kuai

    Joined:
    Jun 17, 2013
    Posts:
    24
    Thanks for your reply:)
    Is there any way to re-initialize all action and condition tasks? Further, a OnSpawn() and a OnDespawn() would be required for object pooling. For example:
    Code (CSharp):
    1. public class TaskForHoldingShadow : ActionTask
    2. {
    3.     public Transform ShadowPrefab;
    4.  
    5.     private Transform shadowInstance;
    6.  
    7.     void OnSpawn()
    8.     {
    9.         shadowInstance = GameObject.Instantiate (ShadowPrefab);
    10.     }
    11.  
    12.     void OnUpdate()
    13.     {
    14.         Align (shadowInstance);
    15.     }
    16.  
    17.     void OnDespawn()
    18.     {
    19.         GameObject.Destroy (shadowInstance);
    20.         shadowInstance = null;
    21.     }
    22. }
    Thanks:cool:
     
  31. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    I fixed a few code myself to let NC works with Unity 5.5. It is usable, just that when I right-click on the canvas to bring up the context menu, it will sprout hundreds of warnings saying there is no AnimationCurveEditorBackground layout.
     
  32. jterry

    jterry

    Joined:
    Oct 30, 2014
    Posts:
    9
    Hey Nuverian,

    Any idea of an ETA for 5.5 support?
     
  33. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    I will be sending the new version to the asset store in the weekend. :)
     
    jterry likes this.
  34. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    228
  35. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,

    The new version supporting Unity v5.5 is already submitted and pending review by the asset store team.
    Regarding FlowCanvas and macros instantiation, it's not improved in this version submitted now, because I really had to push the new version through to support Unity 5.5 as a top priority.
    Thanks!
     
    WendelinReich likes this.
  36. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I'm a Playmaker/Behavior Designer user and I really like both of those products. So, I'm not coming here as a disgruntled user of either system, although I have seen performance issues with large, multiple Playmaker FSMs. But I'm here because I'm tempted by the fact that Node Canvas combines the use of FSMs and BTs into a single product. The investment in a new product when I've already spent a good chunk of change on other tools is not an easy decision to make, but I've been deliberating on it for some time.

    My main concern with making a switch is whether or not Node Canvas supports console platforms with AOT. I am using the Wii U currently, but will soon also be developing for XBox One. Is there any reason to believe this won't work on Wii U or XBox One?
     
  37. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    Thanks for your interest in NodeCanvas.
    Yes, NodeCanvas works absolutely fine with AOT platforms.
    There is a small step required as explained here, but it's as simple as a press of a button:)
     
  38. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Thanks for the response. I'll definitely consider picking this up and giving it a try.
     
  39. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Thanks :)
    If you have any other questions, just let me know.
     
  40. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    The new version 2.6.2 has recently gone live but I did not post about it, so here it is now :)
    The changes include:

    Unity 5.5 support.

    New: Improved Re-Linking connections and now also possible for BehaviourTree and Dialogue Tree nodes.
    Relink.gif

    New: Action/Condition Lists are now handled automatically.
    AutoLists.gif

    New: Dialogue Trees now work the same way as Behaviour Trees and FSMs do workflow wise. Thus there is now a new component called DialogueTreeController, which is the respective BehaviourTreeOwner/FSMOwner but for Dialogue Trees. As a result to that, Dialogue Tree assets can now also be created and a new nested SubDialogue Tree node type has been added.
    SubDialogueTree.png


    Other things:
    • New: Types (including generic types) and methods will now resolve and fallback to other matches by searching types without namespace.
    • New: Editor performance improvements.
    • Mod: FSM SuperActionState node will now auto-Finish if there are no OnUpdate list actions.
    • Mod: Node/Task Browser is now considerably smaller in size.
    • Mod: Obsolete methods/properties and fields are now excluded from menus.
    • Fix: Duplicate and Delete shortcuts for multiple nodes. Fix: Panning Graph is now undoable.
    • Fix: Control Graph Owner action task when set to StopBehaviour of “self” agent.
    • Fix: Memory allocations when using Dynamic Variables.
    • Fix: Export to JSON, will now correctly include derived graph data if any.
    Cheers!
     
  41. chai

    chai

    Joined:
    Jun 3, 2009
    Posts:
    84
    Is nodecanvas incompatible with Unity versions prior to 5.5? (on 5.2.4f)
    Just bought Nodecanvas, but spits out errors
    We cannot afford to upgrade unity for the next few months due to tight deadlines.

    Code (csharp):
    1. Assets/ParadoxNotion/NodeCanvas/Framework/_Commons/Runtime/Other/ReflectionTools.cs(109,93): error CS0117: `UnityEngine.Debug' does not contain a definition for `logger'
    Code (csharp):
    1. Assets/ParadoxNotion/NodeCanvas/Framework/_Commons/Runtime/Other/ReflectionTools.cs(109,55): error CS0019: Operator `+=' cannot be applied to operands of type `UnityEditor.EditorApplication.CallbackFunction' and `anonymous method'
     
    Last edited: Dec 9, 2016
  42. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    Thanks for getting NodeCanvas.
    Officially, NodeCanvas supports Unity 5.3+, but I have replied to your PM and I can send a special version to you supporting Unity 4.7+. If there is more demand for older versions of Unity prior to 5.3, I can add support for them as well.
    Thanks.
     
  43. chai

    chai

    Joined:
    Jun 3, 2009
    Posts:
    84
    Thanks mate, good stuff!

    Does NodeCanvas allows parameters in subtree like actions do?
    Looking for something self contained like actions, without clattering blackboard

     
  44. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,

    Sorry for the late reply.
    This is exactly what I am working on for the next version, that is the ability for SubTrees to use local Blackboards able to either be set/mapped from parent graph's blackboard variables, or just by a static value, or just not set at all and leave the SubTree variable untouched.
    SubTreeVariableMapping.png

    Thanks!
     
    TeagansDad likes this.
  45. chai

    chai

    Joined:
    Jun 3, 2009
    Posts:
    84
    Wow amazing, can't wait! :D
     
    nuverian likes this.
  46. hoodoo

    hoodoo

    Joined:
    Oct 19, 2012
    Posts:
    154
    Hello @nuverian - I purchased Node Canvas a while back and am now going to start using it. Just wondering if you can suggest the best way to get started and learn? I downloaded the example scene from your website and see you have good documentation as well, but are there any tutorials for getting started (either written or video)? Thanks!
     
    ZiadJ likes this.
  47. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    Thanks for getting NodeCanvas. The examples scenes and the documentation are really the main resources to get started using NodeCanvas now. Another great resource is of course the forums :) I always answer all posts and do my best to help everyone with any question or problem they have, so by all means if the examples scenes and the documentation were not enough and still have any questions at all, please feel free to ask away and I will do my best to help you :)
    Thanks!
     
  48. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    982
    Hi nuverian! Let me start off by saying that this asset is absolutely the best one I've ever purchased! Been using it for about four months now and I love every bit of it. Great work!

    However, I have a slight issue that I'm not sure how to tackle. In my game I'm spawning dozens to hundreds of enemies at a time. For obvious reasons I use object pools all over the place. However, there is still a slight hiccup in the spawning of large numbers of entities that have nodecanvas trees and FSMs. Looking at the profiler it seems that some deserialization is going on each time the components are enabled so I can see why there is a slight delay.

    I'm considering adding a feature to my pooler to let me choose to pause/unpause the nodecanvas stuff rather than simply deactivate the whole entity. But before I spend the time doing all that I wanted to see what your recommendation is. Any clues you can offer would be greatly appreciated.
     
  49. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey Slugy!
    Thanks a lot for your positive feedback man! I really appreciate that and I am very glad you like NodeCanvas that much!
    Regarding the issue you are facing, deserialization should really only take place the first time the graph is enabled. Are you saying that you are experiencing an overhead every time a gameobject with NC component is disabled/enabled?
    Also, what version of NodeCanvas are you using?

    Please let me know and thank a lot once again!
     
  50. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    TeagansDad, nuverian and hopeful like this.