#archived-dots

1 messages Β· Page 274 of 1

rustic rain
#

disable them, and it'll be as good as managed array

viral sonnet
#

no, checks are not it. done without any

#

burst with checks

#

in a huge code base like mine safety checks are massive performance drain but for a very focused test it's not such a big deal. at least it doesn't skew the results that massively

rustic rain
#

have you tried in build?

#

to be sure there are no checks

heady edge
#

unlikely that it's checks
regular c# arrays and lists have a lot of checks built-in, yet they're much faster

viral sonnet
#

Well, I'm still writing out a build even though I know it's wasted time. I have done this a 100 times by now. I know that managed usage of NativeContainers is slower than managed built in containers like List, Dictionary. I'm intersted in the why. If you don't know, no problem, I'm just not interested in guessing games.

viral sonnet
#

some pretty pictures. gotta say, it helps somewhat. still, even in best case it's 2 times worse than burst. it doesn't correlate with my last test but that was for something very different. this only tests for read/write speed

#

oh the labels are gone from top to bottom: build_il2cpp, build_mono, editor

#

burst stays the same in every case. pretty great because it has the same speed in editor

rotund token
#

You can only turn off safety in burst jobs in editor, outside of burst safety is always on in editor

viral sonnet
#

yeah, I realized πŸ™‚ still a pretty huge gap left that I can't explain

#

question1: why the massive overhead of unbursted scheduling. question2: why the massive difference in il2cpp and mono

rotund token
#

Il2cpp is much faster than mono

#

Just in general. For basic math operations it's not even that much slower than burst.

viral sonnet
#

yeah, i mean the tests say so. I'm still confused what mono screws up this much, this is for nativestream reading and nativelist adding.

#

there's not much to screw up honestly. it's very simple code

#

do you know if any marshalling is going on for managed code? isn't there some copying back involved?

rotund token
#

Don't know sorry. Mono just compiles everything much slower

#

Pretty old test now but you can see how poorly it performs in just maths - whereas il2cpp can keep up on occasion

viral sonnet
#

i can't find this post anymore where joachimg basically explained why unmanaged bursted jobs are so fast 😦

patent cipher
#

on the troubleshooting section for jobs it says that you cannot modify nativearrays directly, but isn't this example still modifying a nativearray?

// Job adding two floating point values together
public struct MyJob : IJob
{
    public float a;
    public float b;
    public NativeArray<float> result;

    public void Execute()
    {
        result[0] = a + b;
    }
}
viral sonnet
#

huh? can you post where it says that?

patent cipher
#

Don’t try to update NativeContainer contents
Due to the lack of ref returns, it is not possible to directly change the content of a NativeContainer. For example, nativeArray[0]++; is the same as writing var temp = nativeArray[0]; temp++; which does not update the value in nativeArray.

Instead, you must copy the data from the index into a local temporary copy, modify that copy, and save it back, like so:
https://docs.unity3d.com/Manual/JobSystemTroubleshooting.html

viral sonnet
#

pretty sure it means something else. yeah, it's just saying you have to write it back and that it's not enough when you just modify the struct return value like var c = result[0]; c++;

patent cipher
#

but when I use result[0]++ it does update

viral sonnet
#

I dunno, it's a weird example. result[0]++ is actually translated into result[0] = result[0] + 1; πŸ€·β€β™‚οΈ

#

maybe they fixed it by now, doc could be pretty old and out of date

rotund token
#

yeah, they are making an important point

#

but that example is bad

viral sonnet
#

even worse when it's wrong and it actually increments πŸ˜…

molten flame
covert lagoon
#

Why does the DOTS sample game's character controller code do both collider casts and collider distance calculations? Is it only because the character colliders can rotate?

covert lagoon
#

Wait no, ColliderCastInput takes start and end positions instead of a RigidTransform, but it also takes an orientation quaternion

rustic rain
covert lagoon
rustic rain
covert lagoon
#

Ok, CalculateDistance really sweeps in all directions it seems

#

Red ray: from Translation.Value to Translation.Value + velocity
Blue rays: from DistanceHit.Position to DistanceHit.Position + DistanceHit.Distance * DistanceHit.Normal

covert lagoon
#

I just discovered that Debug.Break() exists

drowsy pagoda
half jay
#

if i destroy child entity should i remove it from Child Buffer myself?

covert lagoon
#

Ok my character controller works perfectly fine and I only use CollisionWorld.CastCollider(ColliderCastInput, out ColliderCastHit)

#

Well it works perfectly fine when the player is interpolated

#

When it's owner-predicted, it jitters, mostly when falling onto the ground

#

That's a large prediction error for a client that should have no network latency

rustic rain
covert lagoon
#

My character controller when the player ghost is interpolated: perfect.
My character controller when the player ghost is owner-predicted:

#

I don't get it

half jay
rustic rain
covert lagoon
#

Basically, I now keep track of the player's velocity and other controller state for the last 64 ticks and it fixed my broken prediction

#

Ok nvm it did not fix it, I had forgotten to switch back the default ghost mode from interpolated to owner-predicted in my player prefab

#

Wait now it works again

#

What

#

Ok no it doesn't work

glass wyvern
#

.

covert lagoon
#

Well it fixed the jitter but it didn't fix the collision bugs

#

I don't understand how switching the default ghost type from interpolated to owner-predicted can create collision bugs

devout shell
#

Hi everyone! I'm trying to create a simple character controller using the Unity Physics package but my lack of DOTS knowledge is showing.

#

I'm using ModifyNarrowphaseContacts from the examples as a base to test the normals against the slopeLimit but I then assign the normals to a variable inside IContactsJob but I have no idea how to read it outside of the job

#

I tried creating a struct but it didn't work

covert lagoon
karmic basin
devout shell
#

I got it working using pointers

#

Thanks

viral sonnet
viral sonnet
#

is IJobFor not supported yet in ISystem?? (0,0): Burst error BC1059: Method `Unity.Jobs.IJobForExtensions.ForJobStruct`1<T>.Execute(ref T, System.IntPtr, System.IntPtr, ref Unity.Jobs.LowLevel.Unsafe.JobRanges, int)` is being compiled as a function pointer, but both it and its declaring class `Unity.Jobs.IJobForExtensions.ForJobStruct`1` are missing the [BurstCompile] attribute. To fix this error, add the [BurstCompile] attribute to `Unity.Jobs.IJobForExtensions.ForJobStruct`1<T>.Execute(ref T, System.IntPtr, System.IntPtr, ref Unity.Jobs.LowLevel.Unsafe.JobRanges, int)` and `Unity.Jobs.IJobForExtensions.ForJobStruct`1`. ```0,0): Burst error BC1054: Unable to resolve type T. Reason: Unknown.

at Unity.Jobs.IJobForExtensions.ForJobStruct1<T>.Execute(ref T jobData, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, ref Unity.Jobs.LowLevel.Unsafe.JobRanges ranges, int jobIndex) at Unity.Jobs.IJobForExtensions.ForJobStruct1<NZSpellCasting.Code.TestSystems.NativeStreamPerformanceTestBuildISystem.TestJob_NativeStreamCopyToArrayBurst>.Initialize()
at Unity.Jobs.IJobForExtensions.Schedule(NZSpellCasting.Code.TestSystems.NativeStreamPerformanceTestBuildISystem.TestJob_NativeStreamCopyToArrayBurst jobData, int arrayLength, Unity.Jobs.JobHandle dependency)
at NZSpellCasting.Code.TestSystems.NativeStreamPerformanceTestBuildISystem.OnUpdate(NZSpellCasting.Code.TestSystems.NativeStreamPerformanceTestBuildISystem* this, ref Unity.Entities.SystemState state) (at```

viral sonnet
#

it's indeed not supported. got to use IJobBurstSchedulable/IJobParallelForBurstSchedulable instead.

#

the same job (50k iterations) in SystemBase (scheduled) takes 4.71ms, in ISystem scheduled 4.31ms, running on main thread in ISystem 3.6ms!

viral sonnet
#

what's also pretty crazy, a scheduled job with a NativeList.ParallelWriter AddNoResize takes 14ms and just a NativeList Add takes 4.7ms. Even when there's atomic operations. Just from 1 thread I don't quite understand the huge performance drop

rotund token
#

is it just 1 element addnoresize?

#

with sfaety off i assume

viral sonnet
#

yeah

#

i dunno, weird, I assumed it makes no difference that's why I let it slide in the perf test

viral sonnet
#

made sure there are no errors. same result: only difference is one uses ParallelWriter and the other doesn't. same job otherwise, both are single scheduled

#

it makes 0 difference in my project where I only have a 128 iteration and use AddRange. (well it sure does make a difference but marginal, I can't measure it)

rotund token
#

Interlocked (Increment) isn't particularly fast

rustic rain
#

@rotund token sir. Do you happen to know whether it's possible with UI toolkit?
Basically, I use that entity selection feature in gameplay for selection purpose as Player.
And I need to somehow disable that code execution in case cursor was over UI element.

rotund token
#

yes sec

#

they implemented it the same way as old UI

#

EventSystem.current.IsPointerOverGameObject()

#

need to use the new InputSystemUIInputModule replacement

rustic rain
#

yeah, I'll get reference to it

#

I assume it'll count all VisualElements?

rotund token
#

it might only be ones that can take input

#

ui toolkit has this event pass through

#

i wrote this extension ages ago

#
        /// <param name="element"> The element that blocks. </param>
        public static void BlockInputEvents(this VisualElement element)
        {
            element.RegisterCallback<MouseDownEvent>(StopPropagation);
            element.RegisterCallback<MouseUpEvent>(StopPropagation);
            element.RegisterCallback<KeyDownEvent>(StopPropagation);
            element.RegisterCallback<KeyUpEvent>(StopPropagation);
        }```
#

not sure if it's still required or there's a better way

#
        {
            e.StopPropagation();
        }```
rustic rain
#

StopPropagation is what exactly?

#

looking into APi

#

oooh

#

I see

#

hmm

rotund token
#

not certain this is needed anymore, just try it out

#

but yeah if you're images aren't blocking input, try that

#

anyway got to run (sleep) gl

rustic rain
#

Thanks sir, gn

covert lagoon
#

Ok I'm giving up on client-side prediction, I can't afford to waste more time on getting it to work as this is a school project I have to present this Friday.
This works almost perfectly. Sometimes, seemingly only when moving diagonally against a wall, the player refuses to move in the non-wall-facing direction (he doesn't move at all), and you have to move backwards to this direction to fix it.

#

I still don't understand what the point of CollisionWorld.CalculateDistance() for character controllers is because I ended up not using it

pliant pike
#

stupid question but can I not do this inside a an IJobParallelFor NativeQueue<CellData> indicesToCheck = new NativeQueue<CellData>(Allocator.Temp);

#

I'm getting some kind of infinite loop or something I'm guessing it may be using a singlequeue for multiple threads?

rustic rain
#

could you elaborate?

pliant pike
#

that's the sum of it to really I do this inside a parrallel job public void Execute(int index) { NativeQueue<CellData> indicesToCheck = new NativeQueue<CellData>(Allocator.Temp);

#

and my cpu's end up at 99 percent and Unity not responding

#

I'm guessing its not exactly that it may be the way I'm using Enque and Deque if its a single queue shared between all the threads

rustic rain
#

are you certain it locks on init of queue?

pliant pike
#

not entirely, I'm pretty sure its something to do with queue I've reduced the code and put in returns that don't return

#

ok its definitely the nativqueue I just reduced it to the declaration and I get the warning The container does not support parallel writing. Please use a more suitable container type.

#

that's annoying I never got that warning before it must be a bug

acoustic wave
#

Has anyone ran into the issue where you install Unity.Collections, I am using it in the script, I can use NativeArray but NativeList can't be found?

coarse turtle
gusty comet
#

in 2021 i installed hybrid and idk what to do cuz i keep running into errors with all these outdated guides

karmic basin
calm edge
pliant pike
#

I don't understand what has happened to parallel jobs that I can't use lists or queues or anything in them anymore?

#

I just want each thread to have its own unique list but I can't even seem to do that with nativelist a fixedlist probably an unsafelist πŸ˜•

heady edge
#

Are there known problems with NativeHashSet?
I've spend so much time profiling my algorithm, but it turns out that if NativeHashSet is allocated with too big of a size, operations with it become insanely expensive

pliant pike
#

neh mind I've got a list working, you have to declare and initialize it in the code execute

rotund token
heady edge
#

indeed

rotund token
#

(unless you have a poor hash and a lot of collisions)

heady edge
#

but i have them proofs

rotund token
#

what operations in particular

heady edge
#

the problem with it's not the size

#

it's capacity

#

I've initialized hash set with ~10000 as first argument, but only used like 1/100th of capacity and it performed muuuch worse, than if I intialize it with capacity of 0

#

the algorithm is quite complex, I can't pinpoint the particular operation. I may try a more synthetic test to check

#

but difference between those values is algorithm taking 0.1 ms and 2 ms on exactly the same data set

rotund token
#

you're memory is randomly spread over 20,000 elements in buckets

#

rather than 200 elements next to each other in memory

heady edge
#

hashset capacity is defines how many buckets it will create?

#

ouch

#

yeah, should have seen that in that case

rotund token
#

buckets is 2*capacity

heady edge
#

yeah, my bad really, needed to stop and think for a second

viral sonnet
#

seriously? that big of a difference with such a low amount? I never got that results. hm

#

isn't this more about allocation time than bucket reading?

rotund token
#

if you pre allocate a giant set you aren't doing any allocations when adding

#

if you don't allocate you are doing constant allocations

viral sonnet
#

that's true but we'd have to compare a constant 10k allocation against a 1 allocation and maybe 6(?) reallocs when the final length is around 100. maybe he's allocating the 10k * chunkSize times? I just never had this massive increase with a large capacity is what I'm arguing for.

#

bucket lookup with huge capacity is surely a factor, with 10k it just doesn't range from 0.1 to 2ms but I'd need to know what the actual operation is. thing is I have 100k containsKey and adds in less than 2ms

misty wedge
#

It it still true in 0.50 that for implementing events (e.g. taking damage) a polling system where entities have a component that is iterated over each frame and checked for damage, is faster than a reactive system where an entity is created that contains the event data and is then handled by a system?

rotund token
#

hmm depends

misty wedge
#

I assume it depends on the amount of entities? I have no idea how "costly" iterating over a large amount of entities with an early return in case no "work" needs to be done is vs creating entities with tags.

I guess adding tags to large entities is always a bad idea since it would move them to a different archetype?

rustic rain
#

iterations itself usually aren't

misty wedge
#

Yeah but it's very hard to gauge how costly they are vs just creating entities

rustic rain
#

well creating entities is always costly

misty wedge
#

Scheduling is as well πŸ˜…

rustic rain
#

guess how costly it'll be if you will Schedule AND create entities

misty wedge
#

In either case the creation or "addition" of data is happening in a separate job that runs regardless, this isn't in addition to that

#

E.g. some system deals damage, another applies that

rustic rain
#

I'd rather suggest using buffer for that

misty wedge
#

My question is whether the second system should just iterate over all entities or if the first system should create "event" entities

#

In either case you schedule twice, possible less in the second case if there are no event entities to process (I assume this is cheaper than scheduling)

misty wedge
rustic rain
#

well

#

physics engine is using buffer approach

misty wedge
#

I guess it also really depends on the amount of entities vs how often these events occur

karmic basin
devout prairie
tranquil lantern
#

Hi, I am trying to develop a game using dots but I don't know how the UI should be implemented. I created a UI that derives from MonoBehaviour using the UI Builder but I don't find a way of changing the data by using entities systems. Does somebody have an idea ?

oak sapphire
tranquil lantern
covert lagoon
#

error SGJE0009: Alter.Terrain.MeshRetrievalJob contains non-value type fields.
What do I do then?

    public partial struct MeshRetrievalJob : IJobEntity
    {
        public Mesh[] Meshes;

        // ReSharper disable once UnusedMember.Global
        public void Execute([EntityInQueryIndex] int entityIndex, in RenderMesh renderMesh)
        {
            Meshes[entityIndex] = renderMesh.mesh;
        }
    }
        protected override void OnUpdate()
        {
            var ecb = _ecbSystem.CreateCommandBuffer().AsParallelWriter();

            var numChunksToGenerateMesh = _chunksToGenerateMeshQuery.CalculateEntityCount();
            var meshDataArray = Mesh.AllocateWritableMeshData(numChunksToGenerateMesh);

            new TerrainChunkMeshGenerationJob
            {
                EntityCommandWriter = ecb,
                MeshDataArray = meshDataArray,
                VertexLayout = _vertexLayout,
            }.ScheduleParallel(_chunksToGenerateMeshQuery);

            var meshes = new Mesh[numChunksToGenerateMesh];

            new MeshRetrievalJob
            {
                Meshes = meshes,
            }.Run(_chunksToGenerateMeshQuery);

            Mesh.ApplyAndDisposeWritableMeshData(meshDataArray, meshes);

            _ecbSystem.AddJobHandleForProducer(Dependency);
        }
#

I can't have a Mesh[] field in my MeshRetrievalJob

#

And as far as I know I can't pass an existing EntityQuery to Entities.ForEach()

#

So do I go back to writing a call to Entities.ForEach() that replicates my _chunksToGenerateMeshQuery by querying the same components?

#

Feels like a hack

rustic rain
#

I haven't tried it though

covert lagoon
#

You can see it in the snippet I posted:

            var meshDataArray = Mesh.AllocateWritableMeshData(numChunksToGenerateMesh);
            Mesh.ApplyAndDisposeWritableMeshData(meshDataArray, meshes);
rustic rain
#

oh

#

I see

covert lagoon
#

The problem is retrieving the managed/non-value (class instance) Mesh objects contained in the RenderMesh components

#

Since Mesh is a non-value type, I can't put an array of them as a field in a job struct

rustic rain
#

why do you even need to attach meshes to entities?

#

if you need array

#

you can collect data in Native collections

#

and just grab it in your second job

covert lagoon
#

Native collections provided by Unity.Collections only accept struct types as element types

rustic rain
#

hm, true

covert lagoon
#

Mesh is a class

rustic rain
#

don't you have reference to meshes before hand though?

covert lagoon
#

How?

rustic rain
#

meshDataArray that, no?

covert lagoon
#

They're MeshData values, not Mesh objects

#

They must be applied to Mesh objects

#

Hence this:

            Mesh.ApplyAndDisposeWritableMeshData(meshDataArray, meshes);
pliant pike
#

I don't suppose anyone knows how to get this working Unity.Burst.CompilerServices.Loop.ExpectVectorized();

#

according to my ide its not even in the namespace

#

and I presume I just have to add this to to the top of the file #define UNITY_BURST_EXPERIMENTAL_LOOP_INTRINSICS

covert lagoon
#

?!?!?!?!?!!?

    public class AlterBootstrap : ClientServerBootstrap
    {
        public override bool Initialize(string defaultWorldName)
        {
            AutoConnectPort = 42126;

            UnityEngine.Debug.Log($"{RequestedPlayType}");
#

Why?!

#

Whyyyyyyyy

#

Do I have to manually add UNITY_CLIENT to scripting defines in my build configuration?

remote crater
#

Hello. I am launching a humble foundation towards my space mmo today using DOTS/ECS, thank you all for the past year of help. I have one possibly final question. I'm adding this to an entity, but I am not sure how to check if it may already exist: DynamicBuffer<ItemDropBufferElement> dyn = em.AddBuffer<ItemDropBufferElement>(e);

#

By testing if it already exists, I can see if there is data I need to preserve, and not overwrite it.

#

Thanks again for a wonderful year of help. There's a lot of hate on the internet lately, but the spirit of helping has never stopped as long as I've been on it since 1994. I was told it goes further back from the boss at the lab. He says he was there when some of the big guys weren't big and silicon valley first started up. Everyone wanted to help and share info.

rustic rain
viral sonnet
drowsy pagoda
#

I need to make object pooling in my dots project with the ability to retrieve cached entities from inside a scheduled (burstable) job. Can someone give me a boilerplate pattern or a resource I can look at it?

rustic rain
#

you can just keep archetype

devout prairie
rustic rain
#

for that matter

drowsy pagoda
#

Is there a way for my external ide debugger to debug logic inside ForEach jobs?

#

It seems to be ignoring those breakpoints. But any breakpoints outside it catches and takes it step by step, but doesn't go into the ForEach logic.

heady edge
viral sonnet
#

ah, yeah that might be costly. do you use a method, enumerator or how do you iterate?

heady edge
#

foreach (var item in hashSet)

viral sonnet
#

is that looped once or multiple times per frame?

heady edge
#

loooots of times per frame

viral sonnet
#

ok yeah, that kills it then πŸ™‚ why have a hashset when you iterate so much?

heady edge
#

cause I also need to quickly check existance much more often )

rustic rain
heady edge
#

and quick removal by item, instead of by index

viral sonnet
#

I don't get it πŸ™‚ Anyway, as long as the hashset stays relatively small it's okay but that algorithm does not scale well. brute force iteration is a total perf killer. Might be even better off building a second hashmap

heady edge
#

well, I need to be able to remove an item from a collection quickly, by item value

#

In list it's linear, in hashset it's O(1)

viral sonnet
#

you can make a list and hash the key+value to get the index

heady edge
#

it's possible, not sure if would give me actual benefits over iterating over the HashSet

viral sonnet
#

is it a nativemultihashmap then? not a hashset?

heady edge
#

hashset

#

NativeHashSet<int>

#

(it already stores indices into an array)

viral sonnet
#

hashset/map removal only works really great if you know the key. otherwise it's like a bad O(nΒ²)

heady edge
#

but I know the key

#

it's the int I put there and when something happens I know the key I need to remove

#

I'm not iterating over it to delete things from it

viral sonnet
#

ok, so the iteration is for another part?

heady edge
#
{
if (otherthing)
{
   hashset.add(x)
}
else
{
   hashset.Remove(x)
}
}
else
{
   foreach(item in hashset)
   {
     .....
   }
}
#

in all this inside another loop

viral sonnet
#

what is item in your context? hashset only implements bool as TValue

heady edge
#

NativeHashSet<int>

#

I have an array of things, during the course of the algorithm some things in that array become "active" for algorithm, so I put their indices into that hashset when algorithm needs to iterate over active items it iterates over hashset and get the item by index. If item becomes "inactive" its index gets removed from the HashSet

viral sonnet
#

is this per entity?

#

I think an additional list that saves the index/keys you want to iterate on is the most performant solution. a hashset is pretty good to not being forced to use Contains in a list (which is really slow) but for the iteration itself a hashset is not that great because it uses ceilpow2(capacity) for the bucket array which is iterated fully in the foreach

heady edge
#

The algo itself doesn't work on entities - the data is already preprocessed, but the scale of it is pretty big, I'm currently testing on the array of 20k+ elements

#

it's hard to tell how many items in the hashsetitself at any given time though

#

as it's very inputdata dependant

#

i will try that approach too, as it's basically an exercise in optimization for me

#

already went to vectorized structures, but would it would be nice if i get a bit of performance out of that too

heady edge
#

but actually my biggest timewaste right now is sorting

#

is there a sense in trying to insert sorted to some collection?

#

not really looking forward to implementing some kind of binary tree without at least a hint that it may be faster

cerulean pulsar
#

Has anyone had trouble getting a subscene to load in a standalone build? I am using a BuildConfiguration. I've never had this problem before. I tried including the subscene in the SceneList of the BuildConfiguration but that did not solve the problem. Neither did deleting the Library folder

remote crater
drowsy pagoda
#

Have you actually got it to work?

remote crater
#

t parallel processing

#

and your runs have

#

RUN().WithoutBurst

#

End of for each looks like this: }).WithoutBurst().Run();

drowsy pagoda
#

Yup, that's exactly what I got.

remote crater
#

You getting breakpoints outside of dots/ecs

#

?

#

cuz sometimes you need to rehook the visual studio

#

Make sure you get a breakpoint JUST before the foreach

#

do a UnityEngine.Debug.Log("YO!");

#

just before your for each

#

see if you get that

#

Also one more thing

#

if nothing qualifies for the for each

drowsy pagoda
#

Yeah breakpoints outside ForEach work.

remote crater
#

say no entities have those components, it won't run

#

So strip it down just to Entity e

drowsy pagoda
#

And I confirmed that the Job runs in the Relationship panel.

remote crater
#

and then add one by one your components in

#

Thats the extent I can help for now

drowsy pagoda
#

Ok.

remote crater
#

Yo, anyway of printing anything out of a parallel thread?

#

UnityEngine.Debug.Log isn't getting me anything but an error message. Jason, remember sometimes Debug messages are almost as good as a breakpoint.

#

If you cant get your break, try spamming debug messages.

#

They're harder to read in dots/ecs but they give some info

drowsy pagoda
#

Yeah that’s my plan B, but the logic inside is a bit complex and needs to run every frame with nested iterations, so I’m trying to see if I can look at it live step by step first.

tranquil lantern
#

Hi, I wondered what is the best way to implement a kind of fps hud for players using dots and netcode. Does somebody already did something similar ? I can't find any tutorials online.

rotund token
#

Take a script that implemented an fps hud in a normal unity project, add it to your dots project! What more does it need?

tranquil lantern
#

I made a UI with UI Toolkit using VIsualElements, but i can't find a way of modifying for example the length of a VisualElement using a System. Also, I am not familiar with multiplayer implementations. I tried to check the documentation about UIDocument and I don't know what to attach to my player IComponentData in order to add an UI for each players

molten flame
tranquil lantern
molten flame
tranquil lantern
#

thanks, it will definitely help me

rustic rain
#

not sure why it wouldn't work for you

rustic rain
#

@rotund tokensir. Regarding input actions and UI again:
Do you have separate actions or one for all for mouse clicks?
Cause the moment I tried to switch it all into 1 input action (for this thing you suggested with disabling input if cursor over UI) I realised I used different action maps for same mouse click action.

rotund token
#

Do you have separate actions or one for all for mouse clicks
I have different ones

#

each state in game has it's own map/actions

#

i have a common input struct as well

#

with info like, cursor position, raycast from camera, isoverUI, etc

#

that each of my states can use

rustic rain
#

yeah, cur mouse position is also general for all

#

but it's click that I'm interetsed in

#

and essentially: how you disable input for other maps

#

in case it's over game object

#

Doesn't that StopSmth method only disables current inputAction?

rotund token
#

i only have 1 action map enabled at a time (well not true, i have a tiny common one but for the most part its true)

rotund token
#

it just means the UI has consumed it

#

so it'll be considered over UI

rustic rain
#

ahem

#

then I don't quite get logic behind

#

So I have actions: select entity and UI click.
Both have been attached to mouse click

#

I need to not run select entity in case UI click happened succesfully on UI element

rotund token
#
        {
            var camera = this.EntityManager.GetComponentObject<Camera>(this.GetSingletonEntity<Camera>());

            this.inputCommon.ViewPoint = ((float3)camera.ScreenToViewportPoint((Vector2)this.inputCommon.ScreenPoint)).xy;
            this.inputCommon.InViewPort = new Rect(0, 0, 1, 1).Contains(this.inputCommon.ViewPoint);
            this.inputCommon.InputOverUI = EventSystem.current.IsPointerOverGameObject();```
#

i write my state to a component

#

and i just use it in my logic

#

for when it shouldn't pass through UI

#
        {
            if (!this.InputBuild.Destroy.Down || this.InputCommon.InputOverUI)
            {
                return;
            }```
#

that said reading this i might change the part where i write to my
this.InputBuild.Destroy.Down
to also take into account the inputoverui
I dont the system using this should care, should be handled by my input state system

rustic rain
#

ah, like this

#

I see

viral sonnet
#

totally missed that 2022.1 is officially released by now. quite the pain that the next entities release only targets 2021.3

unique shard
#

Guys : I'm starting a new project, and I'm not sure if I should stick to unity "normal" workflow or start a DOTS project. I'm aiming to create a Backrooms type game (procedural maze in short) so that why I though about DOTS. The thing is that if I go to DOTS, there is no UI, Foot IK... I'm feeling like DOTS is not really integrated to unity packages and etc

#

am I wrong or not ? I feel like DOTS require x20 more effort

rustic rain
#

well kind of

#

there are no built in solutions for anything

#

UI elements though works fine with dots

#

pretty sure uGUI will work fine too

unique shard
#

if I use DOTS, would I be able to have a mix between gameobjects and entities ?

#

or is it a bad thing

rustic rain
#

well yeah, you can

#

hybrid approach is totally fine

#

allthough I personally find it pain in the ass

#

I learnt how to create my own meshes and draw stuff without game objects just to avoid doing hybrid xD

unique shard
#

I see xD

#

but for example canvas are MonoBehaviour based

#

So can I use them ?

rustic rain
#

yeah, game objects exist fine along dots

#

it's just that

#

these are 2 separate worlds

#

and bridge between them is somewhat painful

#

accessing game objects from ECS is relatively simple

#

accessing ECS from game objects is pain

#

so far I use game objects only for UI/event system/ certain data containers (launch options)

unique shard
#

I see ok

rustic rain
#

there it is

#

also cameras

unique shard
#

Oh ok

rustic rain
#

@unique shard ask all you want here, it's totally fine

unique shard
#

ok

#

is there a tutorial series about multiplayer DOTS games ?

rustic rain
#

yeah

#

look up "moetsi dots tutorial"

#

perfect intro I used to get into dots

unique shard
#

ok imma watch it then ty ;)

#

and can I import unity packages or are they not DOTS compatible ?

rustic rain
#

ECS in DOTS is just different world

#

that doesn't cooperate with game object world

#

and runs on it's own

unique shard
#

ohh ok I see

#

alright ty

rustic rain
rotund token
#

hmm not sure, pretty sure this was working last i tested

#

but i have not been working in my game project much as 2020.3 stuff is annoying me

#

just working in my standalone libraries

#

I should add I do remember having issues with this and I might have changed something to fix it

#

But I can't remember, will have to check tomorrow

covert lagoon
#

Really?

(0,0): Burst error BC1021: Creating a managed object `System.Void System.Func`2<Unity.Mathematics.float3,System.Int32>::.ctor(System.Object,System.IntPtr)` is not supported
#

Why doesn't Unity just let us write C++ instead?

#

How do I pass a heuristic function to my pathfinding function?

drowsy pagoda
covert lagoon
rustic rain
#

I never tried doing anything fancy with burst myself

#

but I remember seeing something about it in manual

cerulean pulsar
#

Has anyone had trouble getting a subscene to load in a standalone build? I am using a BuildConfiguration.

I've never had this problem before. I tried including the subscene in the SceneList of the BuildConfiguration, with and without Auto Load, but that did not solve the problem. Neither did deleting the Library folder. Neither did deleting the SceneDependencyCache folder. (Well, including the SubScene in the build config with auto load did load the subscene but the references seemed to be broken). Making a new subscene also did not work

rotund token
gusty comet
#

Is dots at this point compatible with the 2021 LTS version?

rustic rain
gusty comet
#

Afair it was Q2, so at worst end of june right?

#

Or have they delayed that?

rustic rain
#

welp, some ppl were expecting it several weeks ago xD

#

I personally can't wait for it

#

2020 is so bad with UI toolkit

gusty comet
#

I just want production ready dots, with proper 2d rendering capabilities, as well as editor ui for dots stuff

rustic rain
#

welp

#

no earlier than 2023 then

rustic rain
#

which is good

gusty comet
#

That is not good in my book.

#

Ideally dots would have the same workflow as game objects have.

rustic rain
#

welp, I wouldn't expect it any earlier than 2025 xD

gusty comet
#

Yeah I won't either.

#

I still maintain that they went public with dots too early because they feared the competition

#

and shot themselves in the foot in the process

rustic rain
#

well, I enjoy it

#

actually developing on it as indie dev

gusty comet
#

I just hope they dont abandon it half baked like so many other features

rustic rain
#

doubt they will

#

dots is getting hugely integrated into Unity

#

even certain game object components are jobified and bursted

#

Native containers are getting their own overloads for methods that usually accept normal IList

gusty comet
#

I love ECS for its design pattern mostly, which is why its so hugely frustrating for me.

#

Since the ECS pattern makes so much more sense to me.

rustic rain
#

yeah, #1 reason I work with it

#

OOP is frustrating xD

gusty comet
#

I find OOP just obfuscates issues instead of solving them most of the time.

#

Like the issue of shared state, quite often it still shares the same if not more state, but just obfuscates it under piles of abstraction.

#

And to this day nobody could conclusively explain to me where the boundaries of components in unity should be drawn.

#

Which makes it all the more frustrating.

cerulean pulsar
# rotund token You haven't really said what's breaking or the error

Mea culpa. The meshes (e.g. trees) don't load, and the character controller doesn't work. The error is a GetSingleton error, saying there are no entities that match, which I assumed was happening because the subscene didn't load. By adding the subscene to the BuildConfig with autoload, the meshes (e.g. trees) do load, but the GetSingleton error persists (and the character controller is still broken, since it relies on the GetSingleton call). There are no issues in play mode in the editor

Maybe autoloading the subscene via the build config creates a new world. I was using World.All[0] but maybe it's World.All[1] now

rustic rain
cerulean pulsar
rotund token
#

It can take multiple frames for a subscene to load

#

You can not guarantee anything in them will be loaded while your world updates (unless you choose it to be that way)

#

It's not happening in editor because you're probably just starting in the scene with a subscene it's already loaded in memory etc

coarse turtle
#

does anyone remember where to find the source generated partial systems & IJobEntity structs? πŸ€”

rotund token
rustic rain
#

Feels bad

white island
#

hmm. okay so, say I had like an entity with a navmesh agent, transform, model, etc. But then I wanted to remove everything but the transform from the entity, and then add those components back later. Like, if I walked away from the entity, it would unload everything but its position, so then when I came back I could re-give it a mesh and all that. How would I do this without structural changes? I could technically just keep all that around in memory but that's wasteful since I'm not using it

rustic rain
white island
#

yeah, but how could I approach it a different way then

rustic rain
#

If you don't want to remove list of entities

#

You could use disable tag for your system

white island
#

maybe decouple the part I need to remove from the part I want to keep, and then have them linked?

rustic rain
#

Kind of like disable rendering tag works for rendering

white island
#

But all the meshes and stuff are still kept in memory, then

rustic rain
#

It's an option if you often remove add set if components

#

Or when adding those components is painful

#

As in restoring data per entity and etx

white island
#

Also, does entity collision still work with terrains

#

If not then I can't use it yet

covert lagoon
#

Can Translation.Value be relative to a parent whereas LocalToWorld.Position will always be absolute?

rotund token
#

yes

#

Translation is local space

safe lintel
#

What is the source generation for systembase actually needed for?

covert lagoon
#
/home/overmighty/projects/alter/Alter/Assets/Scripts/Alter/Characters/Pathfinding.cs(88,9): Burst error BC1063: Unsupported parameter `ref Unity.Collections.NativeList`1<Unity.Mathematics.float3>` `path` in function `Alter.Characters.Pathfinding.FindPath(ref Unity.Mathematics.float3 start, ref Unity.Mathematics.float3 end, ref Unity.Collections.NativeList`1<Unity.Mathematics.float3> path)`: Field `NativeList`1.m_DisposeSentinel` of type `Unity.Collections.LowLevel.Unsafe.DisposeSentinel` is not blittable. When compiling a method for use as a function pointer, only blittable types can be used in the method signature, including parameters and return type. To fix this issue, replace the non-blittable type with a blittable type. Blittable types include: void, byte, sbyte, short, ushort, int, uint, long, ulong, float, double, UIntPtr, IntPtr, pointers, and blittable structs (i.e. structs containing only blittable types). Alternatively, use a pointer - `Unity.Collections.NativeList`1<Unity.Mathematics.float3>*` - instead of ref - `ref Unity.Collections.NativeList`1<Unity.Mathematics.float3>` - for this struct parameter.

While compiling job: System.Void Alter.Characters.Pathfinding::FindPath(Unity.Mathematics.float3&,Unity.Mathematics.float3&,Unity.Collections.NativeList`1<Unity.Mathematics.float3>&)
at /home/overmighty/projects/alter/Alter/Assets/Scripts/Alter/Characters/Pathfinding.cs:line 88
#

Really?

#

I can't pass NativeLists to Burst-compiled functions?

#

Doesn't m_DisposeSentinel only exist when safety checks are enabled?

rotund token
#

You can't pass any struct to burst func

#

Only primatives and ptrs

covert lagoon
#

Why?

The system Alter.Characters.PathfindingSystem reads Unity.Transforms.LocalToWorld via PathfindingSystem:PathfindingSystem_LambdaJob_0_Job but that type was not assigned to the Dependency property. To ensure correct behavior of other systems, the job or a dependency must be assigned to the Dependency property before returning from the OnUpdate method.
protected override void OnUpdate()
{
    using var players = _playerQuery.ToEntityArray(Allocator.TempJob);

    if (players.Length <= 0)
    {
        return;
    }

    var tick = _serverSimulationSystemGroup.ServerTick;
    var localToWorlds = GetComponentDataFromEntity<LocalToWorld>(true);

    Dependency = Entities
        .WithReadOnly(players)
        .WithReadOnly(localToWorlds)
        .WithAll<NpcTag>()
        .ForEach((Entity entity, ref DynamicBuffer<PlayerInput> inputs, in LocalToWorld localToWorld) =>
        {
            // ...
        })
        .Schedule(Dependency);
}
#

Appending Dependency.Complete() to OnUpdate()'s body fixed it, I don't know why

rustic rain
#

leave it as void method

#

oh

#

I remember

#

you are using Entity type

#

without type handle

#

this is causing dependencies to break

#

lemme remember how I fixed it

#

welp

#

I transformed it into IJobEntityBatch

#

and used type handle

#

xD

covert lagoon
#

ComponentTypeHandle?

rustic rain
#

EntityTypeHandle

white island
#

Are entities able to collide with terrains?

remote crater
#

Is there a quick way to turn off rendering of all entities at once or do I need to do it by hand?

#

Launching my MMO foundation patch in the next 2 hours or so, wooo, a good milestone after 5000-7000 hours dev depending on metrix

remote crater
#

I think I can entity query this, but none of my systembases work until later when the DOTS/ECS segment of my game starts. Is there a way to force a systembase refresh even if the .foreach ain't happenin?

#

Maybe just a foreach of all entities, disable every time seen, slap in a list for later enabling, yah that should do it

rotund token
#

[AlwaysUpdateSystem]

rustic rain
#

Very fast

white island
rotund token
#

it's a pretty vague question

#

physic coliders collide with other physic colliders

#

if you give your terrain a mesh collider and your entity a box collider

#

they will collide

#

if your question is about terrain colliders i do not believe they are currently supported (though there is a type in the backedn)

#

you need to use a mesh collider

chilly crow
#

Q2 2022 is getting frighteningly close to its end ThinkEyes

timber ivy
#

Does ecs interact with audiosource yet or?

haughty rampart
hot basin
#

to be fair you can

#

as managed components exists

tranquil jay
rocky dove
#

more like 0.51

remote crater
#

Yo, I'm releasing a patch to my game today, and I forget the trick about assets when using the build pipeline. Is there some folders from Unity I need to copy with my release for data?

#

I want to go live bad.

remote crater
#

I do not use subscenes

rotund token
#

backend*

#

the more i use writegroups, the better they become

timber ivy
oak sapphire
# timber ivy Any info on how to do these managed components?

https://docs.unity3d.com/Packages/com.unity.entities@0.50/api/Unity.Entities.EntityManager.html

public class CharacterAnimationComponentAuthoring : UnityEngine.MonoBehaviour, IConvertGameObjectToEntity
{
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        dstManager.AddComponentObject(entity, new AudioSource());

What you do with it is up to you. But this creates a Companion Link and an AudioSource object in your scene that always follows your entity.

rustic rain
#

the way, so it creates companion link automatically

#

I also wonder how to query through such components

#

after adding

oak sapphire
rustic rain
#

πŸ€”

rotund token
oak sapphire
# rotund token That's interesting, did not know it'd work like that. Any advantage of this over...

As far as the advantage goes, you wont have any in terms of performance as far as I know, but if you have a Fireball Entity with a ParticleEffect and a crackling sound effect AudioSource added through the AddComponentObject, you don't have to sync the position and rotation of your GameObject with the Entity. It's just convenient for moving Entities. The problem with AudioSource is that you can't have thousands of them, so with many Fireballs you would need another system. You can add loads of normal components this way so you wont have to manage that all yourself. I'm still trying to find the limitation script I read somewhere, will post it if I find it again. For example, a TrailRenderer is not allowed, but a LineRenderer is IIRC.

I believe it'd still convert to the same companion object. Not sure what you mean by that, as far as I know you need to code your own companion object for all the components that you can not use on entities.

coarse turtle
rotund token
# oak sapphire As far as the advantage goes, you wont have any in terms of performance as far a...

I believe it'd still convert to the same companion object. Not sure what you mean by that, as far as I know you need to code your own companion object for all the components that you can not use on entities.
supported companion objects can be converted automatically (but audio source isn't one of them). what you've seen to done is 'convert' objects that aren't actually supported and it works which is super interesting as i did not expect it to work.

when I posted that above, I thought audiosource was one of the supported ones but it appears like it isn't looking at the list.

rotund token
#

i really want to build a super ecs modable library

oak sapphire
oak sapphire
#

Well I searched for a while now, couldn't find the list I was looking for. Somewhere in the source code there was a list of things that were allowed as components.

covert lagoon
#

What entities persist through scene loads/unloads?

rustic rain
covert lagoon
#

When does a world not persist?

rustic rain
#

I don't quite remember what is default

covert lagoon
#

I'm making the main menu for my game and I'm not sure how to properly handle the button for connecting to a server and switching to the game scene

rustic rain
#

But I remember there was an option to not unload world upon scene change

rustic rain
#

you can load/unload subscenes freely while keeping entities that belong to world untouched

covert lagoon
#

Do I load subscenes just like I would load regular scenes with SceneSystem.LoadSceneAsync?

rustic rain
#

yeah

covert lagoon
#

Ok

#

Thanks

rustic rain
#

or you can do it in low level API

#

as in

#

literally just create entity with subscene component

#

and tag to load

#

and it'll load xD

covert lagoon
#

Is there any reason to add ConvertToClientServerEntitywith the ClientAndServer ConversionTargetType to GameObjects instead of adding a subscene to the scene at build time?

ruby cedar
#

Quick question about the Job system
I've seen multiple videos now about the Job system and how you can utilise multi threading with it.
Now, as you can only use native types its mostly impossible to adapt my whole AI code to it.

Question: Does it mean I have to split individual things from my AI code into jobs? So my AI code has multiple different Jobs I'll schedule?
Also, is this a problem if I execute those in a IEnumerator? As Coroutines are running on the Main thread? Or is that not a problem if I schedule a job in a Coroutine?

Thanks!

rustic rain
#

1st grab data for job

#

2nd do jobs

#

3rd retrieve data from job into your managed world

ruby cedar
rustic rain
#

doing several jobs that depend on each other is totally fine in ECS

#

why wouldn't it be in just jobs?

surreal maple
#

Library/PackageCache/com.unity.dataflowgraph@0.19.0-preview.7/Runtime/AtomicSafetyManager.cs(32,74): error CS8377: The type 'T' must be a non-nullable value type, along with all fields at any level of nesting, in order to use it as parameter 'T' in the generic type or method 'NativeList<T>'

Hello, do anybody know how to fix this internal error?

rotund token
#

You probably have old unsupported animation package installed?

surreal maple
rotund token
#

Yes it's no longer supported in entities 0.50

surreal maple
#

which one is proper instead?

rotund token
#

You'll need to wait for after 1.0 for an updated animation package

rotund token
surreal maple
#

Maybe any another way to animate 3d entities?

rotund token
#

You need to use hybrid, just the old mecanim

#

Unless you want to write something yourself

surreal maple
#

I use hybrid renderer, and i know how to animate GameObjects but how to animated entitites i don't know yet

rotund token
#

Hybrid as in use gameobjects not the render

#

Unless you want to do it all via shaders, wait for a third party solution or write a solution yourself

#

Basically stuck using gameobjects for now

surreal maple
#

so for now there is no way to animate enitites. If i want an animated character i should not convert it into the entity and should use it like a regular GameObject, right?

rotund token
#

Pretty much

oak sapphire
surreal maple
#

Thank you. And the last question. What about Rival Character Controller? They implemented their own animation system or their character actually GameObject nor Entity?

https://assetstore.unity.com/packages/tools/physics/rival-dots-character-controller-195567

Get the Rival - DOTS Character Controller package from Philippe St-Amand and speed up your game development process. Find this & other Physics options on the Unity Asset Store.

oak sapphire
#

But it's not the standard way of animating things.

surreal maple
oak sapphire
#

No, its vertex animation, it has no skinned mesh renderer at all, its just a standard mesh. You just bake all the vertices of every frame of the animation into a texture, where every pixel means a position and rotation from your origin point. Then you go through the texture information and set each vertex on the correct spot.

surreal maple
#

I know this unusual but very efficient animation playing mechanism. I though that Animation Instancing is it actually.

oak sapphire
#

I'm not a hero when it comes to terminology, but I thought Animation Instancing is the same as GPU instancing. Where if you play the same animation with the same mesh Unity does some magic and it goes fast.

surreal maple
oak sapphire
#

With 78000 units I'm on 100% CPU usage.

rotund token
#

Yeah what's I meant by Shader above

#

I don't generally recommend it as most people are primarily looking for a way to animate a player controller and this really isn't great for that

#

(just due to the number of animations a player controller can have as well as only have a couple of players at most visible at a time )

#

It's amazing for crowds of things though

surreal maple
#

I thought that as many animations i will have a many textures for storing vertices positions i will have to create for each of them and here is no limitation actually. Am i wrong?

rotund token
#

We have over 1000 animations on our player controller

#

It becomes a bit of a nightmare for artists to maintain

surreal maple
#

but for simpler games it could be good enough or not?

rotund token
#

And there is pretty much no benefit of using this technique on a single object

oak sapphire
#

I 100% agree, it's great for my Kingdom Simulator game where you have thousands of people going about their life.
But you can not use all the fancy stuff like animation blending, so every animation transition looks janky.
As a main character you should not use this.

rotund token
#

Much better said than me

#

Amazing for crowds

surreal maple
#

Do anybody know how the Rival Player Controller (i sent link above) is working?

#

if it's okay it's not a problem to pay for a great solution

#

Sorry, i've just read that it's not deal with input system, animations and cameras. So, this is not a solution for animations...

misty wedge
#

If I want to write a lot of values to a DynamicBuffer, is it enough to call Clear and then EnsureCapacity before writing to the native array returned by AsNativeArray? Or do I need to do something else to make sure the internal stuff like Length is updated correctly?

viral sonnet
#

clear would set the length to 0 so the native array would be empty

rotund token
#

is there a ResizeUninitialized? or is that just another extension i've added

remote crater
#

What is "DOTS root assembly" under build config?

#

I want to launch my DOTS game patch on steam, and my Standalone doesn't match my editor. Quite literally an IDE compiler should never have this problem... But this has plagued me for months before on Unity. Lots of people can't get this scriptable build pipeline thing to work when the old build always worked.

rotund token
#

if you're not using subscenes you can use the old build pipeline

#

we do at work

misty wedge
timber ivy
#

animations and sounds are basically the first thing they should have exposed to dots imo.

#

You literally can't make a game without them.

round narwhal
#

Hello, I'm trying to animate characters in my game, but I'm stuck. I would like to access to the animator component that's contained in a gameobject. I know how to do the conversion, but I don't know when in the code I'm supposed to do it in order to use it in a system

#

please help me

rustic rain
#

If my hopes are justified -it'll query through companion link that has that component

rotund token
#

if you add the animator to the entity

#

you can literally just query it in an entities foreach

#

Entities.ForEach((Animator animator) => { }).WithoutBurst().Run();

remote crater
#

My quest for a DOTS/ECS standalone seems promising. I have a file that is an offender in standalone, present only in my playerdatacache, but not in my actual assets. I'm going to backup, delete the library file, recompile library, then try and build standalone today. Thanks for everyone helping.

#

I'm excited to see if I can start attracting a user base to the update model: Keep player data through updates, but the game you play in radically changes each update.

rustic rain
round narwhal
tranquil lantern
#

I'm currently working on fps shooter using DOTS, but i'm struggling trying to get my Raycasts going from the camera position to a certain distance. I'm using this but it doesn't seem to work cs var cameraHeight = new float3(0f, 1.7f / 2, 0f); var startingPoint = localToWorld.Position + cameraHeight; var destinationPoint = math.mul(quaternion.Euler(math.radians(-90f + input.Rotation.y), math.radians(input.Rotation.x), 0f), startingPoint); Does someone know why ?

rustic rain
tranquil lantern
#

I'm expecting to draw a ray that starts from the startingPoint and ends at the destinationPoint. The startingPoint being the camera position and en destinationPoint being a point in the direction of the camera with a certain range

#

I figured out how to make a Raycast but when I tested it, the line that I drew using DrawLine wasn't following what I expected

round narwhal
rustic rain
round narwhal
rustic rain
#

xD

#
Entities.ForEach((Animator animator) => {animator.Stop(); }).WithoutBurst().Run();
round narwhal
#

okayy ! I will try this
thank you very much

tranquil lantern
#
public partial class GameUISystem : SystemBase
    {
        protected override void OnCreate()
        {
            var UIDocumentObject = Object.FindObjectOfType<UIDocument>();

            Entities.WithAll<UIDocument>().ForEach(
                (UIDocument uiDocument) =>
                {
                    uiDocument = UIDocumentObject;
                }
                ).WithoutBurst().Run();
        }

        protected override void OnUpdate()
        {
            Entities.WithAll<UIDocument>().ForEach(
                (UIDocument uiDocument, in PlayerData playerData) =>
                {
                    var healthBar = uiDocument.rootVisualElement.Q<VisualElement>("player-health-bar");

                    healthBar.style.width = playerData.Health;
                }
                ).WithoutBurst().Run();
        }
    }
```  I have implemented what you suggested but I get an error on this line var healthBar = uiDocument.rootVisualElement.Q<VisualElement>("player-health-bar");.  But in the UIDocument that I created in the Scene, I added the uxml file containing a VisualElement with the name "player-health-bar" but i doesn't seem to be accesible. I also added a UIDocument component to my player archetype. Does someone has an idea why ?
rustic rain
tranquil lantern
#

No it isn't

rustic rain
#

Then there's something really wrong with this code

tranquil lantern
#

😭

rustic rain
#

why do you have uiDocument on entity?

tranquil lantern
#

I want each player to have an HUD

rustic rain
#

is that smth multiplayer related?

tranquil lantern
#

yeah

rustic rain
#

Well, anyways

            var UIDocumentObject = Object.FindObjectOfType<UIDocument>();

            Entities.WithAll<UIDocument>().ForEach(
                (UIDocument uiDocument) =>
                {
                    uiDocument = UIDocumentObject;
                }
                ).WithoutBurst().Run();
#

what you are doing here is assigning same UIdocument

#

to all entities

#

also, you are doing it in OnCreate

#

which means subscenes will not be loaded atm

#

and this most probably will not even run

tranquil lantern
#

ok

#

I am trying to attach a UIDocument component to each player. I did it on the code for the player spawning. But how would I assign the HUD that I made using UI Builder (uxml file, etc...) to that component because the UIDocument constructor is private so I can't do SetComponentData

rustic rain
#

I see, you'd want to ensure when each player gets created

#

they already get their UIDocument

#

so either assign it to game object if they are getting converted from it

#

or if you are creating it from scratch - add your UIDocument prefab manually after instantiation

tranquil lantern
rustic rain
#

well quite literally how you do it with game object

#

add all components you want

#

and press run

#

oh wait

#

UIDocument will not be converted automatically

#

you need authoring component for that I guess

tranquil lantern
#

ok ty

olive kite
#

I am getting this error:

"The instruction Unity.Burst.Intrinsics.X86.Sse4_1.min_epi8(Unity.Burst.Intrinsics.v128 a, Unity.Burst.Intrinsics.v128 b) requires CPU feature SSE41 but the current block only supports None and the target CPU for this method is SSE2AndLower. Consider enclosing the usage of this instruction with an if test for the appropriate IsXXXSupported property."

but have that code inside of #if MOC_USE_SSE41 . Anyone have any clues to what might be causing this?

remote crater
#

What is... AssertionException: Ensure TypeManager.Initialized has been called before using the Typemanager ... mean? Its different when live vs editor.

#

Is it because Standalone is faster to run and I'm waiting less cycles for DOTS to power up?

rotund token
#

It means you have not initialised the type manager

#

But your using a component

#

This usually happens during automatic world bootstrap

rotund token
timber ivy
#

Anyone have any suggestions on how you can handles 1000s of audio sources efficiently?

#

I tried the companion game object thing mentioned but it didnt' produce any better performance than just using monobehaviors to manage them.

#

My vehicle controller has 100 sounds on it. I want to be able to handle up to 250 vehicles in my races. That is 25000 audio sources in a scene and its causing big lag.

pliant pike
#

that sounds excessive, can we even hear that many sounds leahWTF

olive kite
timber ivy
# pliant pike that sounds excessive, can we even hear that many sounds <:leahWTF:7279405055807...

They aren't all playing at once. only about 40 or so play at any given time. But not really excessive. The engine has 30 different clips that change and blend together with rpm values, you can't just change the clip on the source because of how rapidly the clip changes it causes popping. Then there are 30 clips for the exhaust doing the same thing. Then you have tire squeels crash sounds transmission sounds various toggle sounds for lights. Gear shifter sounds.

olive kite
#

AMD Ryzen Threadripper 3970X 32-Core Processor 3.69 GHz

pliant pike
#

yeah I don't know I think audio is always going to be a problem, they use a ton of memory and no easy ways to pare them down that much

olive kite
#

Maybe I'll try on my intel

rotund token
#

Sse4.1 is pretty old, everything modern should support it

#

Bulldozer onwards for ams

#

Amd

olive kite
#

Yeah it def supports it

#

not sure why it is saying "Supports None"

timber ivy
rotund token
#

Having that many audio sources seems wrong to me

#

Sounds like it should be mixing in fmod instead

tranquil jay
#

any news for dots and 2021? I wanna use decals and deferred lights

pliant pike
#

don't they stream them or something when they need them, I doubt they would load that many audio sources at once and use them

timber ivy
olive kite
#

Yeah, I feel like the stuff based on RPM would be easily done in wwise or something

pliant pike
#

I think I even remember Mark Cerny talking about streaming audio sources really quickly from SSD only when games need them πŸ€”

remote crater
# rotund token This usually happens during automatic world bootstrap

Yeah, that's what it is saying . o O"about automatic world boostrap"... How do I fix it? I'm excited, my DOTS/ECS game is launching today if I can fix it. I finished it friday, but can't get a standalone yet. Remember Tertle, you ever need help IRL if I make it, you just ask and I help you out.

timber ivy
#

Who is mark cerny? haha and The memory from the audio being loaded isn't the issue. The audio sources(not even playing audio just existing in the scene) is eating cpu

timber ivy
pliant pike
#

yeah I don't know could you use subscenes maybe, probably not

timber ivy
#

subscenes?

#

Wait

pliant pike
#

its one way you can convert data to entities and load stuff

timber ivy
#

maybe audio mixers

#

can help

#

gonna look into that

tranquil jay
#

hey, any news for dots and 2021? I wanna use decals and deferred lights?

rotund token
#

if you have to ask there's probably no news

#

just expect it june 30th and if it comes earlier be happily surprised πŸ˜„

tranquil jay
#

I am not in touch with unity news as I'd like

rotund token
#

my point is just that the dots crowd will be yelling so loud with joy that anyone could hear

viral sonnet
viral sonnet
# timber ivy gonna look into that

I dunno, is it really worth it to build an audio system for a asset pack that's not even revolving around audio? Or in other words, is it a scaling problem or does 1 car have so many audio sources?

#

and quite frankly, I'd go with Fmod for anything serious when it comes to audio. Maybe it's just my audio inexperience but I never had a good time with out of the box Unity audio

#

Fmod was pretty easy though

timber ivy
#

Its not a problem with one car, its a problem when you start adding more. A selling point of my asset is going to be scaling, because none of the current vehicle physics solutions can handle more than 12 cars without it starting to become a problem for performance. I was trying to avoid using fmod because then anyone that decides to buy this will have to abide by the fmod license.

timber ivy
viral sonnet
#

yeah, makes sense. the framework should give you a good idea of how to scale. It's not that every audio source is playing at once anyway.

rotund token
#

not sure tying your plugin to a 3rd party asset is a good idea

#

that said, whatever solution you use should be modular and easily replaceable

viral sonnet
#

I agree, however in the short run it's hard to go around some problems. Mainly animations and audio. When making a factorio prototype several years ago I also ran into audio problems and never found a good solution for it. The Unity implementation of audio is just not very good when it comes to scale.

rotund token
#

thats why no studio uses it - sad dsp graph development stalled

viral sonnet
#

unity bought so much useless stuff, yet has no good audio solution 🀣

molten flame
#

I've noticed if you have an abstract class that extends from SystemBase, when you extend it with an implementation you need to include the using for Entities or else it doesn't compile

#

Anyone know if this has been raised to Unity?

rotund token
#

Hmm I haven't noticed

#

Going to check when I get home

#

Because I'm pretty sure I have some pretty simple implementations

#

And unused usings auto get culled

viral sonnet
#

Is DSPGraph somewhat usable?

rotund token
#

For example

#

internal class AISystem : AISystemBase<AIContext, AIStorage>

#

public abstract unsafe partial class AISystemBase<T, TS> : SystemBase where T : unmanaged, IContext<T> where TS : AIStorageBase<T>

#

Unless I misunderstood what you're suggesting

molten flame
#

Interesting... no you are understanding

rotund token
#

Are you missing partial?

#

Otherwise no idea.

#

But I have a lot of this without issue

molten flame
#

I'll try narrow it down..
The error is in the implementation of the abstract method from the base class..
The name 'ComponentType' does not exist in the current context

#

It makes little sense and if I put the using in, it compiles lol

rotund token
#

Do you have code gen in your base class

molten flame
#

Nah nothing that wild

rotund token
molten flame
#

oh umm, no actualyl

#

that could be it..

#

OK, it only occurs when I do a GetComponent call in the implementation, like e.g. GetSingleton

rotund token
#

well that's why i never run into it

#

i only ever do GetSingletonEntity and get the component in the actual job

#

to avoid a sync point

#

(that said i dont think i've ever used that in abstract classes either)

molten flame
#

I'll create a forum post for it

remote crater
rustic rain
rustic rain
rotund token
#

Outside of a job it calls entity manager

#

Inside a job it uses component data from entity

#

But that's not the same as getsingleton

rustic rain
#

yeah, I know

#

I haven't really looked, but I guess

#

that GetSignleton is literally query through entities

remote crater
# rustic rain That probably means build configuration files

Oh. I use Assemblies and DOTS/ECS. What scriptable build pipeline options do I need. I think it is an error for Unity to remove core functionality everyone uses and replace it with an experimental feature that is undocumented... But if you help me through this, I'm happy. Wanted to release on Steam last friday.

rustic rain
#

the only reason to use them - include subscenes in build

remote crater
#

I do not use subscenes.

rustic rain
#

everything else up to you

#

welp

#

you don't need build assets then

remote crater
#

How do I compile a standalone?

rustic rain
#

I gotta say tho, if your project is multi platform

#

it is a great helper

remote crater
#

My project is windows

rustic rain
#

in keeping settings intact

remote crater
#

I can't compile a standlone.

rustic rain
remote crater
remote crater
#

Still didn't work, crashing on level0 again... which isn't even my code, but .50 code

#

Looks like this "level0" is found in the following .50 files:

BoundingVolumeHeirarchyBuilder.cs
BlobificationTests.cs
ConvertGameObjectToEntityTests.cs
HierarchyIntegrationTest.cs

This may explain why my project built standalone in pre .50, but is not 100% certain the cause.

#

using NUnit.Framework;
using Unity.Collections;

namespace Unity.Entities.Tests
{
#if !UNITY_PORTABLE_TEST_RUNNER
// https://unity3d.atlassian.net/browse/DOTSR-1435
// These tests cause crashes in the IL2CPP runner. Cause not yet debugged.

viral sonnet
#

what does the stacktrace say?

remote crater
#

player.log or crash.log?

#

The file 'D:/starfighter/Starfighter_Data/level0' is corrupted! Remove it and launch unity again!
[Position out of bounds!]

viral sonnet
#

post both logs

remote crater
#

level0 is only found in .50 UNITY DOTS blackboxed behind API files.

#

Playerlog also complaines about level0

viral sonnet
#

that's quite odd. you said you don't use subscenes? i'm not sure what would corrupt level0.

remote crater
#

I did use scenes, but ripped em out with the new subscene routine being too difficult to use.

#

Maybe I have some floating code around, good call Enzi

viral sonnet
#

did you find the error message in a code file? I couldn't find it in entities

remote crater
#

So, I removed all the headers: #using Scenemanagement

#

and now I get a crash in editor, which is promising, thank you. This is probably it, but I gotta get into work soon

rustic rain
#

Hmm

#

So when scene is open

#

and I add Animator Component to CompanionLink

#

animator works in runtime

#

but when I close scene

#

it doesn't work

#

but it is certainly added

#

to companion link

viral sonnet
#

monobehaviours don't work in subscene GOs. they are culled for some reason

#

test if the animator that is added is really valid but I guess if it would be you wouldn't have that issue

rustic rain
#

it is valid

#

animation exists

#

and it's also good

#

but as soon as I close it

#

nnnoep

viral sonnet
#

is the animator added from script?

#

or is it already on the go?

#

if it's on the go, test if it works when you add a new animator in the conversion stage

rustic rain
#

I add it as AddComponentObject

#

yay

#

Updating manually works

#

hmm

#

now I wonder

#

how to know when subscene is open and when it's not

#

so I can enable/disable that system automatically

olive kite
#

Is anyone familiar with the occlusion culling system in Hybrid? It seems to cull objects and their shadows as well, which is causing some weird instances where cliff shadows disappear when facing away from them. In the normal Unity occ. culling it seemed to still display shadows if in screen. Is there a way to get it working in Hybrid with the same behavior?

#

It works to duplicate each mesh in the LOD and make a shadow-only mesh + remove occludee component, but feel like that would be really inefficient

rotund token
#

To be blunt, not ready for use

#

The shadow issue makes it pretty unusable imo

#

But also it had a bug where if you hit 32k entities you'll crash

#

This is fixable by editing the package and changing the cull index field from a short to an int

olive kite
#

@rotund token thanks. that helps. I can get around the shadows for the time being. Were you ever able to get the terrain to be included in occlusion calculations?

#

as an occluder

#

And I'm sure you saw on the slack, the issue with the SSE4 was I was using compiler blocks and it needed to be in if() statements instead

rotund token
#

Yeah I saw that

#

Was good to know

rotund token
#

Also another issue is that dynamics currently don't work

#

There's no reason the system can't handle dynamics and I started updating it to fix the issue but then decided against using it for now as I had other priorities.

#

I'm pretty excited/hopeful for a runtime occlusion culling implementation but yeah needs work

rustic rain
#

hmm, I'm trying to make that EntitySelectionSystem work with sprite renderer

rotund token
#

You can see my work on this here @olive kite

rustic rain
#

I assume I can just draw Quads

#

but I don't really get how to make it's scale according to sprite

remote crater
#

Why is it that I can't build and run if I include DOTS components?

rotund token
#

I guess a good question is, why do you have it included? πŸ˜…

remote crater
#

if dots builds dont include, it doesn't build entities

#

Well like as of 3 months ago

rotund token
#

ahh that's not true

#

the one in unitys own sample does not include it

#

and it works fine for me without

#

anyway your issue is probably you haven't included any scenes

#

all i use

viral sonnet
#

good catch, no scenes is indeed a problem. how did that ever run with that build conf?

rotund token
#

just what his error is telling him ^_^'

viral sonnet
#

did he post another error or the level0 is corrupted error?

rotund token
#

level0

#

level0 is just the name of the first scene that unity tries to load

#

if you look at a build

#

all scenes are renamed to level0, level1, etc

#

in your X_Data folder

#

it's corrupted in the sense it doesn't exist

viral sonnet
#

not totally obvious but now it makes much more sense. I've never seen a level0 error. I think the classic build menu doesn't even let you build without one as it defaults the open scene. shouldn't happen with the new build settings tbh

still pewter
#

Is Unity Physics slow for anyone else? My project runs mostly without it, but I use it in 1 very simple trigger system. The system itself doesn't take so long, but the stepphysicsworld itself takes up a good 20 milliseconds in the profiler.

remote crater
rotund token
#

you need to add it to the list

remote crater
#

You used to be able to do "BUILD CURRENT SCENE" and have 0 other subscenes

#

the list used to be for subscenes I think

#

Actually I have no clue, but that's about what I did. No one listen to me. I have NO clue what scirptable build pipeline does.

#

I mean I do, but I don't.

rotund token
#

you should not add any subscenes to the list

upper tiger
#

How can I create a local copy of a nativearray to use in the next frame so I can compare it to the current? No matter what I do it wants me to dispose the nativearray, if I dispose it then assign it with a new NativeArray it says that it cant use a disposed thing.

#
            private static NativeArray<PathCompleteBuffer> previousPath;
...
            previousPath = new NativeArray<PathCompleteBuffer>(buffArray.Length, Allocator.Persistent);
            buffArray.CopyTo(previousPath);
#

I just want a copy of buffArray from the last frame to be accessible

rustic rain
rotund token
#

why would you want to keep the scene asset in your build?

rustic rain
#

Oh

rotund token
#

it's already converted to just raw data

#

you don't touch it as a scene in runtime

rustic rain
#

Oh

#

I wonder if including it could be reason for those crashes....

devout prairie
#

@remote crater i may be wrong but i think to use the build assets with dots, it requires Subscenes as it looks for them.. as tertle says the subscenes are built already to data and don't need to be added as scenes to the build... if you're not using subscenes i think you would need to use the old File->Build method which i think Issue suggested ( it does work with dots, but does not work with subscenes if i remember correctly )

#

So, if you have no subscenes - use the File> method
If you do have subscenes - use the build asset method

#

Another problem i had previously was when using the Rival dots asset, which used the Animation package. It was possible to build and run using File->, without using subscenes at all, but i found the skinned animations were not working. It turned out i think the animation clip assets were using blob assets or something blah blah blah and in order to get them to work in the build, i had to change my whole approach to using Subscenes, and building using the build asset approach.

pulsar jay
#

I am trying to recursively collect LinkedEntityGroups. Is there anything like HasBuffer to check whether an entity has a LinkedEntityGroup or not?

rustic rain
pulsar jay
rustic rain
pulsar jay
#

right now it isnt 😬

rustic rain
#

hmm

#

Doesn't EntityManager has HasBuffer?

pulsar jay
#

well this does not work:
HasComponent<LinkedEntityGroup>(entity);

rustic rain
#

I certainly used one of those

#

when made helper method to get all children recursively

pulsar jay
#

entity manager can do it: EntityManager.HasComponent<LinkedEntityGroup>(entity);

#

but that wont work in a thread πŸ™„

#

functionality between EntityManager, ECB and SystemBase not really consistent

rustic rain
#

well, yeah

#

ECB is pretty limited, no structural things

#

why are you even trying to collect LinkedEntityGroups through HasComponent?

#

why don't just make separate query to collect them?

pulsar jay
#

Otherwise I would need to add the SharedComponent to each and every sub entity

rustic rain
#

every time SharedComponent needs to be changed

#

I add it recursively through transform hierarchy

remote crater
#

I'm on day 5, 20 hours of just trying to get Unity to make a standalone.

Live streaming this if you want to help or feel my pain: https://www.youtube.com/watch?v=aieEpMDdIdQ

My clues I'm working on from crash log:

0x00007FFD11157AC7 (UnityPlayer) UnityMain
ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FFD1020DE03)

I think Unity forgets to automatically build your "resources" folder for your addressables and stuff you load on the fly.

I have code like:

loader = Resources.LoadAll<GameObject>("spaceship1");
user.Add(loader[0]);

The above code loads from the /asset/resource folder at live time. I think Unity doesn't know how to copy the resource folder into the live build and this is why I am getting error:

I've coded over 40 years. I never saw any IDE designed for standalones not be able to make a standalone when it works in the editor.

I'm 20 hours into this. It's annoying because this was my big finish line I worked on since 1992. I have 7,000 hours into this project alone. I have probably 40,000 hours into coding MMOS since 1992. I was so s...

β–Ά Play video
pulsar jay
remote crater
#

I do use addressables too

#

I think there is a way to copy the resource folder manually if Unity doesn't do it

#

But I forget how to do it since last time I did it, been a while.

#

Yah, I think this might be in... Unity wouldn't copy the resources folder in with a live build, right?

#

So this could be the cause of my crash right?

pulsar jay
remote crater
#

Np, its a general question for everyone.

pulsar jay
pliant pike
#

does anyone else end up with a ton of commented out code when programming πŸ€”

pulsar jay
pliant pike
#

ah I see, I was going to figure out versioning but they depreciated collobarate

pulsar jay
pliant pike
#

yeah that's what I was thinking I should probably figure out how to use that properly, thanks

hot basin
#

version control is basic programming tool

#

it should be your priority to setup it when starting new project

pliant pike
#

I was thinking I may be a bit behind on that leahS

hot basin
#

but about main topic, commented code is useful when rewriting your code to see what was there before but after that it's useless and should be deleted

pliant pike
#

my code is just a huge mess, I have all the code I might want to change back to

#

but versioning should solve all that

#

I just looked at my code and thought I must be doing something wrong leahWTF

remote crater
#

Methodology being used to track down the problem with the standalone not working:

I'm disabling ALL of my START and UPDATE functions to see if the error still happens. This is time consuming. Been at this since 9 AM, it is now closing in on 12:45 PM. I probably have another few hours to go to start testing if it is my code causing the issue. If not, I can narrow down by removing stuff from my scene. If it is not my code and not my scene, I'll start removing Unity Packages and assets from my asset folders. I think the ol "Strip down" and binary search my way to the culprit will be in order here. I have an attack path, but it will take me many more hours. I should figure out this one eventually

karmic basin
#

Still that level0 error you talked about earlier ? If you make a new scene and only build that empty scene, uncheck all others, does it work ?

#

might be faster to start there rather than the scripts

lofty sequoia
#

Can I use a Quaternion as a field for a Job?

rustic rain
lofty sequoia
craggy orbit
#

is there still a simple way to create a NativeList<T>, or do i have to use AllocatorHandle to do it? i feel like it used to be a lot easier, and didn't require it being unsafe

rotund token
#

you can still use the old Allocator.TempJob etc

#

there's an implicit conversion built in to convert Allocator into AllocatorHandle

#
            {
                Index = (ushort)((uint)a & 0xFFFF),
                Version = (ushort)((uint)a >> 16)
            };```
craggy orbit
#

so there is 🀦 i was trying to do it in an icky roundabout way with AllocatorManager.Allocate πŸ˜… thanks!

pliant pike
#

I didn't even know they changed that leahWTF

viral sonnet
#

So what should we use now? Is the "new" version just an extension or "better"? the ecs samples use World.Unmanaged for allocation. I mainly have TempJob and Persistent. Any need to change that?

pliant pike
#

yeah I'm confused why change that

hot basin
#

will skinning in jobs + Graphics.DrawMesh be faster than skinned mesh?

#

or at least same speed

#

I'm looking for a faster combined mesh animation than skinned mesh or at least faster combining with jobs but updating SMR seems heavy

rustic rain
#

Hmmm. Is that supposed to stuck with loop?

        protected override void OnCreate()
        {
            base.OnCreate();

            LoadUIAsync().Forget();
            _startedRunning = false;
        }


        private bool _startedRunning;

        protected override void OnStartRunning() { _startedRunning = true; }

        private async UniTaskVoid LoadUIAsync()
        {
            var tasks = new List<UniTask>();
            foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
            {
                foreach (var type in assembly.GetTypes().Where(x => typeof(UIBase).IsAssignableFrom(x)))
                {
                    var ui = World.GetOrCreateSystem(type) as UIBase;

                    tasks.Add(ui.Load());
                }
            }

            await UniTask.WhenAll(tasks);
            await _startedRunning.WaitUntilTrue();

            OnLoadUI();
        }
#

Unity stopped on "Starting Running" stage

rustic rain
#

Hmmm

#

Anyone had any experience with making SubScenes addressables?

silk current
#

Hey, I'm trying to make entities appear in the editor, I have a gameobject with convert to entity in the scene, but it just disappears when I enter playmode. It's visible in the entity debugger at least.
I have the hybrid renderer installed, and I also have installed URP but haven't done anything with it - I don't know if it changes anything.
I'm on version 2020.3.34

#

Did anyone have a similar problem?

#

It's a fresh project, with all the packages installed, I have made this gameobject, put it in the scene and I'm trying to make it visible. I've looked on the forums but haven't found a working answer.

silk current
#

Alright, solved. I reimported the project with the URP template. Apparently URP had to be set up properly.

rustic rain
silk current
#

yea but any entity did not appear become visible, as I expected

#

there was nothing

#

after properly setting up URP, they are visible, so I guess that was the issue

rustic rain
#

ah

#

you mean entity didn't render anything

tranquil jay
#

I think 0.51 DOTS launched

viral sonnet
#

oh boy

#

### Changed

* Package Dependencies
  * `com.unity.jobs` to version `0.51.0`
  * `com.unity.platforms` to version `0.51.0`
  * `com.unity.mathematics` to version `1.2.6`
  * `com.unity.collections` to version `1.3.1`
  * `com.unity.burst` to version `1.6.6`
* Increased the maximum number of shared components per entity from 8 to 16.
* Updated dependency on version of com.unity.roslyn package that will work with both Unity 2020 and Unity 2021.

### Fixed

* DOTS Entities throws a compilation error when using named arguments.
* Fix Create -> ECS -> System template now adds partial keyword.
* Fixed a possible memory stomp triggered by specific sequences of `ComponentDataFromEntity` or `BufferFromEntity` calls.
* EntityQuery.CopyFromComponentDataArray<T>() and EntityQuery.CopyFromComponentDataArrayAsync<T>() now correctly set the change version of any chunks they write to.
* If the value of the Parent component of an entity is changed while the previous parent entity was destroyed at the same time, an exception could be thrown during the next update of the transform system.
* Changes to ComponentData made outside of Systems will be properly detected by EntityQueries with changed version filters.

### Added

* New `BufferTypeHandle.Update()` method. Rather than creating new type handles every frame in `OnUpdate()`, it is more efficient to create the handle once in a system's `OnCreate()`, cache it as a member on the system, and call its `.Update()` method from `OnUpdate()` before using the handle.
* SystemBase.GetEntityQuery can now take an EntityQueryDescBuilder.```
#

not much but Unity 2021 and BufferTypeHandle.Update() is cool

#

in other words RIP Unity 2020.3 - you have been a long friend. now, good riddance!

tranquil jay
#

decals and deffered light here i come

rotund token
#

Shared component increase is my doing πŸ’©
Turns out you could hit the cap and hit 9 shared components from just all unity packages on a cube ghost in a subscene

#

But yay!

#

Finally fix my ui toolkit issues

viral sonnet
#

haha, you crazy crazy man

rotund token
#

What's this? Bit of a sore throat

#

Oh no, better take day off

viral sonnet
#

nerds took a vacation for final fantasy. real nerds take one for new entities release

#

Anyone figured out about which Unity version he's talking? I don't think there are any. The improvements I know about are all in the core engine; we had to rewrite the core job queue implementation from scratch, since the old queue was fundamentally never going to cut the proverbial mustard. And, a rewrite like that is never going to get backported to an LTS, because risk.

rotund token
#

I think either unreleased or 22.2+

viral sonnet
#

cool, imo the job system is already pretty solid

rotund token
#

which can replace tempjob and is faster because most of the time it doesn't have to allocate

#

it also doesn't need to be disposed

#

and it doesn't suffer from the fixed update leak issue

viral sonnet
#

ah, that's cool. have you done any testing vs. persistent?

rotund token
#

i haven't really benchmarked it at all

#

the memory lives for 2 world updates

#

then is returned automatically

#

(there are 2 allocators that swap every frame)

#

they call it RewindAllocator

#

from top of my head

#

it's 64 separate pools of memory

#

that can grow and shrink if not used for a few frames

viral sonnet
#

yeah, I've read about it but haven't figured out what to use it for

rotund token
#

in case you allocate like 2Gb

#

it doesn't hang around

viral sonnet
#

huh, guess i need to test this if I still need to hold on to persistent allocations

#

is unity 2021.3.4 from today?

rotund token
#

not up to date with unity builds

tranquil jay
rotund token
#

but from what i saw, main limiting feature of entities in 21 was the engine itself

#

so wouldn't surprise me

viral sonnet
tranquil jay
viral sonnet
#

are you on mac? 2021.3.4 is marked lts now

rotund token
#

mines installing atm

tranquil jay
#

windows (gigachad)

rotund token
#

guess i'll let you know if i run into the same wall

#

i succeeded on editor

viral sonnet
#

i'm still on hub 2.4.5 πŸ˜…

tranquil jay
#

oh im on hub 3.1.2

covert lagoon