Search Unity

DOTS Visual Scripting 2nd experimental drop

Discussion in 'Entity Component System' started by thierry_unity, Jun 17, 2019.

Thread Status:
Not open for further replies.
  1. thierry_unity

    thierry_unity

    Joined:
    Jun 10, 2015
    Posts:
    187
    Hi all!

    Here is the 2nd drop of Visual Scripting! We squashed a few bugs and added a couple of new features that should help you out. As usual, don't expect this to be fully polished and usable in a production environment. We are still pretty early in development. Also, note that with summer at our doors, expect the response rate on the forum to slow down a bit.
    Without any further ado, here what's changed in this release:

    • Upgraded the code to be compatible with 2019.3 along with couple of UI fixes (you'll need at least 2019.3.0a4)
    • Graph states events (we'll find a better name eventually, or maybe if any of you have good suggestions for us?): OnStart, OnDestroy
      OnxEntities.png
    • Entity Instantiate Node
      init.png
    • Floating minimap (it's now possible to dock the minimap outside of the Visual Scripting Editor window)
      minimap.png
    • Double-click on console errors will focus on the error in the graph
    • Corrupted nodes can be cleaned when opening a graph

    You can download the new zipped package HERE

    We are planning to have a 3rd drop around mid-august. Until then, please give us your feedback here.
     
  2. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,133
    This is a related but somewhat unrelated question, I am wanting to get clearer understanding on this visual scripting system, but also some insight into it's roadmap, and how that relates to my own efforts.

    I was working on this, GTLogicGraph, which is a mutation of the ShaderGraph, but for more generic logic.
    https://github.com/rygo6/GTLogicGraph

    More specifically what it does is, you chain together a series of nodes, and each node does an operation on a piece of data. I have set it up so you add your graph on a component in your scene, then you can feed the graph inputs with things from the scene, such a transform or curve in the scene. Then that same component will output the results of the graph through firing UnityEvents on the component, which can be hooked up to anything.

    I have been using this to build out a node based procedural modelling system. So for example, to make a race track. I have a curve component for you draw a curve in the scene. Then you input this curve component into the input slot of a 'LogicGraph' component, which then has a chain of nodes in it to simplify and refine the curve, then extrude a mesh along the curve. The LogicGraph component then fires off a UnityEvent in the end with the generated mesh, which will then add the mesh to a MeshFilter to display in the scene.

    I was going to implement a lot of functionality to then thread these nodes as well.

    BUT it seems like all of this could be replaced by DOTS, and this visual scripting system. Is that a correct intuition? Could I just re-implement all my procedural modelling nodes as nodes to work in DOTS visual scripting.

    I have been looking around the package so far and what seems to be missing is a method to input and output data into a graph from the scene. So I can input a curve component, then have it output back out a mesh onto a static mesh filter. I was looking at the 'Macros' which seem to let you define inputs and outputs, but that seems to not be what I seek.

    Is there a way to do what I describe with DOTS and this visual scripting system? Is what a describe an appropriate use of this system? Or does it make more sense to keep going on my GTLogicGraph?
     
    tarahugger, winxalex and thelebaron like this.
  3. theor-unity

    theor-unity

    Unity Technologies

    Joined:
    Feb 26, 2016
    Posts:
    188
    I think it would fit. in terms of inputs/outputs: DOTS components are what you're looking for, the whole project is based on reading/writing components on entities, as they are the data actually living in the scene. by the way, we support hybrid mode too, so you should be able to just work on your existing components. The mesh generation part is unclear, but worst case it would be a matter of exposing that API with a few custom nodes (eg. a create mesh node with vertices/normals/... inputs)
     
    starikcetin likes this.
  4. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,133
    Is there any issue with using DOTS code for editor tools? The system I am creating is intended to be primarily used in the editor as a modelling tool, not necessarily at runtime by the end user.

    Also, I have some of my procedural mesh operations as C++ code in a DLL. Will that work with this? Can I call a C++ method within a system running on DOTS?
     
    Last edited: Jun 20, 2019
  5. createtheimaginable

    createtheimaginable

    Joined:
    Jan 30, 2019
    Posts:
    29
    Bug report here...

    Using Drop 2 of Visual Scripting I got a spinning cube working in 2019.3.0a5! :)

    But in 2019.3.0a6 I get a Burst Compiler error when I load in the com.unity.visualscripting-release-drop-2 package before I even create a Visual Script.

    Library/PackageCache/com.unity.burst@1.0.4/Editor/BurstAotCompiler.cs(638,32): error CS7036: There is no argument given that corresponds to the required formal parameter 'exceptionType' of 'BuildReport.AddMessage(LogType, string, string)'
     
  6. theor-unity

    theor-unity

    Unity Technologies

    Joined:
    Feb 26, 2016
    Posts:
    188
    Quick fix: go in Packages/com.unity.visualscripting.entities/package.json and update the "com.unity.burst" version to "1.1.0-preview.2". We'll fix it in the next drop.

    it could work, but right now the generated code only references runtime assemblies. if you have a clear data contract, you could manually run the generated system on your components.

    I don't think Burst supports C++ in external DLLs at the moment and I never tested it on our side, but you could disable the job system and create custom nodes for your calls, but that's kind of going against the grain. In the future, it might be worth reimplementing these using burst compiled jobs...
     
    twobob and createtheimaginable like this.
  7. createtheimaginable

    createtheimaginable

    Joined:
    Jan 30, 2019
    Posts:
    29
    I am trying to do something really simple using the Visual Scripting like click a button and have it start and stop my cube's rotation.

    I created a function node in my Visual Script.

    But when I create a Canvas / Button and try to connect it using the Unity inspector to a function created in a Visual Script the function method does not show up to select.

    The only selections I get are: ( see attached image )

    string name
    Dispose()
    ShowInInspector()
     

    Attached Files:

  8. theor-unity

    theor-unity

    Unity Technologies

    Joined:
    Feb 26, 2016
    Posts:
    188
    The visual script asset doesn't exist at runtime, so you'd need to dump the code and actually reference the monoscript.

    In game UI integration with DOTS in general and especially Visual Scripting is not there yet.
    The way to do it will probably be the other way around - find the button from VS, wire the event. Stay tuned
     
    twobob and createtheimaginable like this.
  9. cecarlsen

    cecarlsen

    Joined:
    Jun 30, 2006
    Posts:
    864
    Is "DOTS Visual Scripting" the same solution as "Visual Scripting" introduced at Unite 2018 as part of the road map presentation? It looks radically different. I am very interested in this topic as I am also, like @techmage, developing a visual scripting tool. Naturally I am wondering about the overlap it will have with Unity's native solution(s). I can't find any sub forum on the topic. Anyone knows where can I find more information?
     
    Last edited: Jul 24, 2019
  10. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Well the following is a link to the post where they revealed that plans had changed and their solution would be DOTS-related.

    #89
     
  11. unity_ENboRzggqhioOA

    unity_ENboRzggqhioOA

    Joined:
    Apr 27, 2019
    Posts:
    1
    Will you eventually be able to move between both graph and script?
    For example, create a graph, look at its C# code edit the C# code and it updates the graph?
     
  12. theor-unity

    theor-unity

    Unity Technologies

    Joined:
    Feb 26, 2016
    Posts:
    188
    No. once you move to script, it's done. However, you can extract part of the graph to a separate graph, then move that sub part to c# and optimize it.
     
  13. theor-unity

    theor-unity

    Unity Technologies

    Joined:
    Feb 26, 2016
    Posts:
    188
    Unity's VS is dots only.
     
  14. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    It's impossible to use at all. Tested on 2019.3.a8 by using the project. There are no options to launch the VS window or to create a graph.
     
  15. thierry_unity

    thierry_unity

    Joined:
    Jun 10, 2015
    Posts:
    187
    it's not working anymore unfortunately past 19.0a5 , We are working with the editor team to resolve the different issues. sorry about that
     
    Last edited: Jul 11, 2019
  16. lucianvartolomei

    lucianvartolomei

    Joined:
    Oct 22, 2018
    Posts:
    23
    Some people at Unity seem to have forgotten the name of the product they're working at: Unity. ShaderGraph is not uniting shader development for all pipelines supported by Unity (built-in pipeline support is missing) under a single Shader Editor, while other 3rd party asset store developers support development of shaders using visual editors for both built-in and scriptable render pipelines.
    Now, the same thing seems to happen all over again: Unity's official Visual Scripting tool will not support the standard way of working with Unity, the MonoBehaviour way, but only the newer, experimental ECS/DOTS way.
    The same message that Unity broadcasted to its developer community when deciding to support only SRP's in ShaderGraph will be sent once again, when all 3rd party Visual Scripting asset store developers will add support to their sollutions for the DOTS/ECS features, on top of the classic MonoBehaviour support, while Unity will offer support only for ECS Visual Scripting: That Unity's official product does less than a 3rd party product, in case of Shader Editors and Visual Scripting...
     
  17. frarf

    frarf

    Joined:
    Nov 23, 2017
    Posts:
    27
    DOTS and SRP aren't experimental, they're the future of Unity. Anywho - Unity has priorities, they can't just maintain MonoBehaviour visual scripting and ECS visual scripting very well at the same time, especially for a paradigm that won't exist in the future. Unity Technologies has spread itself very very thin for many years, and they've realized it's better to make a great feature and commit rather than just add it even though they know it won't be well supported. Regardless, MonoBehaviour's are the most documented thing in the entirety of Unity, ECS is not. There's actual demand for a tool to move non-programmers (and even programmers, honestly) to the fairly new and uncharted ECS paradigm.
     
    ClementSXD, gfoot and thierry_unity like this.
  18. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    505
    That's a little dramatic. Maybe it's better to 'unite' their effort on their future vision? Heh. Word play aside, I agree with the choices they are making for the most part. They don't have infinite resources, and the battles they are choosing make sense for the future.
     
    ClementSXD, toomasio, gfoot and 2 others like this.
  19. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    In this particular case we realised that there are quite a few mature solutions that most of the community is using successfully for visual scripting. We didn't think that what we can build on top of MonoBehaviours in terms of visual scripting would have been a massive improvement over solutions in the asset store.

    On the other hand we saw an opportunity to focus VisualScripting on DOTS. Specifically enabling artists & level designers to write incredibly efficient multithreaded game code, by expressing their intent simply and the code being generated taking advantage of DOTS. The data centric nature of DOTS opens many new opportunities for visual scripting and interop with other code based systems.

    We think a combination:
    * Generating high performance visual scripting code out of the box (C# job + Burst + great memory layout)
    * A UX language that reduces noodle graph-ness, by supporting stacking and other dedicated UX paradigm
    * A straightforward path to transition from Visual Scripting -> well organized DOTS C# code
    * Amazing debugging tools deeply integrated into DOTS & Visual scripting

    Provides something quite unique & powerful. Solving many of the long standing issues with visual scripting languages in general. That is worth putting our focus on and brings more value in the long term than splitting our focus and competing with asset store visual scripting solutions that our community is already quite happy with.
     
  20. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    I totally agree with you & unity, it makes more sense for a better future in Game performance.
     
    thierry_unity, gfoot and theor-unity like this.
  21. merpheus

    merpheus

    Joined:
    Mar 5, 2013
    Posts:
    202
    This version looks a lot simpler! First drop was quite confusing as a VS tool. I liked it but I guess there is no job and multithreading support exist now, right ? Because when I look to codeviewer it is derived from ComponentSystem. Will that be supported?

    Feedback:
    • Looks a lot simpler, but I recommend to have some color on node headers(sounds like bs I know but artists love it) I saw there are coloring options for overall but I'd rather this (at least artists&designers in my company liked it)

    • Entity queries are kinda set from blackboard and it doesn't feel convenient. I recommend to have a separate window for it or may be a separate graph just to set those up. Yeah a entity query graph would simplify things!
    • There are overlapping labels on UI like that; upload_2019-7-31_1-35-13.png
    • I liked the macro feature. I guess it works like a subgraph!
     
  22. Silenus3

    Silenus3

    Joined:
    Jun 5, 2019
    Posts:
    20
    Which version of Unity works best ?
     
  23. myanko

    myanko

    Joined:
    Nov 9, 2013
    Posts:
    56
    2019.3.0a4
     
    MaDDoX likes this.
  24. theor-unity

    theor-unity

    Unity Technologies

    Joined:
    Feb 26, 2016
    Posts:
    188
    Thank you for your feedback !
    - The team's UX designer and our Product Owner are working together on the whole color thing. This is a need we're aware of.
    - queries are always a flat list (or might, in the future, inherit from another query and more components), I'm not sure that deserves a graph (I know, a list is a degenerate tree, which is a degenerate graph, but...). Anyway, the UX needs love and is being actively worked on, should be in the next-next version).
    - plenty of UI fixes upcoming, many on our sides, many on the UIElements side
    - macros need love, but I'm quite fond of that feature too :)
     
  25. theor-unity

    theor-unity

    Unity Technologies

    Joined:
    Feb 26, 2016
    Posts:
    188
    Also: there's a big push to bring higher level features to the product right now.

    About jobs: in the graph properties (double click on the graph view background), there's a "Use Job System if possible" checkbox.
     
    Dreamora, merpheus and myanko like this.
  26. merpheus

    merpheus

    Joined:
    Mar 5, 2013
    Posts:
    202
    For a graph, imagine having lots of entity groups, setting them from a tree view is a little complicated, may be having something like this will simplify stuff
    upload_2019-8-7_0-51-10.png
     
    Last edited: Aug 6, 2019
  27. theor-unity

    theor-unity

    Unity Technologies

    Joined:
    Feb 26, 2016
    Posts:
    188
    There's still a lot of features we haven't implemented at all yet, but your suggestion is duly noted !
     
    merpheus likes this.
  28. thierry_unity

    thierry_unity

    Joined:
    Jun 10, 2015
    Posts:
    187
    createtheimaginable likes this.
Thread Status:
Not open for further replies.