#archived-dots

1 messages ยท Page 39 of 1

viral sonnet
#

first i thought, whoa, where all the code comes from until i realized that's basically just inlined NextEntityIndex

robust scaffold
#

If unity provides a systemAPI for CTH<>, there will be 0 reason to ever use IJE.

rotund token
#

like 4 bloody paths for Execute

#

they are providing an API for that

viral sonnet
#

this will be so good

rotund token
#

but i disagree

robust scaffold
#

Well, short of very small jobs. I got a few IJE sitting around doing basic menial work.

rotund token
#

once i get my ExecuteChunk in IJE (distant future ๐Ÿคž or do it myself)

#

there will be nearly no reason to use IJC

robust scaffold
#

Better yet, IJE with raw pointers in the params instead of ref and in variables. On a per chunk basis. And that's basically all that Im doing IJC.

viral sonnet
#

hehe, they already get pointers in the codegen, just pass the ref then

#

and i find it funny the codegen doesn't use GetNativeArray

robust scaffold
#

Yea, if I was brave, I would go into the package and do it myself.

#

well, i dont know how the codegen can assume RW or RO from pointers though

#

Maybe a RefRW/RO variant that's PtrRW/RO?

viral sonnet
#

                for (int i = 0; i < chunk.Count; i++)
                {
                    if (!healthMask[i])
                        continue;
                    
                    // code
                }``` is this how the bitmask is used then?
robust scaffold
#

Yea.

viral sonnet
#

WTH is that? Interlocked.Add(ref UnsafeUtility.AsRef<int>(m_PtrChunkDisabledCount), value ? -1 : 1);?

brave field
robust scaffold
#

Imagine: public void ExecuteChunk([AssumeRange(1, int.MaxValue)] int count, PtrRW<Translation> pos...)

robust scaffold
rotund token
robust scaffold
#

no clue.

robust scaffold
rotund token
#

InterlockedAnd & InterlockedOr

robust scaffold
#

Oh, huh, did min and max already exist?

viral sonnet
#

it's interesting what you write but i was skipping a line and thought this was get ... haha

robust scaffold
#

Wow, an interlocked operation on every [] indexing? That's disgusting

#

Use the bit mask and manually << i > 0 check.

rotund token
#

it's only on set isn't it?

robust scaffold
#

Oh, it is. Huh

viral sonnet
#

just on set.

robust scaffold
#

In that case, yea, makes sense

viral sonnet
#

has anyone a successful vectorization with enabled bits?

robust scaffold
#

The enabled comp also stores the count of disabled comps

robust scaffold
viral sonnet
#

kind of ironic we have this super involved simd intrinsic and then it kills every loop anyway

robust scaffold
#

theoredically you could use vp maskset but I dont see that being generated in burst code.

rotund token
#

if you're not constantly enabling/disabling components it still makes sense to just add/remove them

robust scaffold
viral sonnet
#

yeah, i question enabled comp for health state right now :/

robust scaffold
#

if it's being changed every 10ish frames, might be worth. Just random number i pulled. Beyond that, structural change or if it's a gap of 1 or 2 entities and majority enabled, use math.select. And then use the bitmask to populate a bool4 and swap in changed and unchanged values for a final write.

viral sonnet
#

I'll go with an IsAlive tag. need to persist health when something is resurrected ๐Ÿ™‚ and the tag is much nicer to group everything nicely together

robust scaffold
#

ArgumentException: A component with type:Unity.Scenes.SubScene has not been added to the entity. Entities Journaling may be able to help determine more information. Please enable Entities Journaling for a more helpful error message. This appears every time I try to see a thin client world. Anyone knows what going on?

#

Client, Server, and default worlds work fine but not thins

rotund token
#

How are you instantiating the world and the subscenes

#

Just default workflow?

robust scaffold
#

Using autoconnection

viral sonnet
#

has anyone profiled enabled comps? i would bet it's not any faster than a bool comp

rotund token
#

And it was quite a bit different

robust scaffold
#

CEE and IJE can skip checking large gaps using bitwise operations (lzcnt probably).

#

If it's very fragmented, such as when every other component is enabled, it most likely has equal performance.

robust scaffold
#

And then I can increase its yellowness to see the rest of the entities.

rotund token
#

that means authoring state doesn't it

robust scaffold
#

No clue, it has no hoverover

viral sonnet
#

i think it will only be faster when a large amount of chunks is completely disabled

robust scaffold
viral sonnet
#

i think skipping chunks is a pretty laughable reason. especially when you can do that with change filtering

robust scaffold
#

Change filtering breaks easily and you have to structure everything to support it though

viral sonnet
#

that's right but when it works ๐Ÿ‘Œ

#

only have to be mindful about RW access

rotund token
#

yeah but you can use change filters

#

and enable comps

robust scaffold
#

@rotund token Do you know of a way to improve owner predicted - owner predicted collisions? It's so bad because of the interpolated collision.

#

I could set the other thin clients to predicted but i havent seen any sample that had the player entity be predicted mode.

rotund token
#

nah

#

my game has no prediction

#

interpolated only ๐Ÿ˜„

robust scaffold
#

dont use physics?

viral sonnet
#

huh, no prediction? that's the best thing about netcode. otherwise it feels laggy

robust scaffold
#

Yea, the prediction with regular entities is smooth as butter. With some slight teleportation. But with other players it's ugh

#

I got this massive table of numbers that I've gotta find a good sweet spot for

viral sonnet
#

hm, i sadly can't tell you what i did around 2-3 years ago. i had a perfect implementation of KCC + netcode running. even collision was perfect.

robust scaffold
#

collision between player owned objects?

viral sonnet
#

i used no interpolation that much i know

robust scaffold
#

collision with everything else works out of the box but with players, not so much

viral sonnet
#

with players

#

my test was to jump on someones head ๐Ÿ˜„

robust scaffold
#

i'm trying to hit spheres together

#

Think pool but what if every ball was a player?

viral sonnet
#

KCC was really stable after I found out the problems with it. something that bugged for the longest time was the grounded state which introduced jitters

#

so where's the trouble, only local or on server?

robust scaffold
#

local

#

I hit two player owned spheres together and it pauses for a fifth of a second then teleports

#

it's the interpolation delay

#

I can use predicted movement for everything but then the other player's movement when not colliding becomes jittery

viral sonnet
#

mh, so the physics are not predicting?

robust scaffold
#

Rather, it's physics predicting too much when not colliding

viral sonnet
#

hm, ok, yeah that's surely a tough one. i mean i couldn't move other players around. on collision a player would need to be locally calculated.

robust scaffold
#

yea, hrm. gotta play around with those numbers above.

viral sonnet
#

predicting every network player makes no sense when you can't get it stable

#

but that would be the easiest route when there's a solution to it

robust scaffold
#

I mean, I'm using the worst possible (realistic) network statistics with this:

viral sonnet
#

i think it should be possible to fix the jitter when everything is predicted

#

otherwise it would be pretty sad for physics

#

how's your quantization for position?

robust scaffold
#

Delta pos for input movement is just 2 sbytes. +1 and -1 axis.

viral sonnet
#

translation isn't synced?

robust scaffold
#

Yea, just default whatever came with netcode

#

it's synced

viral sonnet
#

default was way too inaccurate for me

#

i think it has like 2 decimals or smth?

#

in any case, try to increase the accuracy. i think it should help with the jitter

rotund token
rotund token
viral sonnet
#

ah, true

#

pretty sure PoE uses prediction though ๐Ÿ™‚

robust scaffold
#

Hrm, changing quantize factor for translation and rotation doesnt really change anything

viral sonnet
#

from what did you change it to?

robust scaffold
#

i tried 100, 1000, and 10000

viral sonnet
#

10k should be more than enough. :/ hm, wonder why it's jittering then

robust scaffold
#

it's just interpolated collisions

#

client side the interpolated object is an unmovable brick and clientside physics calculates it as such

#

but server side it's a dynamic object that can be pushed by other physics objects

#

where clientside calculates the player bouncing off the other player and then server side says no, you actually pushed the other guy

#

While predicted everything fixes the collisions, other player movement under predicted become very stuttery

rotund token
#

they have an optional predictive path but it feels horrible

#

you constantly desync

#

(it was originally predictive via this path only and they added lockstep like 5-7 years ago)

robust scaffold
#

hrm, one option is to just not let players collide with each other.

rotund token
#

a common approach in games

robust scaffold
#

Another option is to just validate the interpolation physics. Make player - player collisions kinematic. As in players can collide but not push other players

#

But making this possible required a IJacobiansJob that will enforce this very specific collision physics on a small subset of collisions but the job iterates over all collisions occuring

robust scaffold
#

Nope, doesnt look good. There's no way to determine who's colliding with whom so it's a kinematic - kinematic collision. Or no collision at all.

viral sonnet
#

solve it with game design. the player can only push other players when charging, which makes his ball uncontrollable (for a while) for the local player

robust scaffold
#

Ah, here's the other subscene header corruption error: Exception thrown during SubScene import: System.ArgumentException: Multiplayer.Components.PredictSwitchProps must already be filtered by ComponentSystemBase or ISystem at Unity.Entities.TypeManager.FilterSystemType (System.Type type, Unity.Entities.TypeManager+LookupFlags lookupFlags)

robust scaffold
#

You know, setting everything to interpolated actually works

rotund token
#

i need to be able to let the player take control of any ghost (that is npc controlled by default)

#

and you can't change ownership of owner predicted

#

so i'd have to like despawn, respawn etc

#

i couldn't find a nice solution

#

and since the style of game doesn't feel that bad interpolated just decided to save myself a lot of work with prediction

#

and just make whole thing interpolated

robust scaffold
#

The issue is with full interpolated is that what's the use of deterministic then. I guess it'll be great for when havoc comes out because interpolated will be the only way you can use havoc in a network environment.

rotund token
#

yeah actually havoc is something i want to test

#

it provides a much better simulation for something i want

#

but by default doesn't really work with predictive stuff

robust scaffold
#

Is havoc actually better performing? I know it has better stacking and contact stability.

rotund token
#

not sure about performance

#

could be worse for all i know

#

but a key part of what i've been doing is making large chunks of hte game (like full buildings) destroyable

#

and debris could really use some stability

robust scaffold
#

True. And does havoc do soft bodies?

rotund token
#

no idea

#

ive only used it for like 5min

#

was going to be a 1.0 project

#

but ah yeah

#

that's on hold for now ๐Ÿ˜„

robust scaffold
#

hrm, maybe interpolated ghost ownership but predicitive everything else. Sure, movement and action might have ping delay but bullets will have immediate action

#

As for havoc, unless it has better performance, my game is 2D top down and no stacking so I dont think I'm gonna get any benefit from it

#

I wonder if I could implement a sort of reverse owner predictive behavior. Have predictive physics until another player enters within a certain range, and then it's interpolated.

#

Have instant predictive responsive physics until 2 unit distance with another player and then you feel the input lag

rotund token
#

can you just not make other players interpolated

#

so only the local player is predicted

robust scaffold
#

That's just owner predictive

#

and the collisions are jank

rotund token
#

why though

robust scaffold
#

That little monologue is why predictive - interpolated collisions are bad.

gusty comet
# robust scaffold I wonder if I could implement a sort of reverse owner predictive behavior. Have ...

As long as you manage what is predicted yourself instead of relying on owner predicted you can implement logic to disable prediction when another player gets close if you want to try that out. The prediction switching sample - https://github.com/Unity-Technologies/multiplayer/tree/master/sampleproject/Assets/Samples/PredictionSwitching - shows how to manage what is predicted / interpolated manually. That specific sample makes everything close to the player - including other players - predicted and everything far away interpolated, which could also work in your case

GitHub

Unity multiplayer packages and samples. Contribute to Unity-Technologies/multiplayer development by creating an account on GitHub.

mild ledge
#

guys, I'm again coming with the stupid questions. We have a projectile prefab. Let's say we create the authoring components for the projectile. We detect input in a monobehaviour. How do we spawn a entity from that mono with the projectile prefab ?

rustic rain
#

once you have Entity prefab - instantiate it

mild ledge
#

@rustic rain ok so var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;

#

" query for that prefab (it can be singleton comp with Entity fields of your choice)" I dont get this at all

rustic rain
#

you need subscene

#

once subscene loaded you can get your prefab out of it

#

question is where you store your prefab

mild ledge
#

well right now the projectile prefab is just a public GameObject field on the player

#

in the main scene lets call it

rustic rain
#

it's not Entity?

mild ledge
#

i dont know at this point

#

what I want is to create a entity from a prefab at runtime

rustic rain
#

you need to convert your prefab then

mild ledge
#

if I place my prefab in a subscene and play the projectile moves

#
{
}

class ProjectileBaker : Baker<ProjectileAuthoring>
{
    public override void Bake(ProjectileAuthoring authoring)
    {
        AddComponent(new Projectile
        {
            Pos = authoring.transform.position,
            Dir = authoring.transform.forward
        });
    }
}```
#

the system works on this component lets say

#

but our player is not a entity, we dont want our player to be a entity

#

he has a OnShoot method

#

what do I do in that OnShoot to Instantiate a entity ?

rotund token
#

you have to get a reference to the entity manager

#

and the prefab entity

#

and instantiate it

#

but how do you plan to have projectiles hit the player if it's not an entity? (or anything interact with it)

queen dome
#

Is there a way to instantiate prefab and associated it with Entity? I have seen how to create entity out of prefab, but how to add necessary components to existing Entity so that it has visual representation?

rustic rain
#

anything related to visuals should be done that way

#

or else you'll have to dig into graphics package and how it works which is not very nice

queen dome
rustic rain
mild ledge
#

but this just makes a single projectile in the subscene that runs sure

#

how do we dynamically spawn it ?

rustic rain
#

you get reference to prefab and use EntityManager's Instantiate

queen dome
rustic rain
queen dome
#

How?

rustic rain
#

drop it into subscene inside of field

#

and convert in baker

queen dome
#

Great, I want that dynamically from a scene

rustic rain
full epoch
rustic rain
#

and will be removed when 1.0 is out of experimental

queen dome
#

So you are telling me that there is no way a GameObject from a normal scene to create dynamically Entity with prefab associate with it?

#

Like, its a bad practice or literally there is no way to do it?

mild ledge
#

do we somehow cache the conversion with the Baker API or what ?

rustic rain
queen dome
#

So, you either go 100% entities or 100% game objects?

full epoch
#

you can use gameobjects for (for example) camera or ui and you can access them from SystemBase systems

queen dome
#

How do you propagate data out of system to gameobject to UI?

#

I doubt there is way to update UI from ECS

full epoch
#

from OnUpdate easy

queen dome
#

so you can reference Canvas and GameObjects?

full epoch
#

from main thread

#

yes

mild ledge
#

how exactly

#

do you reference a GO in a system ?

rustic rain
queen dome
full epoch
#

you can have GameObjects as fields in SystemBase class

rustic rain
mild ledge
#

how do you drag the reference to the field ?

rustic rain
#

you can't convert game object into entity in runtime, but you can prepare all prefabs you need beforehand

full epoch
#

Get them from the code in main thread

mild ledge
#

do we store the reference on a Component and query the entities or what ?

mild ledge
full epoch
#

other way is for example explained in ecs tutorial (see link above) just go to the end where is camera related code

rustic rain
#

You don't need entities for UI unless you want to literally control inside jobs

queen dome
#

Are there good examples for the "hybrid" approach?

full epoch
#

yes a kind of

spice vale
# queen dome Are there good examples for the "hybrid" approach?

Not that I'm aware of. To summarize: you can use UnityEngine.Object.Whatever in a SystemBase. So you can get your gameobjects that way. Another way is to make a class IComponentData with a GO prefab in it that you instantiate with a system during runtime. Check out tertle's implementation of this: https://discord.com/channels/489222168727519232/1027355900496851027. You can also access entities from monobehaviours via: World.DefaultGameObjectInjectionWorld.EntityManager.

Discord

Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.

rustic rain
#

@robust scaffold sir. Mind showing again code to create custom companion links?

#

I probably should save it somewhere ๐Ÿ˜…

frosty siren
#

If i have N jobs which processing same query, then is it more performant to fetch chunk array from query and them do manual IJobParallelFor (instead if IJobChunk) iteration? I mean how collecting chunks goes before running IJobChunk? Does it happen for every job or for example query cache it's chunks on first collecting?

rustic rain
frosty siren
rustic rain
#

so, why not store conditions then?

frosty siren
#

what you mean?

rustic rain
#

best way - just run single job instead of multiple. No scheduling and dependency costs

#

bool fields in job struct

frosty siren
#

ah, ok. In my case
1st job count sum capacity of all chunks in query
then this job gets forced to complete
then if sum exceed compute buffer's size i reallocate it and run set of jobs A
else I run set of jobs B

so i can't store bool fields, because some main thread logic depends on 1st job results

rustic rain
#

oh

frosty siren
#

yeah

rustic rain
#

better run multiple jobs then I think

#

but yeah, you can convert into Parallel job

#

if you want

frosty siren
#

so would it be more performant to fetch chunk array for all possibly running jobs instead of passing query?

full epoch
# mild ledge so with Singletons

u can also use GameObject.Find in main thread of SystemBase class OnUpdate method if you really need but i think tertle's approach(look above there is a link) and singletons are better solution - also you can put for example callbacks for buttons in SystemBase class and you can use a AddListener method in OnUpdate main thread(having buttons as fields in the same class)

frosty siren
#

i'm asking because such trick brings LOTS of boilerplate code

rustic rain
#

you can take a look

#

at Execute method

#

of IJobChunk

#

called in Run

#

this is pretty much how it works

#

should be pretty clear, what you save by doing this custom approach

frosty siren
#

in my system i sync components data with compute buffers to then send it to shader, so per shader's property i have sync process which means 1 job every frame
so as a result i have [1;3] + Np jobs running, where Np is a count of synced shader's properties. And all of them uses the same chunks, so there is no reason why chunk collecting should happen more then 1 time

rustic rain
#

well

#

you might even use generics for that one

#

to make it even easier

mild ledge
spice vale
#

use a query

#

new EntityQueryBuilder(Allocator.temp)

#

finalize with .Build(EntityManager)

robust scaffold
rustic rain
#

is BakingUtility Editor only assembly?

robust scaffold
#

Adding new components is editor only

#

As in that function is wrapped with the if unity editor assembly define

rustic rain
#

I see, alll right

rustic rain
#

then in Baker

#

do you simple AddComponentBoject()?

#

during Bake

frosty siren
#

One another question:
ArchetypeChunk.DidOrderChange(uint) is just int comparing, so it has O(1) complexity as well as NativeParallelHashSet<T>.Contains(T) ?

robust scaffold
gusty comet
#

Does NativeMultiHashMap have a scale factor to its capacity? Like say I need 100 elements, and I set the capacity to 100, but if a scale factor of 1.7 exists, the internal backing array size would be 170. That would help reduce the number of collisions

#

Itโ€™s rather taxing on memory, but I think Iโ€™ll set the initial capacity of my spatial partitioning to the initial number of eligible entities times 2

#

NativeMultiHashMap still uses a โ€œNextIndexโ€ style of resolving hash collisions, right? So having some breathing room in capacity would decrease the number of jumps across memory

#

That way itโ€™s highly likely that the current elementโ€™s NextIndex is just right next to it

rustic rain
#

it was reworked multiple times

#

after tahat

gusty comet
#

I see. Is the current source code anywhere?

rustic rain
#

compiled in editor

#

pretty much most of DOTS code is open sourced

rotund token
#

Because you're increasing the number of valid hashes

#

Which is equal to 2x capacity

#

Also capacity is scaled up to power of 2

#

But yeah hash maps start being noticeably slower with larger capacities

#

If you care about performance you should be keeping capacity as small as possible

gusty comet
#

Gotcha. So a small capacity combined with a good hashing function will make NativeMultiHashMap fairly close to O(1) for each element?

#

Weโ€™re still talking about Multi Hashmaps right?

gusty comet
#

Right now mapping spatial hashes to all resident entities in a NativeMultiHashMap is my current and simplest solution, but a ton of locations will be inputted into this spatial hashing to help with AI decision making

#

There are online solutions proposing a dynamic buffer of entities, each with their own dynamic buffer to represent a 2d grid with variable elements per cell

#

It wouldnt be a problem to refactor my spatial hashing class to use that approach instead, but Iโ€™d like to know if Iโ€™ve been using the wrong DOTS approach to 2d spatial hashing

robust scaffold
#

If you are, consider building a BVH tree. Using the physics engine works for 3D and for 2D maps, making your own isnt difficult.

robust scaffold
#

Hammered out this new prediction switching job stack.

viral sonnet
viral sonnet
#

i can have multiple ones with 250k and they run fine

robust scaffold
#

switching the player itself from predicted to interpolated is very stuttery. The transition flickers really badly.

#

It's not a seamless transition, the moment where predicted converts to interpolated and vice versa results in a significant teleport

#

The transition duration doesnt help. That's there to smooth the graphical visualization, not the actual position

viral sonnet
#

huu, yeah the predicted object is a few frames ahead. might need some kind of delay

gusty comet
gusty comet
viral sonnet
#

Hm, the Unity relay service is pretty nice but on desktop competing against Steam which is free.

robust scaffold
#

50 ccu, i dont know how concurrent users are calculated but i think 50 unique users per month is the free tier.

gusty comet
robust scaffold
#

Oh, I'm trying to collide 2 owned predicted spheres together smoothly.

robust scaffold
#

Using predicted client and thin client results in smoothish collisions (good enough for me) but stuttering movement

#

I tried all sorts of values in client tick rate and client server tick rate but no combination I found fixes the predicted thin client movement.

gusty comet
#

Collisions between interpolated and predicted can't really be smooth, one is behind the server and the other ahead of the server so they are not at the same simulation time. The only way I see to make that smooth is to have both interpolated or both predicted.

robust scaffold
#

So now I'm trying to implement a joint that links a kinematic collider that exists in the same place as player entities but only collides with other players. Such that players can not push players. That way client owner predicted physics is validated server-side and there's no teleportation between predicted and interpolated collisions

gusty comet
#

The problem with predicting other players is that you will always have a significant delay in the inputs, and the simulation will proceed with old inputs, the correct in rollback when it gets correct inputs. It usually works good enough for objects with some inertia, but if you can change direction or velocity too fast it will become obvious that it miss-predicts. It should not stutter when inputs are not changing though - if it does that there is a bug somewhere

robust scaffold
#

But yea, just moving in a straight line, no input changes beyond the initial key down, results in stuttering movement with predicted thin client spheres.

#

Well no, input buffer is not replicated for thin clients. The buffer on the thin clients for input exist but they're size 0. Only transform and translate are being communicated to the client-side ghost.

robust scaffold
gusty comet
robust scaffold
#

I see two network ID and command target singletons on the server but only 1 on client worlds. I think that's intended. So how do I hook up the command buffers of non-current player ghosts to recieve the input command data from other clients? Do I need to make more network ID singletons?

robust scaffold
gusty comet
#

The full client does not need command target singletons for the thin clients, but it does need the input buffer to be on the ghost prefab for the player rather than some other entity. Since the thin clients are not spawning ghosts you need custom handling there - something like the ThinInputSystem in https://github.com/Unity-Technologies/multiplayer/blob/master/sampleproject/Assets/Samples/Asteroids/Client/Systems/InputSystem.cs which spawns a non-ghost to hold thin client inputs

GitHub

Unity multiplayer packages and samples. Contribute to Unity-Technologies/multiplayer development by creating an account on GitHub.

robust scaffold
#

Hrm, maybe I can record what happens when I use predicted thin clients (ghosts with owners not local)

#

In text form, using this as my input command buffer:

robust scaffold
#

I had to chop a bunch of frames off in that gif. There's about 1 sec pause where no inputs are registered before switching directions

#

The problem is that giant teleportation on changes in movement direction

gusty comet
# robust scaffold This is my very basic movement system

Both of those look correct, only common pitfall I can think of if you're not getting any data is that you must add the input buffer to the ghost prefab at authoring time, if you add it at runtime it will not be serialized. It's not obvious from the gif that you are not getting inputs though - with changing the velocity from one frame to the next like that I would expect some issues like that when changing direction, the client gets the new direction after it already predicted in the wrong direction for a bit and will teleport. You can smooth that out with prediction smoothing but it will never be perfect

robust scaffold
#

300ms round trip ping, teleportation doesnt appear on lan settings for example

gusty comet
# robust scaffold There's just this strange instant teleportation by about 1 unit in the direction...

Doesn't look completely unexpected to me. If you have 300ms ping and 60 fps you have 18 or so frames delay on all remote inputs. So when the client receives a snapshot it will see, oh - I was suppose to start moving 18 frames ago, I'll just resimulate those 18 frames to figure out where I should be now. In other words - it will perform 18 frames of movement in a single tick. Similar when you release, it will see that it was suppose to stop 18 frames ago, resimulate those frames and move back to where it should be after moving forward 18 frames too much. If your remote inputs are not received and always length 0 I would expect that you do not predict movement at all, and you will get the stutter of not having prediction instead of miss-prediction when starting/stopping/changing direction

robust scaffold
robust scaffold
winter depot
#

So I got rendering working and what not, but now my issue is that nested entities don't seem to be following their parents localtoworld position. No matter what I change the only rendering location its its own localtoworld

robust scaffold
winter depot
#

Its all done runtime, just testing starting with a nested entity where a child has a RenderMeshArray added via RenderMeshUtility.AddComponents

#

Worked with the same setup on entities .51 and previous hybrid renderer, so I don't know if this is now expected behavior or not

robust scaffold
winter depot
#

Yeah, just not sure if there's something I need to do with LocalToParent that I didn't before, or another component I am missing

robust scaffold
frigid crypt
#

So, I have a strange issue trying to launch my project on linux

#

On Windows I don't have any issues but when I try to play the scene on my laptop with linux I get a shader related error

robust scaffold
#

Sounds like a graphics problem. Using dots?

frigid crypt
#

Yes, that's why I'm here

robust scaffold
#

Is it pink shader error or is it not rendering shader error

frigid crypt
#

Not rendering

#

I'll paste the screenshot with exact error in a moment

frigid crypt
#

@robust scaffold

robust scaffold
frigid crypt
#

At the moment I'm using 0.51

rotund token
#

Hmm urp had a lot of fixes in 1.0

robust scaffold
#

Oh, then there might be some remaining bugs. Havent heard anything about using it on linux though. And yea, Entities Graphics / HybridRenderer has been massively overhauled in 1.0

#

I dont know if it'll fix the problem though. I imagine testing on linux is at the bottom of the list, if it's even on there for these preview builds

frigid crypt
#

BTW, does 1.0 has any easy ways to add animations or is it the same situation as it was with 0.51?

robust scaffold
winter depot
#

With RenderMeshArray you can at least manually do basic animations at this point

#

I guess for now I will just have a job that just syncs a child entity to its parent entities LocalToWorldTransform every frame? Kinda lame

rotund token
#

why isn't this handled for you?

winter depot
#

I have no idea

rotund token
#

did you mark your entity as static or something

winter depot
#

Not that I am aware of. This same solution worked prior to 1.0,

#

Mmm It appears to work in the sample scenes, so I have obviously something off somewhere. Strange it didn't do this prior to switching to 1.0 though

frigid crypt
#

Ok, kind of a dumb question but how do you build a project using entities 1.0?

#

Build configs from 0.51 don't work and I can't really find any information about it on 1.0

#

Do I just build it like normal?

whole gyro
#

Yeah you build using the normal unity build window

frigid crypt
#

Well, the game build for linux worked on my laptop without issues

#

Let's hope that the editor will also work without major issues

winter depot
#

Sooo anyone work with Layers with the new RenderMeshDescription on a Orthographic camera? I can't get any consistent results, and now position.z doesn't seem to matter like it did for hybridrenderer

hot basin
#

Is Dynamic Buffer still thr only option for arrays/lists?

winter depot
#

NativeArray?

hot basin
#

Can you put it in IComponentData now?

winter depot
#

Dynamic buffer is the way to go

hot basin
#

Thanks!

rustic rain
hot basin
#

are you serious? how?

#

how it influence chunk utilization?

robust scaffold
hot basin
#

you mean to store it as a pointer?

robust scaffold
#

That's what a native array is. A few ints and a pointer to Allocator.Persistant or wherever you put it

viral sonnet
# hot basin Can you put it in IComponentData now?

All NativeContainers work in an IComp now because the managed DisposeSentinel was removed that prevented it. Hashmaps, Queues, all NativeX really. Best to use them in a singleton entity. For several lists that are on entities, DBs are still the best choice.

viral sonnet
whole gyro
#

Wait, new version came out today?

robust scaffold
#

Well, it fixed world update allocator reset and uh, CurrentGroupAllocators are public. No fixes to the jank that is baking or subscenes sadly.

#

how does those changes result in jumping 6 versions?

whole gyro
viral sonnet
#

wonder why they even bothered to release this ^^

#

some more SystemAPI features would have been nice :/

robust scaffold
#

Huh, current group allocator to public is also due to changes in the netcode package.

viral sonnet
#

is there a new netcode version?

robust scaffold
viral sonnet
#

ah then it makes sense for just a minor update

robust scaffold
#

Netcode changes are basically replacing tempjob with world update allocator

rotund token
#

finally my leaks

robust scaffold
#

And some improvements to the editor inspector

#

Yea, the reason for this bump in version was netcode. Graphics got improved documentation and uh, dont know what the small amount of rest is doing

rotund token
#

think they fixed a crash in physics

balmy thistle
#

The subscene problem is I assume the hang you mentioned the other day

robust scaffold
whole gyro
#

Ooh they might have fixed the issue with physics objects falling through the floor when an entity is picked in the scene view

#
  • [CreateBefore(typeof(BroadphaseSystem))] for PhysicsSimulationPickerSystem within UnityPhysicsSimulationSystems.cs script file.
robust scaffold
robust scaffold
#

Netcode also doesnt support physics joints, which is absolute pain

whole gyro
viral sonnet
#

i don't need to dispose anything allocated with WorldUpdateAllocator, right?

robust scaffold
viral sonnet
#

cool, so there's really no reason anymore to use TempJob

robust scaffold
#

It's real nice, i've replaced everything with either temp or WUA. Never call dispose anymore except for compute buffers.

whole gyro
#

So WorldUpdateAllocator is an allocator that disposes automatically at the end of the frame?

robust scaffold
#

Although to do that, you need to use the full state.WorldUnmanaged.UpdateAllocator.AllocateNativeArray<>()

whole gyro
#

wait so it only works for native arrays?

robust scaffold
#

There's also AllocateNativeList<>() but the NL that is returned from it is fixed capacity and basically a NA with a length int.

robust scaffold
#

If you wanted to tag a NHM to it, you would just do so normally like NativeHashMap<int, int>(5, state.WorldUpdateAllocator); but you'll be re-allocating that 5 capacity every update.

whole gyro
robust scaffold
whole gyro
#

Okay cool. So WUA always automatically disposes, and in some special cases avoids re-allocating entirely.

whole gyro
#

Hmm, so I updated packages and it seems to have broken my subscenes. They don't render properly in the hierarchy window:

whole gyro
#

And the inspector doesn't draw the subscene component correctly

whole gyro
robust scaffold
#

Oh shit, mine as well

#

AHHHHHHHHHHHHHHHHHHH

#

@viral sonnet @rotund token @rustic rain Do not update to the newest entities. Broke subscenes, somehow.

rotund token
#

what if you look at dots hieararchy

#

interesting though considering the minor changes

robust scaffold
#

Oh I think I know what's going on, something's broken in AssetDatabase in B12.

#

2D tilemap extra's also had this problem for a few weeks now

#

They said a fix is coming down the pipeline, no ETA

whole gyro
#

Hmm, re-adding the subscene kinda worked, but still having problems

robust scaffold
#

Right, i didnt have anything in my subscenes frankly so reconstructing them wont be a problem, lets see if downgrading fixes the problem

whole gyro
robust scaffold
#

I have a manual workaround to fix this issue but it's incredibly annoying

rotund token
#

deleting your caches didn't work?

whole gyro
#

nope

robust scaffold
#

No, this is a engine problem, not DOTS specific

viral sonnet
#

i had this once and reimported subscene.cs

robust scaffold
#

yea, you need to reimport the packages. AssetDatabase fails to register the scripts required to make everything work.

#

You have to do this every time you restart unity so hopefully downgrading fixes the problem

viral sonnet
#

i had this in b9

#

no idea if this is related

#

but that somethings's broken in the asset database makes sense to what's going on

robust scaffold
#

Downgrading seems to fix all the scripts and subscenes

#

let me see if it persists across restart

viral sonnet
#

for me it was kind of random when it happened.

whole gyro
#

Yeah I think I'm just gonna go back to b8 and old package versions

robust scaffold
#

Yea, just downgrading the packages work

#

well, that's was a concerning few minutes

#

@balmy thistle Just want to point out that on B12, the newest entity release seems to have broken nearly all the scripts.

whole gyro
#

so I just downgraded packages but stayed on b12. Seems to be fine expect for the fact that my scene view no longer renders with correct post processing

viral sonnet
#

man i'm glad i'm always slow on upgrading

robust scaffold
#

i even kinda scanned the update deltas, nothing was immediately red flag in terms of sensitivity

viral sonnet
#

i don't think the packages are unstable. all points to b12

rotund token
#

oh b12 is problematic for me

#

fresh project

#

add any library

#

crashes on asset importing for me

#

works fine on an existing project

#

but just cant get into app on fresh project if i add most packages

robust scaffold
#

oh boy, wow very buggy

coarse turtle
#

hmm damn, guess I should downgrade

balmy thistle
rotund token
#

just on a prefab

#

i stripped it back to just importing a single package at a time

#

entities crsahes

#

urp crashes

#

if i start the project with a template though it was no issue ๐Ÿคทโ€โ™‚๏ธ

balmy thistle
#

anything tricky about the repro?

rotund token
#

let me try it again

#

i mentioned this on slack i was trying to get dani a repo for another bug

balmy thistle
#

Thanks, a repro case would help

#

Really appreciate it

robust scaffold
#

Just installed entities exp 12 on a fresh 2D built in project.

viral sonnet
#

asmdef?

#

oh fresh ... what

robust scaffold
#

Ah, they disappeared on reload though

#

Right, i'm not getting any crashes on this new project.

rotund token
#

well i can't repo my previous crash, going to try again from fresh

#

but i got a new one instead

#

Next Refresh will do full enumeration.Directory monitor buffer overflow for 'Assets'Next Refresh will do full enumeration.Directory monitor buffer overflow for 'Assets'Next Refresh will

#

infinite loop of this

robust scaffold
#

I've never actually gotten any errors from asset database

#

And i've been experiencing roughly similar bug for the past few weeks

#

Yea, fresh project, no bugs, no crashes

rotund token
#

i'm pretty good at crashing unity

robust scaffold
raw mica
#

There is a known issue with Prefabs in the Assetdatabase that causes crashes. The fix has landed in our mainline and it's en route to 2022.2. The bug existed in b8 but it relies on memory re-use and only runs when it needs to re-import a prefab, so you may get lucky and then not hit the issue again -- but if you clear your cache I could see it popping up again.

robust scaffold
#

Once a day?

rotund token
#

these are my import crashes

#

spent like 4 hours trying to solve it ๐Ÿ˜ฌ

robust scaffold
#

Eh, if unity crashes, reload usually fixes it for an hour or two before the next crash

rotund token
#

i couldn't load project once

robust scaffold
rotund token
#

though loading same project 4 days later seems to have magically fixed it ๐Ÿคทโ€โ™‚๏ธ

#
=================================================================
    Native Crash Reporting
=================================================================
Got a UNKNOWN while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

=================================================================
    Managed Stacktrace:
=================================================================
=================================================================
Received signal SIGSEGV
Obtained 13 stack frames
0x00007ff65e539a43 (Unity) ImportAsset
0x00007ff65e55dada (Unity) AssetImportWorker::Import
0x00007ff65e58deea (Unity) AssetImportManager::ImportInProcess
0x00007ff65e58ae64 (Unity) AssetImportManager::Import
0x00007ff65e58e811 (Unity) ImportOutOfDateAssets
0x00007ff65e5997b9 (Unity) RefreshInternalV2
0x00007ff65e5a13bf (Unity) StopAssetImportingV2Internal
0x00007ff65e58eced (Unity) InitialRefreshV2
0x00007ff65dd994d2 (Unity) Application::InitializeProject
0x00007ff65e22c745 (Unity) WinMain
0x00007ff65f5e940e (Unity) __scrt_common_main_seh
0x00007ffedbcc7034 (KERNEL32) BaseThreadInitThunk
0x00007ffeddca26a1 (ntdll) RtlUserThreadStart```
#

from one of the random crashes

robust scaffold
#

yea, prefabs borked unity. Fudge.

rotund token
#

hopefully the known issue

robust scaffold
#

well, exp8 entities seems to work fine enough

raw mica
#

If this is the same crash (perhaps there is more than one -- but the callstack looks identical to the issue I found) then yes it's due to prefab importers using memory after a free. The bug went unnoticed most likely since the heap wasn't as aggressively re-used but changes in the memory system could make that crash more likely to happen.

robust scaffold
#

Yea I think once the importer died, everything failed after it.

viral sonnet
#

i wish every dev would move to an archive file. deleting library and 100k files ... zzz (i gave up on hoping MS would make a good filesystem)

raw mica
# robust scaffold

That is a different error and quite surprising. Do you have a local edit to netcode? That error throws when we are trying to add a non component type to the typemanager. Since we do the discovery based on if the type implements a component interface, this is surprising

robust scaffold
brave field
robust scaffold
raw mica
raw mica
balmy thistle
brave field
robust scaffold
robust scaffold
rotund token
#

check out

#

EntitySceneBuildPlayerProcessor

#

im not exactly sure what triggers this

robust scaffold
rotund token
#

but they have build switches in there

robust scaffold
brave field
rotund token
robust scaffold
brave field
#

๐Ÿ‘€ Btw Entities exp12 seems like dun have any new updates. Just only few lines of new codes that I dunno wat it's for.

robust scaffold
#

But dont upgrade

rotund token
#

oh yeah i didn't head your warning

#

and it works fine for me after i manually reimport subscene file

robust scaffold
#

what about after restarting the editor?

rotund token
#

this was after restarting editor

#

because i did it 30min ago

#

and i forgot to take a screenshot

robust scaffold
#

hrm, let me try again

viral sonnet
#

@rotund token just so you are aware, this code is buggy: foreach (var (linkedEntityGroup, entity) in SystemAPI .Query<DynamicBuffer<LinkedEntityGroupBakingData>>() .WithEntityQueryOptions(EntityQueryOptions.IncludePrefab | EntityQueryOptions.IncludeDisabledEntities) .WithEntityAccess()) { if (linkedEntityGroup.Length <= 1) ecb.RemoveComponent<LinkedEntityGroupBakingData>(entity); } my avatar baker creates a stat entity and the avatar gets a reference to the stat entity. this code removes the LEG. so on instantiation the breaks resolving the stat entity reference and a prefab stat entity is referenced.

rotund token
#

i'm confused

viral sonnet
#

must be some sequence thing. length is 1 when it should be 2

rotund token
#

ah i see

robust scaffold
#

I tried for hours earlier today to attempt to edit the LEGBD in a baking system and nothing worked.

brave field
rotund token
#

well i'll have to try find a repo

#

because i havent run into issues so not sure what the timing is

viral sonnet
#

until it hit me that it might have to do with the leg

robust scaffold
#

I dont know why netcode ghosts mandate the inclusion of LEG buffer on a ghost entity. If I had anything linked to it, I'll include it myself.

viral sonnet
#

every prefab gets a leg

robust scaffold
#

for no logical reason

viral sonnet
#

i say it over and over again. make an internalcap of 0 for leg ๐Ÿ˜…

robust scaffold
#

Of course it's the LEG authoring that somehow still works

viral sonnet
#

LEG just wants to be loved

rotund token
#

i see why this fails

#

are you using CreateAdditionalEntity?

viral sonnet
#

yep

rotund token
#
                    {

                        var additionalEntities = AdditionalEntities[entity];
                        for (var k = 0; k < additionalEntities.Length; k++)
                        {
                            if (NoBakeOnlyMask.MatchesIgnoreFilter(additionalEntities[k].Value))
                            {
                                Commands.AppendToBuffer(unfilteredChunkIndex, entities[i], new LinkedEntityGroup() {Value = additionalEntities[k].Value});
                            }
                        }
                    }```
#

it's done in the actual LinkedEntityGroupBaking system

#

as an append

#

ok well i'll just have to detect this case as well and ignore

viral sonnet
#

hm, can we even get this data?

rotund token
#

AdditionalEntitiesBakingData

viral sonnet
#

ah cool

rotund token
#
{
    var leg = linkedEntityGroupBakingDataHandle[i];

    if (leg.Length > 1)
    {
        continue;
    }

    var remove = true;

    for (var j = 0; j < leg.Length; j++)
    {
        if (this.AdditionalEntities.TryGetBuffer(leg[j].Value, out var additionalEntities))
        {
            if (additionalEntities.Length > 0)
            {
                remove = false;
                break;
            }
        }
    }

    if (remove)
    {
        this.CommandBuffer.RemoveComponent<LinkedEntityGroupBakingData>(unfilteredChunkIndex, entities[i]);
    }
}```
#

completely untested

#

but thats my theory when i finish work tonight

viral sonnet
#

yep, i think that will work

#

gonna test

rotund token
#

will probably have a bit more of a read of the source as well

#

ion theory i should just be able to check LinkedEntityGroup itself in PostBakingSystemGroup

#

and not worry about this whoel thing

#

but i ah, couldn't get that to work when i first tried for some reason (though i think this was user error)

#
{
    var bakingSystemGroup = conversionWorld.GetExistingSystemManaged<BakingSystemGroup>();
    bakingSystemGroup.Update();
}

bakingSystem.UpdateReferencedEntities();

using (s_LinkedEntityGroup.Auto())
{
    var legSystem = conversionWorld.GetOrCreateSystemManaged<LinkedEntityGroupBaking>();
    legSystem.Update();
}

using (s_PostBakingSystemGroup.Auto())
{
    var postGroup = conversionWorld.GetOrCreateSystemManaged<PostBakingSystemGroup>();
    postGroup.Update();
}
#

because it happens after the linked entity group stuff

#

so that would be ideal

#

then i dont need to worry about LinkedEntityGroupBakingData or AdditionalEntitiesBakingData

#

nice to avoid internals if i don't have to

viral sonnet
#

yeah, that would be a better hook

rotund token
#

if you look at the source though it seems to check every entity in the LEG

#

for additional entities

#

as a child can have additional entities

#

as well

#

you're only covering the case when the root parent has additional entities

viral sonnet
#

right, better safe than sorry ๐Ÿ˜„

#
            
foreach (var (linkedEntityGroup, additionalEntities, entity) in SystemAPI
             .Query<DynamicBuffer<LinkedEntityGroupBakingData>, DynamicBuffer<AdditionalEntitiesBakingData>>()
             .WithEntityQueryOptions(EntityQueryOptions.IncludePrefab | EntityQueryOptions.IncludeDisabledEntities)
             .WithEntityAccess())
{
    if (linkedEntityGroup.Length > 1 || additionalEntities.Length > 0)
        continue;

    bool remove = true;

    for (int i = 0; i < linkedEntityGroup.Length && remove; i++)
    {
        if (additionalEntitiesLookup.TryGetBuffer(linkedEntityGroup[i].Value, out var childAdditionalEntities))
        {
            if (childAdditionalEntities.Length > 0)
                remove = false;
        }
    }
    
    if (remove)                
        ecb.RemoveComponent<LinkedEntityGroupBakingData>(entity);
}```
rotund token
#

i wonder if it's possible to have a LinkedEntityGroupBakingData without AdditionalEntitiesBakingData

#

probably not by default

viral sonnet
rotund token
#

if there's a child though

#

then leg length > 1

#

so that's not a concern

#

so yeah your short version seems fine

hard wagon
#

Did something happen to PhysicsUtils class?

viral sonnet
#

ah ok, i leave it at that for now. don't want to run into any weird edge cases ๐Ÿ˜„

rotund token
#

anyway the post version seems to work fine, no idea why when i first tried i couldn't get it to work

#

no wait i lied hmm

#

it's like it gets magically added back

#

yeah that was the issue

#

it clearly removes it via ECB i can see that with a breakpoint

#

but when i play, it still exists

viral sonnet
#

ha, you can't query a component in Entities Hierarchy when it's in a system entity

rotund token
#

yeah because it doesn't use the IncludeSystems

#

entity option

viral sonnet
#

yeah, i hope they refine this because it's pretty annoying that for some calls it is included and sometimes it's not. for the debug window it definitely should.

rotund token
#

new EntityQueryDesc { Any = componentTypes.Set.ToArray(), Options = EntityQueryOptions.IncludePrefab | EntityQueryOptions.IncludeDisabledEntities }

viral sonnet
#

imo system entities shouldn't be treated special to begin with

rotund token
#

it's terrible

#

Any is not what anyone wants

#

at minimum that should be All

#

i will probably inject my own query into it soon

#

that does an All query and hides prefabs/disabled entities by default

viral sonnet
#

true dat

#

i also dislike that behaviour. i would be okay with some or/and syntax

rotund token
#

i'm not sure if i've ever wanted an OR query

#

for filtering

viral sonnet
#

me neither ๐Ÿคฃ

rotund token
#

(i've used it in systems, just not for debugging)

#

when debugging i want to find a specific entity

#

you know

#

something with GivesOxygen that is an Actor

#

or a Building

#

i dont want to search GivesOxygen and have a list of 1000 entities to manually look through

#

or search building and have a list of 10,000 entitites to look through

#

i want to narrow it down...

#

or OR query it and have ~11,000 to look through!

#

its the biggest feature missing from entity debugger

#

i was shocked when it wasn't fixed in 1.0....

#

because i don't know how anyone who actually uses entities for large project development could live with how it is atm

viral sonnet
#

yeah, and those features would be coded really quickly

#

helps a ton

rotund token
#

i know how to inject this

#

into the hierarchy window

#

i just haven't thought of a nice way without having to hit some random button somewhere

balmy thistle
#

That's 0.17

gentle gyro
brave field
#

๐Ÿฅฒ Built-in build at 1.0 not really reliable. Always easy to fail to build runtime player build.

gentle gyro
rustic rain
#

So... no updating yet?

brave field
#

๐Ÿฅฒ dots 1.0 Builtin build feature still not stable yet?

Asset has disappeared while building player to 'globalgamemanagers.assets' - path '', instancedID '-39510'
UnityEditor.BuildPipeline:BuildPlayer (UnityEditor.BuildPlayerOptions)
gusty comet
rotund token
#

In general I feel like switching between interpolated and predicted would be a more long term change (long as in at least seconds+) which seems less suited for enable components?

#

So it would just make the archetype a lot larger for minimal benefit

rotund token
#
{
    var hierarchyField = typeof(HierarchyWindow).GetField("m_Hierarchy", BindingFlags.Instance | BindingFlags.NonPublic);
    var hierarchy = (Hierarchy)hierarchyField!.GetValue(hierarchyWindow);

    var filterField = typeof(Hierarchy).GetField("m_Filter", BindingFlags.Instance | BindingFlags.NonPublic);

    var searchElement = hierarchyWindow.rootVisualElement.Q<SearchElement>();
    searchElement.RegisterSearchQueryHandler<HierarchyNodeHandle>(_ =>
    {
        var filter = (HierarchyFilter)filterField!.GetValue(hierarchy);

        if (filter == null || filter.FilterQueryDesc == null)
        {
            return;
        }

        // Swap our any and all queries
        var desc = filter.FilterQueryDesc;
        desc.All = desc.Any;
        desc.Any = Array.Empty<ComponentType>();
        desc.Options |= EntityQueryOptions.IncludeSystems;
    });
}```
#

swapped Any to All and added Systems into the query

#

avoided changing entities package at all

#

just 10min and a little reflection

#

will probably spend some time adding a simple UI for this to make the Options optional

rustic rain
#

modify package?

rotund token
rustic rain
#

๐Ÿ˜…

#

๐Ÿค”

#

so what happened?

rotund token
#
    public static class CustomHierarchy
    {
        private static HierarchyWindow currentWindow;

        static CustomHierarchy()
        {
            EditorApplication.update += Update;
        }

        private static void Update()
        {
            if (currentWindow == null)
            {
                if (EditorWindow.HasOpenInstances<HierarchyWindow>())
                {
                    currentWindow = EditorWindow.GetWindow<HierarchyWindow>();
                    Setup(currentWindow);
                }
            }
        }

        private static void Setup(HierarchyWindow hierarchyWindow)
        {
            var hierarchyField = typeof(HierarchyWindow).GetField("m_Hierarchy", BindingFlags.Instance | BindingFlags.NonPublic);
            var hierarchy = (Hierarchy)hierarchyField!.GetValue(hierarchyWindow);

            var filterField = typeof(Hierarchy).GetField("m_Filter", BindingFlags.Instance | BindingFlags.NonPublic);

            var searchElement = hierarchyWindow.rootVisualElement.Q<SearchElement>();
            searchElement.RegisterSearchQueryHandler<HierarchyNodeHandle>(_ =>
            {
                var filter = (HierarchyFilter)filterField!.GetValue(hierarchy);

                if (filter == null || filter.FilterQueryDesc == null)
                {
                    return;
                }

                // Swap our any and all queries
                var desc = filter.FilterQueryDesc;
                desc.All = desc.Any;
                desc.Any = Array.Empty<ComponentType>();
                desc.Options |= EntityQueryOptions.IncludeSystems;
            });
        }
    }```
#

full source

rustic rain
#

ah

#

just getting VE reference

#

and modifying it

#

I'm guessing what you did there just register second callback

#

that overwrites

frosty siren
#

can i schedule parallelFor job but length depending on previous job result?

rotund token
#

With an ijobdeferred

#

Or whatever it's called

frosty siren
#

thank you, so i have 2 option: pass int ref with unsafe context or pass nativelist

rotund token
#

yes native list is the usual strategy here

rotund token
brave field
#

Btw currently SystemAPI.Getbuffer<>() only support read only?

#

Dun have read & write SystemAPI.Getbuffer<>() yet?

rotund token
brave field
# rotund token its always write i think

If that's the case then I shouldn't get this error lol

InvalidOperationException: The BufferLookup<xxx> has been declared as [ReadOnly], but you are writing to it.
Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckWriteAndThrowNoEarlyOut (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) (at <4f34b520fe644a2c9c25d8f755df793d>:0)
Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckWriteAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) (at <4f34b520fe644a2c9c25d8f755df793d>:0)
Unity.Entities.DynamicBuffer`1[T].CheckWriteAccess () (at Library/PackageCache/com.unity.entities@1.0.0-exp.8/Unity.Entities/Iterators/DynamicBuffer.cs:158)
Unity.Entities.DynamicBuffer`1[T].Add (T elem) (at Library/PackageCache/com.unity.entities@1.0.0-exp.8/Unity.Entities/Iterators/DynamicBuffer.cs:342)
xxx.OnUpdate (Unity.Entities.SystemState& state) (at Assets/xxx.cs:206)
xxx+__codegen__OnUpdate_00000730$BurstDirectCall.Invoke (System.IntPtr self, System.IntPtr state) (at <fa6bc290fd464bd69e81e0d76f7e0693>:0)
xxx.__codegen__OnUpdate (System.IntPtr self, System.IntPtr state) (at <fa6bc290fd464bd69e81e0d76f7e0693>:0)
(wrapper native-to-managed) xxx.__codegen__OnUpdate(intptr,intptr)```
frosty siren
#

Anyone has experience of choosing between Persistent/TempJob allocators? I have job which writes to list every frame, this list can include count of chunks in query at max. So I can expect, that count of chunks won't change every frame, so instead of allocating new list every frame with TempJob allocator I can instead allocate list with Persistent and then clear it every frame + reset capacity if i see exceed. However allocating persistent list is much slower then TempJob, also TempJob list will have better cache coherence.

Is there any theoretical reasons to pick one or another OR should I just look at actual performance and compare solutions? (I know, I should do that no matter what question is, but just want to research it a bit, because code a little complex at a time)

proud jackal
#

Well, profiling is always what should inform this kind of decision - Also, while you can use TempJob, you also have the option to use state.WorldUpdateAllocator instead, which does double buffering, writing to one buffer in one frame, the other in the next, third frame will then dispose the first and so on, it's pretty neat! ๐Ÿ˜„ (tho I reckon for your usecase that the Persistent is probably the more qoute on quote "correct solution" solution, as it will probably stabilize into the correct allocation size and then not cause more heap allocs.. Clearing should only set the length of the list to zero, thus overriding the memory, much more effecient than a re-alloc)

proud jackal
brave field
proud jackal
#

Well, the rest of our api for pointers (handles, lookups, buffers) has a parameter isReadOnly, so for the sake of consistency that's what we stick to :3 Also notice how EntityManager.GetBuffer has a isReadOnly much better to be consistent in this case :3

brave field
proud jackal
#

that's the plan, but unsure if it'll make it into 1.0 so you might have to do this for now :3

var lookup = SystemAPI.GetBufferLookup<MyComp>(isReadOnly: true);
var buffer = lookup[e];
brave field
#

@proud jackal ๐Ÿง Btw can u try to push dots addressables feature available at future Entities exp. release as early as possible before 2023. Really want to test it at exp. release and not waiting until pre-release

full epoch
#

seems entities and physics exp 12 is out and for graphics exp 14

brave field
queen dome
#

How should I schedule a ICollisionEventsJob job?

gusty comet
#

Looks like a package dependencies edit

viral sonnet
viral sonnet
robust scaffold
#

And then add dependencies.

queen dome
robust scaffold
queen dome
#

I am getting InvalidOperationException: Expected simulation type: UnityPhysics, current simulation type is: NoPhysics on play. How do I set simulation type?

solemn hollow
#

hmm. i cannot reuse a subscene inside other scenes? if i drag it into another scene it is only recognized as a normal scene and baking isnt happening.

robust scaffold
robust scaffold
robust scaffold
queen dome
#

Do I need it?

#

I just added it and does not seem to make any difference

#

Does anyone know why LocalToWorldTransform has somehow disappeared? After updating to latest entities package it disappeared.

robust scaffold
queen dome
#

Not sure what transform v2 is

#

But yeah, I am using physics in the project

robust scaffold
#

Translation / Rotation components separate is transform V1. Combined LocalToWorldTransform is transform V2. Let me find the link.

queen dome
#

I tried using aspect but code becomes not burstable

#

How do I set position of entity in burstable code?

robust scaffold
robust scaffold
queen dome
#

InvalidOperationException: The previously scheduled job NativeStream:ConstructJob writes to the Unity.Collections.NativeStream ConstructJob.Container. You must call JobHandle.Complete() on the job NativeStream:ConstructJob, before you can read from the Unity.Collections.NativeStream safely. What is unity trying to tell me?

#

I am using exactly zero jobs in my code.

proud jackal
brave field
robust scaffold
gusty comet
# robust scaffold Has there been any investigation either on your side or wider unity dots develop...

Internal capacity 0 would mean every single buffer needs to do a separate allocation any time you add a single element to it. We did measure and conclude that the extra cache miss you get on every single access from doing that was a significant performance hit when we initially implemented buffers iirc. LinkedEntityGroup is guaranteed to have at least 1-2 items in it so 0 seems like the wrong default for that one specifically. I am not aware of any additional investigations since then, but we have done passes on the netcode side to improve the default capacities of many buffers based on expected use-cases.

robust scaffold
robust scaffold
robust scaffold
rotund token
#

30% reduced fps with leg

#

And 1.2gb extra memory (this is simply not having component not moving it out of chunk which would not help memory)

#

I'll take the cache miss

#

I think it's more important though to just not add leg when it's not needed

#

It's added to all prefabs by default even with no hierarchy

#

If there is no hierarchy leg is not required

#

And just avoid whole issue

gusty comet
robust scaffold
#

Yea, I have a startup system purging all instances of LEG with one element.

robust scaffold
rotund token
#

ok so the issue is this

#

in IBaker when you call GetEntity(prefab) it will always add LinkedEntityGroup to this prefab regardless if there is a hierarchy
var buffer = _EntityManager.AddBuffer<LinkedEntityGroupBakingData>(entity);

#

link 824 BakedEntityData.cs

#

so all prefabs without a hierarchy have a giant buffer added to the archetype that does nothing significantly limiting entities per chunk

#

to fix this, I have a script that can simply remove LEG on entities with 1 or less elements in the LEG during conversion (1 being itself since it's always added at element 0)

#
    [WorldSystemFilter(WorldSystemFilterFlags.BakingSystem)]
    public partial struct RemoveLinkedEntityGroupSystem : ISystem
    {
        /// <inheritdoc/>
        public void OnCreate(ref SystemState state) { }

        /// <inheritdoc/>
        public void OnDestroy(ref SystemState state) { }

        /// <inheritdoc/>
        [BurstCompile]
        public void OnUpdate(ref SystemState state)
        {
            var ecb = new EntityCommandBuffer(state.WorldUpdateAllocator);

            foreach (var (linkedEntityGroupBaking, additionalEntitiesBakingData, entity) in SystemAPI
                         .Query<DynamicBuffer<LinkedEntityGroupBakingData>, DynamicBuffer<AdditionalEntitiesBakingData>>()
                         .WithEntityAccess()
                         .WithEntityQueryOptions(EntityQueryOptions.IncludePrefab | EntityQueryOptions.IncludeDisabledEntities))
            {
                if (linkedEntityGroupBaking.Length > 1 || additionalEntitiesBakingData.Length > 0)
                {
                    continue;
                }

                ecb.RemoveComponent<LinkedEntityGroupBakingData>(entity);
            }

            ecb.Playback(state.EntityManager);
        }
    }```
#

i would just like to not have to hack this in myself and instead have LinkedEntityGroupBaking.AddLinkedEntityGroupBakingJob handle it by just not adding the buffer if there is no reason to

#

this is my 0.51 LEG difference

#

6.26ms -> 4.03ms

#

now this example isn't as possible anymore because we are 128 entity capped now

#

but it shows the difference chunk capacity can make

gusty comet
rotund token
#

It's interesting internal benchmarks have the cache miss on buffers being a problem.
We did a bunch of testing on this at work on our project last year and concluded we could not find a case where the performance benefit from increase in entities per chunk did not outweigh the cache miss and added a blanket rule of 0 capacity buffers in the project.

#

(this is an old project so doesn't use conversion and therefore doesn't get LEG however it uses a lot of buffers)

robust scaffold
brave field
winter depot
#

Alright, so I can't get layers to mean anything at all in 2D Entities.Graphics rendering with a Orthographic camera. The only thing that appears to make a difference is the material's shader "Sorting Priority". Is this normal? Is there a way to access this property during runtime?

robust scaffold
#

If you're rendering quads, the Z position, or whatever is the depth axis, works fine for layering.

winter depot
#

I am just using RenderMeshUtility.AddComponents directly on an entity. No quads, no conversion.

#

It works on perspective camera (z that is)

robust scaffold
#

Because I've been using hybrid and hybrid is borked in build. If sprite renderer can be attached to using RMU, that's big.

#

Gotta rewrite a lot of stuff if true

#

Ah wait, just meshes. I think.

winter depot
#

Just mesh and material

robust scaffold
#

Are you rendering sprites though?

#

Or just flat textures?

winter depot
#

I am only doing texture because everything else gives the SRP batcher error?

#

Unless something changed

#

URP/Unlit

#

The "Sorting Priority" is the only thing that makes any consistent difference in layers

robust scaffold
#

Unity still does Z ordering even in orthographic mode. Have you tried moving the z axis of the objects?

winter depot
#

Yeah, and thats what I was using prior to 1.0 and the updated entities.graphics

robust scaffold
#

And it stopped working?

winter depot
#

Yeah

#

In edit I can see the objects moving, and it is in front of the other object but still rendering behind

#

So I know Z is working

robust scaffold
#

huh.

winter depot
#

And thats z neg or positive either direction in edit, you can rotate like 3D, its still rendering behind

brave field
winter depot
#

Its frustrating because I am wasting time not knowing if its something wrong with my logic or something unintended with the packages. I understand that they want us to use conversion and 3d is priority but it feels backwards to me. I do everything procedurally, so should I still be turning everything into a GO and then baking into entity?

rotund token
#

The speed up was going from 73 to 232 entities per chunk

rotund token
brave field
rotund token
#

0.51 - 2.05ms
0.51 128 Limit - 4.75ms
1.0 - 4.34ms

#

i'm in the process of reworking library to utilize the empty chunk space that has been forced on me so long term it will probably not be a big difference. it's just the library was very specifically optimized around maximum entities/chunk.

rotund token
#

โค๏ธ reflection and UI toolkit. Replaced the filter button with custom filter options.

#

source here if anyone was interested in some filter options for hierarchy window

brave field
rotund token
#

yep, was pretty easy (UI toolkit is great for this)

#

i have a rule to try never to modify packages because it's too painful to maintain

#

i'd rather just give myself internal access and/or use some reflection

#

i just used reflection to remove the existing event subscription to the add filter button then added my own subscription for my new popup
and subscribed to the same search event that the default search uses and just updated the query after it was created

#

(you can see this in the source)

viral sonnet
#

Hey @gusty comet , first of all, thanks for engaging on this topic with us. I've written most of what I wanted to say on this topic in this thread: https://forum.unity.com/threads/hierarchy-data-as-core-feature.1350353/#post-8526671 maybe you can get some stone rolling on this. My proposal is to either make hierarchies a very performant core feature or at least make the internal buffer capacity something we can change via config in the editor. I prefer pretty much any solution that is not a hardcoded internal buffer capacity. And this topic goes way beyond LinkedEntityGroup and the mentioned PhysicsColliderKeyEntityPair buffer but every IBufferElementData that is used in a package so I hope we can find a good solution for it.

rotund token
#

these were previously part of my core library but not everyone wants a full library (even non-destructive)

#
  • my physics collider inspector
  • the hierarchy filter i just wrote
  • remove LEG from prefabs that don't utilize it
#

that's it (for now)

viral sonnet
#

thanks for putting this together. i consider everything essential

viral sonnet
#

foreach with SystemAPI.Query is not able to call EntityManager.AddComponent. is our only option now to use ECB?

rotund token
#

it'd be nice if it had a WIthStructuralChange option

whole gyro
rotund token
#

but performance wise yeah you probably want to use ecb anyway

#

instead of having to copy the data before iterating

viral sonnet
#

alright, the old error msg still pops up "InvalidOperationException: Structural changes are not allowed during Entities.ForEach. Please use EntityCommandBuffer or WithStructuralChanges instead." was wondering if i was missing some kind of structuralChanges option

#

oh, i need the correct entity when i instantiate (it's a spawner system) because i keep an id lookup around. the deferred nature of commandBuffer.Instantiate strikes again

#

well i can make another loop after the playback

#

still not cool ๐Ÿ˜„

rotund token
#

can't you just write it via the command buffer?

#

or are you storing this in a native container or something

viral sonnet
#

it's stored in a NativeHashMap

#

i'm not really getting why i can't make structuralChanges in a mainthread foreach

rotund token
#

what if Reference.Entity was in the query

#

there's a reason WithStructuralChanges().Run() is required vs WithoutBurst().Run()

#

it has to make a defensive copy

viral sonnet
#

that's a problem of the QueryEnumerable and enumeration. hm, on that note it should be possible to just cache those

#

if we can get a fully copy of the query this should work

rotund token
#

but the chunk you are currently iterating

#

can change by an add/remove/create/destroy

#

the pointer is no longer valid

viral sonnet
#

i get that - but the solution is not to disable the possibility because some code wouldn't work.

#

i read that EM structural changes are now more relaxed in foreach, wonder what's that about then

rotund token
viral sonnet
#

what should really be prevented is making structural changes which include query parameters

viral sonnet
#

and sure, it should just do what WithStructuralChanges does ๐Ÿ˜„

#

that's what i meant with caching the enumeration

rotund token
#

basically basically query.ToEntityArray() then GetComponent on each iteration

#

it's pretty poor performance and should not be default imo

viral sonnet
#

for now i just stick to Entities.ForEach until we have that option. not worrying too much about performance, i have to do this because of hybrid so performance is already out the window ๐Ÿ˜„

rotund token
#
Unity.Entities.InternalCompilerInterface.UnsafeCreateGatherEntitiesResult(ref query, out var gatherEntitiesResult);
var translationTypeIndex = Unity.Entities.TypeManager.GetTypeIndex<Unity.Translation>();
var rotationTypeIndex = Unity.Entities.TypeManager.GetTypeIndex<Unity.Rotation>();
try
{
    int entityCount = gatherEntitiesResult.EntityCount;
    for (int entityIndex = 0; entityIndex != entityCount; entityIndex++)
    {
        var entity = Unity.Entities.InternalCompilerInterface.UnsafeGetEntityFromGatheredEntities(ref gatherEntitiesResult, entityIndex);
        if (mask.Matches(entity))
        {
            var translation = Unity.Entities.InternalCompilerInterface.GetComponentData<Unity.Translation>(__this.EntityManager, entity, translationTypeIndex, out var originalTranslation);
            var rotation = Unity.Entities.InternalCompilerInterface.GetComponentData<Unity.Rotation>(__this.EntityManager, entity, rotationTypeIndex, out var originalRotation);
            __this.TestSystem_LambdaJob_0_LambdaBody(entity, ref translation, ref rotation);
            Unity.Entities.InternalCompilerInterface.WriteComponentData<Unity.Translation>(__this.EntityManager, entity, translationTypeIndex, ref translation, ref originalTranslation);
            Unity.Entities.InternalCompilerInterface.WriteComponentData<Unity.Rotationt>(__this.EntityManager, entity, rotationTypeIndex, ref rotation, ref originalRotation);
        }
    }
}```
#

is what WithStructral changes does if you're interested

#

gets all entities

#

then check if each exists

#

and does a GetComponent

viral sonnet
#

hm, i don't see much way to tidy this up in a SystemAPI.Query

proud jackal
robust scaffold
#

b13 does not fix asset importer problem, sad

viral sonnet
robust scaffold
#

Does anyone know if kinematic - kinematic collisions raise collision events?

#

Also, does anyone know how to open this tab:

rotund token
#

if they're marked to

robust scaffold
rotund token
#

marked to raise collision events

robust scaffold
#

Ugh, Im trying to make players kinematic but still collide with walls. Unfortunately, there's no kinematic to kinematic collisions. Collision events sure, but they're not stopping at static walls.

rotund token
#

but ive just realized you said 2 kinematics, not kinematic/colliderso yeah probably not

robust scaffold
#

Box2D kinematic colliders will stop when they move against static or other kinematics if an option is toggled. Shame dots physics doesnt have the same.

rotund token
#

that seems odd

#

isn't that counter to what a kinematic collider is

robust scaffold
#

The kinematic wont push other kinematics. It just stops like it hit a wall.

#

dynamic - dynamic hits like pool balls, dynamic - kinematic / static hits like a wall, normal kinematic / static - kinematic / static hits nothing.

#

Box2D kinematic - kinematic / static shifts kinematic collisions to the second version from the first.

#

And I think kinematic - dynamic hits like pool balls. Been a while since I tested it

#

And of course 2D has proper continuous collision detection.

robust scaffold
rotund token
#

orly

#

thatd be awesome

robust scaffold
#

Even if it's not stateless apparently, it can just be used as a direct upgrade with full support with prediction.

#

They have tests to ensure deterministic end to end physics simulation and havoc passed. So maybe. We'll have to see in december or, more likely, next year.

robust scaffold
#

@rotund token I'm using your strip LEG at baking system instead of mine during runtime as it makes more sense. Yet in this subscene (baked editor, not in playmode), a size 1 LEG still exists on this prefab. Is this correct?

rotund token
#

hmm

#

there is 1 path i know that would still add it

robust scaffold
#

Huh, I think ghost type component forces existence of LEG.

#

additionalEntitiesBakingData.Length > 0. Removing this condition removes the LEG but breaks the GhostTypeComponent above it.

rotund token
#

and that is if there is a BakingOnlyEntity

rotund token
robust scaffold
rotund token
#

netcode is probably adding a BakingOnlyEntity

robust scaffold
#

Not a baking only entity, this is just a runtime entity

rotund token
#

yes but i mean during baking

#
            {
                var leg = legBuffer[i];
                Commands.AddBuffer<LinkedEntityGroup>(unfilteredChunkIndex, entities[i]);

                for (var j = 0; j < leg.Length; j++)
                {
                    var entity = leg[j].Value;
                    // Only append if not BakeOnlyEntity
                    if (NoBakeOnlyMask.MatchesIgnoreFilter(entity))
                    {
                        Commands.AppendToBuffer(unfilteredChunkIndex, entities[i], new LinkedEntityGroup() {Value = entity});
                    }

                    if (HasAdditionalEntityMask.MatchesIgnoreFilter(entity))
                    {

                        var additionalEntities = AdditionalEntities[entity];
                        for (var k = 0; k < additionalEntities.Length; k++)
                        {
                            if (NoBakeOnlyMask.MatchesIgnoreFilter(additionalEntities[k].Value))
                            {
                                Commands.AppendToBuffer(unfilteredChunkIndex, entities[i], new LinkedEntityGroup() {Value = additionalEntities[k].Value});
                            }
                        }
                    }
                }
            }```
#

this is the code that adds elements to the LinkedEntityGroup

#

if (NoBakeOnlyMask.MatchesIgnoreFilter(additionalEntities[k].Value))

#

notice this line

#

on my stripping is this is false, i would still allow the LEG to be added

#

but if false in LinkedEntityGroupBaking it would not add it to the LEG

#

this means if something adds an additional entity to additionalEntitiesBakingData that has the BakingOnlyEntity component

#

it will still add the LEG but it'll be 1 length when baking is done

#

i haven't played with netcode enough since 1.0 to see what's going on though

#

i was conservative stripping LEG to avoid breaking cases like this (luckily so I guess)

robust scaffold
#

I guess I gotta go back to my runtime stripping. I think it was working.

viral sonnet
#

the edge cases are a bit annoying. if there's an additional entity that is not referenced on the main entity, LEG can be removed.

#

i guess that's your case as i see no references

robust scaffold
#

It should actually have some. I've used GetEntity(GameObject prefab) but none of them are being added

viral sonnet
#

if you have a reference and strip LEG, the instantiation will be buggy as the reference will point to a prefab entity instead

#

that's what i had yesterday

robust scaffold
#

These two entities are prefabs. And there's no LEG on this entity

viral sonnet
#

i mean references that are created in a baker via CreateAdditional or ECB

#

just references seem fine

rotund token
#

i wish i could get it working after LEG was added

viral sonnet
#

like my avatar create a stat entity which the avatar has a reference to. that kind

robust scaffold
#

There's suppose to be an LEG

viral sonnet
#

or someone at unity could listen - i mean we have a strict don't edit packages policy around here ๐Ÿ˜„

rotund token
#

i remove it... but it still appears at runtime

robust scaffold
#

It's added to the reference...

#

and the one time I want an LEG, it doesnt appear

#

that if statement returns false. None of those are true.

#

prefab and baking is borked. That I at least know from all of this.

viral sonnet
#

is the IsPrefab method false?

robust scaffold
#

Actually no, it's only used for weak reference resolution

#

there's no leg in this, hrm

#

Will setting a ghost component to client only be bad? What if the client memory edits the values in the component? Is there no server verification of the values in client only ghost components?

#

Although if they cheat engine the component, they might as well decompile the engine, edit the code to remove the requirements for light rendering, then recompile...

viral sonnet
#

i'm just thinking about what tim said, that leg is used in the most critical paths of netcode. what are these paths?

robust scaffold
#

Actually huh, i re-enabled my leg remover system, cleaned up some queries and bugs (replaced everything with a systemapi):

#

Apparently some netcode systems assume it's existence and dont check

#

Baker is just so bug free

#

Unity, what do you mean this needs to be system filtered:

viral sonnet
rotund token
#

remove it on all the prefabs as well, not just things you instantiate, and i believe it should work (though maybe behaviour broke in 1.0?)

rotund token
solemn hollow
#

@rotund token thanks for the essentials. i love it

#

@rotund token not sure if its possible but i would have a feature request for it right away ๐Ÿ˜„

something like !c:Component that acts as a none filter

rotund token
#

it's possible but i was trying to avoid rewriting the whole interpretation stuff myself ^_^'

#

it'd probably be something like

#

n:Component

#

though

#

much easier

solemn hollow
#

i see. lets just wait for official support then ๐Ÿ˜„
I looked into your script and i wouldnt know how to write that myself. Im not very experienced with unities new UI stuff

rotund token
#

filterField has a private field HierarchyQueryBuilder.Result

#

which has the public field string Filter;

#

so you could parse it in there this way

#
            @$"\b(?<token>[nN]:)\s*(?<componentType>(\S)*)",
            RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.ExplicitCapture);```
#

filter the n: components with this i think

#

(i barely understand regex, this is just unitys version with the cC to a nN)

#

then call
ComponentTypeCache.GetExactMatchingTypes(matchGroup.Value);

#

on the result

#

then add it to the None part of the query

#

and there we have it, kind of done it and now i need to add it

#

๐Ÿ˜„

solemn hollow
#

xD

rotund token
#

Main issue is it wouldn't auto complete with the popup menu

solemn hollow
#

that wouldnt be too bad for a start.

#

we just need to make enough noise so they add it as a core feature ๐Ÿ™‚

#

i remember reading something about a new way to add a component to all linkedEntities.
how do i do it? and i suppose its only possible at runtime?

rotund token
#

my favourite feature of 1.0!

#

ecb can do it

#

ECB.SetComponentForLinkedEntityGroup

#

though this is not adding

#

this is setting components on a hierarchy without knowing if they exist

#

i guess what you want is

#

AddComponentForLinkedEntityGroup

solemn hollow
rotund token
#

it only works on LEG

solemn hollow
#

oh lol you edited it ๐Ÿ˜„

rotund token
#

yeah copy/pasted wrong thing ๐Ÿ˜„

solemn hollow
#

its strange that entitymanager doesnt have it

rotund token
#

because you dont need it

#

you already have access on EM to LEG

#

this lets you set data in a hierarchy of an instantiate

#

which was not possible before

#

because the hierarchy didn't exist until the ECB played back

#

but it's cool because you can just set XYZ components without knowing if it's required

#

imagine an AI hierarchy where you can inject SpawnTime/etc on just the entities that need it

#

only if your utility needs the data will it get set

solemn hollow
#

its insanely useful. ill use it for abilities. each abilityuser has its own prototypeinstance of an ability. the abilityhierarchy needs to know the user. so now i can just set the user on the whole hierarchy.

rotund token
#

yep!

solemn hollow
#

So in this case i really need the ECB.SetComponentForLinkedEntityGroup. that makes it way easier to bake correctly from the getgo

rotund token
#

i haven't actually used it but i've been thinking about usages for quite a while