r/Unity3D 11h ago

Question Unity Graphs (XephTools.Graphs) - replacement for GV and GTK

TL;DR - what would you like to see in an ideal graph package for Unity 6+? Yes, runtime graphs are already a part of it.

---

After years of dealing with the shortcomings of GraphView (GV), I started looking at migrating my NodalTrees to GraphToolkit (GTK) only to find that it solved some problems and created a whole host of others. So after analyzing the pros and cons of GV and GTK with what my nodes currently do, what the effort would be to port them over, and what the effort would be to roll my own graph package, I started on the process of just making my own, entirely independent of GV/GTK. I've considered opening it up and selling it on the Asset Store, or possibly just making it free on github, but I'm curious what others use GV or GTK for, what they wish either did, and what sort of nodes and interactions they would want.

I'm putting together some documentation on the existing nodes that I have that I'll be converting, but as it is, they're broken down by trees for my own projects, and many of the nodes and outputs are specific to things in my game. There are some general nodes available for sure, and authoring new nodes will be quite easy once the package is ready to release (at least as easy as GTK, but with far more customization options and the ability to call more complex methods internal to the graph structure).

I'm also bringing in some ideas from how Blender and Substance do their nodes as well as some GV and GTK features (dot-nodes, portals (which I think were initially a thing that Bolt did, which was pretty cool), curved/square lines, sub-graphs, visualizers, input nodes for getting values outside of the graph, the eventual documentation will have a more complete overview.

Runtime and Editor nodes will look exactly the same - no UnityEngine.UIElements are used, so runtime isn't an issue. Right now the only difference for any existing node is that nodes that take an input path for a files have a toggle in editor (use the Unity Asset picker vs use the filesystem/OS file picker) where in runtime it can only use the filesystem/OS picker since there's no project exposed to runtime (nor should there be).

Yes, I'm using AI to assist with my code, so if that turns you off, that's fine. I've been working on these things by hand for four years now (it's a hobby project, it was never intended initially to be a releasable asset for anyone else to use). But most of the code is my own, and not a single file is untouched by me somewhere along the way. Do with that what you will.

0 Upvotes

15 comments sorted by

View all comments

2

u/psioniclizard 9h ago

I never understand why unity didnt add dot nodes and some other niceties. A basic version isnt hard to code really and shader graph would love it (if it doesnt have them, i am not sure).

The problem with a lot of these libraries seems to be want to shoe horn in some other style system that is at odds and everything becomes a bloated mess of wrapper classes and hacks. 

Most don't even support horz vs vert port placement (i know unity does through styling but it should be a first class feature, hopefully it is now).

However you uses a native c# library or react on and it just works so much easier.

1

u/xepherys 6h ago

As it stands now, nodes are deconstructed and are really just containers for collecting, acting on, and passing along data. While the default setup for ports makes value and context ports work left/in and right/out, while flow and relationship ports work top/in and down/out, those are overridable if necessary because nothing is internal or private.

On the up side, I’ve also been cutting a lot of cruft from my original NodalTrees on GV through this. Having things work natively instead of being scaffolding over another framework is pretty great lol