DOTS Visual Scripting Experimental Drop 9

Drop 9 of Visual Scripting for DOTS is ready for you to try!

Hi everyone, this time around we focused on events and tracing, which we hope you will find useful.

You will find the drop 9 project .zip in here
And a demo project here

The demo project includes everything from drop 9 so you do not need to install both.
It will provide a few examples with documentation to help you start if it’s your first time.

Just look for the 00_Example scene:

We recommend using 2019.3.8f1 since 2019.3.11f1 has some performance issues on larger graphs (>30 nodes).

What’s new?

  • Send and receive events to/from the code from/to visual scripts using On Event/Send Event nodes.
  • You can now choose which scripts are traced.
  • Portals
  • Data Node: This
  • Data Node Select
  • Expression Node
  • Basic node documentation in searcher

Known issues / Limitations

  • Tracing on portals isn’t supported
  • Events only accepts string128
  • Jobs that dispatch or receive events are not Burst compilable yet
  • You must call Complete() on the jobHandles that dispatch or receive even
  • Editor is slow when many nodes are present in the graph. This will be fixed in 2019.3.13f1. Reverting to 2019.3.8f1 is also possible.

Disclaimers

As with the previous experimental drops, this is work in progress that we share to engage in an open discussion with our community. Expect issues and weird workflows as we work our way up to a more final product.

So kindly take note of the usual disclaimers:

  • Not for production use.
  • Early picture of Visual Scripting, not be representative of the final version.
  • Things will change.

Feedback

We are very grateful for your feedback. Even if we do not have the time to answer and debate every point, rest assured we read every comment.

Kindly keep the exchanges polite and constructive. The forum is a space for us to learn and discuss.

Stay safe.

9 Likes

“This” is great

Portals probably should have a way to be titled. Seems kind of confusing that every one would be named “Data Portal” and the only way to know which start and end point belong to each other is by hovering them. I like the typical way this is done, where you give a start portal a title, and then when you add an end point, you get a nice drop down with all the start portal titles to pick from and link too.

That and/or allow the start portal node color to be linked to the end portal node color

Then there is this:

I don’t think that’s supposed to be allowed! Event edges don’t seem to break when other events are added - at least visually

Also parts of the UI is kinda hard to read atm!

Side note, i’m sure you’re aware but getting some really bad GC spikes:

Portals:

  • To rename a portal, simply double click on one, all opposite portals will be renamed at the same time.
  • We still have a huge pass to do with colors in general. We have the same issue with variables.
  • You can at the moment press ctrl+f and search portals by name. (Press enter to to focus on the selected item. WIP)

Node inspector:
Should be fixed in next drop.

Then there is this:
As you can disable nodes, the only thing we may do is add warnings in the future for stuff like in your screenshot.

Spikes:
We are aware of perf issues.

2 Likes

Hi you disabled connectors in this version? How do I enable them?


Thanks!

Also like the Data portals idea. Will play around with this more.

The current implementation is focused on correctness - once the runtime has the right behaviour, we’ll start implementing a performant runtime. That way we can iterate fast now and have unit tests comparing the two backends.
Meaning, we’ve been actively avoiding optimization until now. We’ll start working on low hanging fruits ( like these spikes) for the next drop

1 Like

Simply select the disabled nodes and right click to get to option to enable.
5854564--621964--EnableDisableNodes.gif

1 Like

The Input axis node will only be accessible in the demo project. this is a custom node to give some support for inputs until we make the real thing. I also added 2 nodes in the project to show how to make your own nodes. Warning, TechArt code :P.

Yes exactly. Really cool. :slight_smile:

1 Like

No, I don’t see connectors, but they work correctly, just invisible. Maybe it is a rendering bug in this window.

Ahh ok, cool

I’m guessing then any number of Events can trigger whatever they’re hooked up to as well, or does all but one need to be disable for it to work?

Oh, the edges between ports? looks like a bug. any error in the console ? which version of unity and os ?

You can hook multiple events on nodes and it will work.

5855029--622027--upload_2020-5-15_14-31-3.png

1 Like

Got some render issue.


Ports on disabled node are not displayed correctly.


Control points do not move with Placement.

Thx, those issues are already logged.

Anyway to get enums to show up in the nodes? Or do you have to make separate nodes similar to your getaxis node?

I would like my ‘space’ variable to show up here:

[Serializable]
    [WorkInProgress]
    [NodeDescription("Translate an Entity based on input and multiplier.")]
    public struct Translate : IFlowNode
    {
        [PortDescription("")]
        public InputTriggerPort Input;
        [PortDescription("")]
        public OutputTriggerPort Output;

        [PortDescription(ValueType.Entity, Description = "The GameObject that will change its position.")]
        public InputDataPort GameObject;

        [PortDescription(ValueType.Float3, Description = "Translation direction")]
        public InputDataPort Direction;

        [PortDescription(ValueType.Float, Description = "Speed of the translation")]
        public InputDataPort Multiplier;

        public enum Space { Self, World }
        public Space space;

        public void Execute<TCtx>(TCtx ctx, InputTriggerPort port)where TCtx : IGraphInstance
        {
            var entity = ctx.ReadEntity(GameObject);
            if (entity != Entity.Null)
            {
                var t = ctx.EntityManager.GetComponentData<Translation>(entity);
                var r = ctx.EntityManager.GetComponentData<Rotation>(entity);

                var translation = math.normalizesafe(ctx.ReadFloat3(Direction)) * ctx.ReadFloat(Multiplier) * ctx.Time.DeltaTime;

                if (space == Space.Self)
                    translation = math.mul(r.Value, translation);

                t.Value += translation;

                ctx.EntityManager.SetComponentData(entity, t);
            }

            ctx.Trigger(Output);
        }
    }

Windows 10, Unity 2020.1.0b8, 1 error:

UnityEditor.EditorGUIUtility:LoadRequired(String)
Unity.GraphToolsFoundations.Bridge.GraphViewBridge:OnEnterPanel() (at Library/PackageCache/com.unity.graphtools.foundation.overdrive@f688d1899a2a-1589291002000/Editor/InternalBridge/GraphViewStaticBridge.cs:435)
Unity.GraphElements.GraphView:OnEnterPanel(AttachToPanelEvent) (at Library/PackageCache/com.unity.graphtools.foundation.overdrive@f688d1899a2a-1589291002000/Editor/GraphElements/Views/GraphView.cs:778)
UnityEditor.VisualScripting.Editor.VseWindow:OnEnable()
UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget(String)
UnityEditor.WindowLayout:LoadDefaultWindowPreferences()```

Nevermind…it appears off to the side. I don’t know if I like that. Why not just put it right on the node? seems very off to me.

need to do this first in code:

public struct Translate : IFlowNode, IHasExecutionType<Translate.Space>

edit: I guess I can understand if you have a huge monolithic node to have the execution types off to the side like that…but is there a way to put it right on the node if you want to?

How do you get non-object variables to show up in the inspector? Like “speed” for example.

We don’t support 20.1 yet, can you try the version provided in the first post ?