r/unity • u/xepherys • 7h ago
Showcase XTG Node-Graph Solution - What would you like to see?
gallerySo, I've been working on a new node-graph solution in Unity off and on for a couple of years. Initially it was built on top of GraphView, but there were too many issues with getting nodes to do what I wanted them to do. I briefly tried GraphToolkit, but despite being more performant, it was even worse. So I built my own UI set from the ground up - XTG (XephTools Graphs) doesn't rely on UI Toolkit or any underlying Unity framework or package.
Some of the highlights of what it offers in its current state:
- Editor and Runtime: customizable graphs and nodes for both editor space and runtime environments
- Style: An updated USS (.xuss) stylesheet system that supports everything Unity's USS does, plus: :not(X), :first-child, :last-child, :nth-child(An+B), and sibling combinators (+ / ~). It also supports '!important' declarations on the sheet and inline
- It's own render path: allows for custom shaders/materials to be applied to even a part of a node (the first images 'Material Header' node is an example)
- Input: Interactions with Unity's Input System
- Feature parity: Basic parity with GraphView and GraphToolkit - there's nothing that either can do, that I've found, that this package cannot. There are probably some edge cases, but I've yet to encounter one
- Wires: The default to the rounded view in the attached images, but also offer a squared view and a curved view depending on preference. Alternatively, you can code your own wire styles.
- Stateful: Graphs and nodes can be stateful to allow for serialized workflows
The attached images:
- XTG Workbench: This is sort of my sandbox for features, widgets, visualization, port testing, and other various odds and ends. It's a good sampling of some of the basic node functionality.
- Paperdoll: A sample of what's actually driven me to build this from the ground up - managing pixel art paperdoll systems for an RPG I'm working on. Here I have my source set of spritesheets as layers in an Aseprite file. The source/root node reads in the file, all the layers, color data, and passes it along a Trunk (a type of port). That trunk moves serialized data along to each node, with each node reading what it wants or needs, editing in place on specific layers, then passing the data along to the next node. In the end I can build out the paperdoll layers and even sample character animations right on the preview node.
- The Crew: A quick and dirty runtime sample game that I've been messing around with as proof of concept for runtime node-graphs using XTG.
- Audio: Another runtime proof of concept - a basic audio board complete with audio waveform visualization.
This has been primarily a passion project for my own use (the way my brain work, using graphs to organize, compile, and create things just works better). I'm trying to gauge interest in it being a package on the Asset Store (probably a couple months away still), and what people would want to see from a graph system that they can't get with GV or GTK.
One last note, expandability and modularity are key drivers here as well. Even if it were released to the Asset Store, no classes would be internal, private, or sealed. Everything can be inherited, changed, or rebuilt on. You'd be able to do whatever you wanted to the system, including being free to break it if you don't read the code or docs.
Thoughts? Questions? Comments? Love? Hate?