DOTS Visual Scripting 6th experimental drop

Hi everyone,

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

This time around we are using a Unity package for the drop but it is not visible by default in the package manager. You will need to enable it by adding this line in the manifest under dependencies:

“dependencies”: {“com.unity.visualscripting.entities” : “0.2.3-preview”}

You’ll need to create a project using 2019.3.0f3
(Unity 2019.3)

New features / nodes

  • Control Flow: Execute Once

Execute some nodes only one time particularly when the node is in an update event.

  • Switch Control Flow

Ability to have different flows depending on a value

  • Tracing on Single nodes

Ability to select a specific node and track when it’s being triggered on a recorded session.

  • Show/Hide

Stacked node showing/hiding a hybrid renderer object.

  • Enable/Disable Collision

Ability to enable/disable physics DOTS component

  • Support Jobs in onstart/onEnd stacks

onStart / onEnd events can now be converted to Jobs System

Fixes

  • VSB-418 Right clicking on an empty/default blackboard throws NRE
  • VSB-412 Line numbers are overlapped on the code if the code is longer than 100 lines.
  • VSB-411 PostIncrement error
  • VSB-404 Missing constant fields in searcher
  • VSB-403 Missing UsingDirectives when create node with MethodSearcherItem attribute
  • VSB-402 Graph with only a query in it will show errors in codegen
  • VSB-400 Update After / Update Before settings in inspector is missing
  • VSB-393 Some binary nodes have the wrong ports types
  • VSB-391 Tracing isn’t working with custom function in graph
  • VSB-389 Function nodes don’t work at runtime
  • VSB-388 Macro nodes don’t work at runtime
  • VSB-386 Warning whenever we open the codeviewer
  • VSB-384 Nothing is executed in a coroutine if connected to a separate Stack
  • VSB-383 Can create two ‘‘then’’ from an IF
  • VSB-381 Coroutines aren’t working in OnKey events
  • VSB-380 Error in blackboard after deleting a graph
  • VSB-378 1 frame delay due to coroutine initialization/completion
  • VSB-377 OnEvent stack with a coroutine doesn’t compile
  • VSB-376 Errors with Recorder when using translation in a move to
  • VSB-369 Error is not raised when something is wrong with a coroutine node.
  • VSB-270 Creating a loop directly from the event stack will put the loop stack behind it
  • VSB-269 Creating a macro with a sticky note will not remove sticky from root graph
  • VSB-245 Some edges won’t auto connect

Known issues

  • Event’s aren’t consumed outside of the Entity that sent it
  • Issues with Physics and coroutines
  • Upgrading graphs from Drop 5 will have issues (converting add/multiply… to equals)
  • The component array of the second ForAllEntities node is not passed to the job.

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.

Most notably, we are still far from the final user experience, the complexity you see here is not representative of what we want to deliver. We have not yet created high level nodes to reduce the number of operations or finalized our UI to make interactions as intuitive they can be.

So kindly take note of the usual disclaimers:

  • Not for production use.
  • Early picture of Visual Scripting, not be representative of the final version.
  • You will need to be tech savvy to use this version. Not yet ready for everyone.
  • Things will change.

Most of the team will be away for the Holidays, and will be unable to respond to your feedback immediately. We will be back in January, ready to work on the next version!

Happy Holidays to you all!

9 Likes

This might be from my C# version or something but line 143 of com.unity.visualscripting.entities@0.2.3-preview\Runtime\TracingRecorderSystem.cs thinks that Time refers to ComponentSystemBase.Time, which cannot be called from a static context, rather than UnityEngine.Time. This was fixed by changing
var frame = Time.frameCount; to
var frame = UnityEngine.Time.frameCount;

I had to do this last version too, but then I could just edit the source file, now they are coming straight from packages, so my modifications will be undone next time I open the editor

6 Likes

This only happens when you have the DOTS Editor package also installed. It would be nice if this is fixed so you are able to use the DOTS Editor with Visual scripting out the box.

Also to have your changes stay you can make the package local as if you were downloading the previous drops. Just copy the package from Library/PackageCache/Packages you want to move - You can move the packages you want to modify to Your Project/Packages (Where the manifest file is and all packages placed in that folder will automatically import)

8 Likes

Bug report:

  1. creating more than one custom functions in a graph, it usually got errors.
  2. using “if” node in a custom function, the function will get crashed.
  3. when senario 1 or 2 happens, you will never call any custom graph function in your main thread.
  4. custom function doesn’t support reference function parameters( ref float a).
  5. sometimes a custom function can be created inside a stack, sometimes the same function can only be created from graph(out side of stacks).
  6. cannot “get item” directly form a float 3x3 node. But you can create a “get item” node out of other type(like float3) node, and connect the “get item” node with “float 3x3” node, it works.
  7. I lost all my connect lines after saving graph with above bugs.

Hi, thanks for the feedback.
1 - 3 and 7. Can you post a screenshot of your graph?
4. This is a known issue. Ref and Out keywords are not supported yet.
5. If your function returns a value this is a graph function. If the function just returns void, then it’s a stack function. The difference between what you can create on the graph or in a stack is that only data can be created on the graph. If you want to manipulate data, that’s in a stack. That’s why only graph nodes have output ports.
6. Will be fixed.

1 Like

5300691--532368--bugreport201912200.jpg
Thank you so much for your reply.
It might because of what you said, "If your function returns a value this is a graph function. If the function just returns void, then it’s a stack function. "
New bug report:

  1. I just noticed that float2x2, float3x3, float4x4 variable cannot be created from blackboard.
  2. It seems that “Once” node should swap “if done” and “otherwise”, according to the code generated.
1 Like

Hello,

I’ve downloaded Unity 2019.3.0f.3 then added the line of code “com.unity.visualscripting.entities” : “0.2.3-preview” to the manifest.json file but don’t see the DOTS menu items, can someone point me in the right direction. I’m charged up to help!

I’m not sure how to delete this post but 3rd times a charm its working now :wink:
Edit / Update: Ok, so far I’m loving this!!!

I’ve noticed that after connecting a variable to a node (multiplier in this case), the mul float parameter inside of the node disappears (I’m assuming this is by design).

Also when in play mode objects that are used in an ECSgraph disappear from the hierarchy, it looks like this is the reason for the Entity Debugger once an item is selected the details show up in the inspector. One hurdle nothing is selectable in the scene view?

P.S. did I say Im loving this (tool tips are sweet)!

2 Likes

Hi, glad you like it. And it’s not done yet.

Yes, it is by design.

It is not related to Visual Scripting. That’s the entity conversion flow. Once a GameObject is converted to an entity it is removed from the hierarchy view. But you can see the entity in the Entity Debugger.

1 Like

How’d you get it to work I still can’t find it?

1 Like

What’s the thinking behind the “Visual Script → New Event” menu option?
It defines a bufferElementData, but not sure how I might use this for events in dots.
Simply check the buffer contents in a system?

1 Like

I’m running the editor in the light color theme and this is how the new component window looks, barely readable. Also the script preview window was show on top at the exact same location so I didn’t know that there was this second window below it at first

I followed the video by CodeMonkey during testing out the Visual Scripting system myself, you can find his video here

Overall I’m starting to see how to use the Visual Scripting system, as expected it’s not production ready in any way but that’s very clear from the main post.
Here’s a bunch of things I noticed during my testing

  • A new ECS Graph doesn’t auto open whereas the new Components do automatically open
  • Can’t press delete or backspace on an object to remove it inside the blackboard
  • The ECS graph opened with the OnUpdate in the top left corner cutting off “My Query”, this made me think that it was some kind of tools tab or the component menu at first glance
  • The overall theme is very much focussed on the dark mode even when using the light mode. Not all text is readable because of this
  • Error tooltips don’t try to stay within the bounds of the ECS graph window, they can easily be cut off at the edge
  • The icons in the top look like they are disabled in the light theme, the Save icon looks fine but the others all look grayed out, did not know I could click on them because of this.
  • A double click is required to add a component to a query where a single click could be enough
  • When you drag out a node from the bottom of the on-update and similar it doesn’t automatically show the function window, you need to press spacebar first. This shouldn’t be required imo
  • It’s not that intuitive how you can drag nodes around, when you hover over a node and it shows a line in between the top of the node-stack and function itself (a single if-statement in my case) you can’t drag it to move the node around.
  • The ‘Get Property’ → ‘Properties’ → ‘Edit Ports’ workflow for getting a single value from a component is not that user friendly.
  • When adding a new field to a component the code-viewer automatically shows up even though I closed it right after creating the component
  • A blank/unsaved component script can’t be added to a gameobject, it gives the error “Can’t add script behaviour MoveDirection. The script needs to derive from MonoBehaviour!”
  • It’s not visually obvious that you can add a function back into a node-stack, there are two tiny blue dots at the sides but the “press spacebar” text seems to be on top of this. It does work when there already is a node inside the stack
  • In the component editor you can’t press CMD+s to save it, you have to press the save button at the bottom
  • It would be nice to have a way to control what nodes will be moved when you drag a parent node. Right now it always moved the entire stack so you’d have to work from left to right instead of just moving a single node
  • I can’t drag a component from the Blackboard into the script
  • When dragging out a node from a component the ‘functions menu’ appears on a completely different position than the visual script window (not the window is not in the top left corner but in the center of my screen and not full-screen) could either have something to do with display scaling or it not taking the window position into account.
  • Align node/hierarchy allows nodes to overlap each other
  • On the “Translate by” function, the add boolean is kinda odd, I know what it means but it’s not that intuitive.
  • CMD+Z doesn’t fully respect the position of nodes, I just added a Greater Than node to a property output, it moved the child node down to that location (the point I referred to earlier), I pressed CMD+Z and the Greater Than node did disappear but the location didn’t properly restore itself.
  • Can’t shift scroll in the code-viewer to scroll horizontally
  • Saving a visual script isn’t enough to get it to run, you also need to build it (at least it doesn’t auto build all the time)
  • In the first couple seconds the gameview in the editor lags quite a bit, might be related to 2019.3 in general though.

And I’ve also got two things that I felt were missing:

  • Having a snap to grid on the nodes would be very welcome, or some kind of auto align tool depending on the nearby nodes.
  • A way to add comments would be highly appreciated

Overall I like the direction where this is going, it’s got a long road ahead but there’s some hard work being done!

I might try to make some more stuff and could also have a look at the video posted on the Unity Channel on Youtube regarding ECS and taking input from the user and re-producing that in the Visual Scripting to see how feasible it is right now to follow coding tutorials with the Visual Scripting system :slight_smile:

7 Likes

Yup I just posted that video, hope it works as a useful introduction!

One more issue I noticed while recording, if you create a new Component, and then switch to another window before hitting “Save”, it will create the Component without “Proxy” in the name.
Create Component named “Test” → Alt Tab to another window → Back to Unity → New file shows up, Test.cs
If you click “Save” it will rename itself to TestProxy.cs, if you forget to hit “Save” it will stay as Test.cs and be unable to drag into a Game Object.

Also is there a reason why the Blackboard isn’t visible by default? Seems like it should automatically open as soon as there’s a Query in the script.

I’m planning on doing a complete simple game using only Visual Scripting so will have more feedback soon.

Keep up the great work!

13 Likes

I’m also noticing that the search window doesn’t like it when I try to fuzzy search, if I search for “float2” I don’t get the option to create a Float2 object, but if I search for “float 2” I do, the only difference is the spacebar

1 Like

@ICEC00L3D
In the Unity Hub goto installs (left hand side), then click on the add button (top right), once you have installed 2019.3.0f launch it, create a project under somename. After creating a project close Unity, find that folder “somename” on your system inside those folders there is a folder named “Packages” inside that folder there is a file name manifest.json open it up and “com.unity.visualscripting.entities” : “0.2.3-preview” to the list of others (hint if you put it on the first line add a comma “,” at the end (both of these without parenthesis), restart unity and you should see the DOTS menu item in the top bar. (game on :))

@jeanedouard_unity
Thank you very much! I did some research and realized the difference between entities and objects and so much more :slight_smile:

@CodeMonkeyYT
Keep those UVS tutorials coming, myself and the community will surely benefit (hopefully your youtube channel will as well)!


I’m absolutely loving this (woohoo, dots and visual scripting)!!!

3 Likes

Is there a way to handle UI?
From what I understand DOTS isn’t yet set up to handle UI so since Visual Scripting is DOTS only I’m guessing it can’t be done yet.
If so, is the plan to wait for a official DOTS UI or will there be some workaround to work with Unity.UI?
Trying to make a simple game completely without writing any code.

3 Likes

Not at the moment. We have plans for UI, but you’ll have to wait a bit more.

Btw great tutorial ! you and @wilson_p are doing great work

3 Likes

Is there a way to add other field types to components? I have a custom struct that I’d like to use.

1 Like

I’m also not understanding how to modify components in this. The graphs automatically adds the Read Only parameter and does not remove it when I change the value (which, obviously, throws an error) How do I go about removing the read only parameter?

I’ve also noticed it can’t create a struct variable. I can create it but it throws errors since it won’t use a default value and I can initialize it until it compiles so it’s currently impossible due to errors preventing the window from recompiling.

1 Like

[UpdateAfterAttribute(typeof(StartProductionGraph))]
public class UpdateProductionProgressGraph : JobComponentSystem
{
    private Unity.Entities.EntityQuery Worker_Query;
    [BurstCompile]
    [ExcludeComponent(typeof(LockedTag))]
    struct Update_Worker_Query_Job : IJobForEachWithEntity_ECC<WorkerComponent, WorkerProgressComponent>
    {
        public void Execute(
            Unity.Entities.Entity Worker_QueryEntity,
            int Update_Worker_Query_JobIdx,
            [ReadOnlyAttribute] ref WorkerComponent Worker_QueryWorkerComponent,
            [ReadOnlyAttribute] ref WorkerProgressComponent Worker_QueryWorkerProgressComponent)
        {
            Worker_QueryWorkerProgressComponent.ProductionAmount = (Worker_QueryWorkerProgressComponent.ProductionAmount + Worker_QueryWorkerComponent.inputProgress);
        }
    }

    protected override void OnCreate()
    {
        Worker_Query = GetEntityQuery(
            ComponentType.Exclude<LockedTag>(),
            ComponentType.ReadOnly<WorkerComponent>(),
            ComponentType.ReadOnly<WorkerProgressComponent>());
    }

    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        {
            inputDeps = JobForEachExtensions.Schedule(new Update_Worker_Query_Job()
            {
            }, Worker_Query, inputDeps);
        }

        return inputDeps;
    }
}
1 Like