#archived-dots

1 messages ยท Page 140 of 1

loud matrix
#

yeah, I think my camera system got confused, its rocking 49ms now

storm ravine
#

Yep

#

dynamic batches

#

I guess that part of RenderMeshSystem takes that (most part if not all)

#

Something like AddBatch

loud matrix
#

or not

wary kiln
#

Guys, is dots really worth it?

loud matrix
#

RUN RUN WHILE YOU CAN!

wary kiln
#

Or it is just for specific cases?

naive parrot
#

Guys, is dots really worth it?
@wary kiln Unity performance by default.

storm ravine
#

or not
@loud matrix it indicates only that other system jobs takes long time

#

And camera follow only wait when that other system jobs completes

wary kiln
#

Yeah but i feel like it is a lot more complicated @naive parrot

naive parrot
#

@wary kiln depends on what you seek out of it. which part , or all of it.

storm ravine
#

Yeah but i feel like it is a lot more complicated @naive parrot
@wary kiln It's simple and easy

wary kiln
#

Im making a webgl game

#

Like a moba type game

naive parrot
#

ECS for architectural gains or entire stack , mainly Jobs/Burst for speedups

storm ravine
#

Tiny is for you if you targeted to web

wary kiln
#

Tiny is for you if you targeted to web
@storm ravine What do you mean?

storm ravine
#

@loud matrix check timeline profiler here and you'll see what takes that 49ms

naive parrot
#

one of the biggest deciding factor is how much experimentation and research you willing to do thats not readily accessible out of the box as of today. @wary kiln

storm ravine
#

@storm ravine What do you mean?
@wary kiln Project Tiny.

coarse turtle
naive parrot
#

@storm ravine What do you mean?
@wary kiln its a runtime package for bite sized game based on DOTS

naive parrot
#

MOBA is nothing fitting of tiny though!

#

in conventional terms

storm ravine
#

Well it's tiny enough ๐Ÿ™‚ not so different from network racing game ๐Ÿ™‚

naive parrot
#

tiny is impractical when it stripped down version for full blown DOTS at this point. and far more incomplete

#

and undergone so many re writes

#

not reliable or ready for production at all

#

its in limbo from what i see

wary kiln
#

But what is dots mainly applied? I have seen it used for a big numbers of entities

naive parrot
#

they keep changing its scope and definition

storm ravine
#

Every thing can be Tiny, but how tiny it will - up to devs ๐Ÿ˜„

wary kiln
#

So it is useful for a lot of entities

#

But does the performance increase is significantly in a first person shooter game?

naive parrot
#

there are fundamentally 2 gains you can get out of DOTS. 1 is architectural pattern using ECS. 2nd is performance using SIMD friendly code that runs nicely on multiple core using Jobs/Burst

wary kiln
#

Does dots improve graphics performance?

storm ravine
#

HRv2 yes

naive parrot
#

But does the performance increase is significantly in a first person shooter game?
@wary kiln its not that definitive if you are not capable of writing well optimized low level maths operations that go wide well on parallel cores

storm ravine
#

But it require URP\HDRP

#

Because of how it implemented

wary kiln
#

Im using the urp

naive parrot
#

HRV2 is stilly mainly HDRP focused but better support for URP is planned

wary kiln
#

Idk, dots seems so unfamiliar if you know what i mean

#

Harder to understand

naive parrot
#

it is. its an entirely different paradigm from OOP. DOD

storm ravine
#

Yep because HR team was targeted on HDRP first, because of Unite sample projects ๐Ÿ˜„

loud matrix
#

@storm ravine Really don't know to read timeline profiler, where should I be looking?

storm ravine
#

click at long LambdaJob

naive parrot
#

@loud matrix your ForEach generated code

storm ravine
#

which takes 39ms

#

You can use .WithName("Your for each name") for better naming

loud matrix
#

Where are you seeing this?

naive parrot
#

Worker 6

#

that you selected

storm ravine
naive parrot
#

read the method name

loud matrix
#

Ahhhh thats how you saw 39

#

i couldn;t see it right at the end and was confused :p

naive parrot
#

you can select the bar and hit F

#

to expand

#

and see names /values better

loud matrix
#

Well thats easier than scroll for zooming ๐Ÿ™‚

naive parrot
#

sure is

#

works across the editor to focus on stuff. including animation curves. quite handy

storm ravine
#

What if I say that you can even see jobs flow here ๐Ÿ˜„

loud matrix
#

One massive display of my incompetence at a time please @storm ravine

storm ravine
#

Not flow which you expected ๐Ÿ™‚

wary kiln
#

Does all those Dots packages make the webgl build bigger?

#

An empty classic unity project would be like 3 to 4 mb

loud matrix
storm ravine
#

2019.3?

loud matrix
#

Yup

storm ravine
#

Ah ๐Ÿ™‚

loud matrix
#

You on fancy pants 2020 beta?

storm ravine
#

We always on latest beta

#

and from time to time on alpha

#

That flow looks like this

loud matrix
#

Ahh, I tried setting it up at start but had some conflicts the day i was setting up.

storm ravine
#

White lines and arrow, which show your system jobs flow

grim walrus
#

For 2D, what's the difference between the Entities and 2D Entities packages?

#

Do I need both?

storm ravine
#

2D Entities is for Tiny

grim walrus
#

Ok

storm ravine
#

Entities is regular DOTS package

#

BTW Entities is Dependency for 2D Entities

grim walrus
#

Ok. So for a regular 2D game I only need Entities?

storm ravine
#

When you install 2D entities you'll have entities also

grim walrus
#

Ok

storm ravine
#

2D Entities you need when you use Tiny

grim walrus
#

@storm ravine One more quick question. How much has ECS changed over the last year? Is a tutorial from a year ago still going to be relevant?

storm ravine
#

Which tutorial?

grim walrus
#

I'm taking a look at this

#

and Code Monkey's other stuff

loud matrix
#

Some of his stuff has been changed, usually to easier ways of doing things like setting up Jobs

storm ravine
#

Read docs and samples repo, and source code

#

best up to date tutorials

grim walrus
#

Ok

storm ravine
#

And look at changelog of course

grim walrus
#

I guess I'll watch through the tutorial to get a rough idea then look at the docs

loud matrix
#

Make sure to ask any and all stupid questions here, hopefully It till make me look better. Or worse, more likely worse.

grim walrus
#

Ok, I'll probably have a lot of questions to ask here haha

storm ravine
#

Check forum first

#

It already have answers to all "beginner" questions a lot more than once ๐Ÿ™‚

grim walrus
#

@storm ravine Wait does ECS not support Linux yet?

#

I'm getting DllNotFoundException: libdl.so after doing nothing

#

I have my PC dual booted with Windows/Linux, so I might have to switch to Windows for ECS stuff

storm ravine
#

Install libc6-dev

grim walrus
#

Okay I'm installing it

storm ravine
#

And restart Unity after that if opened

#

It should solve your problem

#

I guess you see Burst in that error message ๐Ÿ™‚

grim walrus
#

I'm curious, are you on Linux as well?

storm ravine
#

No

#

Win

grim walrus
#

Ah ok

#

It installed, just waiting for Unity to restart

loud matrix
#

Am i blind or is there no current docs for unity.mathmatics? The latest docs is just a single page and the old one is missing some bits.

naive parrot
storm ravine
#

All "docs" for mathematics is inside source code

grim walrus
#

@storm ravine Yeay that fixed the error! I can't thank you enough

#

Got a nice clean error log now ๐Ÿ˜„

storm ravine
loud matrix
#

@storm ravine thought as much, annoingly my goto def doesn't work and I've been trawling the git repo to try and find stuff

storm ravine
#

tbh math lib documented very well

#

But not exposed in intellisense

naive parrot
#

@loud matrix should vectorize nicely on burst compilation. havent run since couple component were missing on my end. do check.

loud matrix
#

I'm in VSCode so guess not exposed there eigther

storm ravine
#

Not exposed everywhere

#

But docs here ๐Ÿ™‚

loud matrix
#

Guess I'll stick to using the git repo for my docs then

#

@naive parrot thanks Ill have a look ๐Ÿ™‚

storm ravine
#

Well i'm on Rider, thus source code already here ๐Ÿ™‚

#

Even without resharper decompiler

#

Unity show all source code for packages in pretty nice way

loud matrix
#

Stupid Jetbraisn and their new subscription model, I had their entire suite back in the day but it's all useless now

storm ravine
#

Why useless?

loud matrix
#

You no longer get a discount for "owning" the old versions

#

unless they flip flopped on it again

storm ravine
#

I switched to rider after 7-8 years of VS, first step was resharper, and now I don't even think about moving out from rider last 2-3 years (I count only IDE for Unity here, not every IDE\code editor which I using)

loud matrix
#

I just really dislike their new business model, expecially how they changed from ownership to subscriptions as it kinda screwed me over

#

I'd use Atom if it wern't such an arse to setup for c#

storm ravine
#

Well tere is subscription ages on backyard, everything is by subscription ๐Ÿ˜„ But it's personal choice of course ๐Ÿ™‚

#
  • it also perfect IDE for mac ๐Ÿ™‚ IMO
loud matrix
#

Yeah we still pay for webstorm for macs, though I probably should cancel that. I started using Atom for easy switching from my PC to work MAC

storm ravine
#

Yep webstorm in my work IDE list too

chilly halo
#

Hello Again.

First Thanks for the help , I was able to figure out how to do what I wanted, I ended up using a custom Native Container and a Custom Job to iterate over it. It works like a charm.

Quick question I didnt find in the Docs. How can I link a Dispose from a NMHM to a Job? Dispose(Job) is not working.

sleek ember
#

Hi Guys
how can I get unique id of an entity cause the index and version seems to be changing all the time ?

chilly halo
#

@sleek ember AFAIK ... you cant and you shouldnt.

ocean tundra
#

Wait.. I thought once you have a Entity as long as you dont destroy the enity (with things like EntityManager.DestroyEntity) it will always be valid and point to the same thing. As long as you use Entity, not saving things like Entity.Id

naive parrot
#

@chilly halo do you want to dispose your native container at end of your job? you can pass jobHandle to nativeContainer.Dispose( ) if thats what you need..

ocean tundra
chilly halo
#

@naive parrot I think I know why is not working.

I have something like this.

OnUpdate(JobHandle inputDeps)
if(something)
---For(some loops)
--- --- JobHandle myDeps = default()
--- --- myDepsDeps = Job1.Schedule(myDeps)
--- --- myDepsDepsDeps = Job2.Schedule(myDepsDeps )
--- --- myDepsDepsDepsDeps = Job3.Schedule(myDepsDepsDeps )
--- --- NMHM.Dispose(myDepsDepsDepsDeps)
return inputDeps;

Those Jobs dont have any dependency with inputdeps, but the dispose complains that Job2 needs write acces to it and cant be disposed that way.

naive parrot
#

your first JobHandle , myDeps should be inputDeps i think instead of default , to ensure correct chaining

#

in case thats an oversight.

ocean tundra
#

@chilly halo You have that For... (some loops) could you have many calls to the same NMHM.Dispose from different jobs?

chilly halo
#

@naive parrot
Its not... but I already tried that.

The thing is that those jobs are being scheduled inside a For loop where I loop through SharedDataComponents to run those Jobs only within that filtered query. Inside I create the NMHM with a TempJob Allocator. That NMHM is used inside those jobs to write and read some values. I want to be disposed when the Job3 finish for each loop.

naive parrot
#

arent you then supposed to 'carry forward' your latest job handle from each iteration to next in order to ensure the chain is sequential and valid?

chilly halo
#

You mean that myDepsDepsDepsDeps should be the InputDeps for the next cycle

#

right?

naive parrot
#

yeah

chilly halo
#

So.. the execution order would be something like this...

new NMHM x
Job1 <- Default
Job2 <- Job1
Job3 <- Job2
x.Dispose(Job3)
new NMHM x'
Job1' <- Job2
Job2' <- Job1'
Job3' <- Job2'
x'.Dispose(Job3')

#

For some reason that doesnt work either... same error

#

InvalidOperationException: The previously scheduled job LiquidBehaviourSystem:<>c__DisplayClass_Liquid_Processing writes to the NativeArray <>c__DisplayClass_Liquid_Processing.JobData.simulatedEntitiesParallel. You must call JobHandle.Complete() on the job LiquidBehaviourSystem:<>c__DisplayClass_Liquid_Processing, before you can write to the NativeArray safel

#

Actually Im not really sure if that execution order is even valid...

low tangle
#

is that top level for a regular for, or a entities for each?

chilly halo
#

a regular for

#

its a for that loops through an array of SharedDataComponent

low tangle
#

ah alright, shouldn't be a issue

#

make sure you carry forward all the jobs into each other
then if its still giving the write errors like above, add in disable safety calls on the foreach

chilly halo
#

@low tangle

So.. the execution order would be something like this...

new NMHM x
Job1 <- Default
Job2 <- Job1
Job3 <- Job2
x.Dispose(Job3)
new NMHM x'
Job1' <- Job2
Job2' <- Job1'
Job3' <- Job2'
x'.Dispose(Job3')
Okay I will try disabling safety calls. But this should be doable , right?

Also... Job3 have a EntityCommandBuffer with a Job3 as Producer , that shouldnt be a problem... I think.

low tangle
#

you can disable the checks as long as you are 100% sure they dont overwrite

chilly halo
#

(Y) ๐Ÿ™‚

wary kiln
#

Guys, does DOTS packages increase a webgl build size?

#

If yes, how much?

dull copper
#

everything you add increases size

#

of course if you go with dots runtime / project tiny then you'll get really small end result

wary kiln
#

No

#

Not project tiny

#

Just normal unity engine but with dots

#

Like how much could it increase?

dull copper
#

try it

#

you are asking something someone else would need to try for you

#

could just as well as be you

wary kiln
#

I was just asking in case someone tried it

#

Just to save some time

naive parrot
#

my build went from 15mb to 45mb on android after i added entities/jobs/burst/math/physics/ packages. make of it what you will. rough figures. there were some other contibutors as well like new input system package. its pretty much blank project with basic touch balll that can be rotated.

#

and yes all the dots packages compile to build since am using all of it in code. if there is stripping doubts or such

dull copper
#

it totally depends on which packages you install too

wary kiln
#

@naive parrot thank you very much

outer swift
#

Ok, confused about something ... I'm using the following code to spawn a bunch of cubes using a command buffer:

        {
            for (int i = 0; randomNumbers.Length > i; i++)
            {
                Entity cubeEntity = endSystemCommandBuffer.CreateEntity(cubeArchetype);
                endSystemCommandBuffer.SetComponent(cubeEntity, new Velocity() { Value = new float3(randomNumbers[i], 0) });
                endSystemCommandBuffer.SetSharedComponent(cubeEntity, new RenderMesh() { mesh = mesh, material = material });
            }
        })
        .WithoutBurst()
        .Run();
#

This works ... if I use an entity manager to spawn 1 entity based on cubeArchetype first!

#

Why ..?

#

If I don't create a single cube before running this job, nothing happens.

mystic mountain
#

@outer swift Maybe post whole system, do you know it's running? You sure you set up cubeArchetype correctly, and it is not created from your "first spawn"? Have you checked the Entity debugger?

outer swift
#

I know it's running

#

I generate 12 random velocities for the new cubes, and apply them. Then I see 12 cubes move in random directions from the center of the screen

#

Anyway, I'll post my init as well

solar ridge
#

I'll reiterate Jaws: You'll need to show the system. Not just the method you find relevant ๐Ÿ™‚

outer swift
#

Initialization:

{
    public Material exposedMaterial;

    void Start()
    {
        GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
        MeshFilter filter = cube.GetComponent<MeshFilter>();
        cube.SetActive(false);

        mesh = filter.sharedMesh;
        material = exposedMaterial;

        DefaultWorldInitialization.Initialize("World", false);
        world = World.DefaultGameObjectInjectionWorld;

        EntityManager entityManager = world.EntityManager;
        cubeArchetype = entityManager.CreateArchetype(typeof(Translation), typeof(LocalToWorld), typeof(Velocity), typeof(RenderMesh), typeof(RenderBounds));

        entityManager.CreateEntity(cubeArchetype);

        world.CreateSystem<CubeSpawnSystem>();
        world.CreateSystem<CubeMoveSystem>();
    }

    public static Mesh mesh;
    public static Material material;
    public static EntityArchetype cubeArchetype;

    private World world;
}
#

Spawning:

[BurstCompile]
[UpdateInGroup(typeof(InitializationSystemGroup))]
public class CubeSpawnSystem : SystemBase
{
    protected override void OnCreate()
    {
        base.OnCreate();
        query = GetEntityQuery(ComponentType.ReadOnly<Translation>());
        initialization = World.GetOrCreateSystem<EndInitializationEntityCommandBufferSystem>();
    }

    protected override void OnUpdate()
    {
        int target = targetCount;
        Random random = new Random(++seed);
        int count = query.CalculateEntityCount();
        NativeArray<float2> randomNumbers = new NativeArray<float2>(target - count, Allocator.TempJob);

        Job.WithCode(() =>
        {
            for (int i = 0; i < randomNumbers.Length; i++)
                randomNumbers[i] = random.NextFloat2Direction();
        }).Schedule();

        EntityCommandBuffer initializationCommandBuffer = initialization.CreateCommandBuffer();
        EntityArchetype cubeArchetype = Entry.cubeArchetype;
        Material material = Entry.material;
        Mesh mesh = Entry.mesh;

        Job.WithCode(() =>
        {
            for (int i = 0; randomNumbers.Length > i; i++)
            {
                Entity cubeEntity = initializationCommandBuffer.CreateEntity(cubeArchetype);
                initializationCommandBuffer.SetComponent(cubeEntity, new Velocity() { Value = new float3(randomNumbers[i], 0) });
                initializationCommandBuffer.SetSharedComponent(cubeEntity, new RenderMesh() { mesh = mesh, material = material });
            }
        })
        .WithoutBurst()
        .Run();

        CompleteDependency();
        randomNumbers.Dispose();
    }

    private uint seed = 0;
    private EntityQuery query;
    private int targetCount = 12;
    private EndInitializationEntityCommandBufferSystem initialization;
}```
solar ridge
#

Ah

#

One thing is taht I believe you will need to force the system to update as it is now looking for something matchign that query before running

outer swift
#

Ahhh, right

solar ridge
#

So [AlwaysUpdate] or something similar may help on the system (still looking)

outer swift
#

That does make sense, I was a bit wat that the console reported the job as an Entity.Foreach since, well, it's a job

solar ridge
#

I'd recommend using commandBuffer.Instantiate to be honest

outer swift
#

But if a job is just a different front-end for what amounts to an Entity.Freach, theeeeen ...

#

Instantiate and pass in a GameObject?

solar ridge
#

No, you can send it an entity that is precomposed

outer swift
#

Ahhh, right

solar ridge
#

You can create an entity before hand from a GO

naive parrot
#

GameObjectConversion that nets you a entity 'prefab' with components initialized on it.

outer swift
#

Dang, I thought that was ... what the archetypes were for -_-

solar ridge
#

Well yes and no

#

To do it in pure code

#

Buuuut

#

In this case you are not getting really any performance increase

outer swift
#

I don't really want to use a GameObject, the point of the exercise is to learn how to deal with entities from ground up

#

I don't really care about performance, I'm just wrapping my head around the syntax for the time being.

solar ridge
#

Well the syntax is the reason for the performance ๐Ÿ˜‰

#

1: you are completing the job system (not good creates a sync point)

outer swift
#

Yeah, I was wondering about that.

#

I clearly need to read some more documentation -_-

solar ridge
#

2: if you are making a sync point, you should not really use the command buffer

naive parrot
#

is complete even valid since .Run( ) is used there its all main thread. no relevance of sync point.

outer swift
#

I want to avoid sync points, that was the point of the command buffer.

solar ridge
#

Well you used run XD

#

So that was syncpoint #1

outer swift
#

Yeah, the filthy job wouldn't run without it because I'm passing in a Mesh and a Material

solar ridge
#

Schedule is the one you want ๐Ÿ™‚

#

Hence why I recommended instantiate

#

As you can set all that up and it will handle it

outer swift
#

Yep, that makes good sense

#

Buuuuut how do I avoid my "template entity" being part of the game?

solar ridge
#

So. They have a component called prefab

naive parrot
#

2: if you are making a sync point, you should not really use the command buffer
@solar ridge very broad generalization i would say. ECB are more useful than just deferring structural changes. lets you design and order your systems in streamlined fashion.

solar ridge
#

Fair

#

If you pass in your object as an entity to store for later I believe it auto generates that prefab tag

#

as long as it is not in the scene hierachy

outer swift
#

But how can I use the entity manager to create an entity without putting it in the world?

#

The entity manager is a feature of the world, no?

naive parrot
#

it is. entity exist and are tracked by world

solar ridge
#

This is where the editor and authoring components come into play.

outer swift
#

Or will the Prefab component prevent it from acting like an entity?

solar ridge
#

"Pure" ecs is still a bit of a miss leading concept until they get Core 100%. Especially with them dancing around what hybrid is

outer swift
#

Sad. I was hoping I could do this purely.

solar ridge
#

This is pure.

#

ALL you are doing is makign it so you are able to construct it in editor

#

But it is changed to an entity and GO destroyed on world load

#

(or kept if you desire)

outer swift
#

Yeah, in my world "pure" would be via code and without strange data-from-editor workarounds

solar ridge
#

Then in that case, make an entity in code

#

Add the prefab component

#

And create this entity with all the data you want

#

Then instantiate using that entity

naive parrot
#

its possible. you would still want data from somewhere for any sort of initialization.

outer swift
#

๐Ÿ‘

solar ridge
#

Which then means EVERY change you want has to be done there in the code

#

Which takes a lot more dev time

#

In some cases it is useful. In many cases, you are reinventing the wheel

outer swift
#

Yeah, I'm not worried about that since I'm just experimenting to wrap my head around how this all works.

marsh moon
#

hi, anyone had a problem with loading subscenes in player ?

outer swift
#

I've been making games in Unity for 8 years now, so I've got a decent handle on architecture for game systems.

marsh moon
#

i get this error in playerlog and can't really solve it

solar ridge
#

Im interested in the science novel @storm ravine is writing as his game thus far looks neato!

marsh moon
#

NOTE: In order to load SubScenes in the player you have to use the new BuildSettings asset based workflow to build & run your player.

outer swift
#

Anyway, @solar ridge and @naive parrot, thanks for the help!

storm ravine
#

1: you are completing the job system (not good creates a sync point)
@solar ridge no it's not a synch point. Job.WithCode and his Run doesn't have any synch point itself. Only structural changes throw synch point (mostly EM calls which I mentioned here yesterday)

solar ridge
#

Ah. Thought they made Run complete the jobs

storm ravine
#

Calling Run on job doesn't mean it's synch point. Moreover it even not used any jobs chain

#

I't just fully independent method with bursted code in his case\

solar ridge
#

Cool. The following "CompleteDependency()" is creating a sync ๐Ÿ˜‰

storm ravine
#

Like you just call method and forget and all your other jobs work as if there is no that Job.WithCode

#

If He trying to use it with EntityManager and use methods which trow synch point, only then it will be synch point job

naive parrot
#

EntityManager is literally pretty much all structural change haven , aint it.

storm ravine
#

Not all

storm ravine
#

Thus Get values, or set values (except SCD) not throwing synch point

naive parrot
#

with footer on each method explaining same "Sync Point" theory

storm ravine
#

They all documented

#

And in source code every synch point related calls have comment about that ๐Ÿ™‚

#

Yes it's docfx

#

which generates that from comments ๐Ÿ™‚

#

We also using that

naive parrot
#

atleast as many i have used/aware of

solar ridge
#

Ah

storm ravine
#

How so?

solar ridge
#

XD

storm ravine
#

depends on how you using ForEach it can be EM which still same EM with synch point calls

#

Or ECB

solar ridge
#

They have a method that calls the EntityManger unless in a foreach

storm ravine
#

WithStructuralChanges here only matter how it will behave ๐Ÿ™‚

solar ridge
#

I THINK something along the lines of ComponentDataFromEntity

#

But I am still trying to find it in the doc

storm ravine
#

It depends on WithStructuralChanges

#

If you speaking about short methods

solar ridge
#

Yeaaa

#

My bad

storm ravine
#

GetComponent\HasComponent

solar ridge
#

Yep yep

storm ravine
#

And they in any case wouldn't cause synch point

solar ridge
#

No they wouldn't that wasn't the point

storm ravine
#

because EM calls under hood of that not causing synch point

naive parrot
#

what happened to ECS Visual Scripting. RIP? they turned to GO/MONO route ?

#

was doing fine by 6th drop on forum

solar ridge
#

I mean. For a single release sure. We will see what 9 brings

odd cipher
#

@storm ravine I'm not really sure what you meant by using altitude to do something else than InverseLerp; I cant get anything to really look like what it did with InverseLerp

storm ravine
#

Well I using similar code without this min max and inverse

odd cipher
#

well, how then?

storm ravine
bold pebble
#

Is there something like layers for the DOTS Unity physics? I would want friendly and hostile units to collide but bullets should only collide with hostile units (e.g. no friendly fire).

#

I have just found out that colliders of type CollisionType.Convex have a CollisionFilter property which contains a BelongsTo and CollidesWith bit mask. Will try to mess with that

odd cipher
outer swift
#

Any good places to read up on how you're supposed to instantiate new entities from entities with the prefab component?

#

I have a half-working spawn system (it spawns entities ... under certain conditions), but it simply stops working at all when I add a prefab component to the entity I want to instantiate

storm ravine
#

@storm ravine changed my code to yours but it only generates small dots
@odd cipher replace 2 and -1 to 0.5 for you

#

I need that values for my specific case, in your case they should be 0.5

opaque ledge
#

EntityManager.Instantiate(entityPrefab)

odd cipher
#

Ayy! That did it! It now works just like before

outer swift
#

Let me give some context

#
    {
        int target = targetCount;
        Random random = new Random(++seed);
        int count = query.CalculateEntityCount();
        NativeArray<float2> randomNumbers = new NativeArray<float2>(target - count, Allocator.TempJob);

        UnityEngine.Debug.Log(count);

        Job.WithCode(() =>
        {
            for (int i = 0; i < randomNumbers.Length; i++)
                randomNumbers[i] = random.NextFloat2Direction();
        }).Schedule();
        
        EntityCommandBuffer initializationCommandBuffer = initialization.CreateCommandBuffer();
        Entity cubePrefab = Entry.cubePrefab;
        Material material = Entry.material;
        Mesh mesh = Entry.mesh;

        Job.WithCode(() =>
        {
            for (int i = 0; randomNumbers.Length > i; i++)
            {
                Entity cubeEntity = initializationCommandBuffer.Instantiate(cubePrefab);
                initializationCommandBuffer.SetComponent(cubeEntity, new Velocity() { Value = new float3(randomNumbers[i], 0) });
            }
        })
        .WithoutBurst()
        .Run();
        
        CompleteDependency();
        randomNumbers.Dispose();
    }
#

Ignore the CompleteDependency and WithoutBurst stuff.

#

Also ignore the mesh and material

odd cipher
#

its faster aswell

storm ravine
#

Ayy! That did it! It now works just like before
@odd cipher and now you can run it in parallel

#

Because you don't need to know any thing from other samples

odd cipher
#

Yeah, already changed it to a IJobParallelFor

#

the job takes 0.35 milliseconds

storm ravine
#

Which world size?

opaque ledge
#

what happens if you dont add prefab component to your entity ?

#

are you creating a prefab entity from a code ?

odd cipher
#

200 by 200

outer swift
#

@opaque ledge The code runs as expected and generates 12 new entities moving in random directions but I get an extra entity I don't want

amber flicker
#

@outer swift fyi there's an overload for Instantiate that takes a NativeArray and uses the capacity to instantiate that many - probably quicker than creating one by one though you will still need to set value one by one. In this case I'm also not totally sure if the command buffer can use the result from the command buffers instantiate so a by-product might be it working.

odd cipher
#

you sayin it should be faster? :p

outer swift
#
{
    public Material exposedMaterial;

    void Start()
    {
        GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
        MeshFilter filter = cube.GetComponent<MeshFilter>();
        cube.SetActive(false);

        mesh = filter.sharedMesh;
        material = exposedMaterial;

        DefaultWorldInitialization.Initialize("World", false);
        world = World.DefaultGameObjectInjectionWorld;

        EntityManager entityManager = world.EntityManager;
        EntityArchetype cubeArchetype = entityManager.CreateArchetype(typeof(Prefab), typeof(Translation), typeof(LocalToWorld), typeof(Velocity), typeof(RenderMesh), typeof(RenderBounds));

        cubePrefab = entityManager.CreateEntity(cubeArchetype);
        entityManager.SetSharedComponentData(cubePrefab, new RenderMesh() { mesh = mesh, material = material });

        world.CreateSystem<CubeSpawnSystem>();
        world.CreateSystem<CubeMoveSystem>();
    }

    public static Mesh mesh;
    public static Material material;
    public static Entity cubePrefab;

    private World world;
}```
storm ravine
#

@odd cipher 0.35ms is time from profiler timeline for that job instance?

odd cipher
#

Yeah

outer swift
#

@amber flicker Interestingly, it works under certain conditions

storm ravine
#

it's (Burst) in timeline?

stiff skiff
#

Still optimizing the perlin stuff? nice

odd cipher
#

Yes

storm ravine
#

Yes to my question or to zero? ๐Ÿ™‚

outer swift
#

@amber flicker If I use Create instead of Instantiate and don't add the Prefab component, it works ... but I still need to make that first Entity I don't want

odd cipher
#

both

opaque ledge
#

you can put Disabled component to it as a workaround

outer swift
#

That's incredibly inelegant

amber flicker
#

the first entity you don't want should disappear from the entity debugger with a Prefab component on it I think... when you look it at in the inspector it has the Prefab ICD?

outer swift
#

Yeah, but if I add a Prefab component the code doesn't work

odd cipher
#

actually that 0.35ms is from editor so it may be faster in build

#

but not sure how I could check that

storm ravine
#

You can replace sample and noise height rows to math.mad

opaque ledge
#

i never tried to create a prefab entity from code so i dont know if there is any difference between what Unity does to prefab entites and trying to create a prefab entity from code

storm ravine
#

But it doesn't make much difference

#

Disable all safety checks

vagrant surge
#

0.35ms from a 200x200 perlin grid is absurdly slow

#

as in couple orders of magnitude

#

so i guess you are getting some pretty big overheads

storm ravine
#

It's multioctave perlin ๐Ÿ™‚

vagrant surge
#

still very slow

storm ravine
#
  • editor safety checks
vagrant surge
#

cant you check how much does the "actual" burst job take to run?

odd cipher
#

without safety checks its 0.33ms

amber flicker
#

@outer swift so when you use instantiate, no additional entities appear in the debugger?

odd cipher
#

also,, I'm only using one octave right now

vagrant surge
#

yeah but job system has random overheads for days. If you dig in the profiler, you can find where it actually calls the burst compiled function

outer swift
#

@amber flicker When I use instantiate with a prefab component on the original entity, the spawn system doesn't even run

storm ravine
#

cant you check how much does the "actual" burst job take to run?
@vagrant surge it's already actual, he told that is job itself from timeline profiler which show you actual timesteps for jobs

odd cipher
outer swift
#

@amber flicker Actually, when I think about it ... that makes a perverse kind of sense, since the first job the system does is count all the entities with a certain component on them, and that probably skips the prefab

#

So since there's nothing to count, the system doesn't run

amber flicker
#

exactly ๐Ÿ‘

outer swift
#

Well

#

Still doesn't exactly help me ๐Ÿ˜„

#

So clearly I need a different approach ..?

vagrant surge
#

holy fuck thats slow

#

even worse than i expected

#

3 orders of magnitude now lol

#

have you tried to see how long it takes without the parallel for?

#

just burst, singlethreaded

amber flicker
#

try AlwaysUpdateSystem or whatever that attribute is and see if it works? Then if you're worried about the system always running you can look at either early outing or adding a run requirement

odd cipher
#

1.7ms

outer swift
#

@amber flicker Exciting

odd cipher
#

I'm not really sure why its that slow ```csharp
[BurstCompile]
struct GenerateNoiseJob : IJobParallelFor {
public NativeArray<float> output;
[ReadOnly] public NoiseSettings settings;
[ReadOnly] public NativeArray<float2> octaveOffsets;
[ReadOnly] public int2 worldSize;

    public void Execute(int index) {
        int x = index % worldSize.y;
        int y = index / worldSize.x;

        float amplitude = 1;
        float frequency = 1;
        float noiseHeight = 0;
                
        float2 samplePoint = new float2(x - (worldSize.x / 2), y - (worldSize.y / 2)) / settings.scale;
        for (int i = 0; i < settings.octaves; i++) {
            float2 sample = samplePoint * frequency + octaveOffsets[i];

            float perlinValue = math.mad(noise.cnoise(sample), 0.5f, 0.5f);
            noiseHeight += perlinValue * amplitude;

            amplitude *= settings.persistance;
            frequency *= settings.lacunarity;
        }

        output[y * worldSize.x + x] = noiseHeight;
    }
}
outer swift
#

@amber flicker Amazingly, that didn't work

vagrant surge
#

@odd cipher it could be the noise function

outer swift
#

Now it just says that the prefab entity doesn't exist

vagrant surge
#

what exactly does that cnoise do

odd cipher
#

Actually maybe, because I'm also converting the output 1D array to a 2D array

outer swift
#

@amber flicker I guess that might mean that the prefab doesn't persist from my init

#

@amber flicker So maybe I need to create that prefab in the same scope

#

Hmm

#

Let's try that

amber flicker
#

@outer swift try removing the set component? it might be because the ecb hasn't actually created the entity by the time you try and set the value? Unclear if they improved that recently or not.

storm ravine
#

cnoise pretty optimized and vectorized

#

y * worldSize.x + x why you doing that

#

you already have index

odd cipher
#

oh right, forgot to change that after making it a ParallelFor

outer swift
#

@amber flicker That part works unless the original object is a prefab, so I don't think that's the problem

#

@amber flicker At least it works when I use CreateEntity instead

odd cipher
#

0.3ms now

eager jungle
#

hi guys, it seems like the environment lighting is broken when i use the hybrid renderer and HDRP. I used to have the same issue with the URP which i solved by disabling the SRP batcher, but I can't find the option for the hdrp.

amber flicker
#

@outer swift you want Instantiate to work and you want to use bulk instantiation wherever possible

odd cipher
#

Just one

stiff skiff
#

btw the noiseHeight += perlinValue * amplitude; can also become a math.mad

outer swift
#

@amber flicker Yeah, I'm trying to work out how to do this properly rather than pile workarounds on it.

storm ravine
#

and sample too

#

I mentioned that above

#

Set 128

#

or 64

#

1 for batch size bad here

odd cipher
#

0.2ms

outer swift
#

Ahhhh

#

I figured it out

#

So stupid ๐Ÿ˜„

storm ravine
#

@odd cipher With safety checks disabled? with jobs debugger and jobs stack trace to off?

outer swift
#

@amber flicker Since the system was running in the initialize group, it actually tried to run before Start

odd cipher
#

Yep

outer swift
#

@amber flicker And I created all the dependencies in Start

#

@amber flicker Do it in Awake instead, and everybody's happy

amber flicker
#

@outer swift nice - with hindsight I should have thought of that

stiff skiff
#

@odd cipher mark the output as writeonly

outer swift
#

@amber flicker It's not exactly obvious, and kinda uh

#

@amber flicker Breaks a lot of the standard intuition about how code is run

odd cipher
#

0.19ms

#

not much improvement

outer swift
#

@amber flicker Since the system is not actually created until Start either, so there's a bit of chicken/egg mayhem going on here

amber flicker
#

I think once you know when things happen, it's not so bad. I know you're exploring the pure side of things but this is part of why having content baked at edit time and then used is attractive.

outer swift
#

@amber flicker Since the system is always updated, it doesn't look like it actually needs to be created either. Spooky.

#

Sheesh, looks like you generally don't need to create systems. How very spooky.

bold pebble
#

I try to access BlobAssetReference<Collider> Value on PhysicsCollider inside a Entities.ForEach(...).ScheduleParallel();
This works sometimes but at other times randomly crashes my Unity Editor and as far as I see this happens after this exception: System.InvalidOperationException: The BlobAssetReference is not valid. Likely it has already been unloaded or released.
I have also tried to check if the BlobAssetReference is valid by doing something like this: physicsCollider.Value != null && physicsCollider.Value.IsCreated
What am I doing wrong?

storm ravine
#

200x200 1 octave

odd cipher
#

The function that calls the Job could probably also be improved, as I'm converting the 1D output array to a 2D array

stiff skiff
storm ravine
#

Not this func not involved here you see in profiler actual job itself time

odd cipher
#

alright

storm ravine
#

WHich batch size exactly you use?

odd cipher
#

64

storm ravine
#

It's ok

#

noiseHeight = math.mad(perlinValue,amplitude, noiseHeight);

#

replaced that row to mad?

stiff skiff
#

I'm curious to see the bursted assembly

odd cipher
#

still 0.2ms

storm ravine
#

Now it can be cpu difference ๐Ÿ™‚

#

I have 22 WT

#

this is why it's faster for me

odd cipher
#

not sure what you mean by 22 WT

storm ravine
#

worker threads

odd cipher
#

oh

#

I have 10 WT

storm ravine
odd cipher
#

its probably that then, because our functions are pretty much identical

storm ravine
#

Well it shouldn't tbh

#

because we looking at specific instance

#

on one thread

#

WT counts shouldn't count here

odd cipher
#

I'm not sure then

storm ravine
#

In my case it definitely use SSE because of xmm instructions, not AVX as I can't see any ymm in assembly

#

@odd cipher This is how your assembly should looks before cnoise

#

And c noise part

#

Small cnoise part ๐Ÿ™‚

odd cipher
#

I have barely no knowledge of the assembly

stiff skiff
#

I forgot, is index an int or uint?

storm ravine
#

int

#

Well, that code already SIMD friendly as you can see, I think that job can't be improved more without huge core rethoughts and rewrites ๐Ÿ™‚

stiff skiff
#

I like that it recognizes the math.add(number, 2, -1) to be 2 adds

#

Thats cool

storm ravine
#

Yep definitely should be faster than multiplication ๐Ÿ™‚

#

Tbh burst compiler much smarter than before ๐Ÿ™‚

bold sleet
storm ravine
#

it's in you package in Library->PackageCache->com.unity.entities@VERSION(Or any other package)->Documentation~

#

But it's only Manual part

#

API Scripting part is autogenerated by docfx from code summaries

eager jungle
#

hi guys, it seems like the environment lighting is broken when i use the hybrid renderer and HDRP. I used to have the same issue with the URP which i solved by disabling the SRP batcher, but I can't find the option for the hdrp.

#

I'm using the latest entities (0.10.0) with the latest hybrid

wide fiber
#

Should I use classic rigidbody/colliders or Physics Body/Shape..?

pliant pike
#

well colliders and rigidbodys don't work with entity's as far as I know ๐Ÿค”

silver dragon
#

Are the component colors in entity debuggers defined somewhere? Anyone know what white means?

opaque ledge
#

rigidbody and colliders are converted into phssics body and shape, so you can use both, but i personally use body and shape

silver dragon
#

Good old docs, where are you ๐Ÿ˜ฆ

tardy locust
silver dragon
#

Yep, but with the colors described ๐Ÿ™‚

tardy locust
#

ah

#

drUiD is typing...a novel...

warped trail
#

green = ReadWrite, blue = ReadOnly, red = WithNone, white = WithAll but checking just existence of component without getting any data๐Ÿค”

tardy locust
#

Would be nice if that was detailed somewhere, yea

warped trail
#

I guess universal answer to that is It is just temporary thing, so there is no need of any documentation ๐Ÿคทโ€โ™‚๏ธ

silver dragon
#

thx @warped trail !

amber flicker
#

Unity acquires Bolt ๐Ÿคจ wonder what that means for dots visual scripting

warped trail
#

maybe they want to kill any kind of competition๐Ÿ˜

coarse turtle
#

๐Ÿคจ o wow

vagrant surge
#

dots visual scripting = scrapped. Bolt now renamed to "visual scripting"

#

๐Ÿ˜›

#

its interesting they have taken this long to buy bolt

amber flicker
#

both worked on by different teams with increasing overlap in functionality over the next 5 years followed by an announcement to make a new pure dots solution? ๐Ÿ˜

#

yea... seems like intriguing timing

loud matrix
#

Funny, I don't recall adding magical turbulence to stationary objects.... Well time to work out how I broke this again.

#

Oooohhhk thats a weird one

#

Is there some weird stuff with declaration of variables in a OnUpdate I clearly don't know about?

storm ravine
#

ref velocity

#

You changing it inside?

loud matrix
#

nope

storm ravine
#

How is if it changes

#

Smooth damp changing it isn't?

#

because in OnUpdate they in local space and reset every OnUpdate call and now they in class space and value stores through all OnUpdates

loud matrix
#

I'm not changing it from 1,1,1 though

storm ravine
#

Not you

#

SmoothDamp

loud matrix
#

oh sod i see what you mean

storm ravine
loud matrix
#

I remember why i was planning on rewriting that to use mathmatics now

mint iron
#

As the lead developer of Bolt to this day, I am thrilled about the potential of putting this tool in the hands of more creators and allowing them to concretize their ideas in a visual way. Bolt started as a solo endeavor nearly four years ago, and over time, our team and community grew to welcome thousands of visual thinkers. Today, passing the torch to Unity means Bolt will enter an exciting new phase of its life. While letting go of a project you love is never easy, I have met the amazing people at Unity who will carry it forward and I am confident that Bolt is in the best of hands.

sounds like its a source code hand over rather than a company acquisition.
https://ludiq.io/blog/unity-acquires-bolt

Ludiq

An official visual scripting solution for Unity

storm ravine
#

Yep it's what they mentioned in blog and on Unity forum

#

acquired the Bolt visual scripting plugin from publisher Ludiq

hollow sorrel
#

oh damn

#

that's awesome

#

bolt is great

#

and i don't even like visual scripting

#

but new one basically rewrites your nodes into regular C# code

loud matrix
#

If they make it auto output DOTs I'm jumping ship from coding from scratch ๐Ÿ˜›

warped trail
#

will they rewrite it to DOTS?๐Ÿ˜…

hollow sorrel
#
Unity has been working on its own visual scripting solution for some time. Our solution is built on the new Data-Oriented Technology Stack (DOTS) architecture, while Bolt and Bolt 2 are both designed for the classic, non-DOTS versions of Unity. This helps ensure that there will be visual scripting solutions available for users with DOTS and non-DOTS projects.

seems not

loud matrix
#

Aka unity will continue to be a steaming pile of contradictory packages for years to come ๐Ÿ™‚

outer swift
#

That's its charm

warped trail
#

one of them has to die in the end ๐Ÿ˜

hollow sorrel
#

seems that pricing won't change either so not sure what changes now that they bought it thonking

loud matrix
#

I said it before, I'll say it again, i miss Flash!

#

None of these "oh which visual scripting package do I use" madness, you had ActionScript cancer and you liked it!

opaque ledge
#

has anyone had a problem with FixedList with type of Enum ? it calls object.Equals when doing equality check so therefore burst gives error

mint iron
#

yeah its a problem, you cant put an enum as key in hashmaps either

#

have to cast back and forth with int :S

storm ravine
#

Also be careful until next burst release in changing enums from byte to other types and back.

#

Burst cache incorrectly detect ICD types with enums which switched to byte and back, recommend you clean BurstCache folder inside Library

#

And can miss recompilation for some jobs which using that type

#

This is bug which I faced and we investigated that with guys from Burst team. Luckily problem finally founded and fix will be in next Burst release preview.12 as they told. Guys work really hard!

opaque ledge
#

this kinda sucks big time ๐Ÿ˜ฆ

#

maybe they will fix that as well with preview12

solemn cobalt
#

Anybody point me to a resource to understand what DOTS is? I've bumped up to 2019.3, not sure if there is something to take advantage of. Thanks!

opaque ledge
#

check CodeMonkey's youtube channel

#

there is a playlist specifically for DOTS/ECS

solemn cobalt
#

@opaque ledge Thanks!

#

@opaque ledge wow this was exactly what I was hoping for!

opaque ledge
#

enjoy^^

#

it might be tiny little bit outdated, we no longer use JobComponentSystem and we use SystemBase instead, after watching and understanding those videos you can check the ECS manual to see the differences, manual also has good examples

solemn cobalt
#

Oh, thanks for the tip! I know it's in flux.

wide fiber
#

@pliant pike they are translated into ECS components as far as I know

loud matrix
#

Right brain, I don't like you, and you don't like me, But we need to make a damn GOAP system with ECs now so we need a truce.

wide fiber
#

Does math.atan2 need the float2 (the Y and the X) to be normalized? Or will it work anyway?

vagrant surge
#

a goap system in ecs sounds like such a pain

#

doesnt fit very well i think

coarse turtle
#

i imagine you could use bit flags to represent certain actions for goap to figure out which systems to run ๐Ÿค”

vagrant surge
#

its just not a good fit to the systems-based batch execution of ecs at all

#

goaps are in a way, a tree/graph. You navigate it. Virtuals and inheritance are actually useful on it

coarse turtle
#

yea

#

that's where I have a hard time wrapping my head around - i'm actually curious as to how certain ai behaviours would be defined - aside from swarm like intelligence or fsm

craggy orbit
#

wait we're using SystemBase now? does that mean that we can't use the usual job structs anymore?

untold night
#

you can use job structs, but Entities.ForEach and Job.WithCode are the recommended ways to write jobified code with SystemBase

craggy orbit
#

hm okay. thanks

opaque ledge
#

job struct (IJobForEach) will be deprecated eventually

craggy orbit
#

IJobParallelFor and IJobChunk too?

opaque ledge
#

nope

craggy orbit
#

oh good. i already changed all of my IJobForEach to IJobChunk a few weeks ago. glad that wasn't a wasted effort

dull copper
#

wtf

#

I hope this isn't a new trend

#

selling Bolt while being under Unity sounds super alarming

tardy locust
#

But wasn't Bolt acquired by Unity?

dull copper
#

can we get rid of the subs if we pay for engine tools individually?

tardy locust
#

As in, Bolt gets absorbed?

dull copper
#

"Bolt will continue to be sold on the Unity Asset Store. At this time, there are no plans to change Boltโ€™s availability or pricing."

tardy locust
#

Huh.

dull copper
#

"Unity will honor the commitment made by Ludiq to offer Bolt 2 at no additional cost to current Bolt users and to new users who purchase Bolt before May 31, 2020 (11:59 PM PST). Eligible users will automatically receive an individual license for Bolt 2 when it becomes available."

tardy locust
#

Yeah but that just means that

#

Bolt will be making Unity's Integrated VS

#

And then Bolt as a product will likely cease to be on Unity

#

And sold on other platforms

dull copper
#

this is like the most pointless acquisition from engine users point of view

#

usually the engine users actually benefit from it

tardy locust
#

Eh, I can see why Unity does it

#

They don't wanna spend time on it. Get a company that does Lol

warped trail
#

they didn't bought company ๐Ÿ˜…

tardy locust
#

Unity is excited to announce that we have acquired the Bolt visual scripting plugin from publisher Ludiq. Bolt provides a production-ready visual scripting solution for the current Unity architecture. Unity saw this as an opportunity to acquire the highly popular plugin to help artists and their teams improve workflows.

I see.
So they basically bought source code. So they can integrate it.

dull copper
#

but they aquired the tool

#

I'm confused

tardy locust
#

That would be beneficial to the end user

warped trail
#

now they will develop 2 vs tools ๐Ÿ˜

#

one of them will die

dull copper
#

but Unity doesn't even dev Bolt

#

I'm currently failing to understand the motive in all this

tardy locust
#

To get an integrated VS

warped trail
#

In the meantime we're having a lot of conversations about the road ahead regarding Bolt 2 and DOTS visual scripting, but we're not ready to announce any plan yet.

tardy locust
#

Why spend time on getting it done, when Bolt already has something? Just get that, then integrate.

#

Seems like what they did to me

bright sentinel
#

Probably a strategy to get some semblence of coherency with Unity

#

Lots of features lately that have been unfinished or broken

dull copper
#

I just don't see the point of getting Unity owning the product while still charging for it

tardy locust
#

I think this is just long-term @dull copper

#

Short term it seems odd

dull copper
#

but then again, Unity has done stupid stuff before too

#

like literally trying to sell learning projects to their users

#

and putting learning content behind payway

#

that makes no sense to me when others just give that stuff out so they get newcomers jumpstarted

safe lintel
#

yeah that was a really odd move

warped trail
#

thats just dlc to tutorial projects ๐Ÿ˜…

dull copper
#

yeah, but why ๐Ÿ˜„

#

it gives out a really weird signal

warped trail
#

๐Ÿค‘

dull copper
#

exactly

tardy locust
#

Corporate entities look at things differently than we do

fallow mason
#

๐“œ๐“ฒ๐“ฌ๐“ป๐“ธ๐“ฝ๐“ป๐“ช๐“ท๐“ผ๐“ช๐“ฌ๐“ฝ๐“ฒ๐“ธ๐“ท๐“ผ

tardy locust
#

I didn't understand why Unity thought they "heard us loud and clear" when they introduced the Game Settings AI thing.
But it turns out that, Unity likely heard that from industry people, not indies.

#

So really, this is likely just one of those moves. It's one of those moves where you think "What?" but they have looked at this very differently than you have.

safe lintel
#

maybe continue to sell bolt so when dots visual scripting arrives users are like screw paying to use gameobjects, im moving to dots ๐Ÿ˜‰

warped trail
#

but dots vs is moving toward game objects ๐Ÿ˜…

dull copper
#

just for the record, I'm not crying out loud that they don't give free stuff, I actually pay Unity every month and have done for a while in past too, hence wondering where they are going with this

#

I dont even actually care about bolt at all as I'm not really into VS

tardy locust
#

I'd be fine with letting designers and artists play with VS in Unity

dull copper
#

I'm not

tardy locust
#

At least then they can come to me and go "I want this" and then I formalise it

dull copper
#

it's a bad path

tardy locust
#

I disagree that it's bad to let designers prototype

#

Lol

dull copper
#

imagine you need to pay extra for dots tooling

#

on top of the engine tooling you already pay monthly fee for

#

which they btw, just raised

warped trail
#

they need more money to buy stuff like Bolt, to sell it to you ๐Ÿค”

tardy locust
#

Inflation will make prices rise forever, though.
Question is why Unity raised the prices.

dull copper
#

the havok thing is bit weird too, in past when they licensed tech, they just absorbed the cost in the engine price / sub cost

#

instead they went with the MTX approach on that

vagrant surge
#

unity store is a huge cash cow

#

unity probably got a TON of money from stuff like Bolt

dull copper
#

it's not outrageously expensive, it's just if this trend continues, we'll not see the end of it

vagrant surge
#

there are a few packs that basically everyone buys

#

visual script packs, lightmap addon, input addon is common to see

tardy locust
#

The guy who is on top of Unity atm is from EA right?

dull copper
#

I think they see that one changing now

tardy locust
#

Or at least the AAA industry

vagrant surge
#

from EA i think

fallow mason
#

ea, yes

tardy locust
#

Makes sense that the asset store would continue as it does now.

dull copper
#

I mean, with SRPs alone, they've made a lot of old mandatory things obselete

vagrant surge
#

ive allways found it very weird how unity has had a crappy input system for more than a decade

#

like.. it shouldnt be so hard to make it not-terrible

dull copper
#

especially HDRP gives out practically most of the features out of the box that people would have bought separately in past

tardy locust
#

A lot of people tended to just use SDL2 @vagrant surge and then never have to worry about input ever again

dull copper
#

@vagrant surge the new one is still pretty bad :/

vagrant surge
#

hell you can build a better input system than unity has on your own C#/C++ engines in like a couple days

#

something unreal-engine style works fine and its very easy to build

dull copper
#

I mean the usage of it doesn't suck, it's just too bugged and is missing features so you can't really use it in production

fallow mason
#

I like the new one. Still rough around the edges and missing some important features, but it's miles better than input manager.

dull copper
#

I do like it

#

just can't use it

vagrant surge
#

the new one has some very fun stuff

#

a lot of high end features

dull copper
#

yeah, I don't disagree

#

just wish it was more robust

#

like, actually work on controllers I have here

#

(and have to support)

tardy locust
#

I guess it's a matter of the focus.
Unreal Engine focuses on having in-engine features and less on the Marketplace providing that.

Unity is the opposite. They expect to have some stuff, but you can write yourself most of the stuff you need or get it from the Asset Store.

#

Different strategies

fallow mason
#

I need some more control over input state for some more complicated composites

dawn badge
#

Is there simple documentation on writing tests for Systems?

#

Or am I just going to have a lot of fun "wasd"'ing around haha

coarse turtle
#

uhh look at the ECSTestsFixtures in the package

tardy locust
#

I guess you'd have to test the logic of your system

#

Rather than the system

coarse turtle
#

You can create a test world, create the system in that test world, update the system, and write tests to check the component data of the entities in editor time

dawn badge
#

ok cool makes sense

#

just never wrote a Unity test before so this will be fun?

tardy locust
#

hmm

#

optimism...

#

keep it

#

๐Ÿ˜›

dawn badge
#

yes ๐Ÿ˜‚

fallow mason
vagrant surge
#

i attempted to integrate some unit tests in a couple ue4 games

#

calling it a failure (both times) would be a huge understatement

tardy locust
#

I feel for you vblanco

dawn badge
#

Thank you @fallow mason

vagrant surge
#

ue4 framework is basically untestable

#

without going really far

vagrant surge
#

these guys made sure that they had full coverage basically from day 1

#

and they wrote their own test runners and modified the engine extensively to make them work well

#

what you see in that ue4 test video is fake. Its all custom

dawn badge
#

Ah so you can write integration tests ๐Ÿ™‚

vagrant surge
#

yeah, its going to be integration tests because even basic stuff will likely test a huge % of the engine

dawn badge
#

Seems like a lot to learn but it will be (hopefully) worth it

vagrant surge
#

ECS works very well with unit tests. When i was doing some stuff with rust (the language) and ECS, i had a lot of unit tests

#

the "pureness" of ecs maps well to unit testing

#

create test world, run system a couple times, check output

dawn badge
#

yea I am used to the more data driven approach so this should be useful

#

Amethyst for Rust/ECS?

coarse turtle
#

Oh I've heard of it

#

never had the time to play around with it

dawn badge
#

or just having fun making ECS on your own?

vagrant surge
#

wasnt amethist, but i did use the Specs ecs which is the one on amethyst

#

@coarse turtle there are 2 main ecs now in rust. One is called Specs, it follows a model similar to entt or entitas. Its older, and has extensive auto-multithreading

#

the other is Legion, which is more like the unity approach. Its much faster, but stuff like custom component storage isnt there

#

and add/remove comps is much slower

#

Specs is actually damn fun because it will automultithread the hell out of your systems

#

it also forces you to make systems thread-safe, which can be a bit painful. For rendering (which has to access global state) i had to do some unsafe trickery so rust allowed me to do it

#

seriously tho, rust facilities for multithread are godlike

#

Rayon library is some of the most crazy black magic ive seen. You can spam parallel-fors for days, and the lib is very smart to minimize the overheads of launching jobs

#

so in general you can basically make every ecs loop you have into a parallel for, and it will be fine

tardy locust
#

What is the overhead of the smartness?

vagrant surge
#

near 0

#

because magic

tardy locust
#

How is it achieved though?

vagrant surge
#

i have no idea

tardy locust
#

No free lunch right?

vagrant surge
#

but i dont know of an equivalent to it in any lang

#

all i know is that rayon multithreading, both its async launches and its parallel for, are super spammable

tardy locust
#

It could of course just be a matter of someone who got a eureka moment and found a better way to do things. Just sounds weird if there is no cost.

vagrant surge
#

in cpp if you run parallel STL, you will slow down things unless your work sizes go past X

#

@tardy locust i believe its because it only launches new jobs if it sees there are free cores

tardy locust
#

Hm, that could be.

vagrant surge
#

but the exact implementation of it is something im not sure about

tardy locust
#

But it would still have to schedule those jobs for later no?

vagrant surge
#

it does them "inline", in a way. Its parallel fors are blocking

#

not like unity jobs that get launched in the background

tardy locust
#

Hm

#

This was in Rust, right?

vagrant surge
#

and i think that now that rust has async/await, the hax level went even higher

#

because you can await async tasks and similar

tardy locust
#

Right.

#

So this is a nice example of what Rust tries to do I suppose.

vagrant surge
#

yes

tardy locust
#

Be a Service Layer

vagrant surge
#

without a doubt im sure that it outperforms unity job system by several orders of magnitude

#

plus it allows launching threads from anywhere, not just main thread

tardy locust
#

Question is if you could offload that multithreading to a Rust support setup and back without too much overhead.

vagrant surge
#

on my tests, the "schedule overhead" of Specs (which uses rayon on its backend) was super super low

coarse turtle
#

that's a nice find ๐Ÿ™‚ I'll have to tinker around with the rayon lib sometime

dawn badge
#

rayon is AWESOME

vagrant surge
#

its a straight up selling point of rust

dawn badge
#

.iter().plow() should have been the method signature hahaha

vagrant surge
#

i have no doubts rust is by far the language to grab if you are doing multithreaded simulations

#

the best part is that you can liberall spam parallel for

tardy locust
#

But what I'd like to know

vagrant surge
#

and if its unsafe

#

the compiler just screams at you

#

so if it compiles, it multithreads with no data races

tardy locust
#

Is if I can make a rust parellel setup that does all the multithreading and Unity just passes data off to that and receives data back locally.

dawn badge
#

You can use maybe ffi

#

or a linker

vagrant surge
#

with burst that would be doable

#

burst just generates c style functions after all

tardy locust
#

This way Unity only has to delegate data to Rust and Rust does all the heavylifting.

vagrant surge
#

yeah but its really not so simple

tardy locust
#

I didn't say it was simple.

vagrant surge
#

the reason rayon is so stupidly hax is because rust offloads a bunch of checks into compile time

tardy locust
#

I was just interested to know if it would be feasible and useful

vagrant surge
#

would be too much of a work to be worth it

dawn badge
#

it could be, just passing information safely would be difficult

tardy locust
#

I see.

#

I have never tried doing anything between Rust and C# so wouldn't know. Of course it's already harder to do because Unity's sandbox does not like to share

vagrant surge
#

but for example

dawn badge
#

however the overhead of converting unsafe types into safe types could be worth it..

vagrant surge
#

this does a parallel for multiply + reduce

#

in cpp you can do the same with std algorithms

#

but it will be slower

#

much more so, in fact

#

on small sizes, rayon might not even launch worker threads to avoid overheads

tardy locust
#

That might be why it's so fast

#

perhaps

#

And efficient

#

The difference between making a job and not could mean the difference between fast and slow, because of allocations and whatnot.

#

Especially if you look at it from the perspective of volumes of jobs

vagrant surge
#

yeah, in the article he says that it only launches jobs if there are workers availible

#

unity launches jobs no matter what

#

very old article tho

dawn badge
#

now I want to go back and make my world simulation again .. lol

wide fiber
#

If I use


//Yeah I am deallocating nodes
Entities.Foreach((IDontKnow variable) =>
{
     var tempNodes = nodes;
}).ScheduleParallel();
#

Is tempNodes a copy or the same reference of nodes?

#

I can't use the nodes variable because I change it inside the Entities.Foreach, so things mess up

#

Because while some entities are reading from nodes, other are writing to nodes, so it crashes after a while

warped trail
#

ToComponentDataArray returns copy

wide fiber
#

Yeah but I want to use a copy in the Foreach for each entity

#

I don't want them to write and read from the same array or things mess up

storm ravine
#

tempNodes and nodes itself structs and they copy BUT because they store pointer even in copy it's same number and points to same memory allocated from ToComponentDataArray which mean if you change tempNodes it change nodes (but not chunk because of ToComponentDataArray is copy and not reference to chunk memory)

wide fiber
#

Ok ty

warped trail
#

you want copy of nodes for each entity with IDontKnow ?

wide fiber
#

How can I make a copy in tempNodes? NativeArray.CopyFrom?

#

I want a copy of nodes for each entity

#

Yes

warped trail
#

naive way to do this is to allocate NativeArray<NodesData>(query.CalculateEntityCount() * entity count of your foreach)๐Ÿ™‚

#

but i don't think it is a good idea๐Ÿค”

wide fiber
#

I am trying with

Entities.Foreach(...
{
tempNodes = new NativeArray<NodesData>(nodes.Length, Allocator.Temp);
tempNodes.CopyFrom(nodes);
...
}).ScheduleParallel();```
#

I am making the build (I can't test things in the editor, my laptop is too slow)

warped trail
#

something like this maybe? ๐Ÿ˜… ```cs
var nodes = query.ToComponentDataArray<NodesData>(Allocator.TempJob);
var countA = query.CalculateEntityCount();
var countB = queryB.CalculateEntityCount();
var copies = new NativeArray<NodesData>(countA *countB, Allocator.TempJob);

Entities
.WithStoreEntityQueryInField(ref queryB)
.Foreach((int entityInQueryIndex, IDontKnow variable) =>
{
int startIndex = countA * entityInQueryIndex;
int endIndex = start + (countA - 1);
for(int i = startIndex; i <= endIndex, i++)
{
copies[i] = ... ;
}
}).ScheduleParallel();```

wide fiber
#

Wait wait, probably there has been a misunderstanding, but I've solved the problem

warped trail
#

oh, i forgot to copy data into copies

#

๐Ÿ˜”

mint iron
#

anyone know of a viewer tool that can read the text from burst inspector, its scattered with < color > tags etc

safe lintel
#

hybrid v2 seems even more broken than hybrid v1 from more testing ugh

ocean tundra
#

๐Ÿ˜ฆ thats really not great to hear. I'm using it but all seems ok so far, but im not exactly doing anything with it yet

#

Whats wrong with it?

safe lintel
#

well just weird stuff like if my subscene is open, i cant press play(errors out), shader graph using vertex position doesnt work properly, this one might be hdrp but the automatic exposure compensation is really odd when theres no ambient light, something random triggers subscene entities to be dumped but not recreated in a closed subscene, some occasional but immediate errors on start which are fixed after stopping and playing again etc

ocean tundra
#

๐Ÿ˜ฆ

#

I'm using URP but im also doing 0 graphics stuff, just rendering stuff

safe lintel
#

i didnt have anywhere near this much odd behaviour with v1, i chalk some of this up to hdrp 9.x still not being in public preview but its still frustrating

#

and urp in v2 only supports 1 directional light ๐Ÿ˜’ no other lights? have you tried it with multiple lights other than a directional?

ocean tundra
#

I have not tried with any lights apart from the default directional, I also didnt know that it only supported 1 light

#

That will be a issue ๐Ÿ˜ฆ

safe lintel
#

i know it will support urp's featureset in the future, but its like I dont even know if these things are just havent gotten around to it yet and a current limitation or its a bug. v1 supported multiple lights

ocean tundra
#

all of the supporting packages of ECS suck ๐Ÿ˜ฆ i really want animations but that dosn't work

#

and i want to use unity Transport for my MP and again not compatable with latest ECS

safe lintel
#

yeah animations, spent a good deal of time trying to make humanoid rigs work but no dice(is it a bug, or a limitation lol)

ocean tundra
#

๐Ÿ˜› i just gave up, will wait for the next version

safe lintel
#

and kinda annoying when submitting a bug for physics and qa telling me i can modify my package if its causing issues ๐Ÿค”

ocean tundra
#

๐Ÿ˜›

#

in my last prototype i had modified physics

#

relised pretty quickly that was a bad idea

mint iron
#

BlobArray/BlobRef it turns out, really add a lot of junk to the asm ๐Ÿ˜ฆ

opaque ledge
storm ravine
opaque ledge
#

Cant you just have my moment ๐Ÿ˜’

storm ravine
#

Someone should keep you toned billyWink

mint iron
#

looks awesome @opaque ledge

#

is it all in dots land?

opaque ledge
#

yes ๐Ÿ˜„ except the UI

ocean tundra
#

@storm ravine Man that sounds very close to what i am building, except I'm focusing MP first

storm ravine
#

Well, we ~4 years in development ๐Ÿ™‚

ocean tundra
#

๐Ÿ˜› im about 1 month

#

@storm ravine Do your units have/do any local avoidance or collisions?

ocean tundra
#

Wow very nice

#

how are you doing pathfinding? all custom?

storm ravine
#

Yes

#

Mix of Hierarchical A* and Potential Fields

naive parrot
#

@storm ravine how big is your team?

storm ravine
#

1 artist, 1 writer, 1 GD, and 1 programmer (me) now we hired one more programmer (because I want to sleep) and audio and UI 2D art on outsource

ocean tundra
#

Wow the number of units you can support is insane

dull copper
#

that looks like a project where it would suck to be the only programmer ๐Ÿ˜„

naive parrot
#

cool! fairly small team then! props to all the work you have done so far. game looks legit lit!

dull copper
#

altho I can imagine the pain on collab work with dots when everything is experimental

storm ravine
#

Well all things in game our own, no assets, and only audio\2D (UI) art from outsource

#

๐Ÿ˜„

ocean tundra
#

๐Ÿ˜› I'm having to use assets where I can, mainly polygon models and A star from https://arongranberg.com/astar/
I'm not smart enough to build that custom

storm ravine
dull copper
#

that a* implementation can be a head scratcher ๐Ÿ˜„

ocean tundra
#

I'm also using Enet and Ceras for networking untill unity transport gets more stable

dull copper
#

I remember using it on some of the first unity projects I was at and it needed some hacks to play nice

ocean tundra
#

Yea im basicly rewriting some core parts of it to work with ECS

storm ravine
#

Well A* itself pretty easy thing

dull copper
#

^

storm ravine
#

Flowfields too

ocean tundra
#

I guess, ๐Ÿ˜› but its all the other bits, optimizations and data layout/stores

dull copper
#

it's just, most users do love to have the tooling and all algos to make it look more polished

storm ravine
#

Polished looks ugly and unnatural

dull copper
#

prebuilt tooling doesn't help much on dots land though :p

#

I was more of thinking stuff like path smoothing

ocean tundra
#

yea im not using that just yet ๐Ÿ˜›

storm ravine
#

This is tricky part - made that feel "real", I spent around half of year to nice looking navigation and collision

tardy locust
#

Btw, regarding our little "Unity Meta Files are dumb" discussion earlier. Currently have a meta file that did not change whatsoever, yet it's listed as "changed" xD

ocean tundra
#

oh man, half a year just on pathfinding stuff...

storm ravine
#

navigation and collision

#

Optimized for crowds

#

dynamic rebuilds etc.

#

And everything at runtime without any prebaking

#

because of procedural worlds

ocean tundra
#

how did you even do collisions? im guessing not unity physics?

dull copper
#

well, if the feat is central thing on your game

#

6 months is nothing

storm ravine
#

Not Unity. All systems in our game custom - Animation, navigation, physics, rendering

dull copper
#

pretty sure dots physics wasn't even a thing when he started :p

storm ravine
#

Nothing was a thing ๐Ÿ™‚

#

First public DOTS release was at GDC 2018

ocean tundra
#

I cant even imagine

storm ravine
#

And had only entities core ๐Ÿ™‚

safe lintel
#

when did you start your game? right after the dots announcement?

storm ravine
#

Game was near to final (80%) and was in development ~2 years

#

And at GDC 2018 we decided jump to DOTS

#

And I start rewrite every thing

#

grow and expand

ocean tundra
#

Are you glad you changed to ECS?

storm ravine
#

Of course

ocean tundra
#

it looks amazing

opaque ledge
#

my game will beat yours ๐Ÿ˜’

#

jk, please dont beat me

ocean tundra
#

how do you handle/structure the game data, like the units and buildings?

#

im using JSON files and addressables. JSON is all the stuffs (name, max hp, resource costs......) and the addressables are the prefabs (for each phase, under construction/final) and materials

safe lintel
#

yeah not only does it look super impressive, but being built when dots is like in its teething stage is also super impressive ๐Ÿ‘ถ

storm ravine
#

We dropped JSON, it's inefficient. I wrote many Editor tools for fast not programmers data management and editing, like 1 click making our dots animation from fbx without any preparing or actions from artist. Map generator previewer with nice config, game data configs, building set editor , with all required safety stuff for excluding human error etc. All loads through addressables (prefabs, assets, configs, etc). Also we using our own persistent ID system and not relating to unity guid system. Everything async and main thread never stuck or freeze at loadings, procedural generation etc.

#

Well again thread of our game! Stop, lets cheer @opaque ledge quests systems! It's nice progress!

ocean tundra
#

Very nice, I'm eventually planning to have a compiled (bson? binary) instead of json, but i also want to support modding

opaque ledge
#

aww โค๏ธ haha

ocean tundra
#

@opaque ledge Yea very nice ๐Ÿ™‚

naive parrot
#

anyone got clues how to use the dots animation package for basic clip playback?

#

no blending and fancy stuff

opaque ledge
#

i dont think anyone here uses dots animation

naive parrot
#

sadface.png

#

to the forums we go..

dull copper
#

a) is the animation package compatible with the recent dots?
b) it doesn't have any samples of it's own?

sand prawn
#

With a dedicated game server, how do I specify which scene to start up with? I'm seeing my NetCode bits not execute ... kinda looks like my scene isn't loading?

ocean tundra
#

@naive parrot I tried very hard but havnt managed to get animation to work ๐Ÿ˜ฆ

#

@sand prawn In your first scene have a script that reads the command line arguments and then loads the right scene

#

then when your launching the server you pass in the settings (server.exe -scene "SCENE NAME") or something like that

sand prawn
#

Ah, ok. So there's no way to trivially specify a startup scene?

#

for now, I don't even need it to be CLI, I just need SOMETHING to load

ocean tundra
#

oh it should load the first scene in your player build settings list

sand prawn
#

Hm. I don't seem to be seeing that...

#

My DOTS Sample-based code works in this scene in the editor, but nothing runs in the DGS build

mint iron
#

if i int divide a 1D array to chunks of 4, then ill have to pad by 1 if there's a remainder right?

#
    public static unsafe void SetFlags(int* flagsPtr, int length, ref NodeFlags addFlags)
    {
        var flagToSet = (int4)(int)addFlags;
        var batchFlags = (int4*)flagsPtr;
        var batchLen = length / 4 + math.select(1, 0, length % 4 != 0);

        for (var i = 0; i < batchLen; i++)
        {
            batchFlags[i] |= flagToSet;
        }
    }
ocean tundra
#

I dont use any sub scenes tho so might be something different there

#

or your crashing on start? try a debug build

sand prawn
#

No, main scene is loading (tested by building a script component with just a debug log in it)

#

So I was on crack

#

What's happening is that the code that looks for ServerSimulationSystemGroup never finds one

ocean tundra
#

oh netcode.... i guess something is wrong with the world init stuff

#

I've rolled my own and disabled all of unitys startup stuff

sand prawn
#

Oh, interesting... why's that?

#

fwiw, I think the code I wanted was just #ifdef'd out

#

durh

ocean tundra
#

:p

coarse turtle
#

if i int divide a 1D array to chunks of 4, then ill have to pad by 1 if there's a remainder right?
@mint iron that should be the case (had to try it with some arbitrary #s)

ocean tundra
#

so I've built my own so i can setup/inject some custom stuff (my netcode, and some addressables) and so i can have full control over the update loop (I have server ticking in fixed update, but also doing some stuff in some update(s) )

mint iron
#

thnx, yeah needed a sanity check lol, i've padded the end of the array so it doesnt matter if it runs over.

sand prawn
#

Your netcode?

ocean tundra
#

๐Ÿ˜› im crazy and building a MP RTS

#

Using ENET and stuffs for core MP as i wasnt happy with Unity Transport (which also isn't compatible with latest Entities)

sand prawn
#

heh yeah, I've done the package juggling

#

what specifically did you need latest-entities for?

ocean tundra
#

I do eventually plan to swap back to Transport as i think i could get better performance, but ive used enet before and could get running in a day or so

#

didnt really, i just wanted latest packages for everything ๐Ÿ˜›

#

does anyone know if theres a way to copy all components from 1 entity to another?

coarse turtle
#

instantiate a copy of the entity?

ocean tundra
#

the target entity allready exists

coarse turtle
#

Oh

ocean tundra
#

and the source ๐Ÿ˜›

coarse turtle
#

hmm - i actually don't know ๐Ÿค”

#

maybe you can mimic how EntityManager.Instantiate(entity) on the lower level

ocean tundra
#

:/ its mainly for a editor tool...

#

i think ill just leave it for now ๐Ÿ™‚

opaque ledge
#

yeah, i kinda need that as well, to 'clone' an entity

ocean tundra
#

for me its more of a modifier tool.. I use the gameobject conversion flow then i want to Add some new components to the final prefab entity and ideally i dont want to have to code each one i want to add by hand

ocean tundra
#

Hi all does sorting a dynamic buffer ( .asNativeArray()) sort and save to the underlieing buffer?

var data = BUFFER.AsNativeArray(); data.Sort(new Comparer());

#

From what I've read .AsNativeArray dosnt copy anything and still refers to the same buffer data

untold night
#

it's just manipulating the buffer directly

ocean tundra
#

yup, turns out it was another bug that was messing with my data, making me think that the sorting was failing or something

#

Woooo, finally got my networking stuff all nice and smooth ๐Ÿ˜›

bright sentinel
#

Nice ๐Ÿ˜„ Is this using NetCode?

ocean tundra
#

No, custom, based on some of the NetCode ideas, using ENet and Ceras (serializer), I will be using Unity Transport when its a bit more stable

wide fiber
#

How many ComponentSystemGroups are you using?

I am using in the order: PrePreUpdate, PreUpdate, Update, LateUpdate

#

I don't know how good are these names, probably I need also another group before PrePreUpdate

opaque ledge
#

you shouldnt use it like that imo, group up the systems that has a common thing

#

i have PlayerSystems for example which includes, PlayerMovement, PlayerMovementRaycast, PlayerInteraction etc..

wide fiber
#

Well I am organising things in this way:

In the PrePreUpdate I have the input/AI systems, in the PreUpdate I have some modifiers and in the Update I have the actuators.

An example is a weapon system:

  • In the PrePreUpdate I have the check for the input and if I am pressing the mouse button, in a component called Trigger I set Value to true.
  • In the PreUpdate I have some systems that check if I have enough ammo in the magazine, if enough time has passed between the last shot and the current one (fire rate)... If not, the Trigger.Value is set to false because the weapon can't shoot
    -In the Update the LauncherProjectile check if Trigger.Value is true, if it's true it launches the bullet
opaque ledge
#

i mean.. as long as it works out for you, as long as you are comfortable with the workflow, all is fine ๐Ÿ™‚

wide fiber
#

(the LateUpdate for now it's not used)

#

Ok

opaque ledge
#

only thing i would watchout for is Transform system, which LocalToWorld component is updated, so if you are using LocalToWorld component before Transform system that means that component is 1 frame old and not the updated one

wide fiber
#

Ok

#

Maybe I should use better names.. something like:
InputDataUpdate, DataModifierUpdate, DataActuatorUpdate.

But I don't know which set of names would be more intuitive for other people (PrePreUpdate vs InputDataUpdate..)

opaque ledge
#

why would you think about other people ? are you making an asset ?

wide fiber
#

Nope

opaque ledge
#

For me, i go with InputDataUpdate, it simply makes sense

wide fiber
#

Ok

odd cipher
#

is there a way to call somestruct.equals(default(somestruct)) with burst?

opaque ledge
#

you can do somestruct.equals(new somestruct())

#

if you are checking equal against 'null' value of a struct you should do what Unity does with Entity, you should make a static property in your struct that returns 'null' representation of your struct