#archived-dots
1 messages ยท Page 269 of 1
1 mesh + X chunk transforms get passed to render batch
1 mesh happens to be 1 chunk
yeah, I see. well, I rest my case ๐ I don't see much to improve here then
what kind of cpu timings are we talking about @rustic rain ?
then don't optimize ๐
do you have a 2d or 3d game?
you probably have cell data already, right? you can hash the mouse position and build a lookup table to find the hovered cells. finding anything based on position will be useful for other things too
I'd only use this entity pick system in the editor.
hm, well I don't know your game. can I imagine it like rimworld or something different?
i haven't but a google search gave me an idea ๐
so if you're doing this I assume that you not use any physics or colliders?
yeah, I see. just don't overdo it. having no spatial awareness makes a lot of things unnecessarily tricky
OverlapSphere doesn't look too hot for 10k ๐คฃ
is that all 1 thread?
if you only update half a frame
that's 15fps!
i do think based off what i know your requirements in general are this will probably not be fast enough ๐
yeah, just a Run() to see how things go. I wonder how MMO servers do this stuff. they have so many entities on a server it's insane. could run on players instead of enemies but still
sad to see physics is *that *slow for that. :/
they aren't triggering 10k creatures/frame
that said most mmos 95% of the creatures are asleep
usually they sleep like 50m from a player
some form of spatial trigger has to wake them up
and yeah, I guess most of the stuff runs okay because it's just not happening that often
when the players actually do the overlap cast it'll be a lot less. still servers can have 7-10k players
I had high hopes I can just throw this feature in and be done with it ... lol fk
yeah that isn't 1 server though
that's multiple machines acting like 1 single server
yeah true, what I'm even thinking ... haha
so I guess for the demo I'd have to put the overlap cast on the enemies and not on the casters, otherwise performance is down in the dumps
you could optimise this a lot
if you have a bunch of things in an area
they dont all have to cast an overlap sphere
you can cast one and use the same result for all of them
I'll certainly keep this in mind. Don't want to cheat too much as it would be unrealistic anyway to have casters all stacked up on a few positions ๐ but yeah, talking about unrealistic with my kind of numbers. I see the irony
physics doc doesn't even mention ITriggerEventsJob
what's the correct way of converting? this messes up physic blobs ```BlobAssetStore blobAssetStore = new BlobAssetStore();
GameObjectConversionSettings settings = new GameObjectConversionSettings(World.DefaultGameObjectInjectionWorld, GameObjectConversionUtility.ConversionFlags.IsBuildingForPlayer , blobAssetStore);
prefabEntity = GameObjectConversionUtility.ConvertGameObjectHierarchy(go, settings);```
I don't know where to get the BlobAssetStore
subscenes? ^_^"
for hybrid, I now know that GameObjectConversionSystem holds a BlobAssetStore but GetExistingSystem returns null.
at least from the DefaultGameObjectInjectionWorld
I'm honestly surprised that the posted method doesn't screw up the blobs from the subscene. the problem started when I put a trigger on the hybrid spellcaster
triggers run even worse (as expected) also messes up physics time step and now I have 6 updates in 1 frame ...
option A) use sphere overlap cast b) build a specialized hashMap - I have to stop at one point with this madness haha, maybe now is a good time
not really sure what hybrid has to do with it
blob asset management is a bit of a pain and it's pretty complicated under the hood
if you dont care about maximum memory saving then just create, retain and disposing your own store is fine
Is there a way to set EntityQueryOptions directly in an EntityQuery object or do i always have to work with EntityQueryDesc for that
I just want to include Disabled Entities in the query
welp, I checked
1 ms takes
for thousand of entities
to be constantly removed/added with components, kek
for sake of fail proof rendering disabling
how is tertles suggestion not failproof though? whenever someone changes the room you add DisableRendering. whenever someone enters you remove it.
I would have thought your solution is MUCH faster actually than you profiled. there should be no memory copied around and most chunks shouldnt even change at all since most chunks are disabled anyways. the few chunks that need to be enabled again should just have their archetype adjusted and nothing more. not sure how this could take so long.
it's not failproff because there could be potential bugs due to missing such changes
meanwhile fail proof is constantly checking for "dirty" entities
Id probably try it with a reactive system. whenever an entity changes the room you do the checks
but it's not efficient
yeah
reactive system is best scenario
but here the problem
i guess your problem is the SCD
just have another normal ICompData holding the room ID too and always write into both. then you can filter for changes on the normal one
I am working on it
first I want to make a difference between
Player view
and player entity
for culling?
yeah, I guess you can call it culling
just need an ability to look into other rooms
at least for debugging purpose
btw, this is not an option, since writing to shared comp can't be done through buffer
why would you need to write it through a buffer?
so I can have actions with it in bursted jobs
rn all actions I can do: are only through filter
so far it's enough, but can't wait for unmanaged shared comp
from Unity
I dont get the problem. when an Entity leaves a room you write to SCD and ICD at the same time. Then a System with a ChangeFilter on the ICD picks up the change and sets your DisableRenderer.
I don't think I get the idea. Could you elaborate?
I really dont know what more to say to that.
You must have some Logic that changes the room right? Like a collision with a Stargate changes the RoomSCD. Whereever you write to RoomSCD you just also write into another IComponentData the same value. In your RoomDisableRendererSys you then Filter for changes on the IComponentData. So RoomDisableRendererSys only runs for chunks where an Entity changed the room. If nothing changes rooms it doesnt run at all.
hmm
version filter
I see
curious
Does Entity Manager support it though?
Since I don't want to run it through loop, I can literally just do it in EntityManager
Its a Filter for a query. So if i understood your question right ofc you can use it with Entitymanger
ngl, your idea of doubling room component is great
now it also solves a question of how to acess data
for reading only
yep
hmmm
any idea whether I can simply cast
my shared component to normal?
public struct StarNormal : IComponentData
{
public int systemID;
}
public struct StarShared : ISharedComponentData
{
public int systemID;
}
kinda like this (StarNormal) new StarShared();
doesn't really let me
you can use an static implicit cast operator or UnsafeUtility.As with ptrs
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/user-defined-conversion-operators
what a pain, I'm not able to remove the LinkedEntityGroup from a converted GO :/
usually removing works during Convert but for some reason for this case it doesn't
it's a prefab, if I put the prefab in a subscene LEG gets removed
Huh. I never had the case that Subscene conversion did something diffrent to single conversion
LinkedEntityGroup is pretty much the last thing that happens in conversion right? are you maybe not removing it late enough?
yeah, must be a order problem. hm, is there a post convert? I'm not aware of any
so where it's different is. prefab in subscene -> normal. same prefab referenced in spawner subscene GO -> LEG still there
hmm. im guessing here. the diffrence could be that prefabs don't have an associated entity when conversion starts but get them later on when they are discovered via DeclareReferencedPrefabs. Maybe you somehow manage to delete LEG before those Prefabs are discovered?
no there isnt. i would have needed that quite often myself already ๐ฆ
I just found this, maybe it helps here
I think LEG is done even after late conversion group. but im not sure. feels like i looked into it once but it was quite a while ago
static void FinishConvertIncremental(World conversionWorld, Conversion conversion)
{
using (s_UpdateConversionSystems.Auto())
{
conversionWorld.GetExistingSystem<GameObjectBeforeConversionGroup>().Update();
conversionWorld.GetExistingSystem<GameObjectConversionGroup>().Update();
conversionWorld.GetExistingSystem<GameObjectAfterConversionGroup>().Update();
}
using (s_GenerateLinkedEntityGroups.Auto())
conversion.MappingSystem.GenerateLinkedEntityGroups();
#if !UNITY_DISABLE_MANAGED_COMPONENTS
using (s_CreateCompanionGameObjects.Auto())
conversion.MappingSystem.CreateCompanionGameObjects();
#endif
conversionWorld.EntityManager.DestroyEntity(conversionWorld.EntityManager.UniversalQuery);
}
seems so, the test with GameObjectAfterConversionGroup didn't work. I just don't get it why it's working for a subscene GO. should be the same conversion process. I mean, not completely, as it's converted into a subscene
ah thanks, that confirms it
guess I have to unlink it then. major pain ... ๐
why are they linked in the first place ๐
I'm lazy and easier to setup ๐
technically they are linked. I just don't want a 144B LinkedEntityGroup in my archetype
Well you could attach both objects to one empty GO and then in lateconversion delete that GO
then LEG wont be added ? might work
that doesn't sound too bad actually
thanks, I'll try
the reason I'm doing this is to keep my main archetype free from any physics and collider stuff. main archetype is big enough as it is. I need some CDFE calls because of this but it's not too bad. at least, it's worth it to keep the archetype small
pointer to LTW is set once for the main entity so I even have access to translation, rotation without losing too much
but that does mean that your entity with LTW may never change chunk?
im a bit confused
pointers are set every frame to avoid that problem.
hm, when I destroy the entity the linked entity group entities are also destroyed, right? how would I just destroy the container?
i hoped you can destroy the Entity in the DstWorld in conversion before LinkedEntityGroup is set up
oh, right. well let's see
conversion mapping system errors out sadly: The entity does not exist
why are they adding something after post convert? WHO DOES THAT???
hmm maybe the problem is that the ConversionEntity Exists and the DstEntity not
try what happens if you delete the gameobject in conversion
it was worth a try, this is getting too hacky for my taste. I need to take a step back and reevaluate. I must be able to remove the comp at one point. and if all fails, I'll remove it in runtime for the created prefab
thanks for the help, I'm off now to a birthday party ๐
yes i do it in runtime too atm for the same reason. At some point in the future i hope we'll get a ExportConversionGroup like tiny had! have fun at the party!
ah, good to know. thanks! ๐
@rotund token in .50 samples (1.0+ collections) my code with IJobParallelForDefer works
so for now I think I need to switch to simple IJob waiting for 0.51
Just avoid parallel native list until you upgrade
but sadly I need it more than defered job ๐
Be careful because it breaks in other situations as well
do you really need a nativelist or couldnt you work with nativestream etc?
but will it work with IJobParallelForDefer?
and can I add structs to the stream?
Never used stream
sorry
ok, it turns out that EntityManager add component through query is extremely fast and I can simply solve all my renendering through FixDirty
doing it every time I want, as long as it's not every frame xD
basically every time entity gets created/changes it's room
i never used DeferJob sorry too ๐
i dont know what you are trying to solve. No idea if NativeStream makes sense for your problem. You need to know the size of the stream beforehand too but it wouldnt be a huge problem if you oversized it.
yes you can
look into the Tests for NativeStream. Gives you a basic idea on how to use them.
Tertle is probably the expert on NativeStream though given he has made a whole EventSystem based on it
I used it like 3 times.
hmm, I assume GameObjectConversionSystems are just like any other SystemBase exist in world?
I just want to create native array in it
and later access from other systems
which repo?
NativeStreamTests.cs in Collections
it seems that I need to specify max capacity of the stream
yes
@hot basin do you have entities or not?
I have
cant you even guess an upper limit? what do you want to write into it?
but i'm on 0.17 as I need 2021.2+
so, why can't you know upper limit?
because it's bound to setup in editor
but then you can infer from the setup how big it might get can u not?
the ConversionSystems live in the conversion world. you should probably use blobassets to save that nativearray and later read it in the Gameworld
nnnah
I just figured I'd add another component
kek
prob not a better idea ngl xD
I can't because I don't know how many and which entities would be in the runtime
I could multiply all the maxes
but why
You don't need to know capacity, just width
Native stream can resize in parallel
width?
tertle to the rescue!
yeah I figure that out
Power went out at 7:30 last night, went to bed early to get up early. Got up at 4:50, internet went down at 4:59 with 7am+ eta
So annoying, so here I am
oof
Anyway if I was you krajca I'd just ditch parallel native list and just do ijob there and keep deferred job
Parallel native list really slow anyway and when you upgrade less code to write
Oh man its slow? joachim said multiple times that hes impressed with nativestreams performance
It's because they can't know what entities to link until all stages are done. You can create additional entities during conversion
Parallel Native list is slow
Streams are fine
ah so misstyped?
I was talking about the LinkedEntityGroup.
So am i
Yeah my bad
Eh, should just have a stage after adding the linked entity group
Any stage of conversion can call create additional entity. This needs to be added to linked entity buffer
Unity does not expect you to remove this because it breaks a lot of tooling
so to read from stream I need to do the whole thing?
var reader = nativeStream.AsReader();
for (int i = 0; i < nativeStream.ForEachCount; i++)
{
int count = reader.BeginForEachIndex(i);
for (int j = 0; j < count; j++)
{
var axis = reader.Read<Axis>();
Debug.Log($"{axis.input} | {axis.scale}");
}
}
I'm already using CreateAdditonalEntity at conversion stage and that doesn't add a LinkedEntityGroup
Now I do really wish this was a capacity of 0
Let me check but I'm pretty sure it should =S
I've only seen it for GOs that already have a hierarchy
yeah, checking myself now ๐
could be wrong
yeah, my AI entity was never linked
The reason you pass in a component to create addition entity is to link it
Are you passing in null?
var aiEntity = conversionSystem.CreateAdditionalEntity(this); in Convert
Hmm no idea just booting up to confirm
I've done this a few times now and previously I even built the LinkedEntityGroup myself because I needed it
ok I can convert it to array
(other project)
You seem to be right interesting
Now I need to figure out why this isn't working
Hmm because it's not coded to
You know what, that's annoying
Can confirm. I dont get a LEG on createadditionalentity either
Actually no looking at code it seems to imply it should
This is super annoying together with the fact that you cant instanciate prefabs
how to use deferred job with NativeStream?
it's heavy to convert stream to an array?
Hmm a little
If you use native stream to write best to just use it to read
Ok wtf am I missing, I can't even create a linked entity group atm
but I can only paralelize by width and it would not be same for every index
Sorry I don't follow
yeah, maybe I care too much, but ParallelFor with an array will batch work in same sizes so it will be evenly distributed
and if I will do ParallelFor with native stream I need to bach it by foreach index
Generally you'd make the width chunk index or something like that
Using entityInQueryIndex is pretty poor for native stream
what do you mean? at runtime?
At conversion
@rotund token is that proper reading? I didn't missed something yes?
There are no linked entity groups in my subscene
Ideally you read it in parallel
The main benefits of stream is lockless multi thread writing and ability to read in parallel without merging
But often you do need to read it in a single thread to use the data
can I change data in native stream while reading it?
What do you mean sorry? You want to write to it during reading?
if I have list/array I can take element at index, change it and write it back
can I do something like that with native stream?
You can only write to a native stream once
That said, if you wanted to get real dirty with pointers there nothing stopping you changing a value
@hot basin I had very similar problems and developed this with tertle: https://github.com/enzi/Entities.Exposed
how did you solve the problem?
with a nativelist that has nearly the same speed as a nativestream for parallel writing
blocks are allocated and reused for writing until there are none left
yeah krajca problem isn't speed atm
it's the fact that nativelist parallel writer is broken in 0.17
and can't be used with deferred job
hence krajca is looking at alternatives
oh damn :/
(i got internet finally woo)
Read returns a ref, so yes
I'm not sure if that's really helpful though, do you iterate 2 or more times over the stream?
in the end it will be in 100 or even 1000
oh, it's persistent?
sadly no
it's an AI for units
so I don't know how many or which type of units there will be
well that's even easier then ๐
so I dynamically gather all and calculate
are you talking about elements in the stream?
yes I do
ah ok, I was asking how often you loop over the full stream because I was confused why you need to write back to the stream
1 write, 1 calculation and 1 read an the end
and the calculation needs the ref?
yes or I would need to somehow connect stream element with an ID
a suppose I could make another stream
with ID + result
if you read multiple times over the full stream I'd try to make a native array out of it. that way you can read faster and the worker threads are more balanced
yeah it will be easier
NativeStream has a quirk that sometimes worker threads do a lot more than others even when the write was totally balanced
never figured out why
but I wanted to explore native stream here in the conversation as I never used them and they seems helpful
NativeStreams are great ๐ I like DreamingImLatios UnsafeParallelBlockList a bit more though
it's not tied to a for each count
just the 128 worker count
as with everything, both have their pros and cons
how should I change native stream into an array between write job and calculation job?
thats basically what my event system uses, just a fixed nativestream with 128 wide
if you are less than 128 though it does add a bit of overhead vs a nativestream
NativeStream has a ToNativeArray method
@hot basin what kind of AI are you going for?
IAUA - infinity axis utility ai
nice soon all of us will have their own implementation of it xD
Mabye you dont want to write back to the stream after the calculation? Pretty sure you could reject alot of scores already and only fill a small list with the highest ones
I gather all the axis and then I'm doing calculations
UAI lover here โ Was working on mine too but halted DOTS for some time ๐
all as from all ais
so I can't assume anything as I don't know relations while calculating
Im not kidding. i bet there are atleast 10 dots implementations from ppl posting in the forums
okay i dont wanna go into details of UAI yet again but i wonder how you want to scale that up.
what do you mean?
unity physics is giving me nothing but trouble. no wonder some of you have written their own spatial query system
I saw one form DreamingImLatios
well dreamings custom physics comes from a different reason
of him fundamentally hating unity physics
if i had the time i would too... physics still takes 5 ms even after reducing collisions to basically 0 (and yes safetycheck etc disabled)
hvae you turned off physics integrity checks?
yes
alot. but alot static
250k! ๐ haha, then it starts the physics death spiral
around 100 non static
yeah i don't think you can have more than around 40k physics elements enzi
anyway just in case someone isn't aware what i mean by integrity checks
this nukes performance
yes this brought physics down from 7 to 5 ms for me
10k kinematic is 2ms for me
wtf am i doing wrong then
well i need to get the framerate higher through other means first anyway
i was simulating like 20k dynamics in less main thread time than 5ms im pretty sure
one problem is that stepphysics runs multiple times.
atm game runs at 30 fps in editor so thats a problem...
hybrid stuff kills performance
the dreaded physics death spiral
yep
really annoying, is there anything to turn off this behaviour?
tertle suggested reducing the tickrate of physics
welcome to fixed update life
you tell it to run 60 frames a second
it will run 60 frames a second ๐
okay this is slightly off topic :
my artist was using 2D Animation Package to animate with inverse kinematics. now they run every frame and take 3.5ms... anyone dealt with this before? how to "bake" the Ik motion into the animation and not have it calculate at runtime
at the very least in editor i usually drop tick rates to 30 for physics/netcode
because editor has a lot of overhead which can keep your fps low
i feel like 0.50 introduced insane editor spikes
i have noticed large chunks of editorupdates
not certain related to 0.50 or not though tbh
well it would be about time
btw thx for the help with the EffectsSystem. It finally works after quite some trouble.
is this normal for physics? so much idle time and only MT thread active
looks like this for me too
i tried to schedule the heavy work before physics so it can fill in some gaps
good idea, this gap sucks really hard
do you know what's going on there?
good thing I have system groups, now I can just move it in front of fixed update
it seems like stepphysics is doing sth heavy on mainthread before it starts to schedule stuff. but i havent looked into it
this is all editor overhead btw
oh god
m_RemainingBlocks = 0;
m_Safety = stream.m_Safety;
CollectionHelper.SetStaticSafetyId(ref m_Safety, ref s_staticSafetyId.Data, "Unity.Collections.NativeStream.Reader");
#endif```
if you run a build and profile it
that fixed string stuff goes away
oh, cool!
hmm i really need to profile in build soon... I was changing to Subscene conversion and alot of stuff broke.. so i couldnt build for like a month now
and my artist is still stuck on some conversion topics
every system that doesn't run with burst runs like shit ... 18 enemies, 2.59ms for the HybridAnimationSystem
what are you doing in that
eh ๐ setting animator values all the time. pretty bad actually
that said, usually those get a decent speed up if you build with il2cpp
at least if you have any logic in there
be nice when we can finally get away from this editor mono
you mean when mono gets replaced with .net core?
yeah
that'll be huge. it's taking a loooong time sadly
i'm not much of a ms fan but their work on c# is solid
hmm i cant profile mine right now but this seems indeed slow.
nvm mine is probably equally slow. i just thought i write to 100 entities but i optimized it already
are we talking 2022 or even longer?
they have moved it so much. I don't know. 2022 or 2023 likely. 2023 is more likely I guess ๐
2025 it is
very naive and unoptimized ๐
more like a prototype if anything
I need to figure out how to best reduce the writes
i love the early out for dead entities comment
haha ๐
mine looks exactly the same. when i said optimized i meant the number of entities i write to. not the code ๐
I have a habit of even commenting really obvious early outs
hmm my animwriter system takes 0.04 ms
just tested with 3 entities. ill test with more
@viral sonnet going back to stream questions, I can't convert stream to array if I don't .Complete() previous job
you should be able to convert it in a job with a handle
you'd have to get the nativearray back somehow. single sized native array with a void* maybe. I think there are better solutions
So with 18 entities i got 0.1 ms
lol damn ๐
anyone has this problem in a system? protected override void OnCreate() { physicsWorldSystem = World.GetExistingSystem<BuildPhysicsWorld>(); mainCamera = UnityEngine.Camera.main; mainCameraTransform = mainCamera.transform; } mainCamera is null in a build
maybe it runs too soon?
Do you have camera with proper tag?
yep, runs fine in editor
public partial class AnimationWriterSys : SystemBase
{
protected override void OnUpdate()
{
Entities
.WithAny<SLOD0,ZombieTag>()
.WithNone<DestroyReq>()
.ForEach((in HybridArtChild hybridArtChild,
in AnimationStateOutput animationState) =>
{
var animator = EntityManager.GetComponentObject<HybridArtManaged>(hybridArtChild.childEntity).animator;
if (animator == null) return;
switch (animationState.abilityAnimationState)
{
case AbilityAnimationState.frontSwing:
animator.SetBool("isAttacking", true);
break;
...//some cases
case AbilityAnimationState.ignore:
animator.SetBool("isAttacking", false);
break;
default:
throw new ArgumentOutOfRangeException();
}
animator.SetBool("isEating", animationState.isEating);
animator.SetBool("isInfecting", animationState.isInfecting);
animator.SetInteger("abilityIndex", animationState.abilityAnimationIndex);
if (animationState.isDying)
{
animator.SetBool("isDying", true);
}
if (Vector3.SqrMagnitude(animationState.moveDirection) > 0.01f)
{
animator.SetBool("isRunning", true);
}
else
{
animator.SetBool("isRunning", false);
}
})
.WithoutBurst().Run();
}
}```
what is the diffrence that costs u so much performance?
could be the triggers
totally the getcomponents and maths
also the local velocity transformation is expensive
i really think in hybrid systems you should do nothing but write data
true, the NHM lookup could also be slow without burst but I don't think it adds this much
hm, I realize now that it runs much more often but fails to get an animator
i didnt expect the diffrence to be this grave. โค๏ธ burst
i want to see the enzi 10x profile marker performance analysis of this job
because im curious
it is indeed the NHM lookup. damn NativeContainers without burst are so slow. 0.043ms with 18 enemies. before I had 50k additional lookups
what kind of magic is this kek
my pepe algorithm is slowing game down during fps drops
if (StartStop)
{
double curTime = Time.ElapsedTime;
if (curTime - _prevTime >= _interval)
{
_prevTime = curTime;
base.OnUpdate();
}
}
pepe algorithm
kek
just remember though safety is extra slow in mono so you can't really tell until you run it in a build
wasnt there a way to control updaterate of systemgroups? fixedratemanager or sth?
yes
but who can work like that ๐
I end up using second stream to gather results
my build had 2 errors. both are fixed and it's still crashing. meh
๐คฃ
this is why i try to make a build every week or so
because tracking down build crashes can be a pain if it's been a long time
it's crashing so hard I fear it might be something unsafe related. I don't get why editor is unaffected
what does the dmp show
phew, at least log is pretty good. I know where it happens
and it's never what you think it is: EntityQueryImpl_GetSingleton_TisHandleCombatEvents_Options from all the things possible. it's a damn singleton component. I think that wants to access before the subscene is loaded. that it ends in "Attempt to access invalid address." is pretty bonkers though
just a note, subscene loading is async
yep, had my pains with it in a netcode project ๐
yeah i wrote a whole management thing for it
that lets me load a bunch of subscenes into a world before the world starts running
so i don't have to a million RequireSingletonForUpdate in my jobs
what is the difference between those?
ah cool, it's manageable with 1 subscene but when you get more than that. eh, it has to be managed
from memory, FixedRateSimpleManager only updates once per frame
I'm looking for one that will smooth out ticks for target
I was trying to find it
Is EntityCommandBuffer.SetSharedComponent not allowed in a burst function?
Bummer
@rotund token got my build up. 1.9ms-2.2ms for the hybrid animation instead of 2.5ms in editor (mostly useless NHM lookups 50k)
yeah, like I said, native containers outside of burst are really slow
i'll add some tag HasAnimator to reduce this ๐
why don't you just attach the object to the entity
too little experience with that. it doesn't change any archetype right?
its 4 bytes from memory
so yes archetype will change
but all the animator ones will be grouped in the same chunk
but HasAnimator will also change the archetype
true, I'll think about it some more. I don't want to make useless optimisations that don't make sense in practice. like, how many casters will actually have no animator?
code confused me how they save MBs. somewhere in an array and the index is saved. guess this will be the 4 bytes you mentioned
why is having an extra archetype with no animator a performance concern?
I don't want the data in the archetype, that is pretty much all my reasoning ๐ I just got it back to a 51 chunk capacity
What package do you need for animating a character in dots 0.5?
Or do you just need to use the standard animator still?
standard animator
i saw a crowd demo with dots not sure if i should post link but i assume they also just used the standard animator?
there's https://github.com/Dreaming381/Kinemation-Skinning-Prototype - haven't tried it though
nah, there was an animation package once but it got dropped
at least dropped until 1.0 has released
yeah, i think i'll wait to experiment with the idea
FixedString32Bytes is the smallest? ๐ฆ
another useless thing in my chunk
Is data like EntityGuid, SceneSection, SceneTag, EditorRenderData also in a build?
bummer that we can't actually see what's the archetype capacity. (other than calculating it ourself)
oh, a unity dev name dropped a profiling tool I didn't know: https://superluminal.eu/
i have a ministring, size 16, 15 character, but burst 1.7 kind of broke it
i havent tested burst 1.8 if they fixed it
I hope I can find a setting so physics doesn't actually collide with anything and I can only use it for spatial querying
put it in a separate physics world?!
wait what? how would that help?
ah, you mean a world where it doesn't actually steps?
PhysicsWorldIndex is what i mean component wise
someone in here managed to get this working and ticking it manually you could run it without the simulation step
It's really nice, using it at work all the time
Havent tried profiling a Unity app with it yet tho'
or just dont put it in the simulation@viral sonnet just use the bvh yourself
use the colliders etc but leave off PhysicsWorldIndex
and then just pass it to the bvh like unity physics does
their bvh is very re-usable
cool thanks! what do you mean "leave off index"?
well if you dont add teh shared component
it wont be put in physics simulation
but you can still use the physics colliders
(purely a theoretical idea, i haven't tried to see how well it works)
I'll play around with it. removing PhysicsWorldIndex certainly stops the physics step
and I'm a dummy. the mentioned NHM lookup is actually a Dictionary, I never figured out to use NHM to save the Animator class
saving it in the archetype sounds more attractive by the minute
hehe, the system vanished. had some free space on the physics entity. needed some data from it anyway
Any idea where this is coming from?
Too many debug lines added during the frame (max 10240 can be added from jobs). Some lines have been dropped.
To avoid this please pass "-debug-line-buffer-size <size>" on the command line or add to boot config
There is nothing being printed to console ๐คท
have you disabled one of the messages?
Nope
hm, never had this error
somewhere it will log though, such an error doesn't come out of nowhere
I have some acceptable numbers now from physics. 14ms with 250k colliders. no dirty hacks. I set the physics step to no physics and removed the rigid body from the entities. unity says they will be now static but they can still change position and spatial querying works fine. (with AI pathing)
there's some drifting at first because for some reason all enemies spawn on the same position. - bug aside, pretty acceptable for what it is. - I tried now with physics on for the steps and it doesn't make a difference. removing the physics body is enough
I do basically the same thing, just use the physics system for querying and use character controllers for movement
Granted the game is 2d and has no complex physics anyways ๐คท
hmm interesting. id like to actually use collisions though. i would only need active colliders around the player. maybe i can disable the colliders for the rest of the simulation.
Hmm
is there an option to have random without individual components?
what can I tie it to?
I tried to tie it to LocalToWorld position value
but that ends up with 0
sometimes
leading to exceptions
im not sure what you mean by this
float3 pos = ltw.Position;
var rand = new Random();
rand.InitState((uint)pos.x);
float2 deltaPos = rand.NextFloat2(MINWanderRadius, MAXWanderRadius);
this fails sometimes
well anytime pos is 0
why cant it be at same pos x?
but anyway
(1,1), (1, 123414)
i usually just generate random outside job using unitys random to give initial seed
I'v seen option with adding Random to entity as component
I kind of look for a way
rn to also make a random that will replicate itself
under same circumstances
To combat save scumming a bit xD
eh, seems like adding it as component is the only way
A little bit extra knowledge... A few years ago I was testing the new random struct and found that skmilar (close in value) seeds produced similar results. Don't know if that has changed.
hmm
is there a way
during conversion
to query through interface?
Basically I want to be able to add to certain Components declarations my interface
and then during conversion in case any entity has component with that interface
add another component
meanwhile I don't want to add interface to authoring monos
only to entity comp
componenttype cant be an interface
not component type
but Component itself
AIList[0].GetType().GetInterfaces()
I think I'm unto smth
kek
it's array of componenttypes
you can gettype from ComponentType
yeaaah
var type = TypeManager.GetType(componentType.TypeIndex);```
something like that
actually theres a shortcut componentType.GetManagedType()
i guess
which just does the same thing under the hood
foreach (var type in AIList)
{
foreach (var interfaces in type.GetManagedType().GetInterfaces())
{
if (interfaces == typeof(IRandomComponent))
{
}
}
}
so is that it?
i think that'd work
can't figure out why it won't show up in inspector
hmm
oh wait
me dum d um
Is it even possible to do such thing?
I know
it woul djust be an int though (+ access mode)
you could write your own component type with a drop down easy enough
just make a custom inspector with
TypeManager.AllTypes
THAT SAID type index is not stable
if you make a build your component type index will be different to editor
hm
you can use StableTypeHash which is stable
UNLESS you ever make any change
add/remove a field
reorder fields
change namespace
change name
etc
i went the roundabout way and wrapping the type into a scriptable object
I simply need it for a system that will automatically add Random component to AI agents that require it
entity query
any {all components that need random}
none {random}
well, that's the thing
but he wants to do it with an interface
I want to do it through interface
not hardcoding
because I want to have oepn doors for modders, that would add new components that might require it
but you wouldnt need a random component per component. couldnt those modders add their own RadnomAuthoringComp if they wanted to
use write groups
if you care about modding everything you do should be setup as a writegroup
yes
still writegroup doesnt solve his randomComponent problem does it?
it kind of does
I just need to do 1 query
question is, whether I can do it in conversion system
basically, once all other components are already added
why does this not set the localToParent?
commandBuffer.AddComponent<LocalToParent>(entityInQueryIndex, newEnt);
commandBuffer.SetComponent<LocalToParent>(entityInQueryIndex, newEnt, new LocalToParent
{
Value = localToParent
});
the entities in the editor havent had their LocalToParent changed at all
is it possible to get ComponentType list from write group?
hm
feels so bad ngl
I can't figure out a way to do it
the problem you are having is that the translation component is probably set to 0,0,0
So as soon as the LocalToWorld System runs it resets your LocalToWorld to 0,0,0
if it is a static entity you can remove translation from it. If it needs translation you need to set translation instead of LocalToWorld (or set both)
ups sry i didnt see its LocalToParent. Still the same applies. Translation writes to LocalToParent
thanks
yeah seems I can set translation but not localtoparent
the localtoparent updates with translation changes automatically
you can. its just overwritten if you dont set translation. if you need the correct position in the first frame you probably should set both
ahh gotcha
I assumed if you set one or the other, the other would be automatically calculated
but only works one way
yes. its advised to only read from LocalToParent / LocalToWorld and write to translation/Rotation/Scale
ofc for performance reasons you could want to write to LocalToWorld in some cases but then you need to take extra care with how you use the other components
an example of this is the boids sample
where they have a custom component overriding the writegroup of the localtoworld
to take ownership of writing to it
Could someone explain me why a "burst compiled" job would perform better than without? I understand that it uses LLVM under the hood, but I do not understand why unity's JIT couldn't achieve the same, and even less why burst has to be explicitly added instead of being an implementation detail
because burst has restrictions
i.e. no managed data
because of this it can make assumptions about your code
And it could be handled by the compiler
and perform optimizations on those assumptions
apart from that, yes llvm and the ability to vectorize parts or all your code
And unity's jit/aot technologies cannot auto vectorize?
i should point out, unitys current mono jit is very old/slow and things like il2cpp or .net 6 can compile much better code getting closer to burst performance
maybe only 20-30% slower for general scalar code
I see, though it is still weird that the annotation is mandatory instead of the compiler being an implementation detail. Or at least only present for compile time errors to ensure efficient compilation
the reason the attribute is required is mostly just for editor speed
its much faster to just lookup attributes than to check every piece of code it verify its burst compilable
fair enough
you dont really want to tab back into editor and wait 30 seconds for burst to figure out what it can compile
And isnt there any overhead going from managed code (jit) to foreign functions? It is at least the case on the JVM, in which case I'd expect small burst jobs to perform poorly
there is but its much smaller than the general speedup you get
however this is why its recommended to not have simple function pointers for example
int Add(int a, int b) => a + b```
As the overhead would be more than any speedup
Alright, thanks for the explanations :)
wait what
burstcompile works in such way?
Oh man, feels so good
2k potential targets, 1k lookers
All processed in less than 2 ms
do you use any spatial sorting?
Hello
Please tell me the sources where i can read about frustum culling and occlusion culling for dots ecs?
for every looker?
i wonder if sorting them into spatial buckets wouldn't be much faster
still NativeMultiHashMap but with bucket id as key etc
it was stress test tho
in real conditions
It'd be way more gentle
smth like 30 potential targets tops
don't get me wrong, it's insane speed already ๐
I just wonder if such techniques have a place in DOTS
idk about sorting
but overall dots is perfect for my case
basically a huge sim
of thousands of agents
can I get Entity in IJobEntityBatch?
var entities = batchInChunk.GetNativeArray(new EntityTypeHandle()); is this a proper way?
no
Get entity type handle
like component type handle
in systembase
and then assign it to field
so var entities = batchInChunk.GetNativeArray(entityTypeHandle); and entityTypeHandle = GetEntityTypeHandle(), in system?
yeah
thanks!
entities array is literally same as component arrays
ngl tho, so far I realised
that using jobs is meh compared to ForEach loop
xD
the only good side I noticed is that you can access shared component id
once I got rid of such need
I moved it all to foreach
meanwhile foreach loop always looks good on system debugger, while counting query count
Is the hybrid renderer supported on the switch platform?
Is dots even supported on switch?
afaik hybrid rendering requires HDRP which isn't available on switch
@valid hazel its says right there that it is not validated for mobile and consoles.
It can work but you will be alone with your troubles.
does any know how to implement state machine in dots?
@pine plaza there are multiple ways. how you wanna do it depends on the usecase u need it for. IMO there is no 1 right solution to fit all.
to name a few:
- Add and Remove StateComponents from entity. Might be good if you have very rare state changes -> structural changes
- enabled and disabled component for each state on the entity -> no structural changes needed but polling all states every frame
- enum in a component. switch in a system
- polymorphic components from PhilSA. See the example in the readme
Any debugging tips? Everything works fine except if I spawn a lot of entities, then a lot of things get spawned in an ECB, and my game hangs and eats massive amounts of memory. No idea what is going on
The last point I can see in Rider where it hangs is EntityCommandBufferSystem.FlushPendingBuffers, specifically m_ProducerHandle.Complete()
I have no idea what dependency this is waiting on though
What do you mean by alot of things get spawned in an ECB. do you refer to the entities you instantiate in ECB?
Yes
so how many entities are we talking about?
There are 9000 things in the list that is run through, and per spawned entity about 10 values get written to the ECB
I dont know how Instanciating prefabs is done in ecb. maybe multiple commands are set per Instantiate to remap entities or sth? Or do you do some setup logic for each Instanciated prefab. like setting position
I use ECB.Instantiate to spawn an entity prefab, and then overwrite some component values
well thats where those commands come from then
Yeah but I don't feel like even 90000 commands would take up 8 gigabytes of memory
When it was 2 GB before
those commands should not be whats taking the memory. its the spawned entities
I don't think 9000 entities would take up 8 gb
yes they wouldnt.
sometimes its best not to use the ECB to instantiate entities
its some editor stuff i guess. i have memory problems too
did you profile it in build?
Not yet
I assume the alternative is write it to buffers and then use the batch functions?
it might be faster to just use EntityManager.Instantiate
ecb in some cases just creates more work than is needed
Would probably be tricky since I don't even know what type of entity is being spawned ahead of time
doesnt it literally call the entitymanager functions? 0.o
yeah but your using I presume a job to queue up commands and then play them back on the main thread
yah batching + setup entities is a pain anyways
Yeah
that takes way time than just using the entmanager.instantiate
I can create thousands almost instantly just by using entmanager
I'm not sure how I would do that though. The archetypes aren't even the same for all spawned entities
are you using batch commands or one by one?
you can just use ordinary entityquerys surely
entmanager.instantiate can accept a nativearray of entity's as an argument
Yes, that's batch mode.
How do you set up individual entity positions then?
yeah it took me a while to find that out
I just do a simple for loop after would
on the original nativearray of entitys
i see. but honestly why spawn 1000 entities in one frame ๐
Yeah I think the smartest thing is just to limit it to 100 or whatever per frame
I'd still like to actually debug it and see what is going on that takes so long and uses so much memory
because its really quick and fast, I'm pretty sure I can do close to 100,000 in under a millisecond
yes you can with batchcommands. but is that the best design you can go for?
You will still run into problems naively modifying component data, since it will cause a lot of memory copying
sure if you have a spacebattle with 100000k spaceships fireing i see the point.
really?
I would assume so? Adding a component will change the archetype of the entity
no you would have the components already on the prefabs and only write to them
Ah I thought you meant spawning "empty" entities
I don't generally do much adding of components in things like that, I just pre-create the archetype and use that and set its components data
Isn't there a batch function to set component data for a set of entities?
maybe I havent used it yet
whats the point though. to create an array of data for the batching you need to loop over sth anyways. can do that once later too
I can write the data from multiple threads, then a single call to EntityManager can set it
yeah unity's method would likely be more efficient than anything we can do manually
I guess Ill try just writing the entity's to spawn to a list and then actually create them on the main thread in batches, see how that goes
yeah its still just a delayed playback system though
personally I wouldn't use ecb unless I absolutely have to
I'm not an expert though
thats the whole point of command buffers. i dont use Entitymanager if i dont absolutely have to lol
the ecb is using the entitymanager though
yes thats the point. its just at another point in time.
you reduce syncpoints that way
and what do you use? also EntutyManager
Sure if you manage everything correctly and manually set all your systems using entitymanager together at syncpoints then its fine. but sooooo much more work
don't understand in which aspect ECB would broke it
yeah I guess if you want to schedule your sync points better then its good for that
and u wont get much if any performance
This goes back to my point of being confused what is actually crashing the game
its probably tooling lol
What do you mean?
All the debug stuff for entities might have a big memory consumption. i never checked but my editor is eating tons of memory
Hmm, guess I'll test in a build
in profiler it shows my entities is around 5mb or sth
but i dont know if that includes hybrid components not stored in chunks
Very annoying though that it seems to be impossible to figure out what is currently running
welcome to multithreading ๐
It's more the issue of the native code
I would need to build and debug the C++ build
but to be fair, "running currently" is what your main thread is doing
Yo, I have a gameobject with lots of child objects... How do I weld em all together so its a single entity?
you do it in conversion. there is no magic to do that for you
for static hierarchies you might wanna use the staticoptimizeentity component
Oh it welds it in conversion? Cool
no you have to weld it in conversion.
Ok, is there a proper term for welding so I can googlify it?
Thanks much
Its okay, seems like its working now
Here, let me show you, its funny!
If you have childgameobjects which should add components to the resulting parententity you need to do this in your authoring components. id say you shouldnt build your authoring like that in the first place.
Straight this is funny, I had an asset of Elon Musk's car I had in orbit of Mars way before the politics stuff happened: https://youtu.be/vytdbGtTKb4
Proof of Achievements no other gamer has: #1 world ladder Starcraft #1 World ladder Broodwar, #1 World ladder Warcraft3 at 200-0, first to 1500 wins Warcraft3, #1 World Diablo2 Hardcore experience ladder, #1 score Pittsburgh without Turtle Tip 1989 Nintendo World Championships, #1 world C&C3, #1 World SC2v2/l https://www.crystalfighter.com/achie...
Funny for me, but I'm weird
not sure how this has to do with your hierarchy problem though ๐
Well Elon's car was all sub childrened out and wasn't colliding
It had a complaint it wasn't childrening
Turns out I was doing the wrong inject method, which you led me to by talking about the convert process
I am reducing scope of my mmo to bare minimum
Which I thought would be SOL instead of all the star systems in the Milky Way
Now I realized a Mars base done bad would last a long time... So I am just starting with one random junk yard scrap system
Which lends itself to creativity: Just throw stuff out there, finally having fun
VICTORY. I made the AStar system from value types only, it can cross between "worlds" (parts of the same graph that are technically in the same space but on different planes- useful for crossing through interiors vs exteriors), the whole thing can be serialized and deserialized on a "One File Per Node" basis (simplifying the serialization and allowing git collaboration without conflicts on the serialized graph), and on top of that, it can be burst compiled!
The last step is to make a KD tree for much, much faster nearest neighbor searching. Which I don't know how to make yet. But i'll figure it out.
sounds great! wish i had bursted pathfinding :S
this isn't the unity navmesh though, this is a hand-placed node graph for more granular pathfinding for off-screen NPC movement
also on my wishlist xD
You also need an attribute on outer class but yes, you can shortcut function pointers
For a function pointer? Well it's not related to entities it's a burst feature
But MonoPInvokeCallbackAttribute is still required for il2cpp builds
hm
That function didn't seem to be related to entities either
Did I understand correctly, that this attribute can be applied to any (burstable) method?
yes (well it needs to be static)
public static class FunctionTest
{
[BurstCompile]
public static int Add(int a, int b)
{
return a + b;
}
}```
you'll want
[MonoPInvokeCallback(typeof(Func<int, int, int>))]
for the sake of il2cpp on the method
but yeah this works fine
i want to say this was allowed since burst ~1.5
it's been quite a while anyway
pretty sure burst up until recently supports 2019
that's a new one.
Nonsensical!
At least the error has a whimsical sense of humor.
How is this triggering a write? I see only reads: DynamicBuffer<TriggerIgnoreBufferElement> beB = World.DefaultGameObjectInjectionWorld.EntityManager.GetBuffer<TriggerIgnoreBufferElement>(entityB);
That's poor error formatting, I'll return to text only.
thats a write right there
ok so I have no idea what this neabs
I'm just adding a struct to a list
here's the stack trace and relevant code
[System.Serializable]
public struct KDPoint
{
public byte d;
public float3 point; //theoretically this is redundant
//-1 is no child
public int leftNode; //left node index
public int rightNode; //right node index
}
public struct KDTree //specifically for 3 dimensions
{
public NativeList<KDPoint> nodes;
public KDTree(int defaultLength, Allocator allocator = Allocator.Persistent)
{
nodes = new NativeList<KDPoint>(defaultLength, allocator);
Debug.Log("KD tree allocated");
}
public void addPoint(float3 p)
{
KDPoint newPoint = new KDPoint
{
point = p,
d = newD,
leftNode = -1,
rightNode = -1
};
nodes.Add(newPoint); //HERE
the error basically means you're trying to resize to a negative value
the question is what in your code is doing this
my best guess is you're calling addPoint on a KidTree that hasn't been instantiated via your constructor
so it's invalid memory
it's been constructed, since the debug.log message appears, the stack trace follows a constructed instance, and unity panics that I haven't deallocated the list, since I don;t get the chance to before it goes boom
well your log only implies that a KdTree has been instantiated, not necessarily the one you're referencing
without seeing the kdtree file we can't really see what is setup wrong
as the stack trace implies, I am creating it through the factory at the end of the file there
hmmmmmmmmmmmmm
and the debug points . length shows me 2, as expected
so im not instantiating it with 0 length or something
the error says it's on line 72 by the way
yeah i cant see anything obviously wrong
i'm going to give it a run at some point when i have free time
and see if i can repo it
huh. changing Add to AddNoResize (because I already instantiated it with the correct size) causes this error.
what does the requested length mean?
what is going on ๐ซ
but anyway
what htis error is saying
you set capacity to 2
but it's trying to add a 3rd element
so it's definitely not been setup to the correct size for the logic
yeah hm.
also it shouldn't be adding a 3rd element. i need to do some testing
Okay, it's instantiated now for capacity 4, adds two elements, and then goes pppbtht
It will run all jobs on the mainthread?
all jobs will run on mainthread, there will be no parallel work
Awesome, that's exactly what I need
useful for debugging and potentially dedicated servers
Also why dedicated servers? For determinism?
and I initialize my native list with a capacity of defaultLength + 1, which is 3, but then it says my capacity is 4? somthing is fishy...
there's overhead for running code in parallel
if you're running a bunch of instances on the same machine it can be more efficient to just run each instance on a single thread
rather than running each instance over multiple threads interfering with each other
๐
Also any other tips on debugging? Everything on my project works fine and then it will randomly stall and commit 30+gb of memory, then crash
It's locking on a dependency, but if I interrupt with rider I can't find what the issue is
I assume it's an infinite loop somewhere, I don't think anything else could take that much memory
and instead using a nativearray creates an infinite loop. What.
yeah see i thought an infinite loop could be the problem
but i couldn't figure out how it would go to a negative length unless you added 2.1billion elements
which i thought would cause issues earlier
i uh hope im not adding 2.1 billion elements
also I have no idea how there could be an infinite loop
add is only called twice
The stack trace says it's in the factory function, but for the record I am calling it like this:
print("Building KD tree");
IOD.NPCGranularNavigationSystem.KDTree.KDTree kd = IOD.NPCGranularNavigationSystem.KDTree.KDTreeFactory.buildTree(
(from p in nodeList.ToArray() where p.worldIndex == 0 select p.position).ToArray() //??? error here???
);
print(JsonUtility.ToJson(kd, true));
kd.Dispose();
the LINQ statement produces a length of 2 which is expected
this is in a different file
@white island
you have a loop
for (int i = 0; i < nodes.Length; i++)
in this loop you add a point
nodes.Add(newPoint);
increasing nodes.length
... youre right.
as it keeps expanding
it keeps going
got it
it should be capacity instead
and i gotta be sure to actually return from the function, whoop[s
ok. that did it. Thanks. Lmfao
sometimes I'm blind to my own code
does collisionWorld.OverlapSphere actually have a cap? like, does the NativeList keep growing over the start capacity?
dont think it's capped
you can cap it if you want
or custom filter it
and all sorts of things
(physics is very flexible for this)
I hate code that ends in interfaces ... lol - yeah, how can I cap it?
OverlapSphereCustom
and implement your own ICollector<DistanceHit>
the default overlap sphere just creates an all hits collector from your list
where T : struct, ICollidable
{
var collector = new AllHitsCollector<DistanceHit>(radius, ref outHits);
return target.OverlapSphereCustom(position, radius, ref collector, filter, queryInteraction);
}
physics provides a few defaults for you
but you can implement any with custom rules you want
ah, so I early out in the AddHit when the cap is reached?
pretty much
๐คทโโ๏ธ
it's a pretty obscure use case
i've never considered a need for something like that
pretty normal for RPG skills. hit N closest or smth
yeah that seems like a reasonable use case
i believe from memory it does add them in distance order
do you know what the return value of public bool AddHit(T hit) is?
{
return false;
}``` only found this false in QueryInteractionCollector
based off that code alone seems like whether it should fire physics events ๐ค
but honestly i dont know havent looked
well, at least I know where to start. it's late and I'm not getting some of these implementations. like ClosestHitCollector is just overwriting m_ClosestHit.
ah, comment above // Called when the query hits something // Return true to accept the hit, or false to ignore it
{
hadHit |= leafProcessor.ColliderCastLeaf(input, hitData[i], ref collector);
if (collector.EarlyOutOnFirstHit && hadHit)
{
return true;
}
}``` I found some more answers but the ClosestHitCollector is still a mystery to me how it actually works with the code and no early out
good thing is that I can control breaking the loop after the cap has been hit with setting EarlyOutOnFirstHit
oh actually i think i was backwards
closest hit is last
which is what the ClosestHitCollector relies on
now it makes sense ๐
and my cap collector wouldn't work. eh, I'll think of something else. no biggie
i need to debug this to confirm. so the list I get back has the farthest first
i believe so
i think i've used this before
so if you only care about x closest hits
just take it from the end
yep, easy enough
but yeah you'll want to check this
and maybe add in an assert just to confirm in case unity ever changes this behaviour
initially I wanted to cap the memory allocations. but with the nearest last, this doesn't really work out
i haven't used it before
but you could try maybe UnsafeRingQueue
but i have a feeling this doesn't actually loop ๐ฆ
which i thought it did
oh well
interesting concept though
but yeah basically just use a native array and index % length
you also get the count from memory on return
yeah NumHits
would always replace the furthest away
what do you mean with this? NumHits is only set internally in the collector. I don't get the hitCount from the for loop
eh, something for tomorrow ๐ Have a good night all o/
isn't it written to the collector which you pass in
and it's passed by ref so you should be able to read it after?
Hello, what can cause such a load in this job?
I'm guessing high number of children in your hierarchy
every entity has no more than 6 - 7 children
and as I can see by colours, you have burst turned off?
oops
Hello. Anyone know what kind of performance difference to expect out of a 2D game in Dots. I remember the early demos, zombie games, and Dots cameras, boids, etc, but since they've changed to a more hybrid approach recently , what are the current performance gains and are there any current examples?
Depends.
Biggest con of ECS is that it takes a lot of perfomance price for scheduling stuff
But with that price you get an open gate to jobified and threaded jobs, which show themselves on scale