Search Unity

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

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

  1. Evgeny-Eliseev

    Evgeny-Eliseev

    Joined:
    Jan 21, 2015
    Posts:
    19
    I thought you can it easily reproduce, but ok.

    I have Unity 5.3.2f. While exporting clean NodeCanvas 2.4.2 project to Windows Store Apps 8.1 I get (Unity C# Project is checked, Development Build is checked, Compilation Overrides is set to Use Net Core, Scripting Backend is set to .NET):

    Code (CSharp):
    1. Assets\NodeCanvas\Framework\Runtime\Graphs\Graph.cs(12,36): error CS0234: The type or namespace name 'Formatters' does not exist in the namespace 'System.Runtime.Serialization' (are you missing an assembly reference?)
    If I fix that, I get new errors:

    Code (CSharp):
    1. Assets\NodeCanvas\Framework\_ParadoxNotion (shared)\Runtime\Serialization\FullSerializer\Converters\fsIEnumerableConverter.cs(50,25): error CS1061: 'System.Type' does not contain a definition for 'IsGenericType' and no extension method 'IsGenericType' accepting a first argument of type 'System.Type' could be found (are you missing a using directive or an assembly reference?)
    2.  
    3. Assets\NodeCanvas\Framework\_ParadoxNotion (shared)\Runtime\Serialization\FullSerializer\Internal\fsPortableReflection.cs(53,20): error CS1502: The best overloaded method match for 'ParadoxNotion.Serialization.FullSerializer.Internal.fsPortableReflection.GetAttribute(System.Type, System.Type)' has some invalid arguments
    4.  
    5. Assets\NodeCanvas\Framework\_ParadoxNotion (shared)\Runtime\Serialization\FullSerializer\Internal\fsPortableReflection.cs(53,33): error CS1503: Argument 1: cannot convert from 'System.Reflection.TypeInfo' to 'System.Type'
    6.  
    7. Assets\NodeCanvas\Framework\_ParadoxNotion (shared)\Runtime\Services\MessageRouter.cs(288,36): error CS1061: 'System.Delegate' does not contain a definition for 'Method' and no extension method 'Method' accepting a first argument of type 'System.Delegate' could be found (are you missing a using directive or an assembly reference?)
    I can fix that by adding to first error 'false' to call, and just commenting code out for others

    Build is fine after that and launches ok.


    But Project with game is still not work correctly. We have some problems with subfsm's. Set Blackboard variable doesn't update that variable on level above. In editor, android, ios all is ok. I tried to reproduce similar cases in Clean Project but looks like fine for WinStore.

    We still digging what S*** is going on =)
     
  2. florianbepunkt

    florianbepunkt

    Joined:
    Nov 28, 2015
    Posts:
    45
    Hi, I'm thinking about purchasing this asset. I saw that besides other functions Node Canvas supports Dialogue Tress. Is it also possible to build quests? I had a look at the Dialogue System asset by Pixel Crushes which focuses on Dialogue and Quests mainly. So I wondered if Node Canvas is able to help in creating a basic quest system and if so what would be a good genereal approach to this. I like the idea to have an AI and dialogue and quest solution in one asset :)
     
  3. doq

    doq

    Joined:
    Aug 17, 2015
    Posts:
    121
    @nuverian I've been looking for Super Action State as well. Having coded my own state machine and then coming to NodeCanvas I found it awkward not having the ability to call a function to clean up state on Exit.

    From a programmer perspective, I think you should include it as a standard state node with the caveat that anyone using it should be aware that anything running on Exit should run to completion (synchronously) before entering the next state.
     
  4. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    Sorry for late response. I've replied to your PM.
    Thanks.

    Hello,
    There is no included system specificaly for quest, but depending on what you are after, you may be able to build a quest graph with the NC FSMs or Dialogue Trees, since with both you can call actions, check conditions and do branching. Let me know of an example you are after and I will let you know back of how it could be approached with NodeCanvas :)
    Thanks.

    Hello,
    Thanks for your suggestion. I will include it in the next version by default.
     
  5. florianbepunkt

    florianbepunkt

    Joined:
    Nov 28, 2015
    Posts:
    45
    Thanks for the quick reply. looking forward to play around with NodeCanvas!
     
    nuverian likes this.
  6. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    Does NC support all platforms? The new version up on the asset store, and it seems now there is an additional step for AOT platforms?
     
  7. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    There is nothing changed as far as platform support :)
    The only thing that changed is that now you will have to generate the AOT classes through the Preferred Types editor if you are targeting an AOT platform like iOS, instead of having the file in the package by default. It's a very simple step. Just open the editor and press "Generate AOT Classes" :)
     
  8. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Speaking of the new version 2.4.3, here are the changes for everyone :)

    FSM
    Added Super Action State as it was requested by some people. This is a new FSM state node, that has a different action list for each of each OnEnter, OnUpdate and OnExit callbacks.
    SAS.png

    Dialogue Trees
    There are some nice improvements in the Dialogue Tree module after some people feedack.
    • The OnGUI dialogue UI has been removed completely in favour of the new improved UGUI dialogue UI.
    • There are two new option in the dialogue UI prefab:
    • - "Skip On Input" if enabled will skip the dialogue text to the next node.
    • - "Wait For Input" if enabled will only continue after the user presses any input.
    • The last spoken dialogue text will now show along with the Mutliple Choice options
    • Improved Multiple Choice node so that the options are irelevant of the connections, so that there is no more the need to first connect a child node for an option to be added.
    MC.png

    The Rest
    • Dynamic Vars are now also allowed for the agent parameter.
    • Improved Script Control Tasks, to show all preffered Component Types to choose a method/property/field from, instead of only the component types that are currently attached on the agent game object.
    • Fixed AnyState "No Retrigger" bug, that was ignoring states after the first.
    • Last but not least, you will now have to generate the AOT classes file through the Preferred Types editor (single click), if you are targeting an AOT platform like iOS. This is only needed once before publishing.

    Cheers!
     
  9. doq

    doq

    Joined:
    Aug 17, 2015
    Posts:
    121
    I'm running into an issue with logging into the NodeCanvas forums. Once I log in it takes me to a Wordpress dashboard.

    But that's tangential to my real issue. I'm having trouble getting Visual Studio run in Debug and attach to Unity. I'm getting a bunch of errors in a variety of files like this:

    Error CS0246 The type or namespace name 'GenericMenu' could not be found (are you missing a using directive or an assembly reference?)

    Unity can play my project with NC just fine, but Visual Studio only complains when I try to attach. I don't have problems with other assets and this issue only came up recently after installing Visual Studio Tools for Unity 2.2. VSTools is probably involved, but I'm not sure 100% sure. Any ideas on how to resolve this?
     
  10. doq

    doq

    Joined:
    Aug 17, 2015
    Posts:
    121
    Despite the errors I'm getting in VS, it looks like I can still attach and debug just fine.
     
  11. BigToe

    BigToe

    Joined:
    Nov 1, 2010
    Posts:
    208
    I'm trying to figure out how to check C# Events that are custom, or from another plugin (EasyTouch) Specifically I am haven't found out how to hook them up.

    I add a conditional node from a BT and ad a task of type Check C# Event. When I choose the "Select Event" button it provides me a list, but everything is grayed out and not selectable. I have created a custom class with a C# event and attached it to the Game Object, but can't get that to work either. Still a grayed out menu.

    What is the proper way to subscribe to a static C# event from another class and add it to Node Canvas? If there is a link to documentation, just let me know.

    Thanks

    (Image Below is from a FSM, but same issue arises with BT)




    Also, here's the TestEvent class I am trying to subscribe to.
    Code (CSharp):
    1. public class TestEvent : MonoBehaviour {
    2.    
    3.     public delegate void CheckTest ();
    4.     public static event CheckTest OnCheckTest;
    5.  
    6.     // Use this for initialization
    7.     IEnumerator Start () {
    8.         yield return new WaitForSeconds (2);
    9.         OnCheckTest();
    10.     }
    11. }
     
    Last edited: Feb 12, 2016
  12. floraffray

    floraffray

    Joined:
    Jan 12, 2014
    Posts:
    5
    Just bought nodeCanvas last week and am starting to familiarize myself with it. Documentation is thorough and clear :) Hoping as more and more people use it folks will make some tutorials as well. I tend to prefer reading to watching videos to learn a new tool but sometimes at the very start it's nice to have a few video tutorials showing the process to kind of get a sense of it which then makes it easier to connect the documentation to the process as you read through it.

    One suggestion for the future development of nodeCanvas is implenting something like the "backdrops" in Nuke (the highly acclaimed node-based compositing software people use in visual effects). Essentially they're just colored squares that you can slide around under the actual nodes to help visually organize your workflow. When node trees start to get unwieldy they are an invaluable tool to help scan your tree and move around the different areas of it.


    here's a link to some images of what the backdrops look like and hopefully they give a sense of their use when you have large node trees:
    https://www.fxguide.com/wp-content/uploads/2012/05/earth_Nuke.jpg
    http://www.valvfx.com/wp/wp-content/uploads/2013/11/Capture-d’écran-2013-10-29-à-08.51.38.png
     
  13. BigToe

    BigToe

    Joined:
    Nov 1, 2010
    Posts:
    208
    While not as colorful as the backdrop from Nuke, Node Canvas does have the Canvas Group feature which can help you organize...But perhaps you have already seen them and want a little more control.



    http://nodecanvas.paradoxnotion.com/documentation/
    Look at section 2.3 for Canvas Groups.
     
    nuverian likes this.
  14. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Thanks for letting me know. I will check this out as well, although it indeed seems a VS thing, since all UnityEditor calls are wrapped within #if UNITY_EDITOR in NC scripts, like the GenericMenu you mentioned.
    Regarding the forums issue, I think it's now fixed, but do let me know if not.

    Thanks.



    Hey,
    The Check C# Event condition task only supports the System.Action delegate, or System.Action<T> in case you use the Check C# Event<T>. I can look into the possibility of supporting custom delegate types though :)
    Let me know if this works for you.
    Thanks!



    Hello and thanks!
    I've actually used Nuke in production since my other half life is as a CG Artist (link in signature) :) and NC has been inspired by it as well. Like @BigToe mentioned, there is such a thing already, but do let me know if you have any suggestions to improve it.
    Thanks again and cheers!
     
  15. BigToe

    BigToe

    Joined:
    Nov 1, 2010
    Posts:
    208
    OK. I am clearly mixing up my delegate concepts. A sample of how a System.Action delegate would be used in Node Canvas would be great.

    Thanks
     
  16. BigToe

    BigToe

    Joined:
    Nov 1, 2010
    Posts:
    208
    Heya. Your server seems to be down and I am unable to access NC documentation. Just letting you know.

    Thanks
     
  17. Wilbert-Blom

    Wilbert-Blom

    Joined:
    Aug 13, 2011
    Posts:
    109
    Last edited: Feb 17, 2016
  18. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    Sorry for the late reply!

    So, you can have this MonoBehaviour for example:
    Code (CSharp):
    1. public class Example : MonoBehaviour{
    2.  
    3.     public event System.Action<float> OnDamageReceived;
    4.  
    5.     void Update(){
    6.         if (Input.GetKeyDown(KeyCode.Space)){
    7.             if (OnDamageReceived != null){
    8.                 OnDamageReceived(Time.time); //the more the time the more the damage :)
    9.             }
    10.         }
    11.     }
    12. }
    Then, in NodeCanvas, you can use the "Check CSharp Event (float)" and the event will be there for you to chose, considering the above Example.cs script is on the agent gameobject :)

    Let me know if that works for you.
    Thanks!

    There were some issues with the web hosting company.
    Hopefully everything is fixed now.

    Thanks.
     
  19. BigToe

    BigToe

    Joined:
    Nov 1, 2010
    Posts:
    208
    Yes. I did get it to work. I tried something similar, but must have crossed wires with Action types. Still would love to see the custom delegate if possible...But will make this work for now.

    Thank you
     
  20. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    The new version is live on the asset store :)

    The basic changes are the fact that it now works with WebGL and also has a big deserialization performance boost.
    To make it work with WebGL, you will need to automaticaly build the AOTClasses.cs and link.xml files through the relevant button in Preferred Types Editor.

    @BigToe I will take a look at this for the next version :)
     
  21. Falagard

    Falagard

    Joined:
    Jan 8, 2014
    Posts:
    43
    Back in November there was a post from DarkMasster that NodeCanvas had both performance and memory issues when instantiating a high number of objects.

    http://forum.unity3d.com/threads/no...es-dialogue-trees.227190/page-28#post-2400182

    Nuverian, you mentioned that the deserialization speed problems have been fixed, but haven't mentioned anything about memory usage.

    I'm not really looking at instantiating 500 to 1000 objects, but was hoping to perhaps hit around 100 to 200 for my game and am a bit concerned about memory usage on mobile devices. Any comments on this?
     
  22. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,513
    Regarding DialogueTrees, I'm a little confused as to why in DialogueTree, the *RequestInfo Actions do not have a DialogueTree parameter, like the other 3 Actions. Instead, I see a static currentDialogue. Is this the dialogueTree that is active when the *RequestInfo Actions fire? I'm planning to have multiple dialoguetrees active at any one time. This is why I ask.
     
  23. nuverian

    nuverian

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

    The memory usage was part of the deserialization performance and have been improved since then quite a lot. There is always going to be some GC when deserializing, but it's certainly not as high now as it was back when the post was written. In any case though, it would always be good to avoid instantiating massive amount of objects in one frame, as there is almost certain to be a hickup even if a slight one.

    Thanks.

    Hello,

    Currently the Dialogue Tree module is build around the concept that only one Dialogue Tree is active at any moment. If you take a look at the OnGraphStarted of the DialogueTree.cs, you will see that it's checking to see whether another dialogue is currently active and if so, stop that other dialogue before starting the new one.

    I could make the Dialogue Trees module allow multiple current dialogue tree running easily, but I think this doesn't make a lot of sense in the context of the UI, since naturaly there can only be one Multiple Choices UI showing for example. Of course maybe your use case is something quite different, in which case I'd really like to hear about it :)

    Also, the *RequestInfo static events don't include the DialogueTree in their arguments since they are only ment to contain what the UI needs to show, but yes, as you've guessed, the currentDialogue tree is the one active when those are raised.

    Let me know.
    Thanks
     
  24. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,513
    Thanks for the prompt response, @nuverian. The explanations behind the design of the Dialogue Tree module sound reasonable. I wouldn't modify the design of it unless you feel like it may benefit more customers.

    Basically, the use case is, if you are in conversation with one character, and by chance, another character appears and you would like to start a conversation with this new character, the first character's conversation would stay paused. With the current design, you would have to terminate the dialogue. What if the player wants to continue the conversation with the first character after finishing up with the second character? Basically, I'll have to store my own dialogue/conversation state for that character, and initiate a new dialogue with appropriate text.

    Something like this:
    Player: "Hello"
    NPC1: "Hi. Do you need any help with anything?"
    NPC2 enters
    Player breaks off conversation with NPC1
    Player: "Hello to you, NPC2. Can you hold on for a second?"
    Player resumes conversation with NPC1
    NPC1: "How rude!"
    or
    NPC1: "As I was asking, do you need any help?"

    Essentially, this means I will keep my own conversation state per character, and if a dialogue is terminated, that state is maintained, and becomes the context for a new conversation with the player.

    No worries, as this sort of state data should be stored with the game AI anyway.

    Thanks for responding!
     
  25. Brian-Kehrer

    Brian-Kehrer

    Joined:
    Nov 7, 2006
    Posts:
    411
    Hey - for various reasons, I'm serializing my own FSM (not using the NC one). But I love your editor. Can FlowCanvas handle assignment of scriptable objects and array data? I don't want to add additional deserialization (e.g. I don't want to use the runtime, just the editor tools).

    I've considered ripping the guts out of the NC editor for my own types, but that would be a lot of work.
     
  26. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087

    Hey!
    Sorry for late reply!

    A thing that I've beed looking at implementing to support this case, is the SubDialogueTree node for Dialogue Trees. So based on some conditions you would be able to go through the path that fires the SubDialogueTree node. As soon as that node is finished, the initial dialogue tree would continue. Hopefully this new SubDialogueTree node will soon be included :)
    For example:
    DLG1.png

    DLG2.png

    Is that something that would work in your case?
    Cheers!

    Hello and thanks. Glad you like the editor.
    Can you please provide a bit more info on what you mean by your question, or want to do?
    Do you want to use a different type in place of the NodeCanvas Node type in place of nodes, thus basicaly use just the editor UI on top of your own runtime system instead for the NC runtime system, or something different?

    Let me know.
    Thanks
     
  27. nuverian

    nuverian

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

    I have uploaded an extension package for EasySave. As always you can download it in the downloads section here.

    Cheers!
     
    GamerPET and hopeful like this.
  28. BigToe

    BigToe

    Joined:
    Nov 1, 2010
    Posts:
    208
    I am trying to do something relatively simple and am struggling a little.

    I have a CheckTrigger Task that is running and waiting for a trigger event. From that, I want to save the GameObject or Transform of the colliding object to the blackboard. Currently the CheckTrigger task allows me to save the GameObject.

    Next I would like to be able to access a component from the GameObject I just saved to the blackboard. The problem is that all of the GetComponent tasks take a Transform instead of a GameObject. Honestly I am not sure how to get the component off of the GameObject I just added to the blackboard. For now I am just writing my own CheckTrigger task that saves to a Transform instead of a GameObject.

    Any advice?
     
  29. BigToe

    BigToe

    Joined:
    Nov 1, 2010
    Posts:
    208
    I think I got it figured out....Get Component does seem to work on a GameObject after all, but I was looking to grab a component at the root of my GameObject and not the collider...I ended up writing a GetComponentInParent version of the task.

    It is a little confusing because the highlighted red text says (Transform), but the type is actually a GameObject. I'm not sure if that means it is casting to a Transform or what...Just made me believing a Transform was required.




     
  30. nuverian

    nuverian

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

    All Tasks are able to work with both a gameobject type or a component of the type required in the parenthesis.
    The required type is fetched through GetComponent at initialization of the task, in case the reference is not already of such a type.
    So on a navigation based task for example where a NavMeshAgent is required, you can either provide the task with a NavMeshAgent variable or a gameobject which has a NavMeshAgent. This is obviously done for convenience and is easier to work with variables this way.
    The 'Transform' type is used when no special component type is required, since all gameobjects always have a transform. It's basicaly one and the same :)

    Cheers!
     
  31. BigToe

    BigToe

    Joined:
    Nov 1, 2010
    Posts:
    208
    Thanks for the clarification!

     
  32. timmehhhhhhh

    timmehhhhhhh

    Joined:
    Sep 10, 2013
    Posts:
    157
    Aside from FindObjectOfType(typeof(DialogueTree)), how might one get a dialogue tree at runtime? I want to be able to do something like GetComponent<DialogueTree>(), but it is not a component.
     
  33. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,513
    I asked @nuverian about that last month. I don't remember where the convo was, but here was the key piece of code:
    Code (CSharp):
    1. DialogueTree tree = (DialogueTree)(object)mDialogueTreeObject.GetComponent(typeof(IScriptableComponent));
    He said it was messy, but I say, "if it works, it works."
     
    nuverian likes this.
  34. JMax

    JMax

    Joined:
    Apr 10, 2015
    Posts:
    4
    When serializing nested FSM in .json file contains a host name field, but there is no field in which i can determine what Asset been used as nested.
    You can add this field to .json file?
     

    Attached Files:

  35. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    Please see the answer that @aer0ace provided. This is exactly how you would get a Dialogue Tree reference in code.
    Thanks.

    Hello,
    I could add the name of the asset being used in the json, but it's really something that doesn't actually need to be serialized, so I would prefer avoiding this :) Can I ask for the use case behind this requirement?
    Thanks in advance.
     
  36. timmehhhhhhh

    timmehhhhhhh

    Joined:
    Sep 10, 2013
    Posts:
    157
  37. JMax

    JMax

    Joined:
    Apr 10, 2015
    Posts:
    4
    Of course.
    For example: We have a large FSM consisting of a set of nested FSM.
    I save it in a file json big fsm and nested fsm. Then, I need to restore the machine from json file. But i can't do this, because I do not know what both called nested FSM before.
     
  38. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    Hi,

    I recently purchased your NodeCanvas utility and followed the quick start guide. Aside from some small difference which weren't a problem, I do have on major issue. Both your store documentation and the quick start guide make mention of the visual debugging that should show on the graph/tree when playing, but mine is not doing this. I made the same simple behaviour tree as in the quickstart guide and the tree does work, but there is absolutely none of the visual debugging or state indication shown in my canvas as indicated on the documentation.
     
  39. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello again,
    I see. Is there a reason not using an fsm asset and instead re-create the fsm manually through the json files? Well, I am sure there is, but if you'd like to share that would be great :)
    I will take a look at serializing the name of the nested behaviours used in the next update.
    Thanks.

    Hello and thanks for getting NodeCanvas.

    That's a really weird issue. Could it be that your behaviour tree is an asset and you have the asset file selected instead of the gameobject using the behaviour tree? Sorry if it's a ridiculus question, but I just want to rule out the possiblities.
    Also, what version of Unity are you using?

    Please let me know. Thanks.
     
  40. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    It was an asset tree, but i'm not sure what you mean by the selection.

    That said I bound the asset to the GO and it worked. I then deleted the whole thing, made it a second time again using asset and this time it worked fine.

    So I don't know what the issue was but it appears to be working as expected, for now at least :)
     
  41. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Thanks for letting me know. Regarding the selection question, I just ment that you may had the asset file selected in the Project rather than the gameobject selected in the Hierarchy and as such the editor was showing the asset, not the runtime graph, but If this wasn't the case or if it happens again, by all means please let me know.
    Thanks!
     
  42. nuverian

    nuverian

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

    I have uploaded an extension for NodeCanvas and SLATE Cutscene Director (a new tool of mine just released :)), that allow controlling some of the cutscenes most important functionality from within NC.

    NC_SLATE.png

    The integration is two-fold, which means that there also exist clips for SLATE for enabling/disabling NC behaviours, sending events, or changing variables.

    SLATE_NC.png
    You can download the extension as usual from here, or from SLATE website here.

    Cheers!
     
  43. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    Will this replace dialogue system?
     
  44. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey!
    Do you mean SLATE replacing dialogue trees in NC? If so, no, not at all. Can you please clarify, cause I'm a bit puzzled by the question :)?
    Thanks!
     
  45. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    Yes that is what I asked. They seem to do similar tasks.
     
  46. BigToe

    BigToe

    Joined:
    Nov 1, 2010
    Posts:
    208
    What is the best approach for calling a Script Control function that needs to be called on FixedUpdate? Do I need to write a custom task in order to handle this?

    Thanks in advance!
     
  47. Deleted User

    Deleted User

    Guest

    Hi nuverian!

    I'm using a combination of FSM and BTs and is working quite well so far but I'd like to add some features and I can't find the right way to do it.

    I have a "Damaged" state which is activated from "Any State" every time the enemy receive an specific Event. What I want is to pause other states before going to "Damaged" and restore them (the one which was running before receiving the Event) at the same point where they left. Is that possible?

    My problem comes when the player attacks an enemy who is about to attack, he goes to "Damaged" and once its finished, "Attack" BT starts again from the very beginning, activating the animation and all the stuff, making it looks so weird. I'd like to restore "Attack" BT in the same node where it was before getting damaged.

    Cheers!
     
  48. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    I really don't know how to compare dialogue trees with a cutscene editor. Slate specialize in synced timeline-based cinematics with camera direction, keyframed animation, editor preview etc. Dialogue trees specialize in non-linear conversations between characters :)
    If you have any questions, please ask and I will be glad to clarify.

    Hey,
    Yes, you will need to create a custom action to handle FixedUpdate, but there are some things that could help you in that. Here is an example:
    Code (CSharp):
    1. using NodeCanvas.Framework;
    2. using ParadoxNotion.Services;
    3.  
    4. public class FixedUpdateExample : ActionTask {
    5.  
    6.     protected override void OnExecute(){
    7.         MonoManager.current.onFixedUpdate += OnFixedUpdate;
    8.     }
    9.  
    10.     void OnFixedUpdate(){
    11.         //...
    12.     }
    13.  
    14.     protected override void OnStop(){
    15.         MonoManager.current.onFixedUpdate -= OnFixedUpdate;
    16.     }
    17. }
    Let me know if this works for you :)
    Thanks.

    Hey,

    Currently this is not possible to be done automaticaly, but is certainly a feature I can look into adding for the SubBehaviourTree node in FSMs. Thanks for suggesting it.
    Right now, you could use variables to manipulate the tree into doing what you want it to do, but it really depends on how the tree is designed so there is not a general solution that I can provide. For example you could use a boolean variable and a Conditional Decorator to make the tree ignore a branch. Of course this is not the same as the feature you are asking, thus I will take a look at implementing it :)
    Thanks
     
    Last edited: Mar 15, 2016
  49. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    Hello again, I have interest in using behavior trees for logic controlling my pedestrians in my sity sim game, I want the NPCs to branch out and do diffferent activities when tagged with a job, so I was wondering, I could initiate whole logical classes with if conditions in my scripts, and have others interact logical with even whole components. And I wanted to know how this product could make my life easier?

    I understand it can launch whole behaviors/scripts from a game manager component board, would getting the full product help me manage stand alone entites wondering around a man, executing logic, or do I only need the lite version instead and just continuously execute behavior trees? Couldnt I just code my behavior trees anyway and manage them inside of my class files? I'm trying to understand why I'd maybe need this to manage entities. Couldn't I just code functions to do it?
     
  50. Deleted User

    Deleted User

    Guest

    Thanks a lot for your reply and considering it as a possible feature, It would be great for sure!

    Right now I'm doing what you suggested but using a selector to check the bool instead a Conditional Decorator but I'll use your way since I think it's cleaner :)

    Thanks for your work and keep it up!