Duplicating subtrees

NodeCanvas Forums Support Duplicating subtrees

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10105

    When I duplicate a subtree, the two resulting subtrees act as if I had duplicated it ‘by reference’. Changing one tree changes the other also. Is there a way to have it behave the same way as duplicating nodes? Having two options, one to duplicate and the other to duplicate by reference. An alternative could be to add a right-click menu option when selecting multiple nodes, to copy/paste them all at once, with the associated connections. I understand that this is not really an ‘issue’, but I don’t see a ‘feature request’ section, so here it is. Thanks for making nodeCanvas so useful that I would like to see more advanced features already. I’m running nodeCanvas on a Mac with Unity 4.5.2f1.

    #10107
    Gavalakis
    Keymaster

    Hey,

    The way that SubTree nodes are duplicated is totaly by design to not duplicate the actual BehaviourTree but rather to reference it.
    The way that usually SubTrees are used are for example to use a ‘Patrol’ subtree more than once within the master Behaviour Tree. You would want the ‘Patrol’ Subtree to be the same in all cases.

    The only reason I can think for duplicating the actual BehaviourTree would be to use it as a starting point for building a completely new one (meaning with new purpose).
    If that’s the case, right now, you can duplicate the actual GameObject that the BehaviourTree lies on (found in the hierachy), create a new SubTree Node and assign that duplicated BehaviourTree to the target behaviour of the node. The fact that Graphs live on normal GameObjects gives that nice flexibility 🙂

    With that said, I will see to adding your suggested option for duplicating SubTree nodes if it doesn’t complicate the workflow.
    Multiple Node duplication sounds more valid in my opionion. I’ve written it down 😉

    Thanks. Im glad you like NC 🙂

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

    #10106

    Multiple node duplication would be a good start. Also, the ability to copy a selected group of nodes (with connections) and paste the whole thing into the same or a different subtree would be ideal. That would allow for duplicating groups of nodes between subtrees. Like you guessed, my use case was as a starting point for building a new behaviour that’s somewhat similar to an existing one, in a separate subtree. It’s often much faster to copy, paste and modify than building up from scratch. I ended up just copying the contents of each node and moving them over one by one, having to first create a new action node in the new subtree and paste the contents back in, then wire it up. In the future it would save time to just select a bunch, copy and paste them over as-is, then rewire and modify. Thanks for making note of the feature request.

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