How to make new Graph Nodes?

How do you make new graph nodes?

Like if I wanted to make a Class Node in C++ for a tree structure, could I make a blueprint of the Root Node and then add nodes and set properties on it in the Graph Editor? Then use that from the gameplay code?

I made a behavior tree system in UnrealScript, but specify the tree in xml. I have a different system in mind, not behavior tree but it is an AI system and would like to use the blueprint graph to set the properties on nodes and their hierarchy.

Hi Michael -

It kind of depends on how in-depth you want to go! For the first part, you cannot at this point blueprint a node, and have it work in the graph editor. We might get there eventually, but not for the moment!

The easiest way to expose functionality to the graph editor is to expose properties and functions of classes, and work on those through blueprints.

Unfortunately, extending the blueprint compiler and the graph editor in terms of Rocket hasn’t gotten much attention as of yet, so you’re a bit limited in what you can do. If you do attempt it though, there are three main things you need to implement to define your own graph system:

  • Extend EdGraphNode to support your own node type (see K2Node as an example of this)
  • Extend EdGraphSchema to support setting the rules that govern your graph, such as which pins can connect to each other, etc (see EdGraphSchema_K2 as an example of this)
  • Create some sort of compiler for your graph, that translates the graphs and nodes into whatever target you want (KismetCompiler is one example)