#Custom Netcode BlobAssetReference error when storing more then 16 CollisionWorlds

1 messages · Page 1 of 1 (latest)

rugged fjord
#

I am doing something similar to the way PhysicsWorldHistory / RawHistoryBuffer handles lag compensation in my own custom net code. Unity’s RawHistoryBuffer has a Capacity of 16 CollisionWorlds.

I increased the Capacity to 30 and now every so often randomly I get a InvalidOperationException: System.InvalidOperationException: The BlobAssetReference is not valid. Likely it has already been unloaded or released. It happens when I Dispose() / Clone() a world.

What is happening? Is this a Stack Overflow?

heavy moss
#

Well disposing a world disposes all the blob assets

lime kite
#

Seems like they fixed to start deep cloning worlds in 1.3.2 . Not sure what version you're using.

rugged fjord
#

I am deep cloning with 1.3.5.

rugged fjord
heavy moss
#

Dispose() / Clone() a world
then what did you mean by this?

rugged fjord
#

' public static void setWorld(int indexWorld, ref CircularHistoryBufferData buffer, in CollisionWorld world)
{
UnityEngine.Debug.Log(string.Format("indexWorld: {0} ", indexWorld));

    switch (indexWorld)
    {
        case 0:
            {
                buffer.world01.Dispose();
                buffer.world01 = world;
#

So far I have only had it happen with index 17 and over. 99.9% of the time it works ever 10-20 mins or so it gives the error. This is with cloning a world which is basically empty.

timid shoal
#

I don't want to hijack your thread, but i'm super curious what all of those worlds are for?

I'm working on an mmo with netcode, early on we had our dedicated server running multiple worlds on different ports, but we ended up changing our approach to force each executable process to only have one server world and we containerized it, just made it easier to manage.

I'm also aware of the unity physics docs talking about multiple client worlds, to me i think about it for stuff like if you want particle effects to run in a separate collision world which makes sense, but you mentioned specifically physics worlds, so i can't think of more than like 2 or 3 uses for multiple physics worlds and would love to know what cool stuff you're cooking up 🙂

rugged fjord