Search Unity

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

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

  1. BigToe

    BigToe

    Joined:
    Nov 1, 2010
    Posts:
    208
    Thanks for jolting me over my mental speed bump. I think binding the variables will help me do most of what I am looking for.


    Hello,

    Hmm. Considering I understood correctly, you might want to consider using Bound Variables instead.
    For example, you could have an GameState enum and a GameManager static class like this:
     
  2. c0smonaut

    c0smonaut

    Joined:
    Oct 11, 2013
    Posts:
    1
    Hi there,

    Is there a way to use FlowScripts as ConditionTasks? ConditionTasks are very inflexible and it would be nice to let interaction designers implement simple transitions.

    Example:
    Player grabs an item
    Event system sends out "PlayerGrabbedItem" event with attached Item object
    Transition needs to know what category of item the Item object belongs to

    At this point, I need to write a ConditionTask that deals with this specific event and checks the Item category in code. Alternatively, I could make another Event that also sends out the ItemCategory at the same time, but that is less than ideal. A simple FlowScript could handle this easily. Is there some way to accomplish this?
     
  3. BigToe

    BigToe

    Joined:
    Nov 1, 2010
    Posts:
    208
    I am trying to check a C# event. It almost seems like it works, but I can't figure out how to correctly check the event. The event is called "TestEvent" and it is a delegate of "TestEventDelegate".

    Do I need to subscribe to the Event with NodeCanvas, or does it do that automatically?

    In the "Event Name", do I need to put the full name including namespace? "IP.IP_GameManager.TestEvent"?

    Thanks. NodeCanvas.png
     
  4. BigToe

    BigToe

    Joined:
    Nov 1, 2010
    Posts:
    208
    I realize now I needed to be checking for System.Action. I can get that to work, but I can't get it to work with a non-system type.

    For example:
    public static event System.Action<Gesture> TestGestureAction;

    Even if the type gesture has been added to preferred types, I can't seem to check the event.

    I'm assuming I can't check the event unless it is a system string, int, float, etc...



     

    Attached Files:

  5. nuverian

    nuverian

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

    Right now it is not possible to use FlowScripts in place of transition conditions, but it is something that is under review and I am currently considering. Even though I like the premise of this, I still think that it can potentially lead up to the FSMs becoming unmanageable the more the FSM / project grows, due to each transition being a nested graph, versus writing a simple condition task for example.
    Once again though, this is something I do consider adding.

    Thanks!

    Hey,

    For everything that is related to "interfacing" with existing code (functions, fields, properties, events) through reflection, you would want to use the tasks found under the "Script Control" category.
    Thus, for checking c# code events, the condition task that you would want to use is specifically the "Script Control/Common/Check CSharp Event", or "Script Control/Common/Check Static CSharp Event", in case of a static event :)

    A few things to consider, would be:
    • Right now only events of System.Action and System.Action<T> type are possible to be checked (even though I am working on allowing any type of event for next version).
    • For both your type which has the event declared, as well as for the event argument type, you will need to add these types in the Preferred Types list if not already. Thus in your case, both "IP_GameManager" and "Gesture" types would need to be added.

    So for example:
    In this case I used float as the argument, but it could be any type as long as you add it in the Preferred Types list.
    Code (CSharp):
    1. public class ExampleClass : MonoBehaviour {
    2.     public static event System.Action<float> onMyEvent;
    3. }
    Then, using the Check Static CSharp Event (Float) and after hitting "Select Event", considering that the "ExampleClass" is in the Preferred Types list, it will show up in the pop-up menu for the event to be selected.
    CheckStaticSharpEvent.png

    Please let me know if that works for you, or if you need further explanation :)
    Thanks!
     
  6. GambitMonkey

    GambitMonkey

    Joined:
    Apr 5, 2016
    Posts:
    65
    Hello support,
    I just purchased NodeCanvas and FlowCanvas and I am currently working my way through the documentation and video tutorials. I have been using Behavior Designer for the last year or so and I am used to that work flow. One thing that I do not see in NodeCanvas that I had in Behavior Designer are tasks such as See and Hear and formation tasks.

    Are these possible in Nodecanvas?

    Thanks in advance!
     
  7. BigToe

    BigToe

    Joined:
    Nov 1, 2010
    Posts:
    208
    Thanks. Got it working and feel better :)

    I did notice that there was no CheckStaticCSharpEventValue<T> condition for some reason. I ended up creating my own task, but am not sure why that wouldn't be an option.



     
  8. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    984
    Seems to be a bug in the latest release of NodeCanvas 2.7.0. Not sure if this happens in a clean install but if it makes a difference I was updating from the last version of Nodecanvas.

    Errors pop up in ProjectVersionUpdater.cs

    Code (CSharp):
    1. //prefabs first
    2.             Debug.Log( "<b>Updating GraphOwner Prefabs...</b>" );
    3.             var prefabOwnerGUIDS = AssetDatabase.FindAssets("t:GameObject");
    4.             foreach(var guid in prefabOwnerGUIDS){
    5.                 var path = AssetDatabase.GUIDToAssetPath(guid);
    6.                 var prefabGO = (GameObject)AssetDatabase.LoadAssetAtPath(path, typeof(GameObject));
    7.                 if (PrefabUtility.GetPrefabType(prefabGO) == PrefabType.Prefab){
    8.                     OnBeforeUpdatePrefab(prefabGO);
    9.                     foreach(var prefabOwner in prefabGO.GetComponentsInChildren<GraphOwner>()){
    10.  
    11.                         prefabOwner.TryUpdateBoundGraphPriorToVersion2_6_2(); //ERROR HERE
    12.                     }
    13.                 }
    14.             }
    15.  
    16.  
    17.             //scene instances
    18.             var projectSceneGUIDS = AssetDatabase.FindAssets("t:SceneAsset");
    19.             foreach(var guid in projectSceneGUIDS){
    20.                 var path = AssetDatabase.GUIDToAssetPath(guid);
    21.                 var sceneAsset = (SceneAsset)AssetDatabase.LoadAssetAtPath(path, typeof(SceneAsset));
    22.                 if (sceneAsset != null){
    23.                     Debug.Log( string.Format("<b>Updating Scene: '{0}'...</b>", sceneAsset.name) );
    24.                     EditorSceneManager.OpenScene(path);
    25.                     OnBeforeUpdateScene();
    26.                     var owners = Resources.FindObjectsOfTypeAll<GraphOwner>();
    27.                     foreach(var owner in owners){
    28.                         if ( !EditorUtility.IsPersistent(owner) ){ //exclude prefabs since they are already done above
    29.                             owner.TryUpdateBoundGraphPriorToVersion2_6_2(); //ERROR HERE
    30.                         }
    31.                     }
    32.  
    33.                     var scene = EditorSceneManager.GetActiveScene();
    34.                     EditorSceneManager.MarkSceneDirty(scene);
    35.                     if ( !EditorSceneManager.SaveScene(scene) ){
    36.                         Debug.LogError("Could not save scene " + scene.name);
    37.                     }
    38.                 }
    39.             }
    The 'TryUpdate...' methods do not exist in the GraphOwner class.

    P.S. The performance updates for the canvas and the ability to resize the blackboard and task viewers and the animated visual highlighting for nodes were the only issues I ever had with this asset (albeit, very small ones). Thank you for absolutely perfecting this asset!
     
  9. PartyBoat

    PartyBoat

    Joined:
    Oct 21, 2012
    Posts:
    97
    Hey nuverian,

    I'm taking a look at using NodeCanvas for my project and I have a question. On the store page it say that you can "Sync variables automatically over the network using UNET, for creating multiplayer games." I'm using Photon Bolt instead of unet in my project and I was wondering if you have support for other networking systems or if you have an idea of how difficult integrating NodeCanvas with another networking system would be.

    Thanks!
     
  10. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    Thanks a lot for purchasing Node and Flow Canvas.
    There are no formation-based, or "hear" tasks included right now, but there do exist tasks like Can See, Within Range, Flee, Wander, Patrol and Seek for example already included in the main package. I could create and include a Can Hear tasks in the next version, but formation-based ones will require a bit more work. The good thing is, that if/when they are done, they will freely be included in the main package as well :)

    If you have any other tasks suggestions, by all means do let me know.
    Thanks!

    Great. Glad to hear it's working for you now :)
    Indeed, CheckStaticCSharpEventValue was omitted. I will make sure to include it in the next version.
    Thanks!

    Hey,

    Thanks a lot for your positive feedback! Appreciated :) I am really glad you like the new update! There are a lot of things I still want to do in future, that I hope you will like equally!

    Regarding the issue you are facing, the "ProjectVersionUpdater" script is totally removed from the new version, along with other scripts as well. To correctly update to v2.7.0 (and preferably every time), please remove the NodeCanvas folder completely from your project (after making a backup!) and re-import the package anew, thus for a clean "install".

    Let me know if doing so works for you without any error.
    Thanks again for your feedback!

    Hello,

    Thanks for your interest in NodeCanvas. Currently there is only support for UNET (even though there is a bug for Unity 2017 which I am working on), but integrating the same NodeCanvas variables net syncing that is possible with UNET, but in some other networking solution, should be easy to do and without changing the NodeCanvas source code, depending on how the networking library works.

    The existing UNET integration is basically done with a stand-alone component, which subscribes to the NodeCanvas Blackboard variables "onValueChanged" event.
    Code (CSharp):
    1.             var bb = GetComponent<Blackboard>();
    2.             foreach(var variable in bb.variables.Values){
    3.                 if (!variable.isProtected){
    4.                     variable.onValueChanged += OnValueChange;
    5.                 }
    6.             }

    Then after network messages are send and received accordingly, the variables are set.
    Code (CSharp):
    1.         void SyncValue(NetworkMessage msg){
    2.             var m = msg.ReadMessage<SyncVarMessage>();
    3.             var name = m.name;
    4.             var value = m.value;
    5.             var bb = GetComponent<Blackboard>();
    6.             bb.SetValue(name, value);          
    7.             waitResponseNames.Remove(name);
    8.         }

    If you want me to send you the full code of the SyncBlackboard script to take a look and judge how easy or hard it would be for you to integrate Photon Bolt for your project, just drop me a PM and I will gladly do :)

    Thanks!
     
  11. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    984
    Yep, works fine. Thanks!


    Dunno why I didn't mention this earlier since it's been an issue since Unity 2017.1 but if you attempt to create a Behavior Tree asset within the graph editor window by clicking on 'Create New' on a nested behavior tree node it will crash Unity. Haven't tried it with the nested FSM node yet.
     
    BigToe likes this.
  12. GambitMonkey

    GambitMonkey

    Joined:
    Apr 5, 2016
    Posts:
    65
    nuverian,
    Thank you for the response. The hear tasks and formation tasks would be a great addition as I use these a lot especially in my dungeon and fortress patrol AIs. Gives the NPCs that extra bit of realism that I enjoy.

    Liking NodeCanvas thus far and look forward to updates in the future :)

    Garry

     
    nuverian likes this.
  13. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Hi @nuverian

    Any chances you refactor and add some better search function to NodeCanvas ? ( like Bolt plugin for example )



    The only action we have to do is choose "Update Options" when new scripts are added or some refresh is needed, but this search function is so much better and usable.
     
  14. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    Hmm.. I have just tried in Unity 2017.2.0f3 and hitting "Create New" for creating a SuBtree from within the node, is working fine. :/ What Unity version exactly is this happening to you?

    Thanks!

    Thank you!
    Rest be assured, that updates will come :)

    Hey,
    I am really not sure what you mean by saying "better search function" though.
    If you mean a browser like the one showing in the screenshot, then there is already such a browser for both nodes and tasks in NodeCanvas (and FlowCanvas).
    In the NodeCanvas editor window and under 'Prefs' dropdown, enable the "Use Node Browser" option (which should be on by default). Let me know if you mean something different though.

    Thanks.
     
  15. basmith

    basmith

    Joined:
    Nov 10, 2011
    Posts:
    17
    hi, does NC support programmatically editing the canvas/graph at runtime? ie, adding nodes and connecting them via code, outside of unity ide, in a baked build?
     
  16. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I'm fine with that as the plugin does what it is mean to do in a good way.

    1) Search function is not great.
    You type "position" , nodeCanvas doesn't found results while Bolt propose many results.




    2) Needs more clarity presentation.
    NodeCanavs results are overbloated with unnecessary title lines.
    Tiltle lines with a too big font that could be on side of the line result instead for clarity.
    Botl displays the minimum, each line is a result.



    Anyway NodeCanavs is great as it is.
    But still the the search functionnality in NodeCanvas would really benefit from a better search and less bloated results display.
     
  17. nuverian

    nuverian

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

    Yes, it is possible to create a graph in runtime using the API. Here is a simple example for a BehaviourTree with two action tasks (wait), where one is set to a constant "wait time", while the other action's "wait time" is linked to a blackboard variable (which should exist, or also created).

    Code (CSharp):
    1. using UnityEngine;
    2. using NodeCanvas.Framework;
    3. using NodeCanvas.BehaviourTrees;
    4. using NodeCanvas.Tasks.Actions;
    5.  
    6. public class GenerateGraphExample : MonoBehaviour {
    7.  
    8.     void Start () {
    9.  
    10.         //build a simply tree
    11.         var bt = ScriptableObject.CreateInstance<BehaviourTree>();
    12.         var sequencerNode = bt.AddNode<Sequencer>();
    13.         var actionNode1 = bt.AddNode<ActionNode>();
    14.         var actionNode2 = bt.AddNode<ActionNode>();
    15.         bt.ConnectNodes(sequencerNode, actionNode1);
    16.         bt.ConnectNodes(sequencerNode, actionNode2);
    17.  
    18.         //create wait action task and give waitTime a constant value
    19.         var waitTask1 = Task.Create<Wait>(bt);
    20.         waitTask1.waitTime = 5f;
    21.  
    22.         //create another wait action task and link waitTime to blackboard variable name
    23.         var waitTask2 = Task.Create<Wait>(bt);
    24.         waitTask2.waitTime.name = "MyFloat";
    25.  
    26.         //assign action tasks to action nodes
    27.         actionNode1.action = waitTask1;
    28.         actionNode2.action = waitTask2;
    29.  
    30.         //assign BT to BehaviourTreeOwner and start it
    31.         var owner = GetComponent<BehaviourTreeOwner>();
    32.         owner.behaviour = bt;
    33.         owner.StartBehaviour();
    34.     }
    35. }
    36.  
     
    basmith likes this.
  18. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    The thing is that NodeCanvas reflection functionality, is a subset part of the tasks found under the "Script Control" category, like Execute Function, Get Property, Set Property etc. So the reflection functionality, is wrapped within these tasks which you have to add first before being able to select a function, or property respectively.
    For example, after adding a "Get Property" action task, you will get a list similar to this:
    SelectProperty.png

    In FlowCanvas on the other hand, which is designed around reflection and is a FlowGraph system similar to what Both also is, you will get everything showing in the list, without first having to add any task.
    For example:
    FlowCanvas.png


    As for the category headers, I think I could make them smaller, or at least display only the leaf category text, thus to be shorter.

    Thank you.
     
    zenGarden likes this.
  19. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    You are right, about NodeCanvas, mùost of the time, users will make their Hight level own BT nodes, so they should not use low level coding for efficiency.

    Yep some , there is some options that would be very welcome :

    - Optionnal smaller font display for the category titles (same font as the methods font)

    - Option to hide Categories

    - Option to display category First "glued" with function name.
    Example results :
    * Transform SetPosition
    * Transform GetPosition
    * Navmesh SamplePosition

    Instead of
    Functions/reflected/Transform/properties
    * GetPosition():Vector3


    - Option to hide methods signatures
    SetPosition(Vector3) : void
    Would become
    * Transform SetPosition


    Thanks.
     
  20. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    984
    Mmm, well, all of the 2017 versions. I would know because I've been frantically dancing between every version of 2017 trying to find a stable platform to develop on. At this point I'd be perfectly accepting of the answer 'It's a bug in Unity and there's nothing I can do to fix it' ;)

    A few other things of note:
    1) There's a minor bug in Actions/Blackboard/ListSpecific/GetListCount. It doesn't display it's node info correctly. The string formatting in the info property refers to the first object twice.
    2) It might be nice to have an option in DebugLogText that allows us to skip logging to console since. Sometimes I need to visually debug a lot of states on different objects simultaneously and the console just brings things to a grind.
    3) Perhaps you can consider adding an option to fade previously active nodes and connections back to neutral when they are no longer active. The sudden and jarring transition from a bright glowing line and a node box to a dull grey one was the first thing I noticed when I moved from BehaviourMachine to NodeCanvas and I still find myself trying to adjust to it. Having a node and its connection fade from its active color back to a neutral color over time can help when visually debugging because it gives you a chance to focus on what has happened in the recent past so that you aren't left scratching your head about what's going on when state changes occur very rapidly.
     
  21. basmith

    basmith

    Joined:
    Nov 10, 2011
    Posts:
    17
    seems great... what i'd like to do is enable the player to create simple behaviors at runtime, and this might be the ticket. :)
     
    nuverian likes this.
  22. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087

    Hey,
    These are some really good suggestions. Thank you. :)
    I will try them out and see which of them can work better together.

    Hey,
    Hmm. I honestly can't replicate that issue in any version I have tried and everything is working fine here :/ That is really strange. Just to cross-off from the list, what operating system are you on?

    Regarding the other things you mentioned:
    1) Done.
    2) Done as well.
    3) It's interesting that you mention that, because there is actually a special case piece of code for connections that on purpose avoids performing fading from the active color, back to the default color. For some reason, my brain couldn't sync well with fading active to inactive color, the same way as it does with having fading inactive to active color. :) I will give it another try though since you mentioned it!

    Thanks!
     
    zenGarden likes this.
  23. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    984
    Windows 10, Home Edition. Again, don't beat yourself up with this if you can't find anything. I tested a little and can only seem to replicate it in one project (of course it would have to be the main project, right?) so I'm fairly certain it's not something with NC directly.

    That's pretty cool to hear!
     
    nuverian likes this.
  24. Ladace

    Ladace

    Joined:
    Dec 7, 2014
    Posts:
    40
    @nuverian Just updated nodecanvas to the newest. It is strange that the performance in an actual build is ten times slower than in the editor (I profiled the game), which decreases my game's FPS from 60 to 30. So strange. How do I fix this? Or will there be a patch?

    [EDIT] Sorry, I figured that was my code's error in a custom action. Turns out Resources.Load won't add performance impact in the editor, while it will in the actual build, probably because the editor caches some resources.
     
    Last edited: Dec 13, 2017
    nuverian likes this.
  25. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    @nuverian I'm starting playing around with NC behaviour trees but I'm not sure how the logic works. Are all node always evaluated ? When using an "until" or "wait" node is it possible to interrupt it ?

    I'm asking that because when working on a simple enemy AI I'm not sure how I should design the BT. My enemy is very basic, it waits until the player is inside its range and then charge it. If during the charge the player jump above the enemy the enemy start to break, stop face the player. If the player is out of its range it waits if not is charge again.

    If node are always evaluated how to not "charge" again and again during the charge action (charge animation) and wait it's done before evaluated the next action. How to test the player position during the charge and interrupt it and perform the break ?
    Finally how to prevent repeating the same node again and again in a BT ? I mean, my example I will have a node attack right after the start node which contains the range test, then during the attack I have to test if the player is jumping and facing, if not, break, then test the range again and then attack again. So I have the sequence "test range and attack" twice in this little example and it could be more depending on the scenario.

    Should I consider WAIT, CHARGE, BREAK as states and have a FSM that will compute at anytime at which state the enemy should be and associate a BT for each state ?

    How would design this simple AI example ? Not asking to having you doing my job but to understand FSM and BT logic :)

    Thanks
     
  26. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hi,

    I'm posting a screenshot of BT in which I try to figured out the logic for my enemy example. Does that make sense for you ?

    Basically I always perform some verfications in order to update values, then for each "action" my AI can do (knocked, break, charge,wait) I have a Sequencer node in which the first node is a condition node. The condition node will evaluate if all required conditions are ok, if so action nodes will be execute. I put the condition node inside the sequencer node because in the first to action (Knocked, Breack) the sequencer is dynamic and I want sure it will be execute any time conditions are ok.

    Thanks
     

    Attached Files:

  27. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    All can be done in BT without FSM to keep it simple if you are starting.

    Your example AI si very simple to implement, something like that


    I suggest you following those tutorials , once you made all those tutorials you should be able to create any AI you want :
     
    nuverian likes this.
  28. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Thanks ! I will watch those tutorials. In the meantime, one question about the Conditonal node your are using in your example. When the condition returns true the linked action node is executed. For example, if distance < value then the "charge player" node will be executed. Let's say that the "charge player" node is an action that last fort 5 secondes - during those 5 seconds all other "conditonal" nodes will be evaluated in order to be able to interrupt the current onde ? I guess it is the case according my understanding of the documentation, but if I can have a confirmation from someone else it's good :)

    Thanks again.
     
  29. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    You have many decorators for Action nodes, the one you would use is "TimeOut" that interrupts the action if the action is still running after a time period.
    This is one way among other how to do it :


    Almost any AI behaviours can be done with BT while it's easy to understand when you learned the basic components.
    Follow tutorials, find new ones and experiment using the plugin, and you should be able to make any AI you need.
     
  30. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Accordind to the documentation about Reactive Evaluation : http://nodecanvas.paradoxnotion.com/documentation/?section=reactive-evaluation

    Wouldn't be best to use Sequencer marked as Dynamic and in each one having conditional node ? It's kind of the screenshot I posted earlier which was based on the documentation explanation. The point would be to be able to interrupt any node when another node condition becomes true.

    Your proposition does make senses but this approach sounds logic to me too, that's why I'm a bit lost here :)
     
  31. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    The sequencer is one running step by step in sequence and always looping, it's similar to Dynamic. There is many ways to get the same result.
    The picture is only a quick example, nothing something really i could try and debug.

    Do it as you think it's better, try other ways and you'll find what is best lol
     
  32. DarkMasster

    DarkMasster

    Joined:
    Mar 23, 2015
    Posts:
    15
    Hi Nuverian !!!

    I wanna use EditorUtils.GetTypeSelectionMenu(...) in my custom task, in OnTaskInspectorGUI. But it\s work only for classes who driven from target Type. I wanna use it for classes who implement Interface. And i't doesnt work. After investigating this problem i found part of code and fix it. Now i can use this method for display all class who implement some interface. Add this fix in nex update.

    Fix in EditorUtils.cs - check t.GetInterfaces().Contains( baseType ) )

    Code (CSharp):
    1.    
    2. public static List<Type> GetAssemblyTypes(Type baseType){
    3.  
    4.             List<Type> subTypes;
    5.             if (cachedSubTypes.TryGetValue(baseType, out subTypes))
    6.             {
    7.                 return subTypes;
    8.             }
    9.  
    10.             subTypes = new List<Type>();
    11.  
    12.             foreach (var asm in System.AppDomain.CurrentDomain.GetAssemblies()) {
    13.                 try
    14.                 {
    15.                     foreach (var t in asm.GetExportedTypes() )
    16.                     {
    17.                         if( ( baseType.IsInterface && t.GetInterfaces().Contains( baseType ) ) || ( t.IsSubclassOf( baseType ) ) )
    18.                         {
    19.                             if ( t.IsVisible && !t.IsDefined(typeof(System.ObsoleteAttribute), true))
    20.                             {
    21.                                 subTypes.Add(t);
    22.                             }
    23.                         }
    24.                     }
    25.                 }
    26.                 catch
    27.                 {
    28.                     Debug.Log(asm.FullName + " will be excluded");
    29.                     continue;
    30.                 }
    31.             }          
    32.        
    33.             subTypes = subTypes.OrderBy(t => t.FriendlyName()).OrderBy(t => t.Namespace).ToList();
    34.             return cachedSubTypes[baseType] = subTypes;
    35.         }
     
  33. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    @Kiupe

    Hey!

    Taking @zenGarden 's example and your question about reactive evaluation with the Conditional Decorator, yes the Conditional Decorators in that example will indeed re-evaluate if the parent Sequencer or Selector is set to be "Dynamic" and thus lower priority children (the ones on the right) of that Composite (Sequencer/Selector for example), will be interrupted so that the higher priority children (those on the left) can execute.

    I think for that example and since you want to treat each Conditional Decorator child as a "state", a Selector would probably be better than a Sequencer, since it will continue with the first child that returns true (from left to right).

    Thus in this example, the right most "very long" action, will be interrupted as soon as "Fire1" button is pressed down.
    ExampleDynamicSelector.png

    You can also set the Conditional Decorators themselves to be "Dynamic" as well. Marking a Conditional Decorator to be "Dynamic", will make it's assigned condition re-evaluate per-frame.

    Here is an example to illustrate a Conditional Decorator set to be "Dynamic". As you can see, the "Very Long Action" is only executed for as long as "Fire1" is Pressed Down, but as soon as I let go the button, the action is interrupted.
    DynamicConditional.gif

    If we were to have the Conditional Decorator in the above example, not be Dynamic, then as soon as "Fire1" is pressed and even if I let go off the button, the "Very Long Action" would still continue execute up to it's completion.

    Please let me know that helps :)
    Thanks.

    ---

    @zenGarden
    Thanks a lot for your input and for helping in @Kiupe 's questions!
    Much Appreciated :)

    ---

    @DarkMasster

    Hey!
    Thanks for letting me know. I think a better fix would be to simply replace 't.IsSubclassOf(baseType)' with 'baseType.IsAssignableFrom(t)' ;)
    I shouldn't have used 'IsSubclassOf' there in the first place :)
     
  34. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Hi @nuverian

    About FSM and the specific "Any State" entry. Can we have several of those in the same graph ?
    For example i would have two like that :
    - Any state : Health < 10 : Flee
    - Any state : Health item : goto item and grab
    - Any state : Alert leave zone : move and go to next zone

    How to give priority to each state ? For example first is higher priority while last is lower priority.
     
  35. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    Hi, I just purchased Node Canvas (before that I also purchased Flow Canvas) and I am starting with the Dialogue.

    I followed the documentation and made my first simple dialogue. My question is how can I change the scene after the dialogue is finished?
     
  36. grogshotgames

    grogshotgames

    Joined:
    Aug 6, 2015
    Posts:
    77
    Hi I just bought NodeCanvas (v2.7, Unity 2017.2.1f1) and it seems I'm getting a weird visual behavior from the canvas.





    I don't know if this is how it is supposed to work, but it is really uncomfortable to work like this.
     
  37. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Is there some option to turn off all detail text and only display titles ?
    I think this is something that should be available.
     
  38. grogshotgames

    grogshotgames

    Joined:
    Aug 6, 2015
    Posts:
    77
    Hi zenGarden! What do you mean with detail text? You mean the text shown in the conditionals?
    I want to see all the text that I can, but it's weird how nodes are always hiding behind action boxes.
     
  39. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Yep, i was meaning option to hide the text.
    Some option to hide connections text is what you need.
     
  40. grogshotgames

    grogshotgames

    Joined:
    Aug 6, 2015
    Posts:
    77
    I'm sorry but that wouldn't work for me. Conditionals are essential to understanding why actions are connected, so those texts are something I need to look at many times.

    I believe a better solution would be to visually treat conditionals as actions (with their own opaque boxes and arrow connections).

    @nuverian any solutions?
     
  41. nuverian

    nuverian

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

    While it is possible to have multiple "AnyState" nodes, at least right now there is no way to set priorities in those nodes.

    Thus probably the best solution if execution priority is a concern, would simply be to use a single "Any State" node with multiple transitions and rather set the priority of those transitions. :)


    Hello,

    Thanks for getting both NodeCanvas and FlowCanvas :)
    I have attached for you here a simple ActionTask named "Load Scene". You can use this action (or any action of course) within a Dialogue Tree, by adding an Action Node and assigning the action in that node. For example:
    LoadScene.png

    Let me know if that works for you, or if you need any further help.
    Thanks again.

    Hello,

    Thanks a lot for getting NodeCanvas.
    This is how the FSM transitions always were in NodeCanvas. Transition labels show in the middle of the transitions and having the full summary info display have both it's pros and it's cons. The pros are naturally the fact that you get to see what the condition does exactly. The cons are arranging the states so that they are readable.
    States are generally best arranged diagonally, like in your second screenshot.
    Thus, considering that you want to keep the full summary shown, the only real solution would be to simply move the target state further to the right, or bottom :)

    Alternatively and similar to what @zenGarden said, there is also an option to collapse the info, so that it is shown only when the transition or it's parent state is selected. This can be done by right clicking the transition label and selecting "Collapse Info". Doing so, can help keep the FSM more tidy.
    TransitionCollapseInfo.gif

    Treating transitions like nodes as per your suggestion, I think would not have a lot of difference as far as space required is concerned since the text space required would be of the same size (if not more) since the text is the same.
    One benefit I can think of though, would be that you could manually place the transition label at any position in the canvas. If that was indeed what you mean, then moving transition labels to manual position is something I am already looking at.

    Thank you.
     

    Attached Files:

    Nadan and zenGarden like this.
  42. grogshotgames

    grogshotgames

    Joined:
    Aug 6, 2015
    Posts:
    77
    Hi @nuverian the problem might be that transition labels are clearly not positioned in the middle, as you can see in the images below:





    I've been testing it for a bit and my guess is that transition labels tend to follow the next pattern:
    If you move the destination action box in Y axis, transition label tends to stay in the origin action box. If you move the destination action box in X axis, transition label tends to stay with destination action box.

    Manual positioning seems like an interesting proposal.
    Thank you!
     
    Last edited: Dec 22, 2017
    nuverian likes this.
  43. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Hi @nuverian ,

    I added a new Action task for FSM with "GameObject" category.
    It is not visible when i try to add it to some action, what must i do ?

    Also i would like a graphic simplification about FSM.
    Could you make "Action List" word on Actions optionnal, because it brings nothing to the table and i prefer only titles.

    Actual one :


    New one :


    Thanks.
     
    Last edited: Dec 22, 2017
  44. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    In my game the NPC gives player objectives and when that objective is done there is a PlayerPrefs value that is changed. So the player talks to the NPC then goes away, completes the task and comes back.

    How would you recommend me to change the dialogue based on if the player has completed the quest or something else (different PlayerPrefs value) or not? Should I do different dialogue trees for each situation and make separate script to activate the right dialogue tree, or could I just do that all within the dialogue tree itself?
     
  45. Schazzwozzer

    Schazzwozzer

    Joined:
    Jul 27, 2012
    Posts:
    18
    Using NodeCanvas Lite, I've got a situation where some Behavior Tree asset seem to be corrupted(?) in some weird way. Any time they're accessed, multiple Deserialization Errors are raised in the console. Fortunately, I've found that editing them in any way (even simply moving a node) seems to fix the error, but it's still a bug that lost me several hours (I was originally convinced it was related to an upgrade to 2017.3).

    This is with the latest version of NodeCanvas Lite, 2.6.2.

    Code (CSharp):
    1. <b>(Deserialization Error)</b>: Unable to cast <0.5> (with type = System.Double) to type System.Collections.Generic.Dictionary`2[System.String,ParadoxNotion.Serialization.FullSerializer.fsData]
    2.   at ParadoxNotion.Serialization.FullSerializer.fsData.Cast[Dictionary`2] () [0x00065] in E:\Projects\Unity\DungeonGolf\Assets\Plugins\ParadoxNotion\NodeCanvas Lite - BT\Framework\_Commons\Runtime\Serialization\Full Serializer\fsData.cs:276
    3.   at ParadoxNotion.Serialization.FullSerializer.fsData.get_AsDictionary () [0x00002] in E:\Projects\Unity\DungeonGolf\Assets\Plugins\ParadoxNotion\NodeCanvas Lite - BT\Framework\_Commons\Runtime\Serialization\Full Serializer\fsData.cs:253
    4.   at ParadoxNotion.Serialization.fsRecoveryProcessor`2[NodeCanvas.Framework.BBParameter,NodeCanvas.Framework.Internal.MissingBBParameterType].OnBeforeDeserialize (System.Type storageType, ParadoxNotion.Serialization.FullSerializer.fsData& data) [0x0001c] in E:\Projects\Unity\DungeonGolf\Assets\Plugins\ParadoxNotion\NodeCanvas Lite - BT\Framework\_Commons\Runtime\Serialization\fsRecoveryProcessor.cs:21
    5.   at ParadoxNotion.Serialization.FullSerializer.fsSerializer.Invoke_OnBeforeDeserialize (System.Collections.Generic.List`1 processors, System.Type storageType, ParadoxNotion.Serialization.FullSerializer.fsData& data) [0x00012] in E:\Projects\Unity\DungeonGolf\Assets\Plugins\ParadoxNotion\NodeCanvas Lite - BT\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:169
    6.   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) [0x00017] in E:\Projects\Unity\DungeonGolf\Assets\Plugins\ParadoxNotion\NodeCanvas Lite - BT\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:801
    7.   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) [0x0005b] in E:\Projects\Unity\DungeonGolf\Assets\Plugins\ParadoxNotion\NodeCanvas Lite - BT\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:744
    8.   at ParadoxNotion.Serialization.FullSerializer.fsSerializer.TryDeserialize (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType, System.Type overrideConverterType, System.Object& result) [0x00049] in E:\Projects\Unity\DungeonGolf\Assets\Plugins\ParadoxNotion\NodeCanvas Lite - BT\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:705
    9. UnityEngine.Debug:LogError(Object)
    10. ParadoxNotion.Serialization.FullSerializer.fsSerializer:TryDeserialize(fsData, Type, Type, Object&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:716)
    11. ParadoxNotion.Serialization.FullSerializer.Internal.fsReflectedConverter:TryDeserialize(fsData, Object&, Type) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/Converters/fsReflectedConverter.cs:97)
    12. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_5_Converter(Type, fsData, Type, Object&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:887)
    13. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_4_Cycles(Type, fsData, Type, Object&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:879)
    14. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_3_Inheritance(Type, fsData, Type, Object&, List`1&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:858)
    15. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_1_CycleReference(Type, fsData, Type, Object&, List`1&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:744)
    16. ParadoxNotion.Serialization.FullSerializer.fsSerializer:TryDeserialize(fsData, Type, Type, Object&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:705)
    17. ParadoxNotion.Serialization.FullSerializer.Internal.fsReflectedConverter:TryDeserialize(fsData, Object&, Type) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/Converters/fsReflectedConverter.cs:97)
    18. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_5_Converter(Type, fsData, Type, Object&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:887)
    19. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_4_Cycles(Type, fsData, Type, Object&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:879)
    20. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_3_Inheritance(Type, fsData, Type, Object&, List`1&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:858)
    21. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_1_CycleReference(Type, fsData, Type, Object&, List`1&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:744)
    22. ParadoxNotion.Serialization.FullSerializer.fsSerializer:TryDeserialize(fsData, Type, Type, Object&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:705)
    23. ParadoxNotion.Serialization.FullSerializer.fsSerializer:TryDeserialize(fsData, Type, Object&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:678)
    24. ParadoxNotion.Serialization.FullSerializer.Internal.fsIEnumerableConverter:TryDeserialize(fsData, Object&, Type) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/Converters/fsIEnumerableConverter.cs:73)
    25. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_5_Converter(Type, fsData, Type, Object&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:887)
    26. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_4_Cycles(Type, fsData, Type, Object&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:879)
    27. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_3_Inheritance(Type, fsData, Type, Object&, List`1&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:858)
    28. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_1_CycleReference(Type, fsData, Type, Object&, List`1&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:744)
    29. ParadoxNotion.Serialization.FullSerializer.fsSerializer:TryDeserialize(fsData, Type, Type, Object&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:705)
    30. ParadoxNotion.Serialization.FullSerializer.Internal.fsReflectedConverter:TryDeserialize(fsData, Object&, Type) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/Converters/fsReflectedConverter.cs:97)
    31. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_5_Converter(Type, fsData, Type, Object&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:887)
    32. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_4_Cycles(Type, fsData, Type, Object&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:879)
    33. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_3_Inheritance(Type, fsData, Type, Object&, List`1&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:858)
    34. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_1_CycleReference(Type, fsData, Type, Object&, List`1&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:744)
    35. ParadoxNotion.Serialization.FullSerializer.fsSerializer:TryDeserialize(fsData, Type, Type, Object&) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/Full Serializer/fsSerializer.cs:705)
    36. ParadoxNotion.Serialization.JSONSerializer:Deserialize(Type, String, List`1, Object) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/JSONSerializer.cs:96)
    37. ParadoxNotion.Serialization.JSONSerializer:Deserialize(String, List`1, GraphSerializationData) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/_Commons/Runtime/Serialization/JSONSerializer.cs:67)
    38. NodeCanvas.Framework.Graph:Deserialize(String, Boolean, List`1) (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/Runtime/Graphs/Graph.cs:132)
    39. NodeCanvas.Framework.Graph:Deserialize() (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/Runtime/Graphs/Graph.cs:77)
    40. NodeCanvas.Framework.Graph:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize() (at Assets/Plugins/ParadoxNotion/NodeCanvas Lite - BT/Framework/Runtime/Graphs/Graph.cs:47)
    41. UnityEditor.DockArea:OnGUI()
    42.  

    I've attached the simplest of the problem Behavior Trees. Hope it helps you track down whatever is causing the issue.
     

    Attached Files:

  46. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Happy New Year Everyone!
    Sorry for the late replies due to holidays.

    Hey,
    Do you mean that it doesn't show up in the menu for adding actions in the FSM state?
    Can you please post your custom action task?
    I will also take a look at your suggestion by the way :)
    Thanks!

    Hey,
    You can branch a Dialogue Tree based on some condition, without complicating it with SubTrees, simply by using the nodes found under the "Branch" category, specifically the 'Task Condition' or 'Multiple Task Condition' nodes.
    These nodes can work with any of the included Condition Tasks, or your own custom Conditions Tasks made if so required.

    For example, using the "Task Condition" node:
    BranchDialogue.png

    Or using the "Multiple Task Condition" node, if you want to branch the dialogue based on multiple condition checks:
    MultiBranchDialogue.png

    For the purpose of these examples above, I've also made a custom Condition Task that checks an integer value from PlayerPrefs, since that was your example case :)

    Code (CSharp):
    1. using NodeCanvas.Framework;
    2. using ParadoxNotion.Design;
    3. using UnityEngine;
    4.  
    5. [Category("PlayerPrefs")]
    6. public class CheckPlayerPrefsInt : ConditionTask {
    7.  
    8.     public BBParameter<string> key;
    9.     public BBParameter<int> check;
    10.  
    11.     protected override string info{
    12.         get {return string.Format("Prefs {0} == {1}", key, check);}
    13.     }
    14.  
    15.     protected override bool OnCheck(){
    16.         return PlayerPrefs.GetInt(key.value) == check.value;
    17.     }
    18. }
    19.  

    Let me know if the above helps, or if you have any other questions.
    Thanks!


    Hello,

    I am sorry about the issue and thanks for the report.
    I wasn't able to properly test with the assets you posted because there are a lot of types used in those assets which I don't have or are included in the zip, but based on your posted error log, a quick fix would be to please open up fsRecoveryProcessor.cs and add the following lines of code at the start of the OnBeforeDeserialize method:
    Code (CSharp):
    1.             if (!data.IsDictionary){
    2.                 return;
    3.             }
    I will update NodeCanvas Lite to the latest framework version 2.7 very soon by the way!
    Thank you!
     
    Kapteeni-Studios and zenGarden like this.
  47. TSabos

    TSabos

    Joined:
    Mar 8, 2015
    Posts:
    94
    When updating a node and a Dialog Tree being open in editor.. sometimes the entire tree is wiped if a node I edit code for is in use in the tree. Besides ensuring any time I edit any code involved in any open BT/DT etc to close the window, is there any other way to ensure I don't lose the tree? It wipes the blackboard variables (literally deletes every known variable, not even there.. not just resets to Default(T) and everything.. sometimes even when there is no compiler error. Hard to repro.. fun one I know, sorry. I've lost 2 DTs now making custom nodes and they were an hour of work ea.
     
  48. markoal

    markoal

    Joined:
    Aug 31, 2015
    Posts:
    30
    Hi!
    I'm using n-array tree (multiple connected nodes) for some in game world generation.
    I wonder, can I use this asset to visualise my tree.
    I don't need any additional logic like BT, dialog system, only creation and representation of some Tree data(like on image bellow).

    And when I click on each node i have few custom properties.
    Is this possible to create using this asset? If it is I would appreciate hints on how to do it.
     
  49. nuverian

    nuverian

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

    Hmm. This is the first time I am being reported this issue and is something that should definitely not happen of course.
    I am trying to replicate this but I don't seem able to do so in any way :/
    What version of Unity and NodeCanvas are you using?
    Is there anything logged in the console when that happens?
    Have you by any chance moved NodeCanvas in a different assembly folder (eg Plugins)?
    Please let me know.
    Thank you!

    Hello,
    NodeCanvas is really made to create logic using the editor to design Behaviour Trees, FSMs, or DialogueTrees, rather than visualizing existing logic. Even though what you want to do might be possible by creating a new graph system using the NodeCanvas framework, it might not be as convenient since that is not what the tool is made for.
    I would thus recommend checking out RelationsInspector, which is a tool that is made for visualizing existing logic similar to what you want to achieve as far as I understand.

    Cheers!
     
    markoal likes this.
  50. TSabos

    TSabos

    Joined:
    Mar 8, 2015
    Posts:
    94
    Unity 2017.2.0f3 and NC 2.6.3 all default locations.

    This seems to possibly happen with the following scenarios:
    Make a prefab with a Dialog Tree on it, bound graph.
    Create several nodes as a template and then use Ctrl + D to create a duplicate of it.
    Change some code in one of the nodes while leaving it open and then it might blank the whole tree, no errors or warnings.

    This is very.. very isolated and rare but I will try to force it to happen again if I can.

    Something weird I noticed with Ctrl + D is it (sometimes, rarely) has the name of the "template" tree at the top left of the window. I have since started dragging it to scene, renaming, and then dragging back to assets to create an entirely new prefab instead of Ctrl + D and haven't seen the issue. Something weird with serialization possibly clashing.. could even be Unity's fault, will avoid using duplicating directly in assets entirely for now but will still try to break it in case it's in NC somehow.