#Reload Domain and Completing Domain is taking a long time?

1 messages · Page 1 of 1 (latest)

serene garnet
#

I have a pretty simple program:

  • One UI Document (UI Toolkit) with two sliders on it
  • Two ISystem that spawns parallel jobs.
  • One SystemBase that tracks changes (on the main thread) in the UI and then when it happens, updates some unmanaged data.
  • 4 cube prefabs with 4 different plain color materials
  • One 3rd party addon called Odin Inspector (I could get rid of it as i only use it for simple display in the editor)
    I'm using DOTS 1.0 pre13 and i have an URP pipeline.

Every time i change a simple thing - update a variable add some Debug info, Unity spends 20-30 seconds reloading Domain and Completing Domain.

My computer isn't very fast, but in a non-dots project with a LOT more complexity, the load time is much smaller.

Is this normal? Can i do anything to speed it up? It seems too small yet to create multiple assemblies. Did i miss a setting somewhere?

wise herald
#

In manual it's recommended to disable domain reload

#

but it'll still be done on every recompile

mossy shadow
#

This is a known side-effect of many of the things we do to make ECS work today - We're aware of it, and trying to address domain reload time! 😄
And yeah, do as Issue says :3

serene garnet
#

Ok thanks guys. Just to understand - i can disable it somewhere but it won't make a difference (right now?)

wise herald
#

play mode without recompile will be near instant

#

but

#

C# world will not be rebuilt

#

and all static fields will be kept from previous state

#

so it will be up to you to clean it all up

serene garnet
#

ok thanks 🙂 i'm still not sure if i'm doing things right (probably not) - not using anything static atm

wise herald
#

that's good generally

serene garnet
#

I'm trying out this approach. I have one SystemBase that holds references to managed code (non-dots world) Then it writes to the unmanaged IDataComponents in the dots world when there are changes - or when it needs to

using Unity.Entities;
using UnityEngine;

public partial class ManagedCodeBridge : SystemBase
{
    private UIManager _uiManager;
    
    private readonly SyncableValueHolder<float> _speed = new SyncableValueHolder<float>(1);
    private readonly SyncableValueHolder<float> _strength = new SyncableValueHolder<float>(1);

    private RefRW<WorldProperties> properties =>  SystemAPI.GetSingletonRW<WorldProperties>();

    protected override void OnCreate()
    {
        _uiManager = GameObject.FindObjectOfType<UIManager>();
        _uiManager.onSpeedChanged += _speed.SetValue;
        _uiManager.onStrengthChanged += _strength.SetValue;

        properties.ValueRW.Dimension = _uiManager.Dimension;
    }

    protected override void OnUpdate()
    {
        _speed.SyncValue(ref properties.ValueRW.Speed);
        _strength.SyncValue(ref properties.ValueRW.Strength);
    }
}

The SyncableValueHolder is a class i made because i got tired of a lot of null checking, new/old tracking and callback bindings

wise herald
#

ah, just as I'm finished with nested binding 😅

serene garnet
#

I just realized i'm not caching properties

wise herald
#

finally everything works

serene garnet
#

nested bindings?

wise herald
#

Nested float = {#Group:{>NestedFloat} Deep bool = {#Deep:{>NestedBool} Deep float = {>NestedFloat}} }
yeah

#

Localization package feature

#

All the code to make that screen

    public partial class TestViewModel : ViewModel
    {
        [RelayCommand]
        private void Increment() => Counter++;

        [ObservableProperty, NotifyPropertyChangedFor(nameof(FontSize))]
        private int _counter;

        public StyleLength FontSize => Counter;


        [ObservableProperty] private int _testInt = 12;

        [ObservableProperty] private NestedGroup _group = new();

        protected override void OnInit()
        {
            Group.NestedFloat = 24f;
            Group.NestedBool = true;
            Group.Deep = new();
        }
    }

    public partial class NestedGroup : ObservableObject
    {
        [ObservableProperty] private float _nestedFloat = 3f;
        [ObservableProperty] private bool _nestedBool;
        [ObservableProperty] private NestedGroup _deep;
    }
#

literally, that's all

serene garnet
#

oh ok 🙂 not something i've tried yet - actually i'm just doing this project as a demonstration on data oriented programming with unity 🙂

#

Oh that is right - i have to check out your MVVM framework 🙂

wise herald
#

I have not published it yet

#

previous version is obsolete

#

allthough it's 90% ready

serene garnet
#

ok but i think you gave me a link to a preview earlier 🙂

wise herald
#

yeah, repo is public, but I almost fully rewrote it since

serene garnet
#

ok cool 🙂 perhaps i'll wait a bit - so much to learn atm anyways - i might as well wait for the "final" product

#

crazy 🙂

#

Ok I give up - where do i disable domain reload?

wise herald
serene garnet
#

Thanks