Graph Nesting Layers

NodeCanvas Forums Support Graph Nesting Layers

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #9758
    hcarriker
    Participant

    I’m running into an issue(which I am pretty certain is new to 2.1) where nested graphs inside of another nested graph are not keeping their hookups. First I need to explain what I am doing. Before I start the topmost graph I go through a dictionary of tag/graph pairs and assign the node who matches the tag with the appropriate graph. I then go through those nested graphs and do the same thing. The problem is that the nested graphs inside of nested graphs do not keep the connection. I have narrowed it down to the CheckInstance function inside these nodes. I know this because if I call OnGraphStarted on the node after I make the connection then all works well. It seems that it is mandatory that CheckInstance is called after assigning the graph to the node AND BEFORE assigning any nested node graphs. I am still looking into the situation further. I will let you know if I make any progress without modifying any NodeCanvas code. I do not like modifying asset code because then updating is always a nightmare ha.

    #9761
    Gavalakis
    Keymaster

    Hey,

    May I ask why are you assigning the nodes to different graphs manualy in runtime? This can be very tricky, but most importantely I’d like to know what you are after 🙂

    Thanks.

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

    #9760
    hcarriker
    Participant

    I have upper graphs that are shared amongst all entities of the same type. In these graphs are nested graphs which can keep nesting for however long they need to nest for. The lower level graphs are specific for each type of that entity. For example, monster entity is the type but then there are goblin, orc, etc… The lower levels are different for them. They also all share the same blackboard as to not have to manipulate data in multiple places. What I do is attach a loader script to the goblin/orc that specifies which graph owner to use, which blackboard to use, and also all the subgraphs to assign to the nodes using the tag as a lookup. I have got this working by waiting until the top graph starts its behaviour, and directly after that assigning all the nested graphs and then calling OnBehaviourStart on the node. This creates the instances in the correct order to keep the nested graph references.

    #9759
    Gavalakis
    Keymaster

    Hello. Glad to know you have this working.
    Maybe what you after can be achieved more automaticaly, by using Blackboard variables for the nested graphs which is possible in v2 +.

    So you could have an FSM blackboard variable for each subtype. and in the NestedFSM node, select the FSM variable you want to use there. 🙂

    Let me know.
    Cheers!

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

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