Some notes about subgraph usage in AI Behavior package

Hey.

So I was trying to use subgraphs to improve visibility of my behaviors. I noticed that assigning variables is a bit odd and didn’t work in the end.

Type for placeholders

Maybe instead of duplicating the name we better use type of the variable as placeholder?
Like: Self => GameObject and so on.

image

Types are ignored for variables in subgraph

My subgraph representation has specific type selected for variables Couch and Fridge, but when I try to assign something, it lets me assign totally different values

Unexposed variables appear for subgraph

I understand that unexposed variable shouldn’t be possible to pass from outside and I have it set this way. Although I still able to do so for a subgraph:

Values aren’t passed to subgraph

So… The biggest problem is that my values aren’t there for some reason, even though I set them in parent graph

Maybe I do something wrong there, thanks for looking into that!

Mike.

1 Like

Hi Mike!

We have found some regressions with passing components & some other types down to subgraphs.

I am working on a fix currently and we should be able to release a patch this week.

Thanks for reporting & I hope it solves your issue soon.

Best,
Darren

1 Like

Hello

Can we have Issue to track, when problem with not passing values to subgraphs would be resolved?

It’s pretty crucial problem

Hi mitaywalle,

Upcoming 1.0.3 version is going to resolve the issue about the node not passing values to subgraph. Estimated Time of Arrival is End Of Week.

However some issue around the area will persist. For instance, using the RunSubgraph (Static) node, the default values of the subgraph’s Blackboard are overridden.
This is cause by the RunSubgraph (Static) node directly referencing the graph asset, which replaces the default values of the subgraph Blackboard.
For now the workaround is to use RunSubgraph (Dynamic) instead. Assign Subgraph as a Blackboard Variable , rather than directly referencing the graph asset to the node.

We are actively working on a troubleshooting page for the next release to help mitigate.

Than you for your patience and sorry for the inconvenience. :bowing_man:

1 Like

Thank you for detailed answer. Will try your suggesstion to use dynamic subgraph.

Have a nice day