Search Unity

DOTS Visual Scripting Experimental Drop 9

Discussion in 'Entity Component System' started by ans_unity, May 14, 2020.

  1. useraccount1

    useraccount1

    Joined:
    Mar 31, 2018
    Posts:
    275
    Are you going to change the way nodes look like? I just downloaded the example project and honestly as a user that has touched blueprints in unreal engine this doesn't look nice and is hard to read due to colours and weird sizes of everything which forced me to constantly zoom in and out to know what I'm looking at.
     
  2. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    Do you mean there will be custom nodes in C# that can be created?
    That would be pretty powerful.
     
  3. jocelyn_legault

    jocelyn_legault

    Unity Technologies

    Joined:
    Jan 16, 2019
    Posts:
    12
    We are acutely aware of this. We're going to be working on a reskin of the tool before we get to 1.0.
    On top of the reskin per se, we're also considering LOD for nodes, so when things get too small to be even read the actual UI structure of the node would change to be simplified so that we can still expose a meaningful set of information at any zoom level.
     
    JoNax97, V_i_T and Vectrex like this.
  4. theor-unity

    theor-unity

    Unity Technologies

    Joined:
    Feb 26, 2016
    Posts:
    188
    You can write nodes the same way we do it, is it what you're asking ?
     
  5. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    I don't know yet how the nodes are written, but I think yes.

    And anoter queston

    Is it possible to get and set values that are exposed on gameobject scripts in the inspector?

    For example if there is a slider control in the inspector that its possible to control the slider via a node.
     
    toomasio likes this.
  6. JoNax97

    JoNax97

    Joined:
    Feb 4, 2016
    Posts:
    611
    Oooh I like this. The big picture is kind of an issue in shader graph as andwell, I can see this helping in both cases.

    Also have you considered the idea of zooming into/ out of subgraphs? Instead of opening them in a new editor.
     
  7. jocelyn_legault

    jocelyn_legault

    Unity Technologies

    Joined:
    Jan 16, 2019
    Posts:
    12
    The a good chunk of the graph LOD stuff is going to be implemented in the common graphing layer that is currently being used by a few newer products. I certainly hope that ShaderGraph will migrate to this in the future, but I don't know
    a) when the LOD is going to go in and
    b) if or when ShaderGraph would migrate to this common graphing base.
    So zero promises on that front.

    AFAIK, this is not something we've considered. Not sure how scalable it would be either. That being said, I could see the appeal from a strictly UX point of view. I'll make sure to transmit the idea to our UX designers.
     
    JoNax97 likes this.
  8. toomasio

    toomasio

    Joined:
    Nov 19, 2013
    Posts:
    199
    Also wondering if this will be possible.
     
  9. ericb_unity

    ericb_unity

    Unity Technologies

    Joined:
    Nov 24, 2017
    Posts:
    167
    We have a task to get exposed variables back in the component.
     
    toomasio likes this.
  10. theor-unity

    theor-unity

    Unity Technologies

    Joined:
    Feb 26, 2016
    Posts:
    188
    do you mean getting/setting another monobehaviour's public fields ? if so, no, as we're DOTS only.

    We do have a task to show a graph's variables in the inspector of an object with that graph however
     
    toomasio likes this.
  11. theor-unity

    theor-unity

    Unity Technologies

    Joined:
    Feb 26, 2016
    Posts:
    188
    to give you a quick idea:
    Code (CSharp):
    1. public struct AbsFloat : IDataNode
    2.     {
    3.         [PortDescription("", ValueType.Float)] public InputDataPort Input1;
    4.         [PortDescription("", ValueType.Float)] public OutputDataPort Result;
    5.         public void Execute<TCtx>(TCtx ctx) where TCtx : IGraphInstance
    6.         {
    7.             ctx.Write(Result, math.abs(ctx.ReadFloat(Input1)));
    8.         }
    9.     }
    Code (CSharp):
    1. [NodeDescription("The Once node force anything passing through it to execute only one time. Ex: Placing this node after an On Update Event node, will make anything chained to it's output port execute only one time.")]
    2.     public struct Once : IFlowNode<Once.State>
    3.     {
    4.         [PortDescription("", Description = "Trigger the execution of the node.")]
    5.         public InputTriggerPort Input;
    6.         [PortDescription(Description = "Reset the Done state and let its execute.")]
    7.         public InputTriggerPort Reset;
    8.         [PortDescription("", Description = "Execute next action after changing its state to Done.")]
    9.         public OutputTriggerPort Output;
    10.  
    11.         public struct State : INodeState
    12.         {
    13.             public bool Done;
    14.         }
    15.  
    16.         public Execution Execute<TCtx>(TCtx ctx, InputTriggerPort port) where TCtx : IGraphInstance
    17.         {
    18.             ref State state = ref ctx.GetState(this);
    19.             if (port.Port == Input.Port)
    20.             {
    21.                 if (!state.Done)
    22.                 {
    23.                     state.Done = true;
    24.                     ctx.Trigger(Output);
    25.                 }
    26.             }
    27.             else if (port.Port == Reset.Port)
    28.             {
    29.                 state.Done = false;
    30.             }
    31.  
    32.             return Execution.Done;
    33.         }
    34.     }
     
  12. tslancik

    tslancik

    Joined:
    Apr 21, 2019
    Posts:
    14
    I noticed it's not possible to specify seed for the Random nodes, what is it based on? Is in nondeterministic?
    Would it be possible to add optional Seed port for deterministic results?
     
  13. tslancik

    tslancik

    Joined:
    Apr 21, 2019
    Posts:
    14
    Would it be possible to generally overload Setters?
    Set <Component> like Set Position currently only sets position, would be handy to have Combine Mode dropdown or even corresponding enumerated port , where User can choose a mode how to combine the value with original one (Set, Add, Subtract, Multiply, Divide, ...)
    Obviously this would depend on the component value type
    Vector, Float, Int components could have (Set, Add, Subtract, Multiply, Divide, ...) options
    Bool components could have (Set, And, Or, ...)
    Matrix, Quaternion components could have (Set, Premultiply, Postmultiply, ...)

    the Rotate By node is sort of functionality that could be achieved by this, but instead of having dozens of nodes for this, it would be just the setting of a single node
    - This would allow for flexibility in quickly trying different options or quickly altering copied graphs to different functionality
    - Also it's very compact workflow and avoids creating multiple nodes for basic operations like Get <Component>, Do Math ,Set >Component
    - Components like Rotation can have options to choose the type for example, so that Set Rotation can be set by plugging Euler Angles vector + Rot order, or by plugging in Quaternion value or by plugging in Matrix and it would internally do the math based on the Combine Mode chosen
    - to push it even further generic Setter with Dropdowns for Component, Value Type, Combine Mode would be extra great, and obviously dozens of aliases for such node are fine, but all of them would place this node in specific configuration, but user can still change if needed instead of replacing the node

    EDIT: It could have clear visual indicator of the Combine Mode it is currently in
    here is a coparison of very simple graph and how it can get rid of redundancy
    https://forum.unity.com/threads/dots-visual-scripting-experimental-drop-8.857707/page-2#post-5662939
     
    Last edited: May 23, 2020
  14. toomasio

    toomasio

    Joined:
    Nov 19, 2013
    Posts:
    199
    Yeah so in the "authoring" component where the graph field is, will variables of whatever graph you put in the field appear in the inspector based on what graph is selected...so you can have different initialized variables on each entity using that graph. Like "startMovementSpeed" for example, having different start speeds on separate entities.
     
  15. theor-unity

    theor-unity

    Unity Technologies

    Joined:
    Feb 26, 2016
    Posts:
    188
    everything's possible. we haven't spent much time on the random yet - what you see comes down to a proof of concept.

    seeing a script's variables in the inspector, yes. setting a random monobehaviour's variable from a script, no.

    We're discussing a solution like that. the issue is that it's down to the node author to implement each mode, but that's probably not worst thatn having to implement different nodes
     
    toomasio likes this.
  16. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    I'm sorry to say but not being able to set mono behaveour properties in the inspector makes the whole VS a no go for me personally.

    I will stick to playmaker and I'm already able to do everything I want there.



    Here's a nice story of how this tool makes games possible, I hope someone will make a bridge node that will enable the setting of mono behavour values.
     
  17. theor-unity

    theor-unity

    Unity Technologies

    Joined:
    Feb 26, 2016
    Posts:
    188
    I'm sorry, I'm still not sure we're talking about the same thing.

    Do you want:
    1. in a visual script, to declare a property (eg. "Speed"), then see/edit it in the inspector of an object with your script ? that's planned
    2. in a visual script, to manipulate a property of another, non-visual script monobehaviour (eg. RigidBody.mass) ? that wouldn't work with DOTS in general, hence not with DOTS visual scripting
     
  18. gghitman69

    gghitman69

    Joined:
    Mar 4, 2016
    Posts:
    93
    Hello I just tried visual script but before I coded in c # dots and I find for my part visual script very difficult in ordering (ex I want to do an action in update I place "Onupdate" then I would like inside " This "get" getComponent-Translation "then" Random a float3 "to put it in moveForward) each step connects from left to right but in visual script it is all different and therefore very difficult for beginners which I believe is not your goal. more direct nodes (simplify) would be faster ex (move forward, lookrotation) not having mathematical formula at all nodes
     
  19. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    Yes option 2
    https://hutonggames.fogbugz.com/default.asp?W696

    Like in this video.

    It does not have to be a script property
    It can also be for example Particle.rate

    Perhaps a future integration with bold will help with this?
     
    theor-unity likes this.
  20. + @theor-unity

    I think you guys are missing each other's point because you're talking in two different worlds.
    @Lars-Steenhoff yes, there will be ways to change effects and other parameters on other systems, but not like this, ECS and the DOTS-world in general does not work on the way the MB world does. You won't manipulate a parameter on a MonoBehaviour, you will set "the mass parameter on a physics body" or "change the rate of a particle system".
    But you cannot do it anywhere, ECS is performant because of the rules they set up, if you disregard them, you basically invite all the pain you have to set it up without any of the benefits.

    (ps: sorry to play the uninvited mediator here...)
     
  21. aabrownjr

    aabrownjr

    Joined:
    Apr 22, 2017
    Posts:
    4
    Is there a Ongui node? If not ow do i call the OnGui method from the visual scripting engine??
    Also, on a unrelated question,is there a node for UGUI (Unity'ss Canvas UI system)?
     
  22. aabrownjr

    aabrownjr

    Joined:
    Apr 22, 2017
    Posts:
    4
    In version 9, it seams as though I can no longer access many of the different variables types, things such as animation controllers, color, color32, texture, and many more, are no longer in the list of variable types that can be used.

    In previous versions of the visual scripting engine, I could select these variable types in blackboard, now it seams as though there no longer in the list of variable types.
     
  23. theor-unity

    theor-unity

    Unity Technologies

    Joined:
    Feb 26, 2016
    Posts:
    188
    Thanks ! I think you're right on our miscommunication. Does that answer your question @Lars-Steenhoff ?

    You can't use either with DOTS, same for us. We'll have a solution for UI eventually, but not for now.

    You can't anymore.
     
    aabrownjr likes this.
  24. theor-unity

    theor-unity

    Unity Technologies

    Joined:
    Feb 26, 2016
    Posts:
    188
    That's planned. we have a few proof of concept nodes already shipped - see the tween node as an example. of course we want a lot more nodes in the long run, however nodes like "Move forward" only work for prototyping or learning - on a bigger project "Moving" usually involves state machines/root motion/...

    Edit: I'd really like us to have a prototyping nodes library btw, AND the opportunity for more specialized productions to make their own node lib.
     
  25. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,079
    Bolt can absolutely replace code in many cases. Bolt 2 even more so now that it generates native C# and covers most of the Bolt 1' missing feature set. It might not be a good fit for AAA productions looking for every last drop of performance they can squeeze out of the engine, but for the rest of us? Bolt does just fine.

    I guess the question here is more about Unity's priorities. Seems like all recent advancements and decisions are being made in favor of attracting the AAA crowd and studios from other industries like TV and movies. Sometimes at the cost of Unity's primary audience - the indie crowd and mid-sized AA studios.
    I assume that's why the comments on these drops sometimes get heated. Devs who are mainly interested in DOTS VS solution and comment here want to make games entirely in a VS solution which does not align with Unity’s goals for the package. But those people (me included) are probably a loud minority.

    I wish my brain wasn't so visually oriented and I could stomach text coding better.
     
    Last edited: May 26, 2020
    needyme likes this.
  26. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,079
    Wires help but are not entirely essential. I think what makes VS better for me than text code are the nodes. In text you can type out the same thing in many ways and you have to remember all kinds of parameters and modes and what not, which usually leads to searching the API unless you’ve coded that thing multiple times in the past and know it well.

    As an indie I have to tackle new kinds of problems all the time, I can’t be experienced in everything so in VS there’s a single node for what I’m looking for, it already has all the parameters on it and I don’t have to worry about the syntax. So I can purely focus on the design and not the quality of my code and I can work on things I’ve never coded before quite easily. Perhaps it’s a crutch, but usually I don’t have to leave Unity to search the API, I just search for the thing I need in VS tool and go from there.

    Additionally, tools like Bolt and Flow Canvas have Live edit - I can code while playing the game as well as see values passed on connections in real time. It gives me significant speed gains in both prototyping and debugging. I often catch problems before they become problems because the values are all right there for me to view at every step of the logic. This is something C# can’t do without typing out an army of debug.logs.

    So while VS coding in tools like Bolt initially takes more time than traditional text, it’s much easier to maintain and extend long term for me as a visual thinker. And now that Bolt 2 will generate C# for builds - it'll have the best of both worlds - all the good aspects of visual scripting as well as the performance of native text code.

    Ideally DOTS VS would adapt the similar principles of VS scripting as a first class citizen but for ECS. But that’s my personal interest which might not align with studio pipelines where a tool like this would be in the hands of level designers and game designers rather than coders.
     
    Last edited: May 26, 2020
    neoshaman likes this.
  27. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    It would be interesting to have a system where you use a proper code editor to write DOTS systems and define entities, but the system dependency order was done in a visual tool instead.

    The problem there is going between the graph and the text editing - I don't want to enter text into a text filed in Unity - but you could probably solve that by adding buttons to the nodes that jumps you to the text editor.


    hnnnn... that's a very tempting experiment. In a custom-made engine, the order of things is easy - you go to the main-method and then find the core game loop and then check which order things happens in. Unity's MonoBehaviour world is the opposite - you're supposed to build behaviours that work independently of which order they execute in. That means that not having an explicit order you can see in a script is fine.

    DOTS very much order-dependent; the order in which systems run is a core part of the system. But the order is defined by declaring dependencies in text, which makes it very hard to actually grok the order of things.
     
    NotaNaN, Vectrex and Tanner555 like this.
  28. theor-unity

    theor-unity

    Unity Technologies

    Joined:
    Feb 26, 2016
    Posts:
    188
    You're right, designers are our target audience for VS 1.0. Doesn't mean we don't want to expand that later (I'd love to), but we had to pick an audience for 1.0 in order to avoir scope creep. Stay tuned, hopefully we'll have good news for you later.
     
    PanthenEye and JoNax97 like this.
  29. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    To answer, yes as long as I can easy change the particles, animation events, etc, I think I will be able to use it.
     
  30. picklemaster2000

    picklemaster2000

    Joined:
    May 28, 2020
    Posts:
    5
    How do I get the visual scripting window?
     
  31. m_cg

    m_cg

    Joined:
    Apr 20, 2019
    Posts:
    6
    create visual script and click twice on it or window(visual script)
     
  32. m_cg

    m_cg

    Joined:
    Apr 20, 2019
    Posts:
    6
    What am i doing so wrong ? I am working on custom rbd sim with houdini and seeing the collision effects is dream come true for me . Did same as in the demo , but my script does not get any created variables VS.jpg
     
  33. theor-unity

    theor-unity

    Unity Technologies

    Joined:
    Feb 26, 2016
    Posts:
    188
    Any error in the console ?
     
  34. m_cg

    m_cg

    Joined:
    Apr 20, 2019
    Posts:
    6
    That's it . So this is not expected behavior and the problem is in my tv, Hoped that there is something missing. You gonna give me heart attack , i am so eager to start playing with it.
     

    Attached Files:

    • VS.jpg
      VS.jpg
      File size:
      240.6 KB
      Views:
      417
  35. m_cg

    m_cg

    Joined:
    Apr 20, 2019
    Posts:
    6
    Forgot to mention something. Not sure whether it matter, but my variables do not have green point in front of the name . Way is that so?
     
  36. picklemaster2000

    picklemaster2000

    Joined:
    May 28, 2020
    Posts:
    5
    Is there an alternative way because that doesn't work for me, maybe I set it up wrong somehow. Thank You
     
  37. m_cg

    m_cg

    Joined:
    Apr 20, 2019
    Posts:
    6
    You must have set it very very wrong, if you can not open script by clicking on it . Thought that i screwed it but youuuuuuuuuu . Suggest you to create new project with the recommended version. What i do is to create empty project, drop the demo files inside, run it from Unity hub and it will update . That's it.
     
  38. picklemaster2000

    picklemaster2000

    Joined:
    May 28, 2020
    Posts:
    5
    I will try that, but it never game me the option to create a visual script. That is what I meant.
     
  39. picklemaster2000

    picklemaster2000

    Joined:
    May 28, 2020
    Posts:
    5
    f
    for some reason it is still not letting me create a visual script. I did what you said and there is still no option for it.
     
  40. picklemaster2000

    picklemaster2000

    Joined:
    May 28, 2020
    Posts:
    5
    Do I have to set it up other than dragging the files into my project. There is no option to create a visual script.
     
  41. m_cg

    m_cg

    Joined:
    Apr 20, 2019
    Posts:
    6
    Close Unity editor, merge the demo files within your project directory and run it
     
  42. sinjinn

    sinjinn

    Joined:
    Mar 31, 2019
    Posts:
    149
    is anybody doing any tutorilas on this...
     
  43. About what? There is not much you can do in this yet which is super-useful for real. You can play around with the system, but it is very far from ready let alone stable. Things always change, no reason to make tutorials for this just yet.
     
  44. sinjinn

    sinjinn

    Joined:
    Mar 31, 2019
    Posts:
    149
    Turorial on how to get started for dummies. Also, how many years away is this in your estimation? I remember a talk in which they said "The MVP of DOTS, DOTS VS, coming to preview in 2020.1". I'm guessing this is now a grossly innacurate estimation.
     
  45. ans_unity

    ans_unity

    Unity Technologies

    Joined:
    Oct 12, 2017
    Posts:
    124
    Have you tried the demo project we included with this drop? While not a full fledged tutorial, the project does try to show how to get started with simple examples.
     
    quabug likes this.
  46. HeliosJack

    HeliosJack

    Joined:
    Aug 15, 2013
    Posts:
    41
    Hey, just a general shout out to the devs for tackling all the feedback and criticism in here. Its really cool to see that you are actually listening. It seems clear from your posts that your team's internal conversation about VS is growing and you are learning from us and about us as users. As a user story, I fall in with the awesomedata/Vectrex persona, but as a Unity community member, I really can't state strongly enough that I admire your team that you fight us _and_ you learn from us.

    I know it must be especially tough to see the same criticisms seeming to replay over and over. But you seem to be reading each of them to try to understand them on their own grounds. It seems like you're being very generous of your time and your insight. Thanks, sincerely.
     
    Last edited: Jun 2, 2020
    awesomedata, NotaNaN, Ofx360 and 9 others like this.
  47. theor-unity

    theor-unity

    Unity Technologies

    Joined:
    Feb 26, 2016
    Posts:
    188
    Much appreciated !
     
    awesomedata, NotaNaN, Ofx360 and 3 others like this.
  48. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913
    I think this is the key point. It's basically a fancy way to browse through the API in an organised way, without leaving the editor. And each node is usually fully documented. You can find things easily, like with the Add Component button on GameObjects. Visual Studio's Intellisense just lists everything in existence.

    If there was a VS addon that supported a more organised intellisense for when you press Ctrl-Space, where it was categorised in a similar way to the Add Component menu, then it would help non-coders a lot.
     
    NotaNaN and PanthenEye like this.
  49. Karsten

    Karsten

    Joined:
    Apr 8, 2012
    Posts:
    187
    Something is telling me that this will get lit af!
    Keep it going, never give up!!!
     
    theor-unity likes this.
  50. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,079
    That and not having to declare a billion local variables since nodes have both inputs and outputs, it's all in the background, VS tool only exposes the most essential information to you.

    I can open some graph weeks or months later and still perfectly know where everything is and what it does. I can't say that about text code, especially if it's not commented. I have to re-visualize the abstract structure of text code and rebuild it in my mind. Maybe that's related to how my brain works though.
     
    NotaNaN likes this.