Secondly, what my viewpoint is that IMGUI is too old: out of date UI outlook / lack of performance and so on.
e.g. For IMGUI, every UI things are under OnGUI() method and called drawed every frame, if it gona be a nightmare for big complicated nested graph?
At same time, I have seen that so many problems on Unity Forum about UI Toolkit, and even some people go back to use IMGUI for some reason. Are those problems come from the complicated of UI toolkit or UI toolkit’s bug itself? It is stable now to build a large customized graph editor tool in unity by UI toolkit?
Finally, What want to build is a unreal engine blueprint-like node graph editor to build 3A Narrative story and logicals, many ui elements/connections/nested graph/… I have done it in unreal engine before, and now I turned to unity to rebuild the same thing.
Unity has a GraphView experimental class. Unity also has an experimental „new“ GraphView: GraphTools Foundation package which unfortunately has seen most of its work behind the scenes for Unity‘s own graph view needs (Shader Graph, Visual Scripting, …). It‘s been in this state for years and not recommended to use it until Unity starts making updates to it again.
Then we have XNode and NodeGraphProcessor repositories on github (and a couple more). I think the former implemented its own graph view with IMGUI and has been around for longer but it‘s also been having performance issues. The latter sits atop of Unity’s GraphView class and extends the system. Personally I found the former to be too slow and outdated, the latter was very confusing and lacked ease of use and customization options.
Overall there is no great solution but NGP still works best and cuts down dev time significantly.
Generally you will NOT want to make an IMGUI based graph view, or generally use IMGUI for any serious GUI efforts. It‘s okay for a shooter GUI but anything more involved UIElements/UIBuilder are the goto tools, even though they lack in some areas such as lack of rename refactoring without manually fixing broken identifiers in code.
I’m sure that GraphView and GTF(GraphTools Foundation package) are not in my consideration, because it is expermential api not stable and may change in the furure.
As you know, NodeGraphProcessor repositories is based on GraphView( also based on UI Element, but UI element is part of UI Toolkit, so this part is fine), so it’s not a good start for me.
If you want know more about those tools, I advice you NewGraph. It is not based on any expermential api and still under maintenance.
Howevery, I need to start from scrach so I more concert about the foundamental editor api such as IMGUI or UI Toolkit.
By the way, Is there any tutorials or repo talk about UI Toolkit may helps me. Thank for your reply.
If your goal is to use this tool for a specific game in production, it would be madness NOT to use an existing solution that let‘s you start with content creation within a short time. Building this from scratch you can easily spend 4+ weeks to create only a very rudimentary version.
Even if you aim to use this tool for a) several games in the future or b) sell it on the store (among stiff competition for dialogue design tools - perhaps one of these would actually fit your bill?) it would be sensible to spend time working with and implementing prototypes with existing solutions to learn about their shortcomings. Especially as you seem to have no experience with this sort of tool in Unity, and possibly with GUI in Unity in general.
Yeah I would just use Xnode if you need something quick and working right away, or build your own on top of Graph View or Graph Tools Foundation.
Yes it will change in the future… who knows many years down the line knowing Unity’s pace with some things. However it’s not like it will disappear from any given LTS version that you’re on which includes it. And your projects are unlikely to update through major Unity versions unless you’re targeting mobile.
IMGUI is definitely not an option for this kind of thing. And UI Toolkit, while having issue, is 1000x better than IMGUI.
Thanks for advice, I would spend a few time to dive into those ‘existing solution’ to learn about their features;)
However, for some comany reason, I can’t build some thing on expermental api.But it did have great features and examples that I see on the NodeGraphProcesser github page. I would learn from that.
I honestly didn’t realise xNode was IMGUI. I always assumed it was UI Toolkit. In any case, it’s a battle-tested, free tool to so you’re doing yourself a disservice not at least trying it out.
I’ve used Graph View in a previous project in 2021 and it worked well enough for my use-case. The only issues I had were that I didn’t have any experience with UI Toolkit at that point, so it was definitely a crash course that accelerated my understanding of it.
I think at the moment there is no non-experimental official supported Graph-Tool/Framework available.
Building it from scratch is such a pain. I’ve done that over and over, for runtime, for the editor. I’ve also used the official Graph-Frameworks. GraphView and GTF.
I’m not 100% sure but I think Amplify Shader Editor works with their own rendering - a friend of mine mentioned it, because it works so much better than anything else in the Unity Editor, much more responsive, fluent. Wether they’ve really done that or not, it’s absolutely possible to write the shaders to render text and boxes and lines on your own. But that would take ages … like … literally months.
GraphView will at some point be deprecated and replaced by GTF. GTF will get an official update, some day.
Right now it would be better to use GraphView because it’s much more flexible. With GTF you are basically forced to use Assets (or create temporary assets/scriptableObjects) or else you would have to rewrite half of it’s Codebase to use it.
Also GTF forces a specific layout of your nodes - for me that wasn’t suitable for my own dialogue tree, “logic graph” and behaviour trees.
Making anything with Graphs in Unity right now is a mess. Pick anything and hope it suits your needs - once things update, update your tools accordingly and you’ll be fine.
And to clear things up → GTF and GraphView are both based on UI Toolkit. They aren’t another implementation of UI Toolkit, they use it - just like you are using Unity to build something. GraphView and GTF are like addons to UI Toolkit, they just provide some stuff (classes, interfaces, icons, style-sheets) which make it easier for you to create Graphs in UI Toolkit.
They’re just using UI Toolkit like the rest of Unity’s editor UI stuff moving forward. UI Toolkit is just a UI API that both Unity and ourselves can use to design our UI stuff, both in and out of the editor nowadays.
I agree with the opinions above too. So far Graph View is probably the lesser of two evils. Graph Tools Foundations just seems… incredibly convoluted as far as usability goes. Hopefully that’s streamlined when it becomes the prevailing API moving forward.
I used to be a Unreal engine programmer, now a days I need to create similar editor tools in Unity that I have done in Unreal. I feel so sad to hear that: “Making anything with Graphs in Unity right now is a mess.”