Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

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

  1. Ladace

    Ladace

    Joined:
    Dec 7, 2014
    Posts:
    40
    Hi, there is an initialization issue on Blackboard with property-binded variable.

    In my case, if I instantiate a gameobject with Behaviour tree which immediately tries to access a variable that binds to a property, the variable will not be ready and return null, because Blackboard has not initialized yet (`Awake()` is not called yet). It is because when `GraphOwner.OnEnable()` is called, `Blackboard.Awake()` is not guaranteed to be called before.

    So I changed Blackboard's script order to -40 and this issue was gone.
     
  2. Ewanuk

    Ewanuk

    Joined:
    Jul 9, 2011
    Posts:
    257
    Having an issue with the Switch composite.

    Whenever my code compiles, if I have the canvas editor open, the nodes will rearrange themselves (change their x,y position)

    This only happens if if the switch composite is set to Enum Based selection mode

    Before:
    Before.png

    After:
    After.png

    It makes the switch composite pretty much unusable. And even deleting it appears to "corrupt" the asset to always rearrange itself after doing a recompile.

    This error shows up to, but I'm not 100% sure it's related:

    ArgumentException: Getting control 0's position in a group with only 0 controls when doing repaint

    Using v3.18 against Unity 2020.2.2f1
     
  3. nuverian

    nuverian

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

    There is currently a summer giveaway running for 3 NodeCanvas license keys!
    Enter, share and you might just win one of those :)

     
    SugoiDev likes this.
  4. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Only two days remaining for the License Keys Giveaway :)

     
    SugoiDev likes this.
  5. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    SugoiDev likes this.
  6. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    zIyaGtVm, hopeful and Subliminum like this.
  7. SUUNE

    SUUNE

    Joined:
    Mar 10, 2019
    Posts:
    65
    Hello.
    I have an FSM with couple action states and I need to be able to jump to the specific action state by code (or change start point by code). Best if I could select action state by string name. Is it possible? I can't find any documentation about that.
     
  8. bdae

    bdae

    Joined:
    Dec 24, 2017
    Posts:
    23
    How do I access a variable attached to another game object from within the node canvas behavior tree?
     
  9. trullilulli

    trullilulli

    Joined:
    Sep 4, 2013
    Posts:
    7
    Quick point on switch composite and enums. I've quite a large list of enums to represent every single large entity type in my game, I'd like to specifically choose which enum leads to which path (As I'd like to use the Gambling Table enum here). Is there any way around this or is it on a list of potential implementations?
    upload_2021-9-13_20-38-46.png
     
  10. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    577
    Hi is it feasible to switch from fs to odin serializer?
     
  11. Zurusona-Kitsune

    Zurusona-Kitsune

    Joined:
    Mar 11, 2012
    Posts:
    94
    hi, I've been trying to learn node canvas but the website is inaccessible to me, I'm getting a "this site can't be reached"... ERR_CONNECTION_TIMED_OUT error.
    So I'm wondering is the website down or is it a problem on my side?
     
  12. aptd

    aptd

    Joined:
    Jun 24, 2017
    Posts:
    2
    Throws an error
    NodeCanvas Lite
    NullReferenceException: Object reference not set to an instance of an object
    ParadoxNotion.Design.EditorUtils.GetMenuItems (UnityEditor.GenericMenu menu) (at Assets/ParadoxNotion/CanvasCore/Common/Design/PartialEditor/EditorUtils/EditorUtils.ContextMenus.cs:357)
    ParadoxNotion.Design.GenericMenuBrowser.GenerateTree () (at Assets/ParadoxNotion/CanvasCore/Common/Design/PartialEditor/GenericMenuBrowser.cs:271)
    ParadoxNotion.Services.Threader+<>c__DisplayClass8_0.<StartAction>b__0 () (at Assets/ParadoxNotion/CanvasCore/Common/Runtime/Services/Threader.cs:44)
    System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    System.Threading.ThreadHelper.ThreadStart () (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    UnityEngine.<>c:<RegisterUECatcher>b__0_0(Object, UnhandledExceptionEventArgs)
     
    Last edited: Feb 20, 2022
  13. nuverian

    nuverian

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

    Just in case you haven't seen them, there are some new video tutorials available in collaboration with @UnsideUnityAssets on youtube.



    --



    A new version was also recently released (actually a lot since the last update in this thread :) ).
    As always you can check all version changes here.

    Cheers!
     
    SugoiDev likes this.
  14. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    SugoiDev likes this.
  15. Zamaroht

    Zamaroht

    Joined:
    Nov 4, 2013
    Posts:
    23
    I've been getting this same error when trying to assing an action task to a node. Strange.
     
  16. Zamaroht

    Zamaroht

    Joined:
    Nov 4, 2013
    Posts:
    23
    We were using an old version of node canvas, after updating the package to the latest version this is now fixed!
     
  17. osgseb

    osgseb

    Joined:
    Jan 17, 2022
    Posts:
    26
    Hello,

    @nuverian I was wondering how would you handle a BT which handles iterating through sequences using a repeat node and a wait until node to check if the current sequence is complete - but I'd like to be able to start a timer, maybe using a timeout action, at the beginning and be able to react/interrupt the current flow when the timer reaches 0. I'm not sure how to do this because it means I need the timer part to be active and executed while the other part of the graph is running too knowing I would have to use a wait until not on that part.

    Thanks
     
  18. ItsGonnaBeOk

    ItsGonnaBeOk

    Joined:
    Jul 14, 2016
    Posts:
    21
    @nuverian hi there

    I'm trying to find the right approach to using polymorphic objects in flow scripts.
    For example I have a node that creates an object on scene with custom MonoBehaviour script attached to it and returns it for further usage.
    I then want to pass it to another general purpose node called "Extract Game Object" that has input value as Component and output value as GameObject (it does a simple job - returns component.gameObject). I cant do it however because the Canvas requires "automatic type conversion".
    I'd be grateful if you'd point me in the right direction - some kind of tutorial perhaps?
     
  19. Graham-B

    Graham-B

    Joined:
    Feb 27, 2013
    Posts:
    330
    How would I use the "Manual" update mode. Can't find any info in docs. Thanks!
     
  20. Graham-B

    Graham-B

    Joined:
    Feb 27, 2013
    Posts:
    330
    I’m currently using the Priority Selector to create a Utility based AI. So far so good, but unless I’ve overlooked something, it could really use some randomness.

    Since it always chooses the highest scoring action, the resulting AI behavior is often predictable and repetitive.

    There are two simple solutions to this problem that I’ve seen used, and it would be great if they were options within the Priority Selector.

    1. Tournament random
    - The tournament size is set, meaning the number of competing actions that will be considered in the selection process
    - The top scoring actions (limited in number according to the tournament size) are then chosen from randomly

    2. Weighted random
    -
    A minimum score cutoff is set, meaning all competing actions that score above this threshold are chosen from randomly
    - Uses the scores as weights (eg. if one action is scored 33% and another is scored 66%, it's twice as likely to pick the 66% action)
    - As with tournament type, a maximum size of candidates can be set

    Thanks for hearing me out!
     
    Last edited: Sep 3, 2022
  21. Graham-B

    Graham-B

    Joined:
    Feb 27, 2013
    Posts:
    330
    I'm trying to customize the PrioritySelector.cs script, however I'm not able to add basic custom variables. I'm aware that this is due to the OnNodeInspectorGUI() overriding the GUI, but I can't find any GUI documentation for NodeCanvas.

    I have been able to implement through BBParameter like so:

    Code (CSharp):
    1. public BBParameter<bool> customBool;
    2. protected override void OnNodeInspectorGUI() {
    3. customBool= (BBParameter<bool>)NodeCanvas.Editor.BBParameterEditor.ParameterField("Custom Bool", customBool);
    4. }
    But I would like to know how to show a simple basic variable.
     
    CaffeinatedCoolaid likes this.
  22. baumxyz

    baumxyz

    Joined:
    Mar 31, 2017
    Posts:
    107
    Have you found a solution? I'd like to know the same thing.
    @nuverian Can you tell us how to use the manual update mode for a FSM?
     
  23. nuverian

    nuverian

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

    I'd like to remind you to please use the official forums for support since it is far better for tracking inquiries per thread there. Feel free to also join our community on discord as well. Last but not least there were a lot of updates since my last post here! You can always find the full change log on the website :)

    Thank you.
     
  24. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087