Search Unity

Node Graph [Custom Purpose Unity Built-in Node Graph]

Discussion in 'Scripting' started by PixelLifetime, Apr 8, 2019.

  1. PixelLifetime

    PixelLifetime

    Joined:
    Mar 30, 2017
    Posts:
    90
    Unity has 2 graphs. VFX Graph and Shader Graph. Is there an api that lets you use the node editor for your own needs? Like if I would like to create the AI that would be node based or parametric generation, or dialogues... Is it possible to use built-in system for these tasks? If not, will this be added to roadmap?

    P.S. I know about open-source and other free node graphs available. I am not sure about their performance, or support in the future, their reliability, etc.
     
    Billy4184 and fherbst like this.
  2. Filtiarn_

    Filtiarn_

    Joined:
    Jan 24, 2013
    Posts:
    173
    I remember seeing at one of there keynotes that they plan to make graph UI avaliable for anyone to use. I'm not sure when, maybe when visual scripting comes out in 2020.1.
     
  3. Filtiarn_

    Filtiarn_

    Joined:
    Jan 24, 2013
    Posts:
    173
    Also I was just going to write my own node based AI ontop of units visual scripting tool coming out. You be able to make custom nodes.
     
  4. PixelLifetime

    PixelLifetime

    Joined:
    Mar 30, 2017
    Posts:
    90
    My question is: will Unity release some API or better if Unity releases source code for UIElements that was used to create Shader / VFX graphs? It would be helpful in situations where you need to create graph with custom behaviour and custom nodes.

    I know it's possible to recreate the graph from scratch with either GUI or UIElements and some graphs are open source on the internet. But having native code and standardized approach for creating graphs would be very useful. Plus any updates, changes to API for the graph would be handled by the team responsible for Shader Graph and VFX Graph which in turn would save a lot of time of other developers as well as bring them the best experience in using graphs in unity.

    I am asking to be sure if such graph is on the roadmap or do we have to create one ourselves? Because it would be very heartbreaking if we have been working on a UIElements graph API for a long period of time and then suddenly Unity releases one and all that work, time and efforts would be gone as native one would support same/similar kind of behaviour.

    `The intended use of a graph would be for AI graph, branching dialogues, procedural generation...`

    Thank you for your time.

    P.S. if source code isn't in C++ but in C# - it would be very convenient to have it, because then again it allows for creating extensions for graph, assets for Asset Store and much more. To clear things what I imagine it's code that handles = drawing window, drawing nodes and connections, dragging nodes... Basically just some part of visual stuff that is shared between many types of graphs.
     
    Last edited: Aug 9, 2019
  5. palex-nx

    palex-nx

    Joined:
    Jul 23, 2018
    Posts:
    1,748
    I've asked the same quesntion in the blog under the article about shadergraph. There was a reply they may open graph api later, as far as I remember.
     
    PixelLifetime likes this.
  6. PixelLifetime

    PixelLifetime

    Joined:
    Mar 30, 2017
    Posts:
    90
    That is good news, but knowing the date could be very useful. If they decide to open it like a year from now - then there might be no point in waiting and creating your own graph would be a reasonable idea if you need it faster.
     
  7. PixelLifetime

    PixelLifetime

    Joined:
    Mar 30, 2017
    Posts:
    90
    MoonbladeStudios and palex-nx like this.
  8. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,982
    https://github.com/Siccity/xNode

    That one has amazing support, works well, code is clean and easy to extend, and is free. Give it a go :)
     
    Bunny83 likes this.
  9. PixelLifetime

    PixelLifetime

    Joined:
    Mar 30, 2017
    Posts:
    90
    I have seen this one. Although, it's good - it uses GUI system which soon will be replaced by UIElements which scale better for this kind of thing (GUI will still be supported). And we can now use GraphView which is another step forward.
     
  10. Ivan_br

    Ivan_br

    Joined:
    Nov 10, 2015
    Posts:
    29
    Hi @PixelLifetime, have there been any updates on what you have found or used in these past 2 years? Did you end up choosing to use Unity's GraphView? It seems to still experimental, unfortunately, so support could be dropped at any moment, but hopefully since ShaderGraph and the VFX Graph is developing well they will maintain it.
     
  11. PixelLifetime

    PixelLifetime

    Joined:
    Mar 30, 2017
    Posts:
    90
    Hi, there is going to be or already is a supported graph API in UIToolkit. I am not from Unity, so this all is just my assumptions. But here check out Graph Tool Foundation - https://forum.unity.com/threads/graph-tool-foundation.1057667/#post-6880742 .

    https://unity.com/roadmap/unity-platform/editor
    Go to CUSTOMIZABILITY & EXTENSIBILITY, "Node-based tools creation" is `In Progress`, so it's safe to assume that it will be supported in the future.
     
  12. Ivan_br

    Ivan_br

    Joined:
    Nov 10, 2015
    Posts:
    29
    Hi @PixelLifetime , thanks for your update on this. Great to see it is on the roadmap and that it is currently at version 0.11.2-preview, I hope it stays there and gets further improved. The link to the form you posted is great as well, good to see people actively using it and hopefully the feedback given there will be used to improve it.