#EntityManager Batched Operations
1 messages · Page 1 of 1 (latest)
thanks @jovial nova but I realised that it's not the way to go for batching operations
Man that article was from 2018
Let's recycle this useless post for a more useful question then:
I miss 5argon work
how can I set a batch of components values on a batch of components that I just added
let's say I did something like:
_EManager.Instantiate(dotsEntity, nativeArray);
and now I want to do a batch operation of AddComponent, how can I set different values for each component for this specific set just created?
Setting is really just iterate everything and write
yes but how I can iterate just the set of entities I just created
let's say I added this second batch and a first batch was already existing
how can I iterate just the components of this second batch
You have the native array you just passed in of those entities
yes
You can just iterate that
are you suggesting to do EntityManager.AddComponent(array[i], data)?
iterate with a foreach? like Entities.ForEach?
If it's not like 100k entities just iterate in a normal loop in isystem
ok but how can I say iterate just the components of the set just created
I am not aware of a way to say : do not itearte all the entities in the world, just the ones just created
Just loop the native array of entities
You never mentioned reading data
I have to write the component, not read
Then just use entitymanager setcomponent
isn't the same of doing o EntityManager.AddComponent(array[i], data) then?
No
Because add is a archetype change
If you batch all your adds in a single query call it'll be 100x faster
Because it can just add the component to the entire chunk
right so you say AddComponent batched and single setcomponents is better
Instead of having to move each entity individually
it's a shame I cannot do a burstified operation for this copy
I do have to set a large quantity of entities
Why can't you do this busted?
EntityMaanger.Setcomponent bursted?
You should be doing this all in a bursted isystem
does ISystem support that now?
that's cool, and SystemBase cannot do that?
You can't (easily) burst system base update
I meant more if now with DOTS 1.0 I can use EntityManager inside Entities.ForEach
trying it very quickly now
ok I will try ISystem
In 1.0 you should avoid efe 😅
all right trying ISystem
ok the DOTS examples are quite clear about it
thanks I see where I can get with this
it makes much more sense from the example for sure, looking forward to test the performance
last question @jovial nova are the batched operations burstified internally anyway? Regardless if I call them from burstified code or not, like the ECB playback?
don't tell me I cannot add am ISystem explicitly in a world
No
At least I don't think so
Maybe it's changed since I last looked in depth