#ArgumentException: Type {} couldn't be found in the SystemRe

1 messages · Page 1 of 1 (latest)

winter walrus
#

i bet if you define UNITY_DOTS_DEBUG in your scripting defines, you'll get an error message that says "type registry is not initialized" instead of that error
@cinder vine
nope, enabled that check and type registry seems to have initialized fine

#

simply commented out the conditionals

cinder vine
#

🤯

#

this is extremely curious. I’m unfortunately afk but hmmm…. do you by any chance have an unreasonably large number of systems? I wouldn’t think that would do this, but then I wouldn’t think anything would do this when the typemanager initializes correctly

winter walrus
#

as far as i can tell debugging this though this

SystemBaseRegistry.AddUnmanagedSystemType
which is meant to be generated in UnmanagedSystemPostprocessor has simply not been run on these systems

#

yeah can confirm

#
        [ExcludeFromBurstCompatTesting("Takes managed Type")]
        public static unsafe void AddUnmanagedSystemType(Type type, long typeHash, ForwardingFunc onCreate, ForwardingFunc onUpdate,
            ForwardingFunc onDestroy, ForwardingFunc onStartRunning, ForwardingFunc onStopRunning, ForwardingFunc onCreateForCompiler,
            string debugName, int burstCompileBits)
        {
            Debug.Log($"Adding unmanaged system type {debugName}, bcb={burstCompileBits}");```
#

i re-enabled this log

#

and it's never called for these systems in a build

#

it's called for every other system except these systems in the UNITY_EDITOR || UNITY_DEVELOPMENT

#

called 147 times (I guess that answers how many ISystem I have)

#

Adding unmanaged system type RpcSystemErrors, bcb=2
Adding unmanaged system type EffectDamageSystem, bcb=3
etc

#

so they're simply not being added to type manager

winter walrus
#

yeah ok i have the simple 1 script repo

#

assembly that looks like this

#
using Unity.Burst;
using UnityEngine;
using Unity.Entities;

[BurstCompile]
public partial struct TestSystem : ISystem
{
    public void OnCreate(ref SystemState state)
    {
    }

    public void OnDestroy(ref SystemState state)
    {
    }

    [BurstCompile]
    public void OnUpdate(ref SystemState state)
    {
        Debug.Log("Work");
    }
}
#

with a script in it that looks like that

#

make a development build

#

get error

#

ArgumentException: Type TestSystem couldn't be found in the SystemRegistry. (This is likely a bug in an ILPostprocessor.)

cinder vine
#

successfully reproed this ^ what a bizarre thing

winter walrus
#

👍

#

if you're curious why i do it this way it's because publishers like a development build with debugging tools enabled and it's much easier to just put all the debugging stuff in an asmdef and strip it out at the assembly level once rather than wrapping things individually

#

(sorry i should have probably made a ticket for this earlier tbh kind of forgot about it)

cinder vine
#

oh totally it makes sense to do

cinder vine
#

well, a man from platforms just came along and told everybody that we shouldn't rely on DEVELOPMENT_BUILD anymore, because it doesn't work reliably on all platforms; for example, if you export a visual studio project when building for windows, you can swap between dev and nondev builds, but you'll have already compiled one set of assemblies (which either had the define or didn't), and so you'll just always be wrong.

so i guess the goal (which is not quite true yet, but i guess is coming along) is to always have 1 set of managed assemblies for both engine and user code in any given player build, no matter whether it's dev or nondev or what

winter walrus
#

that is not ideal

cinder vine
#

there's apparently a way to check at runtime, if that helps

winter walrus
#

yeah there's like Debug.IsDebugBuild

#

but i don't want this code to exist at all in a release build

#

it took users like 1 day to unlock all our debug tools on our early access (and this was an il2cpp build)

#

i'll just swap to my own define and remove it when i make a release build, just need to figure out a nice way for this to work for others

cinder vine
#

you could use your own scripting define? this admittedly would be easier with build configs