[BUG] Global blackboard variable names with slashes are not behaving as expected

NodeCanvas Forums Support [BUG] Global blackboard variable names with slashes are not behaving as expected

Tagged: ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #14472
    zsoik
    Participant

    Using global blackboard variable names with slashes in them does not work as expected. If you add a variable named “John/Age” to a global blackboard and you try to reference it, it won’t be found and creates runtime issues. We use slashes in variable names extensively to group them together, expecially in context menus, but it hadn’t worked as expected when global blackboards came into play.

    We worked around that issue by patching the ResolveReference method on BBParameter to only allow two splits on ‘/’ instead of infinitely many.

    Tested with 2.9.2 & Unity 2018.4.4f1

    #14493
    Gavalakis
    Keymaster

    Hello and very sorry for late reply due to summer vacation!

    To be honest, I wouldn’t recomend using slashes for the name variables since slashes are used to determine the usage of Global Blackboard if any, more than categorizing the variables in the menu. Even with adding a limit of 2 splits, if you are using a variable name with a slash, while it does work correctly in runtime (BBParameters is linked to Variable), it is done so via unexpected behaviour. If for example the first string of the split (on the left of the slash), is accidentaly also the name of a Global Blackboard, that means that things will not work correctly because BBParameter will try to resolve the target variable via a Global Blackboard of that name.
    With that said, I could probably change the character for determining Global Blackboard to something else other than a slash (like for example a “@” char), or find some other solution to differentiate the two of them and thus make using slashes more predictable.

    Let me know what you think.
    Thanks!

    Join us on Discord: https://discord.gg/97q2Rjh

    #14504
    zsoik
    Participant

    We actually had this “bug” discovered already 2 years ago but I haven’t come around to reporting it until having to port all our little fixes/adjustments we did to NC over time to the newest NC version. Using slashes was very important for our game designers to reduce clutter in pop-up menus where you have to select a specific BB variable because we did put lots of categorized information into large global blackboards. We haven’t used it in instance blackboards so that’s probably why we got away with it. As you have explained it now, I see how this was actually unintended behaviour, but for us a very nice feature. For me, using a different separator for the blackboard/variable name separation sounds good, the automatic context-menu grouping that comes from using forward slashes is really helpful.

    #14528
    Gavalakis
    Keymaster

    Thank you for your input.
    I will look into making changes for retaining with “/” ability to categorize variables without messing up with the Global Blackboard resolution at the same time. Probably using a different character like “@” or even some other completely different way.

    Thanks.

    Join us on Discord: https://discord.gg/97q2Rjh

    #14861
    zsoik
    Participant

    Hi! Is there an update about this feature/fix? I just had to fix-up the number of string splits in BBParameter in 3.0.5 myself 😉 It’s as simple as adding the “number of splits” parameter to the string.Split invocation.

    #14867
    Gavalakis
    Keymaster

    Hey,

    Sorry I didnt look at his before. Even though “/” are not meant for categorization, I will add this since it also doesn’t break anything so no problem :). Can you please send me your change more specifically so that I add it.

    Thanks.

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.