#archived-dots

1 messages ยท Page 45 of 1

viral sonnet
#

rarely. can't say never but it's not at the point that it annoys me ^^

rotund token
#

i've found it really dependent on my library

#

and i think there is a correlation between number of scriptable objects that are referenced by subscene

#

though data is small and could be completely unrelated

viral sonnet
#

i haven't changed authoring comps in a long time. maybe that's a reason it's mostly stable for me

rotund token
#

personally i haven't seen any difference in frequency in any version between b6 and b14

#

all just fail as much as each other

viral sonnet
#

haha

#

i've not seen any references to this problem in known issues

#

so that's a bit concerning

rotund token
#

i wrote a little interface that let's me replicate baking at runtime

robust scaffold
# viral sonnet so that's a bit concerning

They know it exists. My bug report on some asset database bug got an internal marker for tracking to fix by the time it enters prerelease status. The known issues I think are for core module bugs in Unity. The stuff that ships with the editor.

rotund token
#

i was finding writing unit tests really annoying with bakers

viral sonnet
#

asset database is not core?

robust scaffold
#

It is but it hasnt been a problem until DOTS decided to do fancy things with it

viral sonnet
#

huh okay, i thought this is a global problem, not just related to dots

robust scaffold
#

Has anyone outside of dots reported similar compilation problems?

viral sonnet
#

no idea but then again i haven't even read about it in the dots forum

robust scaffold
#

true... i wonder why

rotund token
#

i'm pretty sure it's a core engine issue

#

it just manifests in the separate processes that baking uses

robust scaffold
#

It's kinda blatant the bug when just creating a new file causes subscene corruption

viral sonnet
#

were you making a repo case?

rotund token
#

i have a 100% repo - recompile ๐Ÿ˜„

viral sonnet
#

lol

#

now i'm scared of making a new file! ๐Ÿ˜„

rotund token
#

i have found i can minimize the effect of this bug by not coding bugs ๐Ÿ˜„

#

reduces recompiling

safe lintel
#

corruption as in gotta clear subscene cache or gotta remake the actual unity scene file?

robust scaffold
#

It's very convenient that unloading a scene (full scene) closes all the subscenes within it so I just need to unload the main scene and re-enter play mode to test instead of unchecking every single one of my subscenes whenever I need to go through this song and dance when I forget to close out of the editor before creating a new file. Incredibly annoying altogether and hopefully fixed sooner rather than later.

safe lintel
#

ah that dance. just downloaded b16 and hoping that has some fixes for that

drowsy pagoda
#

Do Baking Systems work in the same way as Bakers on build the baking systems will not execute right? They run during build and that's it right?

rotund token
#

yes baking systems only execute during bake

deft pilot
#

in 2022.2

rustic rain
#

has been here for a while

deft pilot
#

If it does I cant seem to access it

#

ToArray no longer returns a managed array according to the ide

#

And also takes in an allocator

rustic rain
#

๐Ÿค”

rustic rain
deft pilot
#

yeah ofc

rustic rain
#

is it referenced in current assembly?

#

this is collections extension

deft pilot
#

is it its own namespace or something?

#

i don't have it

worn umbra
#

@robust scaffold thank you very much for your help. I solved my problem. I had everything right but I was not setting NetworkStreamInGame on the server-side for the client connection. I did it just on the client-side. Therefore it didn't properly started the connection. Do you have any site, where I can buy you a coffee? I would like to appreciate you were helping me.

dense crypt
#

How can I temporarily remove an entity from physics (like it never exists)? I intend to enable it again later. But I'd like to keep the entity enabled for quering other components

rustic rain
coarse turtle
robust scaffold
covert lagoon
#

I found out that I have to use ComponentSystemBase.GetBufferTypeHandle instead, but ArchetypeChunk.GetNativeArray only accepts a ComponentTypeHandle, not a BufferTypeHandle, so what do I do?

#

Nevermind I just found ArchetypeChunk.GetBufferAccessor.

solemn hollow
#

In a baking system i need to gather buffers from additional entities back to the main entity. unity is telling me that the lookup is defined as WriteOnly but i also read from it. Is there a way to disable this error? I can guarantee that there is no read from buffers i write to

                Entity e, in NavModifierMainEntity navModifierMainEntity) =>
            {
                var subModifierBuffer = navModifierSettingsBufferLookup[e];
                var mainModifierBuffer = navModifierSettingsBufferLookup[navModifierMainEntity.entity];
                mainModifierBuffer.AddRange(subModifierBuffer.AsNativeArray());
            }).Schedule(Dependency);```
#

or do i really have to use a different buffer?

safe lintel
#

@dense crypt i think you can just remove the physicsworldindex from it(just remember the actual value if you happen to have multiple physics worlds)

#

oh didnt see issue's post. gotta drink more coffee

vernal cypress
#

Hey, Do you know how dependencies are resolved between jobs in the same system ? let's say i schedule one job after the other, will the run concurrently or one after the other ?

rustic rain
#

I'm guessing those are IJE?

#

if you want them in parallel, use Dependency property from state for parameter and store output jobhandle

#

and then assign that dependency property to JobHande.Combine of those 2

vernal cypress
#

thanks ! yes thoses are IJobEntities

rustic rain
#

for clarification - take a look at codegen behind the scenes

#

it's in other part of this partial struct of system

vernal cypress
#

good to know how to run them in parallel but i actually want them one after the other

edgy fulcrum
#

@vernal cypress then just change the second job's schedule to depend on the first job

#

e.g. var starterJob = new NavQueryJob().schedule(Dependency); var disposalJob = new DisposalJob().Schedule(starterJob); disposalJob.Complete();

rotund token
coarse turtle
rotund token
#

edit

coarse turtle
#

oh cool, do you think you can share how it's done? (I want to move away from creating the entities in set up to test some things)

rotund token
#

is what my baker looks like right

    {
        /// <inheritdoc/>
        public override void Bake(EffectAuthoring authoring)
        {
            var effectBuilder = new EffectBuilder(Allocator.Temp);

            authoring.LifeCycle.With(ref effectBuilder);
            authoring.Conditions.With(ref effectBuilder);

            authoring.Stats.With(ref effectBuilder);
            authoring.AddTagAuthoring.With(ref effectBuilder);
            authoring.ModifyEffects.With(ref effectBuilder);
            authoring.createEffect.With(this, ref effectBuilder);
            authoring.General.With(ref effectBuilder);

            var bakerConverter = new BakerConvert(this);
            effectBuilder.Build(ref bakerConverter);
        }
    }```

and for example a test
public abstract class EffectTestFixture : ECSTestsFixture
{
    // ...
    public override void Setup()
    {
        base.Setup();

        this.blobAssetStore = new BlobAssetStore(64);
        this.EffectEntity = this.Manager.CreateEntity();
        this.converter = new EntityManagerConvert(this.Manager, this.EffectEntity, this.blobAssetStore);
    }
    // ...
}

    [Test]
    public void CooldownDurationTest()
    {
        new EffectBuilder(Allocator.Temp).WithActiveCooldown(2).WithActiveDuration(1).Build(ref this.Converter);```
#

there's nothing crazy going on here

#
    {
        void AddBlobAsset<T>(ref BlobAssetReference<T> blobAssetReference, out Hash128 objectHash)
            where T : unmanaged;

        void AddComponent<T>()
            where T : unmanaged, IComponentData;

        void AddComponent<T>(in T component)
            where T : unmanaged, IComponentData;

        DynamicBuffer<T> AddBuffer<T>()
            where T : unmanaged, IBufferElementData;
    }```
just a tiny interface
#

and implementations for baker/em/ecb/ecbp

true mirage
#

Can we use properties in struct to encapsulate in job system? and if yes, is it OK instead of simple public fields?
and do you know a priority queue implementation which works with job system?

rotund token
#

you can use properties though generally not recommended except to present data in a specific way (i.e. avoid logic)

#

note properties won't appear in your inspector in unity

coarse turtle
rotund token
#

but it should make my tests much more maintainable

#

as i can update the various builders and the test will have correct data

#

my 1 issue with unit tests has always been maintainability

#

writing them is fine, but maintaining such a drag

true mirage
#

I said I want to use that struct in job system

rotund token
#

ok maybe i misunderstood what you are using properties on

true mirage
#

Don't need inspector

rotund token
#

is it the job struct not the component?

true mirage
#

Yes

rotund token
#

ok i read it as properties on components which is a common request

#

not sure i've ever had someone ask about properties on job structs

#

i see no reason it wouldn't work

#

though not sure i've ever seen anyone do it

true mirage
#

For example, instead of changing a field and then write another line to set another field in the next line, change the second field inside the first property
The second field value is dependent

rotund token
#

is this for setting up the job struct?

#

or from within during Execute

true mirage
#

In job, Field A can change, so Field B value changes because of Field A (it is getter)

#

B= A+C

rotund token
#

hmm this has a bit of a risk involved

#

if you're using a parallel job

#

avoid doing a ScheduleByRef if your storing state inside the job

#

also note that the same struct is re-used between chunks of work

true mirage
#

Also, if there is a big array (readonly when executing a job but can change in different situation with low frequency), I should keep that array as a NativeArray persistent?

#

or when I want to execute a job, copy it and make a native array based on it

rotund token
#

if you're changing it then i think its best to just keep it as a native array

#

especially if it's big

true mirage
#

It is worth noting, a job works in a section of that 3d array, a 3d slice

true mirage
#

I am worried if I have trouble when I want to work with it as a simple array (OOP) because probably, I will use job only for some specific parts

rotund token
#

nothing stopping you using the native array in OOP

#

if you need it in array[] for a specific API

#

you can make the native array from the [] and have them point at the same memory

true mirage
#

@rotund token Thanks dude, I ask more in the future

rotund token
# true mirage <@133111808562036737> Thanks dude, I ask more in the future
        private GCHandle handle;
        private NativeArray<int> myNativeArray;

        protected override void OnCreate()
        {
            this.handle = GCHandle.Alloc(this.myArray, GCHandleType.Pinned);

            unsafe
            {
                var addr = this.handle.AddrOfPinnedObject();

                this.myNativeArray = NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray<int>((void*)addr, this.myArray.Length, Allocator.None);
#if ENABLE_UNITY_COLLECTIONS_CHECKS
                NativeArrayUnsafeUtility.SetAtomicSafetyHandle(ref this.myNativeArray, AtomicSafetyHandle.Create());
#endif
            }
        }

        protected override void OnDestroy()
        {
            this.handle.Free();
        }```
#

myArray and myNativeArray will point to the same memory

#

if you change one the other one will be affected

#

this way you can use both a native array and regular array without needing to memcpy between them

#

just make sure you free the handle

covert spire
#

What is the best way to have a Dictionary in ECS 1.0? I have a system that determines which objects need to spawn given a position. However, I need a quick way to determine if the object is already spawned. I would like to have a list/dictionary of items that have spawned, and be able to do if (!dictionary.Contains(spawnPoint)) SpawnObject(spawnPoint); or something like that. DynamicBuffer does not seem to support Contains, and I really don't want to iterate over every element in a dynamic buffer and check if (element.position == spawnPoint) found = true; or anything like that

rotund token
#

NativeHashMap<TKey, TValue> is the dictionary in collections (also NativeParallelHashMap if you need support to write in parallel)

#

DynamicBuffer does not seem to support Contains
buffer.AsArray().Contains(X)

covert spire
#

is one preferable over the other? is AsArray() okay to run every update?

rotund token
#

AsArray is just a reinterpretation of the buffer

#

it's not a copy

#

it's as costly as looking up buffer[0]

#

you can cache it if you are doing multiple iterations/lookups

covert spire
#

What is the most efficient way to create new entities? Spawning from a prefab using Instantiate, or CreateEntity with an archetype? Can you instantiate from an Aspect? I'm a bit fuzzy on the difference between archetypes and aspects

rotund token
#

Spawning from a prefab using Instantiate, or CreateEntity with an archetype
they'd probably be the same

#

though spawning using instantiate might already set a bunch of values

#

which would be more efficient than having to set them yourself

#

so ideally you should be doing instantiates instead of create

devout prairie
#

I was wondering if ECS benefits from pooling objects for spawning

#

So for example build up a pool of x number items over several frames so they are available to spawn, rather than instantiate all at once

rustic rain
devout prairie
#

I guess ECS would benefit from that just the same

rustic rain
#

if it's continious instantiation/destruction

#

it's GC thing

devout prairie
#

Yep

rustic rain
#

not really to OOP/ECS

devout prairie
#

I suppose GC is still a factor even within ECS, never actually considered that

covert spire
#

How do I append to a singleton buffer? Getting "Invalidated by structural change" errors. I see that i can use ecb.AppendToBuffer but that requires an entity, and I have used SystemAPI.GetSingletonBuffer to get a reference to the buffer

rustic rain
#

at least by safety system

covert spire
rustic rain
#

structural change = entity/component add/remove

covert spire
#

my code has not done any of that

#

doesn't it occur when the buffer location needs to change?

rotund token
#

i'm not sure there's much benefit in pooling entities over instantiating

#

it's basically the exact same structural change

#

(assuming pooling is done adding Disabled)

#

the best way to instantiate lots of entities is EM.Instantiate batch overload

#

it's magnitudes faster than individual instantiation

viral sonnet
#

yeah at some point you can reduce it down to the costs of memcpy

#

em batch instantiate is insanely fast

devout prairie
#

interesting

devout prairie
#

I instantiate a lot of ragdolls, usually spread over a number of frames, but I think even one prefab with joints and colliders has a certain cost

#

Maybe impossible to avoid that in the case of prefabs with physics setups

covert spire
#

What is the difference between an ECB and state.EntityManager? I have an ISystem and ecb.CreateEntity does not work in Update, but if I run state.EntityManager.CreateEntity, then it works

solemn hollow
#

its probably some very easy solution i miss

viral sonnet
covert spire
#

then in the job you do ecb.createentity or what have you

viral sonnet
#

i don't know for sure about the dispose. some weeks ago it was said we don't need to anymore (in ISystem) and my baking ISystem since then has no dispose call anymore. no leaks, although leak detection is not working anymore according to other posts. so, better save than sorry, and dispose ๐Ÿ™‚

rotund token
#

But I don't get where the write only is coming from

#

That nearly 100% of the time means safety not setup since no one actually marks writeonly

#

Can you show code outside job

#

Also you're using schedule

#

So you don't even need to disable parallel for safety

#

And why do you have it twice

robust scaffold
#

I lost the circle thing next to the hierarchy to see systems and non-subscene entities. Does anyone know how to get it back?

#

This circle thing

balmy thistle
#

Lost it?

rotund token
#

Reminds me of the subscene script disappearing

hushed fjord
#

why am I getting this error? using unity version 2021.3.14f1

#

also for some reason I was able to install an earlier version of entities (I think 0.51?)

hushed fjord
#

nevermind, just had to use 2022+

covert spire
#

Is there a good way to debug entity positions? Like Gizmos but for entities?

coarse turtle
#

i used to just record the positions and then later draw the positions with a Graphics CommandBuffer before switching to aline

covert spire
coarse turtle
solemn hollow
# rotund token My advice is but to use efe ๐Ÿ˜„

i usually mock it up with EFE and then change it to IJE as soon as it works.
once its disabled safety and the other is disabled parallel for restriction. i was just testing if one of those is helping in any way.

            {
                navModifierSettingsBufferLookup = GetBufferLookup<NavMeshModifierSettingsBuffer>(false)
            }.Schedule(Dependency);```
```public partial struct CollectBufferModifiersJob : IJobEntity
    {
        public BufferLookup<NavMeshModifierSettingsBuffer> navModifierSettingsBufferLookup;
        
        public void Execute(Entity e, in NavModifierMainEntity navModifierMainEntity)
        {
            var subModifierBuffer = navModifierSettingsBufferLookup[e];
            var mainModifierBuffer = navModifierSettingsBufferLookup[navModifierMainEntity.entity];
            mainModifierBuffer.AddRange(subModifierBuffer.AsNativeArray());
        }
    }```
#

thats the whole code. nothing else happening in that system with those buffers.

#
    {
        public override void Bake(NavMeshModifier authoring)
        {
            var additionalEntity = CreateAdditionalEntity(TransformUsageFlags.None, true);
            AddComponent<NavMeshModifierSettings>(additionalEntity);
            AddComponent<NavModifierMainEntity>(additionalEntity, new NavModifierMainEntity
            {
                entity = GetEntity()
            });
            var modifierBuffer = AddBuffer<NavMeshModifierSettingsBuffer>(additionalEntity);
            
            var settingsCount = NavMesh.GetSettingsCount();
            for (int i = 0; i < settingsCount; i++)
            {
                var a = NavMesh.GetSettingsByIndex(i);
                var agentID = a.agentTypeID;
                if (authoring.AffectsAgentType(agentID))
                {
                    var navModifierData = new NavMeshModifierData
                    {
                        ignoreFromBuild = authoring.ignoreFromBuild,
                        overrideArea = authoring.overrideArea,
                        area = authoring.area,
                        affectedAgentTypes = agentID
                    };

                    modifierBuffer.Add(new NavMeshModifierSettingsBuffer
                    {
                        navMeshModifierData = navModifierData
                    });
                }
            }
        }
    }```
#

thats the baker that is adding those buffers to additional entities. i had the need to use multiple navmeshmodifiers on one gameobject. so instead of adding the components to the main entity i add it to additional components and later in a baking system combine them back to the main entity

rotund token
#

Can you show me error

solemn hollow
#

1 sec. entity header...

#
Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckReadAndThrowNoEarlyOut (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) <0x3c70f8718 + 0x0003f> in <fc0f0c704593490789be2e6908a1168e>:0
Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckReadAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Jobs/AtomicSafetyHandle.bindings.cs:166)
Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeReadOnlyPtr[T] (Unity.Collections.NativeArray`1[T] nativeArray) (at /Users/bokken/build/output/unity/unity/Runtime/Export/NativeArray/NativeArray.cs:1059)
Unity.Entities.DynamicBuffer`1[T].AddRange (Unity.Collections.NativeArray`1[T] newElems) (at Library/PackageCache/com.unity.entities@1.0.0-exp.12/Unity.Entities/Iterators/DynamicBuffer.cs:387)
AI.Comp.CollectBufferModifiersJob.Execute (Unity.Entities.Entity e, AI.Comp.NavModifierMainEntity& navModifierMainEntity) (at Assets/Scripts/AI/Comp/NavMeshModifierBakingSys.cs:167)````
#

the error happens in the line where i do buffer.AddRange

rotund token
#

Do me a favour and change it to ToNativeArray and see if it still errors

solemn hollow
#

no it doesnt?!

#

so the problem is i am trying to read and write in the same line?

true mirage
#

My tile map is chunk based. I keep an array for each chunk. In some situations, I need to access several chunks for example in path finding.
I think maybe it is better to keep all of them in one giant array. So, the access is faster.
If I want to keep them separately, I should use NativeMultiHashMap and inside NativeArray?
World => Chunks[]
Chunk => Voxels[]

solemn hollow
#

at how many crashes/needed restarts per code iteration are you guys? im close to 1

rotund token
#

hmm i don't recall crashing recently

#

but close to 1 on subscene corruption

#

thankfully most of the time i don't care

rotund token
#

i didn't think writing to a buffer should invalidate other buffers

#

it's probably something like the secondary handle just not liking it

rustic rain
#

Hmm. Is entity chunk hashmap pre allocated with size of max value or gets dynamically reallocated on demand?

solemn hollow
rustic rain
solemn hollow
#

sry i dont follow. its an array isnt it? not a hashmap

rustic rain
#

Yeah it is an array

#

But it's used as hashmap

rotund token
#

Which particular layer are we talking

#

Accessing entities or chunks

solemn hollow
# rustic rain But it's used as hashmap

okay that statement confused me lol. In which case you think it has a max size? if you get the chunkarray and then loop over it you dont get empty entries in the array. its always the length of the available chunks for the query you specified

rustic rain
#

Supposedly it'll be size of int.maxvalue

#

But that seems a lot

solemn hollow
#

var chunks = query.ToArchetypeChunkArray(Allocator.TempJob); you talking about those chunk arrays?

rustic rain
#

No

#

Look at how em get component from entity works

#

This array

solemn hollow
#

really i try to find what you mean. but i cant.

#

any idea how this error is happening? : Invalid allocation label passed to UnsafeUtility::Malloc

#

i get this error as a followup : System::ArgumentException: Could not allocate native memory. Please report a bug. This Exception was thrown from a job compiled with Burst, which has limited exception support. #3 scripting_raise_exception(ScriptingExceptionPtr) #4 UnsafeUtility::Malloc(long long, int, NativeCollection::Allocator, ScriptingExceptionPtr*) #5 Unity.Collections.LowLevel.Unsafe.HashMapHelper`1<int>.Resize(Unity.Collections.LowLevel.Unsafe.HashMapHelper`1<int>* this, int newCapacity) -> void_e7f125cd1d9c91d6115fba1a3b491d17 #6 ForwardJobToManaged(ManagedJobData*) #7 ujob_execute_job(ujob_control_t*, ujob_lane_t*, ujob_job_t*, ujob_handle_t, int) #8 lane_guts(ujob_control_t*, ujob_lane_t*, int, int)

#

seems like resizing the hashmap doesnt work. but it shouldnt really resize anyways.

rotund token
#

What allocator does it have

#

(definitely seems like it's trying to resize though)

solemn hollow
#

TempJob

#

i allocate it with a capacity of 10 and only ever add 2 keys

rotund token
#

Hmm that makes no sense then

solemn hollow
#
            Dependency = new BuildSurfaceEntitiesMap
            {
                navMeshEntities = navMeshEntities,
            }.Schedule(Dependency);```
#
        public partial struct BuildSurfaceEntitiesMap : IJobEntity
        {
            public NativeHashMap<int, Entity> navMeshEntities;
            public void Execute(Entity e, in AgentTypeID agentTypeID)
            {
                if (navMeshEntities.ContainsKey(agentTypeID.Value))
                {
                    navMeshEntities[agentTypeID.Value] = e;  //TODO atm only one navmesh per agentID is possible.
                }
                else
                {
                    navMeshEntities.Add(agentTypeID.Value,e);
                }
            }
        }```
rotund token
#

Assuming you have confirmed only adding 2 you have some weird stuff going on

#

Is this at runtime or baking

solemn hollow
#

runtime and yes i confirmed it

rotund token
#

(probably shouldn't use tempjob anyway over world update allocator)

#

(doesn't stop the weirdness though)

#

Same issue without burst?

solemn hollow
rotund token
#

When you think tempjob just think update allocator

solemn hollow
#

not sure how to assign it

rotund token
#

There's a shortcut in both system base and isystem

solemn hollow
solemn hollow
rotund token
#

I'm not as familiar with inner workings of new native hash map

#

And I'm not at home atm so hard for me to recall what it's trying to do internally

#

I did see an odd bug report about it though

solemn hollow
#

ooh wait wasnt the old one actually renamed to nativeparallelhashmap or something?

rotund token
#

Yes

#

You could try that

#

It's not as fast but we've suffered for years anyway

solemn hollow
#

its not something that is in a performance critical path anyways

#

oh god it works with the old Hashmap

#

i lost so much time already on this ^^ i didnt get that i was using a new one...

#

i think that solves some of my unity crashes i had too

#

cause crash report said something about the hashmap having 20 stackframes or sth

rotund token
#

Yeah I don't know what's up with it

#

I haven't had any issues but I definitely saw a post about someone having a fundamental issue like this

#

Though I don't use that many tbh

#

Your case seemed very simple though

#

I'm still curious about the non burst error

solemn hollow
#

ill try to get it

#

my first frame setting up everything literally takes minutes...

#

without burst

#

i really wish i could disable burst just for certain assemblies

solemn hollow
# rotund token I'm still curious about the non burst error

it crashed this time with this Error: #0 0x0000010745d244 in block_merge_next #1 0x0000010536bae4 in DynamicHeapAllocator::Deallocate(void*) #2 0x000001053791c8 in DualThreadAllocator<DynamicHeapAllocator>::TryDeallocate(void*) #3 0x0000010536f6bc in MemoryManager::Deallocate(void*, MemLabelId const&, char const*, int) #4 0x0000010536f494 in MemoryManager::Deallocate(void*, MemLabelId const&, char const*, int) #5 0x0000010536d768 in free_alloc_internal(void*, MemLabelId const&, char const*, int) #6 0x00000104dd49e0 in UnsafeUtility_CUSTOM_Free(void*, NativeCollection::Allocator) #7 0x000002dcbda43c in (wrapper managed-to-native) Unity.Collections.LowLevel.Unsafe.UnsafeUtility:Free (void*,Unity.Collections.Allocator) [{0x3767cd870} + 0xb4] (0x2dcbda388 0x2dcbda4d0) [0x17644ea80 - Unity Child Domain] #8 0x000002dcd223fc in Unity.Collections.Memory/Unmanaged/Array:Resize (void*,long,long,Unity.Collections.AllocatorManager/AllocatorHandle,long,int) [{0x33b299988} + 0x37c] [/Users/tom/Documents/UnityProjects/ZombieRoad/zombie-road/ZombieRoad/Library/PackageCache/com.unity.collections@2.1.0-exp.4/Unity.Collections/Memory.cs :: 89u] (0x2dcd22080 0x2dcd22464) [0x17644ea80 - Unity Child Domain]

#

the stacktrace is too long to post it all here

#

another weird thing about it is that sometimes i can play for quite a while until the error happens. despite this beeing run every frame (not in final version ofc)

solemn hollow
#

hmm i cannot reproduce that error with burst disabled. it just sometimes crashes but i cant identify the cause.

gaunt quest
#

I upgraded an old project from 2021 to 2022 and now there's a million complaints about missing assembly definitions. I've updated and refreshed the cache of Unity packages but it's not helping. It can't find Unity.Mathematics which for sure is there.

rotund token
#

try reimport the packages

gaunt quest
#

I completely deleted the library cache and redownloaded them.

#

It's really frustrating, every few months I try to play with ECS again and the first problem I encounter is some bullshit about assembly definitions. Almost every time I've used Unity I've had some catastrophic and impossibly ambiguous issues with assembly definitions, even before ECS.

#

This code works fine in the older version but something about the upgrading pipeline destroys it

rotund token
#

these are warnings not errors

#

what's the first error

gaunt quest
#

It's the same, complaints about missing definitions. I restarted Unity twice and somehow the second time resolved the assembly issues. The remaining errors are actual problems from the upgrade (api incompatibilities).

solemn hollow
#

can i do a requireforupdate with an IJE without specifying the query?

#

lots of boilerplate id like to avoid

rustic rain
#

[WithAll(type)]

#

and etc

#

and on system you need to add attribute

#

[RequireMatchingQueriesToUpdate]

balmy thistle
solemn hollow
# rustic rain attributes

RequireMatchingQueries would trigger an update as soon as any query is not empty. i would like to not update the system if one of many IJobEntity has an empty query

solemn hollow
covert spire
#

Is there a way to limit how many entities a system processes at once? For example, if I have many entities and a heavy job, can I just run it on 10 entities at a time?

rustic rain
covert spire
rustic rain
#

yeah

#

you can quite literally iterate chunks manually

#

but to use job system you'll have to go abit more complex

#

allthough, you can just use IJobFor

solemn hollow
#

@covert spire i split up the work over multiple frames for my AI. every frame i choose 10 or so chunks that get to be updated.
I use manual chunk iteration with IJobFor like Issue suggested. Its not really complicated to get going.

covert spire
#

thanks!

tepid stream
#

When I added the Unity.Physics package to my project it seemed to have completely removed LocalToWorldTransform anyone know how I can get it back? I want to use the Unity.Physics for collision detection.

rustic rain
tepid stream
rustic rain
#

hopefully yet

tepid stream
tepid stream
#

Cool cool thanks for the help ๐Ÿ‘

#

Should have probably imported all the packages first xD. Now I have some refactoring to do

covert spire
#

Does adding/removing tag components cause a structural change? I have a group of entities that go through various "stages" of their lifecycle and wondering the best structure for it. If each entity has say, an Enum with a State, then each system would have to process all of the entities, and check if (state == the one the system cares about), which is inefficient. Would it be better to add a tag component for each State and only have one enabled at a time, or have a tag component for each State and add/remove them from the entities as needed?

solemn hollow
#

How you implement it really depends on how often your state changes. If you change it every few frames you enable/disable is probably the better choice. if it happens only once in a while you should add/remove components to keep the chunks sorted

covert spire
#

Is enable/disable the only way to effectively get a where in an entity query?

solemn hollow
#

not sure i get the question. enable / disable does filter out entities the same way add/remove would. it just does not incur a structural change. the entity still is in the chunk but is not processed by systems that use the enabledfilter

covert spire
#

I'm effectively trying to do something like public void Execute(Aspect a where a.state == NeedsInitializing) in an IJobEntity

#

I know that I could make NeedsInitializing a component and then create a new aspect where it is required

#

lets say state has 3 different options. I have a system that processes entities that have each type of state

#

Would it be better to give the entities all 3 state components and only enable 1 at a time, or add/remove state components as needed? Is there a better way to filter out the entities of state X?

solemn hollow
#

i would say there is no better way.
and see what i wrote above. it depends on how many statechanges happen. if its very frequent -> enable / disable otherwise add/remove

#

that beeing said if you have a lot of states AND you have frequent changes it maybe even better to check inside the system for the state and early out instead of having alot of state components. but that would have to be profiled

#

another option that would also lead to a structural change is having a shared component with the state enum and filtering after that

#

but i have no idea how performant shared components are now. it used to be a bad option to do this but i think it got massively improved by now

solemn hollow
covert spire
# solemn hollow i havent worked with aspects at all but id imagine id not want to have new aspec...

Does this look like the correct pattern to you? WaitingToGenerateComponent implements IEnableableComponent

    {
        EntityCommandBuffer ecb = new EntityCommandBuffer(Allocator.TempJob);

        new GenerateChunksJob
        {
            ecb = ecb,
        }.ScheduleParallel();

        ecb.Playback(state.EntityManager);
        ecb.Dispose();
    }

[BurstCompile]
[WithAll(typeof(WaitingToGenerateComponent))]
public partial struct GenerateChunksJob : IJobEntity
{
    public EntityCommandBuffer ecb;

    [BurstCompile]
    public void Execute(Entity chunk)
    {
        // TODO do work
        ecb.SetComponentEnabled<WaitingToGenerateComponent>(chunk, false);
        ecb.SetComponentEnabled<WaitingToMeshComponent>(chunk, true);
    }
}```
#

The idea is to then having a Meshing system do the same thing, do its work, disable the WaitingToMeshComponent, then enable the next state component

solemn hollow
#

why are you enabling/disabling when it seems like you will ever do this once?

covert spire
#

The states go in a cycle

solemn hollow
#

that statechange wont occur often right? on the same entity i mean

covert spire
#

I'm planning on reusing entities. So for example, when they are too far away they will "become" the next one that is needed and the cycle will start over

#

kind of like pooling i guess

solemn hollow
#

and you expect to have an entity cycle through all states every few seconds?

covert spire
#

Fairly often, yes

solemn hollow
#

well i guess its fine then. but one of the real advantages of enabling / disabling is that you dont need syncpoints

#

you might wanna get rid of that

viral sonnet
#

i don't know if there's a chunk based solution

#

i think there is, just needs an IJobChunk then

solemn hollow
#

a chunk based solution to the state switching thing or to the loadbalancing?

covert spire
# viral sonnet you don't need ecb to set enabled btw. set it directly with a componentlookup

How is this?

    {
        ComponentLookup<WaitingToGenerateComponent> generateLookup = state.GetComponentLookup<WaitingToGenerateComponent>();
        ComponentLookup<WaitingToMeshComponent> meshLookup = state.GetComponentLookup<WaitingToMeshComponent>();

        new GenerateChunksJob
        {
            generateLookup = generateLookup,
            meshLookup = meshLookup,
        }.ScheduleParallel();
    }
}

[BurstCompile]
[WithAll(typeof(WaitingToGenerateComponent))]
public partial struct GenerateChunksJob : IJobEntity
{
    public ComponentLookup<WaitingToGenerateComponent> generateLookup;
    public ComponentLookup<WaitingToMeshComponent> meshLookup;

    [BurstCompile]
    public void Execute(Entity entity)
    {
        // TODO do work
        generateLookup.SetComponentEnabled(entity, false);
        meshLookup.SetComponentEnabled(entity, true);
    }
}
#

Or should I be using SystemAPI?

solemn hollow
#

it really confused me there that you call your Entity chunk lol

covert spire
#

Oh woops, its a chunk system haha

solemn hollow
#

a what? ^^

covert spire
#

Like minecraft chunks

solemn hollow
#

aah

#

i havent really used enable / disable yet so im not sure if lookups are the only way to set these? cant you just set it from the ComponentData directly without indirect lookup?

viral sonnet
viral sonnet
#

SystemAPI writes additional code. caches the handle in a private variable, creates in OnCreate and then just calls Update in the Update method. it's faster that way

#

and that's also the pattern for all handles.

#

SystemAPI.GetComponentTypeHandle is still missing but coming in 1.0 final

solemn hollow
#

and you do that in create or update?

viral sonnet
#

in update

solemn hollow
#

nice

#

@viral sonnet do you have to use LookUps to set enabled?

viral sonnet
#
{
    generateLookup = SystemAPI.GetComponentLookup<WaitingToGenerateComponent>(),
    meshLookup = SystemAPI.GetComponentLookup<WaitingToMeshComponent>(),
}.ScheduleParallel();``` this is how it would look then
viral sonnet
solemn hollow
#

cause you get access to the enabled bitmask right?

viral sonnet
#

right. there's public readonly void SetComponentEnabled<T>(ComponentTypeHandle<T> typeHandle, int entityIndexInChunk, bool value) for example

#

in ArchetypeChunk

solemn hollow
#

ah! alright. but requires boilerplate ๐Ÿ˜ฆ

viral sonnet
#

yep, i'm not aware how you'd do it in an IJobEntity. maybe there's a way but i've only seen code that uses ComponentLookup

solemn hollow
#

thats something probably comming at some point

covert spire
#

hmmm can't write to ComponentLookup in IJobEntity

solemn hollow
#

what the error? maybe its not possible in parallel

covert spire
#

This container does not support parallel writing

solemn hollow
#

try disabling nativeparallelforrestriction

covert spire
#

works just with Schedule() though

solemn hollow
#

since you only ever write to your own entity you could disable safety

covert spire
#

that seems to work also, thanks

solemn hollow
#

here its fine to do. just take care to not cause raceconditions when you write from one entity to another.

robust scaffold
rotund token
#

Rip

solemn hollow
robust scaffold
solemn hollow
#

no

robust scaffold
#

Hrm. Well, I can type "c:" into the search bar and it'll show all entities so I can get around this strange bug/feature at least.

solemn hollow
#

wait a second. i thought you were talking about inspector

#

my hierarchy doesnt have it either

robust scaffold
solemn hollow
#

both dont have it

robust scaffold
#

This is what mine looks like, suppose to have a yellow circle next to the triple dots

robust scaffold
solemn hollow
#

tbh i never toggled it there so i didnt notice

robust scaffold
#

I got a bunch of buffers on system entities used for prepping rendering data so not being able to see systems is slightly annoying

#

Not quite as annoying at 0.51 bug where selected entities werent highlighted. That was unusable.

solemn hollow
#

i hope unity is aware of this issue already

#

the editor useability is the main thing im looking forward to in official 1.0 release

robust scaffold
#

I dont doubt they know this is an issue but I'm hesitant on sending in a bug report on something this obvious and I want them to focus on making the baker functional.

dense oriole
#

is it "normal" that clicking on things in Entities Hierarchy breaks them? like clicking on stuff with colliders causes the colliders to stop working :p

robust scaffold
rotund token
#

it's only an issue with subscene open

rotund token
#

todays invention

#

DynamicLookup

#

or maybe DynamicEnableableLookup

#

i want to be able to set a ComponentType enableable state (without having <T>)

#

without a command buffer

#

basically
EntityDataAccess.SetComponentEnabled(Entity entity, TypeIndex typeIndex, bool value)
but adding a dependency to all potential components

tired mulch
#

Is this the correct way of writing to buffers from aspects?

rotund token
#

i believe so

#

impure is just a bit of an annoying warning

tired mulch
#

Ah alright, got it thanks ๐Ÿ‘

slow epoch
#

Is there an updated guide on how to get info from the ECS world from outside? Currently I need some info from the camera as a gameObject to follow the player and not sure how to move forward on that

robust scaffold
#

Editor: Console messages logged from Burst code now have clickable stacktraces.
2023 alpha, sweet.

rotund token
#

they are pretty close there on 2022 with 1.8

#

so nice to see the final hurdle has been done

#

clickable but doesn't go anywhere ๐Ÿ˜„

robust scaffold
rotund token
#

oh wait

#

my burst jobs work fine for stack traces

#

its just my burst function pointers dont (ISystem OnUpdate)

#

but yeah i already get fully clickable burst stacks from jobs already

#

yeah i thought i was already getting these

robust scaffold
rotund token
#

not sure why they are different (there are 2 separate systems that call this job, but i have 3 different call stacks)

#

but yeah its not like execution of the job is actually from the system - it's just added to a queue

robust scaffold
#

Also, has anyone tried out the new native render pass API in URP? It seems like an alternative way to render compared to command buffers.

robust scaffold
rotund token
#

yeah these the bottom 2 are the same job/system

#

486+5376=5862

#

they should match as they run as frequently

robust scaffold
#

Well, as long as the caller, in your case Timer.cs:82 are the same and easily / reliably identifiable, good enough.

rotund token
#

yeah it's pretty useful

#

burst quality of life has definitely improved a lot recently

#

the breaking in it has been amazing

#

rarely need to turn burst off now

robust scaffold
#

Yea. I dont think I've ever needed to turn off burst for any debugging now.

worn umbra
#

Does anyone know why "Multiplayer PlayMode Tools" is limited to 32 thin clients? I want to scale up to 100.

rotund token
#

even at 32 you generally don't have a good time ๐Ÿ˜…

#

just manually create some more

robust scaffold
#

Random constant

worn umbra
#

I see, I was worried why the limit is set to 32. What is the reasoning behind it. i.e. if it means netcode supports only up to 32 concurrent players?

robust scaffold
gilded glacier
#

Question on practices: Do you store (or at least note) queries and archetypes somewhere ?
Like for the scenarios when you want to create/query specific entities, but you don't want to left out some components, or you don't expect anyone to know exactly what that entity must contain, or you want to have some kind of factory method that you can modify once for the whole project when you need that entity to have something more or less, etc.

robust scaffold
gilded glacier
#

what is the builder ?

robust scaffold
#

EntityQueryBuilder

gilded glacier
#

til

#

okay, but what about creating entities ?

robust scaffold
#

I either store an archetype in the body of the system or just CreateEntity and add the relevant components

gilded glacier
#

that can work if only that single system is the only one responsible for creating that entity

#

but in case of some kind of "event entity" that triggers certain behaviour and can be triggered by several other systems ?

robust scaffold
#

Okay? Query for unique components on that entity for relevant systems and conduct work on the entities that match the query.

#

Entities are universal and not tied to a single system, systems query for relevant entities.

misty wedge
#

How does unity patch deferred entities not set via the ECB? For example, say I create an entity in a job with an ECB, and have a reference to a component, and assign an Entity field in that component to the deferred entity. How does unity replace it with the "real" entity?

robust scaffold
misty wedge
#

Yeah I know the indices are negative, but I thought they are re-used between ECBs. I know there's a function to check if a component has any entity fields, so I'm assuming they're doing something along those lines. However, I am also too lazy to check.

rotund token
#

it's actually surprisingly easy

#

the typemanager stores all the info you need

#

i do something similar for my save system, except map old entities to new entities

#

kind of like transferring entities between worlds

#
        /// Gets a pointer to entity offsets for a given type index.
        /// </summary>
        /// <remarks>
        /// This always returns a pointer even if the given type has
        /// no entity offsets. Always check and iterate over the returned pointer using the
        /// returned count.
        /// </remarks>
        /// <param name="typeIndex">The TypeIndex to review.</param>
        /// <param name="count"></param>
        /// <returns>Returns a pointer to the entity offsets.</returns>
        public static EntityOffsetInfo* GetEntityOffsets(TypeIndex typeIndex, out int count)
        {
            var typeInfo = GetTypeInfoPointer() + typeIndex.Index;
            count = typeInfo->EntityOffsetCount;
            return GetEntityOffsets(*typeInfo);
        }```
#

is basically the magic you need

dense oriole
rotund token
#

what do you mean?

#

closed subscene is the final state of baking

#

you can see all the entities
i never have my subscenes open except when editing them - old habitat as netcode did not work with open subscenes in 0.51 or earlier

#

or do you mean in like scene view?

dense oriole
#

game playing with the subscene opened:

rotund token
#

subscene closed is the experience you will get in a build

dense oriole
#

closing with the button "close" here:

#

the game now ^

#

what was in the subscene is missing (?)

#

oh, just noticed this error after closing the subscene:

Loading Entity Scene failed because the entity header file couldn't be resolved. This might be caused by a failed import of the entity scene. Please take a look at the SubScene MonoBehaviour that references this scene or at the asset import worker log in D:\Unity\resourcerer2d\Logs. scenePath=Assets/Scenes/MainScene/test.unity guid=83c65158b405a0847a1ea5baa4e581ce

rotund token
#

yeah it hasn't baked

#

ok so that's the bug that is very unfun atm

#

basically requires a unity restart, preferences -> entities -> clear entity cache, reimport

dense oriole
#

what do you mean by reimport?

rotund token
#

should be a button on the subscene that says reimport

#

alternatively just open, clear, close i think works as well

dense oriole
#

yaay, it worked

#

does it happen often?

#

btw thanks a lot, you rock ๐Ÿ˜ป

misty wedge
rotund token
misty wedge
#

How does it know which entity fields to "fix"?

rotund token
#

any component that has an entity field is cached in the typemanager

#

so it just needs to check if the data exists or not

misty wedge
#

So it just runs over all of them?

rotund token
#

when you do a set|addcomponent

#

ecb is broken into 2 paths

#

SetComponent
SetComponentWithEntityFixUp

#

which one is used is determined at time of calling the command

            {
                if (op == ECBCommand.AddComponent)
                    cmd->Header.Header.CommandType = ECBCommand.AddComponentWithEntityFixUp;
                else if (op == ECBCommand.SetComponent)
                    cmd->Header.Header.CommandType = ECBCommand.SetComponentWithEntityFixUp;
                else if (op == ECBCommand.ReplaceComponentLinkedEntityGroup) //TODO DOTS-5586: Add support for component data with fixup
                    throw new ArgumentException("This component value passed to this command contains a reference to a temporary Entity, which is not currently supported.");
            }```
#

not during playback

#
        {
            if (!TypeManager.HasEntityReferences(typeIndex))
                return false;

            var offsets = TypeManager.GetEntityOffsets(typeIndex, out var offsetCount);
            for (int i = 0; i < offsetCount; i++)
            {
                if (((Entity*)(data + offsets[i].Offset))->Index < 0)
                {
                    return true;
                }
            }
            return false;
        }```
#

it checks if the data exists in the typemanager, if not early outs
then checks each possible entity field and checks if it's index < 0

#

i.e. it's been added by command buffer

#

the caching of the offsets makes the whole thing quite fast and efficient

misty wedge
#

No, I meant the scenario where I don't use the ECB to set the component, and just write the deferred entity to a component by reference

#

And I think that that isn't actually supported

#

It requires the setcomponent on the ECB to "fix" the values from what I can tell, but I assume that's what you meant

rotund token
#

yes

#

references wont be updated unless you use ECB

#

it will just have the virtual entity

#

and you will get an error saying entity wasn't played back blahblah if you try to use it

misty wedge
#

Yeah

#

I'm using a kind of weird workaround where I just read all entities in a job and them set them again, probably far from ideal but it works

rotund token
#

2 separate ECB will both have the same -1, -2, -3 etc virtual entities so it's only valid within that ecb until its played back

misty wedge
#

They all have deferred values so it may even be faster than using the ECB a bunch of times

misty wedge
#

Looks so dumb thonk

rotund token
#

ahhh is cellData using the same ECB or something?

#

otherwise this ain't going to work

misty wedge
#

yeah, they basically all write deferred values directly to the component and then at the end this fixes it

rotund token
viral sonnet
#

that's really easy to miss after some time

#

i was just like, why am i not setting this directly?

drowsy pagoda
#

So I'm not seeing the LocalToWorldTransform in entities 1.0, despite the docs explicitly saying that this is the new way of doing this now. I see all the old LocalToWorld etc, but not the new one. I have the Unity.Transforms namespace referenced. What am I not getting here?

rotund token
#

physics/netcode doesn't work with new transform system

#

if you install either package it will be disabled and use old transform system

drowsy pagoda
#

Ah, wow. Ok. The issue I was having was when I remove parent, the item's global transform was overwritten by it's previous local transform. Need to manually overwrite after de-parenting. Or is there an easier way?

drowsy pagoda
#

Using 1.0 and latest 2022.2.0b16. Did a build and it said it was built successfully, but before that it gives this error in console:
Failed to build EntityScene for 'Assets/Scenes/Main/Sandbox.unity'
Then when running the build, get this exception:

Loading Entity Scene failed because the entity header file couldn't be resolved: guid=5b6967bf99878714ab9b019f2db397f7.```
I went into the `StreamingAssets` directory, but the `EntityScenes` folder does not exist.

This is strange because before (on this same setup) I build and ran successfully without issues.
I just have a `Main` scene with a `Sandbox` subscene. Do both `Main` and sub scene need to be in the build scenes? Or just main?
rotund token
#

your subscenes don't need to be in the build config

rotund token
drowsy pagoda
#

Thanks, I will try without subscene in build list. Didn't know I needed to close it, last successful build I didn't close scenes. Let me try this out.

rotund token
#

but closing it will build the subscene in the editor

#

and well, if you get an entity header error

#

you know it's not building properly atm

#

and might need to restart/clear cache

drowsy pagoda
#

ok. I'll try all of that out. Thx for the tips man. I really appreciate it

frosty siren
#

how to instantiate entity from prefab as additional entity in IConvertGameObjectToEntity? There is no Instantiate method in GameObjectConversionSystem and while trying spawn entities through EntityManager.Instantiate I get DuplicateEntityGuidException: Found 7 EntityGuid components that are shared by more than one Entity with all my 7 prefabs

rotund token
#

umm

#

i think you can only be using CreateAdditionalEntity

frosty siren
#

going to 1.0 is heavy, I'm preparing

rustic rain
solemn hollow
#

is there a way to easily inspect queued commands inside an ecb?

#

since 1.0 i got some weird spikes where one of my commandbuffers takes 12ms

brave field
#

Is that currently not possible to modify the data of buffer at idiomatic foreach?
error CS1654: Cannot modify members of 'xxx' because it is a 'foreach iteration variable'

solemn hollow
#

Its the same for disabling burst for debugging. i do get all the info i need when i disable it but my game becomes unplayable. i would love to disable burst just for certain assemblies to specifically debug them

solemn hollow
#

whenever i get a spike UnsafeUtility.Malloc and .Free are present in the ecb playback

#

the difference is 25ms vs. under 0.5ms

rustic rain
#

burst gets disabled for specific job

solemn hollow
#

as long as burst tells you which job generates the error i guess its fine. then i can disable burst for that job. maybe that is actually a non issue by now because burst debug messages became much better already. maybe its just an old habit of mine to disable burst entirely sometimes when i could just disable it locally.

#

there were cases in the past where burst couldnt tell me at all where the error comes from

dusky roost
#

Has anyone worked on an implementation for trail renderer in ECS? I have looked for it and haven't seen anything but wanted to confirm before implementing my own

rustic rain
#

as soon as you set breakpoint inside job

#

it gets unbursted for debugging

#

take a look at burst manual for explanation

solemn hollow
queen dome
#

How one should access IBufferElementData component in Aspect?

#

I know how to get another aspect or component but not sure how to access IBufferElementData component

rustic rain
queen dome
# rustic rain try same way as normal comp

Unity.Entities.SourceGen.AspectGenerator\Unity.Entities.SourceGen.Aspect.AspectGenerator\PlayerAspect__Aspect_1407537409.g.cs(40,94): error CS0315: The type 'Unity.Entities.LinkedEntityGroup' cannot be used as type parameter 'T' in the generic type or method 'ComponentLookup<T>'. There is no boxing conversion from 'Unity.Entities.LinkedEntityGroup' to 'Unity.Entities.IComponentData'.

rustic rain
#

just use it as a direct type

#

DynamicBuffer<T>

#

no wrappers

queen dome
#

@rustic rain yo, thank you

#

Unfortunately I hit another snag. There is no SystemAPI inside aspect, so I have no way of access components of entities inside LinkedEntityGroup

#

I guess ill keep that piece of code inside the system

rustic rain
#

you don't need SystemAPI

queen dome
#

I need it to check for component inside an entity that I get from LinkedEntityGroup buffer

drowsy pagoda
#

I created a Physics Material Template. But when I go to attach it to a PhysicsShape, it gives me this error.

#

Is this a bug?

queen dome
drowsy pagoda
queen dome
#

Then I am not sure what could be the problem

rotund token
#

There's been a few versions of unity that have had some odd asset issues

slow epoch
#

How should I go about getting a singleton entity from a monobehaviour? Right now I'm doing this but not working:

            playerEntity = new EntityQueryBuilder().WithAll<Player>().Build(World.DefaultGameObjectInjectionWorld.EntityManager).GetSingletonEntity();
            var playerPos = World.DefaultGameObjectInjectionWorld.EntityManager.GetComponentData<LocalToWorld>(playerEntity).Position;
drowsy pagoda
safe lintel
#

@slow epoch whats the error? have you walked through the steps, like does the entity exist, does it have a localtoworld on it?

rotund token
#

Not at pc to check but from memory don't you need to pass an allocator to entity query builder

slow epoch
#

it says there's no localtoworld, it's in update so it's checking all the time

#

But checking the inspector, I can see the entity with both Player and LocaltoWorld

rotund token
#

then you can just use GetSignleton<LocalToWorld>() instead of having to use EM

slow epoch
#

Fixed with the allocator and "WithAll<LocalToWorld>", cheers!

#

Also issue is I don't know where I can use "GetSingleton" besides SystemAPI

drowsy pagoda
rotund token
#

i can repo your issue

#

i don't understand why though - the script looks fine

#

ok got it to work by finding PhysicsMaterialTemplate and reimporting

#

just that script, nothing else

#

some really funky stuff going on with asset database

drowsy pagoda
#

Yeah, it's unstable it seems, can't figure out the culprit.

#

Only other thing I can think of, and this is a very long shot, is that a plugin is interfering? I'm using Odin Inspector.

robust scaffold
drowsy pagoda
#

What's a quick way to get SharedComponent from a specific entity?

#

from main thread.

rotund token
#

EntityManager.GetSharedComponent

drowsy pagoda
#

๐Ÿคฆโ€โ™‚๏ธ oi, I need a break.

#

thx

misty wedge
#

Is there still no way to use a component lookup for a shared component?

rotund token
#

(someone asked for this a couple of days ago so I threw it together in 5min)

misty wedge
#

I wonder why Unity hasn't done it yet

#

with shared components finally being unmanaged they're actually usable now

#

Have the devs said anything about what the plan is going forward with the extreme entity size?

robust scaffold
misty wedge
#

It's not really an issue for me right now, I was just wondering how they would address it

#

I think enzi and tertle already tested with different chunk sizes and it seemed to work relatively well

robust scaffold
#

I mean, what are you sticking onto an entity that is ballooning it to 16KB or more?

misty wedge
robust scaffold
#

Jesus christ.

solemn hollow
#

i can beat that.

misty wedge
#

like 80% of those components aren't even mine

rotund token
misty wedge
#

it's all unity's stuff

#

I really need to get rid of LEG and the physics stuff I don't use

robust scaffold
#

I have it as well since that dev educated us all on the magic of pointers but yours is probably far better structured.

misty wedge
#

I hope they make a bunch of this stuff optional in the future

#

I also hope cleanup components can be baked in the future, that would also get rid of some stuff

robust scaffold
misty wedge
robust scaffold
misty wedge
#

Is this not in Unity.Entities.Hybrid?

#

It's not even internal but for some reason I can't import it

robust scaffold
misty wedge
#

the assembly it's in

robust scaffold
#

Oh, it's a custom assembly. CornExt.

#

That's the reason why you need the other folders.

misty wedge
#

Ah oops, I forgot to actually ask the correct question

#

I meant this group: LinkedEntityGroupBakingCleanUp

#

๐Ÿ˜…

#

I don't know how I forgot to put that part in my question

robust scaffold
#

Uh, no clue what that is.

solemn hollow
#

i got a very basic question... im new to reflection sry:

```if (Type.GetType(moduleType.Name + "Ref") == null)````

this never is true. i also tried assembly.GetType()

robust scaffold
# misty wedge

Also consider using halfs. Like health and stamina doesnt need 7 digits of precision. Halfs reduce it to 3 to 4 but that's plenty.

solemn hollow
#

i need to codegen something if the type doesnt exist

misty wedge
#

iirc I mentioned this some time ago and you said the performance hit isn't insignificant ๐Ÿ˜…

#

(something along the lines of halfs are used for storage and not computation)

robust scaffold
misty wedge
#

The thing is, this is the "normal" entity size

#

Anyone working on a regular old unity project that wants to use dots will run into this as soon as they import all the standard unity stuff

#

physics, netcode, etc

robust scaffold
#

Starting unity is pain, give me a sec and let me see how big my entities are

misty wedge
robust scaffold
misty wedge
#

Yeah but you aren't using physics or netcode are you?

#

That's what I'm wondering. We don't even have all of the basic "game" stuff, and the entities are already huge. What happens once audio, animation, etc is in? 2 kb per entity?

robust scaffold
#

Yea, Im using netcode and physics

#

And here's the player, only 0.5KB.

misty wedge
#

I'll check once the buffers are smaller

#

Unity didn't like that

#

ArgumentException: LinkedEntityGroup[0] must always be the Entity itself.

#

re-bake fixed it

#

(which kind of makes sense)

rotund token
#

that lets you set capacity of any buffer element

#

no need for code

misty wedge
#

what version are you developing the library on?

rotund token
#

1.0

#

(it'll also remove LEG from things that don't need it by default)

robust scaffold
#

Yea. Tertle's version has nice UI and added features. Mine is just a block of code and any changes must be hardcoded at the point in script.

rotund token
#

i still have my original version which is attribute based -edit- oh wow this needs a code cleanup, seems i committed it mid changes

misty wedge
#

Huh, odd. The EditorWindow is failing creation for some reason

#

Ah, I see why. Nevermind, I messed up

misty wedge
rotund token
#

download 0.9 branch

#

i haven't updated master in a while

misty wedge
#

ah, got it ๐Ÿ‘

#

Can you pull specific branches via UPM?

rotund token
#

oh no it's not pushed to github/upm yet

#

once i merge 0.9 back to master i'll update upm/master

#

i'm pretty close to finalizing a 1.0 branch

#

as i need it for some libraries i intend to release soon

misty wedge
#

Do I clone it in the same folder I would normally put local packages?

rotund token
#

yeah

misty wedge
#

I cloned it to standard assets earlier and it failed loading the UXML

rotund token
#

Packages/com.bovinelabs.core/

robust scaffold
#

A library to read my mind and instantly parse it into high performance bursted code will be a good start.

misty wedge
robust scaffold
#

See, not hard at all. We're just asking for the bare minimum.

misty wedge
rotund token
#

yeah

#

thats the first

#

ive been very slow at writing documentation...

#

(also been pretty busy, our game content lock is in a couple of weeks)

misty wedge
#

Very cool, been looking forward to that

rotund token
#

so when im off work, last thing i feel like doing is writing documentation

misty wedge
#

Understandable

drowsy pagoda
#

Shit, this thing is falling apart at the seams lol.
I had some strange behaviour with Editor, so I closed everything, nuked the library and re-opened project.
Now my subscene can't load, it shows this in console:
Loading Entity Scene failed because the entity header file couldn't be resolved. This might be caused by a failed import of the entity scene. Please take a look at the SubScene MonoBehaviour that references this scene or at the asset import worker log in D:\Projects\Access\Logs. scenePath=Assets/Scenes/Main/Sandbox.unity guid=5b6967bf99878714ab9b019f2db397f7
So I looked into the logs, found this line:
Exception thrown during SubScene import: System.ArgumentException: Tried to serialized an Entity reference however entity reference serialization has been explicitly disabled.
Where do I enable this entity reference serialization?

drowsy pagoda
#

Ok, here is another weird behavior.
When I register a prefab in the Baker via GetEntity into an IComponentData, it works fine, I verified that it indeed saves the right Entity reference.
However, when I register a prefab in the Baker the same way except into an ISharedComponentData, it references a Unity.Rendering.InstantiateDeformationSystem instead, which obviously gives me all kinds of errors being as it doesn't even have the basic transform components.

Is this a bug, or am I misunderstanding something?

rotund token
#

many of us get this every recompile and need to restart editor

#

clear cache

#

to continue

drowsy pagoda
#

Yup, I found where to clear cache, once i did that, everything started to work.

#

Any thoughts on the Shared Component issue?

rotund token
#

i dont think shared components support entity remapping

drowsy pagoda
#

Ah ok. Just keep shared component data to primitives yeah?

rotund token
#

You can use more than primitives

misty wagon
#

Hey. Is there a way to set constraints in DOTS physics for rotation like in classic rigidbody?

rustic rain
#

it is a bit complex though

solemn hollow
#

anyone of you know how to create a class via codegen and then afterwards create a scriptable object for it reliably? I do get the script and the asset at some point but never without errors getting thrown.
It seems like it is impossible to wait until unity can discover the new type file.
I tried AssetPostProcessor, AfterAssemblyLoadEvent, [DidReloadScripts], [InitializeOnLoad]... in every version the Type im trying to instanciate is not found by unity. but its there if i tab into rider... ```Exception thrown while invoking [DidReloadScripts] method 'UtilityAI.ReferenceGeneration:CreateScriptableObjectAsset ()' : NullReferenceException: Object reference not set to an instance of an object
UtilityAI.ReferenceGeneration.CreateScriptableObjectAsset () (at Assets/Scripts/UtilityAI/Core/ReferenceGeneration.cs:166)

#

The goal is to generate Scriptable Objects that hold references to IComponentData Types to be able to drag and drop references in the Editor and enable visual scripting with them.
I dont want to find the Types directly and serialize them since renaming such a type would break everything.

rotund token
solemn hollow
#

yes after creating the .cs file from the template i call AssetDatabase.Refresh

#

whats weird is that i got another editor script where i do essentially the same thing which works fine.

#
    public static void CreateScriptableObjectAsset()
    {
        if (dataInstance)
        {
            var newScrObj = CreateInstance(dataInstance.persistentName);
            AssetDatabase.CreateAsset(newScrObj,
                folderPath + dataInstance.persistentPath + dataInstance.persistentName + ".asset");
            AssetDatabase.SaveAssets();
            DestroyImmediate(dataInstance);
        }
    }```
#

this is called after an assetdatabase refresh and it creates the scriptable object without issues

solemn hollow
#

How do i regenerate the system codegen?

#

[Worker3] Exception thrown during SubScene import: System.ArgumentException: ResourceEngine.FoodProducerSys+FoodProducerSys_3B57E52E_LambdaJob_0_Job must already be filtered by ComponentSystemBase or ISystem

#

@rotund token you might be interested in this. I think my Codegen Code calling AssetDataBase.Refresh is somehow exposing errors in the baking process for me.

#

maybe i can get rid of the entityheader breaking all the time by fixing those

rustic rain
solemn hollow
#

interestingly enough the first bake went through without errors. after creating my asset and calling assetdatabase.resfresh i get errors again

#
Unity.Entities.BakerDataUtility.AddBaker (System.Type type) (at Library/PackageCache/com.unity.entities@1.0.0-exp.12/Unity.Entities.Hybrid/Baking/BakerDataUtility.cs:91)``` 
this one i have no idea what to do
#

and the one from above also reoccured. despite me rewriting it to an IJE too

dense crypt
#

When making IJobEntityBatch jobs I have the option to check for changes using DidChange on the archetype. The same option sort of exists on queries as well. I looked in to the ParentSystem and I see that Unity sets a change filter on the query, and also checks for DidChange in their jobs.

I suppose that a consumer of the job could forget to set the change filter on the query, and the job would ensure that it checks for changes first. But is there any other sort of pro/con to doing stuff "twice" in this sense?

rocky dove
#

Would WithChangeFilter be a good approach for listening for when new components of a type are created?

rustic rain
rustic rain
#

you need DidOrderChange check on chunks

pulsar jay
#

The DOTS Physics package gets more and more annoying the more I use it. Does anybody have a solution for Objects with multiple colliders? E.g. hit zones?

#

Imho there should not be any need for a physics body at all in this case. But without physics body conversion just creates compound colliders ๐Ÿ˜ฌ which does not make any sense if the sub colliders are moving and also makes it hard to figure out which one was hit

rustic rain
pulsar jay
#

If they where static they would not need to be children would they?

worn umbra
#

Is there any way to make [UpdateInGroup] conditionally? Fallback when the group is not enabled would be enough.
Background: I would like to prototype systems without multiplayer to see if the issue is coming from dots logic or network logic. Then maybe a button that will start a quick multiplayer and shows the behaviour of online mode. So using host solution won't help here.

I think I will have to make some bootstrap around systems, prevent auto loading and load them in the bootstrap when the condition is satisfied ๐Ÿค”

rustic rain
rotund token
#

happens every time i recompile and manifest in 3 different ways

solemn hollow
#

hm but i didnt get to those messages before. thats what baffled me

rotund token
#

welcome to our world ๐Ÿ˜„

#

as far as i can tell, the baking is running too early with an our of date type set or something

solemn hollow
#

i am really worried that played into my codegen issues somehow

#

i have no idea why it works now

solemn hollow
rotund token
#

there were issues with this conversion as far as back 2020.3

#

i noticed in 2020.3 if you created a new assembly it would not appear in the bake process

#

until you restarted

#

in unities assembly list

#

i found that out because of this

        {
            if (!AssembliesMap.TryGetValue(asm.GetName().Name, out var uAssembly))
            {
                return false; // this happens in sub scene conversion process if a new assembly is added after loading unity...
            }

            return (uAssembly.flags & UnityEditor.Compilation.AssemblyFlags.EditorAssembly) != 0;
        }```
#

        private static Dictionary<string, UnityEditor.Compilation.Assembly> AssembliesMap =>
            assemblies ??= UnityEditor.Compilation.CompilationPipeline.GetAssemblies().ToDictionary(r => r.name, r => r);```
#

the editor compilation pipeline in the conversion process wouldn't return a new assembly until restart

#

basically cached at startup

#

no idea if this is still an issue in 2022/1.0 i haven't tested

#

another thing in 2022 is it doesn't read the like asset cache

#

if you make a change to a scriptable object in unity, you can use that new value straight away without saving

#

but in the baking process if you access it will be the value on disk

#

very easy way to make a mistake

#

i'm actually considering removing all my SO

solemn hollow
#

So you have to rebake after every scrObj change?

rotund token
#

well of course you do if you make changes to SO that affect baking world

#

but the problem is, if you don't actually hit the save button the changed values won't be baked

#

it isn't that unintuitive it's just different to how the regular unity experience is

solemn hollow
#

ah right. maybe ill just resort to saving in onvalidate then for now

solemn hollow
#

thought there was a forum thread about the dependency not working

rotund token
#

they worked in 0.51

#

i do believe they might have been bugged in 1.0 for a time, not sure if fixed let me test quickly

#

though i can't 100% recall but i remember what you're talking about

#

yeah seems to work fine now

#

oh wait hmm, might only be working with an open subscene

solemn hollow
#

yes i havent encountered any issues myself with them but i really didnt change too many values

rotund token
#

yeah... only works if subscene open

solemn hollow
#

hm and how do prefabs factor into this?

#

do prefabs get rebaked seperately from the objects in a subscene?

rotund token
#

prefabs rebake fine without even saving

#

even with closed subscene

#

on any change

solemn hollow
#

it really blowed my mind that an instance of a prefab inside a subscene is baked differently than a prefab itself

#

i had that issue with the linked entity group not beeing added

rotund token
#

it's just not detecting changes in a SO

rotund token
#

objects in a SS don't get LEG

#

(unless you add the script)

solemn hollow
#

yes exactly. but that really caught me offguard. say i have a unit entity inside my subscene placed at a certain point. and an ability kills it. now if id rely on LEG to kill all children with id have a bug

#

but not with units i spawned into the scene later on

rotund token
#

well i think subscenes are kind of designed to be static

#

because if you close/open it again it'll respawn

#

unless you use my save library which can handle this! ๐Ÿ˜„

#

runtime subscene state saving

solemn hollow
#

yes i totally get it but i feel like its not communicated like that. especially when its now the only way to convert entities

rotund token
#

most people trying to get rid of LEG, you're trying to add it!

solemn hollow
#

its better than traversing a hierarchy to delete children lol

#

i dont think you can avoid hierarchies completly

rotund token
#

i have no hierarchies ๐Ÿ˜„

#

i mean i'm sure i'll have at some point

solemn hollow
#

then let me rephrase : should ๐Ÿ˜„

rotund token
#

but i haven't had one in like 4

#

it's been peaceful

#

just never needed one in any library i've written

#

i think they're more gameplay related

solemn hollow
#

i try to design without it but sometimes its just too convenient...
and really having the option to destroy a bunch of entities in one go is nice

#

the alternative is reimplementing something similar to LEG if you need to cleanup other entities after you destroy one

rustic rain
#

I have a concept in mind

#

where entities have a component with index to other entity

#

which contains array

#

instead of having whole LEG on entity

solemn hollow
#

you might as well reduce leg size to 0 and have the same result

rotund token
#

just seems like you're reinventing the wheel but making it square?

#

LEG does magic stuff under the hood with instantiate/destroy

#

you'd have to managed it yourself as manarz said about the alternative

#

i wonder if making a system have a write dependency on every IEnableableComponent is a bad idea

rotund token
#

basically i have the ability to enable/disable components via effect system

#

but i got no idea what component users will set

#

and well the easiest solution is obviously to enable/disable via command buffer

#

and it's all safe

#

but being me i don't like that

#

instead I wrote an UnsafeEnableableLookup

#

which let's me toggle the enable component using ComponentType of any component

#

but I need to add dependencies to the system

#

and I dont know what components a user will toggle with the effect system so easiest way it just add all valid enableable components

#

alternative I can require them to be tagged with an attribute but that's a pain and means a developer has to do it for a designer

#

but yeah it's requiring a huge like semi sync point i don't like

solemn hollow
#

i feel you. its really hard to give the user full control inside your packages

#

with their own components

#

its exactly why i did that codegen thing yesterday...

solemn hollow
rotund token
#

going to start looking ridiculous

#
    [EffectTag]
    [EffectEnableable]
    [InternalBufferCapacity(0)]
    public struct TestEnableable : IBufferElementData, IEnableableComponent```
solemn hollow
#

whats the difference between discovering them with attributes vs implemented interfaces?

#

bad practice to have empty interfaces?

rotund token
#

i dont discover from interface

solemn hollow
#

i do since yesterday and i wondered what the difference really is

#

maybe reflection being faster with attributes or sth?

rotund token
#
            {
                return false;
            }```
#

i just use the typemanager for everything

#

already has the data

solemn hollow
#

ah makes sense. i need to do it in editor tools though

rotund token
#

so?

#

this is in editor tools

rotund token
#

imo attributes re more data oriented while interfaces object

#

but realistically makes no difference

solemn hollow
#

oh wait i thought the TypeManager is something ECS does to manage mapping between IComponentData and Types

#

im total reflection noob here

rotund token
#

that i can put on any field

#

and have a bunch of rules

#

        public bool OnlyZeroSize { get; }

        public bool OnlyEnableable { get; }

        public bool AllowUnityNamespace { get; }

        public bool AllowEditorAssemblies { get; }```
#

been very useful

solemn hollow
#

and is the typemanager something comming with entities or would i always have access to it?

rotund token
#

TypeManager is from the entities package

solemn hollow
#

okay atleast i got that right puh

#

this looks really nice. i like it more than looping through assemblies getting all the types :S

rotund token
#

yeah it's already done that for you

#

no need to do it again ๐Ÿ˜„

solemn hollow
#

but thats the thing you meant is not updating when adding new types right?

rotund token
#

no

#

assemblies aren't updating

#

well i guess
if (!attribute.AllowEditorAssemblies && type.Assembly.IsAssemblyEditorAssembly())
this check here isn't updating technically

#

if you create a new editor assembly

#

add a new component into that editor assembly

#

yeah it'll appear until you restart

#

(though i haven't tested this in a year, it might be fine in 2022/1.0)

solemn hollow
#

okay that isnt so bad. i dont intend to start codegening assemblies

#

god i could look at your code the whole day and learn something new every 3 lines...

#

So you let the user add tags to effects(?) in editor?

rotund token
#

yeah

#

my effect authoring is getting quite large

solemn hollow
#

and those tags are done by the user. so how do you serialize them in a way they would not break when the user renames them

solemn hollow
#

ah that was a no go for my workflow

rotund token
#

and then the baking will yell at them

#

and they will meekly revert their renaming

#

renaming components breaks saving

#

and requires a migration

#

which is not hard but developers are lazy

#

they'll learn they cbf

solemn hollow
#

yeah all that is what i am trying to avoid going the huge detour with scriptable objects

#

might be a bad idea :S

rotund token
#

im not actually sure how your scriptable object would help here

#

if it still needs to point to a component?

#

i could write a tool reasonably easily to update this data

#

my save system has a type database to store old stable hashes

#

so if they rename/add fields etc

#

they can figure out what the type was previously

#

then migrate it to the new type hash

#

i could probably automate this for effect config files since i dont care about data, only hash

#

but yeah... i'll look at that in like, 2 years

solemn hollow
# rotund token if it still needs to point to a component?
using Unity.Entities;
using UnityEngine;

namespace UtilityAI
{
    [CreateAssetMenu(fileName = "#CLASSNAME#.asset", menuName = "UtilityAI/ComponentTypeRef/#CLASSNAME#")]
    public class #CLASSNAME# : ComponentTypeRef
    {
        public override Type GetComponentType => typeof(#CONNECTEDCOMPONENT#);
    }
}```
#

i codegen this for all IComponentData the user actually wants to use

rotund token
#

oh that makes sense i guess

solemn hollow
#

one added benefit is i dont need to worry about UI code

rotund token
#

just a note

#

componenttypes are not stable between editor and builds

#

they will change on certain platforms

#

and between mono/il2cpp

#

if you are baking the component type that will break

solemn hollow
#

yes thats why i codegen that

rotund token
#

yeah but won't this be baked?

#

or are you reading the actual scriptable object in a build

solemn hollow
#

wait let me think about this for a sec

rotund token
#

im saying, your component type might be 1234 in editor

#

when you bake and make a build that is what will be saved

#

when you play the build it will try find 1234

#

and go, this component not found

#

we found this to fail about 3 in 500 times

#

not sure what makes a component differ

#

but anyway the solution is easy, just store the stabletypehash map instead of the componenttype

#

thats why it exists

#

it's guaranteed to be stable across platforms

#

you don't need to change like anything just add a
TypeManager.GetTypeIndexFromStableTypeHash()

solemn hollow
#

sry my mind is just not really grasping it right now. i dont think i store the componenttype in any field while baking

#

what i do is using that componenttype to create generic systems

rotund token
#

oh yeah thats fine then

#

if you aren't storing it in a component / on entity all good

solemn hollow
#

i think im not having that issue. atleast i havent encountered any issues on other platforms for 2 years now

rotund token
#

we encountered it mostly on consoles

solemn hollow
#

okay i couldnt speak to that.

rotund token
#

though windows il2cpp also had issue

#

but anyway yeah thats why the stablehash exists

solemn hollow
#

its in TypeManager i assume

rotund token
#

TypeManager.GetTypeInfo(t.TypeIndex).StableTypeHash

#
            /// Hash used to uniquely identify a component based on its runtime memory footprint. 
            /// </summary>
            /// <remarks>
            /// This value is deterministic across builds provided that the underlying type layout 
            /// of the component hasn't changed. For example, renaming a member doesn't affect things, 
            /// however changing a member's type causes the parent StableTypeHash to change). 
            /// </remarks>
            /// <seealso cref="TypeHash"/>
            public   readonly ulong        StableTypeHash;```
#

the ) bothers me ๐Ÿ˜„

solemn hollow
#

ah and with saving the hashmap you meant you create your own hashmap

#

wait if renaming a member doesnt change the hash why would renaming the type itself do?

rotund token
#

changing a member's type causes the parent StableTypeHash to change

#

because it uses type/namespace as part of hash

solemn hollow
#

ah damn

rotund token
#

so that 2 things with same memory layout dont have the same hash

#

otherwise
struct component1 {int value}
struct component2 {int value}

#

would get the same hash

#

and you could only have 1 tag component in your project ๐Ÿ˜„

solemn hollow
#

yeah i wondered how they would solve this but figured they have some internal variables to types maybe or sth. like i said i dont know nothing about reflection and the actual typesystem of c#

rotund token
#

dont reflection when you have all the type info cached ๐Ÿ˜„

#

(totally not true)

solemn hollow
#

haha and you cannot even recover the Type by inspection of the members in ECS now since every member is just called Value

rotund token
#

TypeHash.CalculateStableTypeHash

        {
            ulong versionHash = HashVersionAttribute(type, customAttributes);

            if (hashCache == null)
                hashCache = new Dictionary<Type, ulong>();
            ulong typeHash = HashType(type, hashCache);

            return CombineFNV1A64(versionHash, typeHash);
        }```
#

if you're interested

#

it uses
HashVersionAttribute
HashTypeName
unity objects use their internal hash and early out
GetFields - ignore statics

#

and that's basically it

solemn hollow
#

oh lets go from naming types with typenames to tagging them with unique attributes. ๐Ÿ˜„

rotund token
solemn hollow
#

well then use the Typename as a redundancy!?!

#

i hope noone changes both at once ๐Ÿ˜„

rotund token
#

anyway that's how it all works

#

TUL ๐Ÿ˜„

#

still undecided about my original problem

solemn hollow
#

i feel so much smarter ! another tool in my belt

solemn hollow
rotund token
#

registering dependencies on all ienableable

solemn hollow
#

the enable disable system

rotund token
#

and alternatives

solemn hollow
#

cant you let users define dependencies in the Editor?

rotund token
#

subject to very badly breaking

#

if they forget

#

there will be no warning

#

they'd just be writing unsafely

solemn hollow
#

i solve this kind of via graphs

#

ah ok. forgot about the unsafe thing

rotund token
#

i could just use a command buffer but ๐Ÿ˜ฆ

rotund token
#

this might not be too bad

#

i can strip the check in builds

solemn hollow
#

dont know if you saw me posting it but i got huge ECB playback spikes in 1.0 now

#

with unsafeUtility.Malloc and .Free calls seemingly beeing the culprit

#

spikes that are 25 ms compared to normally sub 0,5 ms

rotund token
#

i use them pretty minimally

solemn hollow
rotund token
#

nah i can grab the user config data in the system

#

pass it in and check if the component when used is in the map or not

#

i already do this

#

i just do it for all valid ienablecomponents