As in the title. I want to make system with heavy calculations that will not slow down/blocks other systems. Is it possible? How to achieve it?
Just schedule system job, without other dependencies.
And it will run on its own, selecting relevant CPU thread to execute on.
Make sure, you don’t use schedule.Complete ().
Is there a way to setup priority of this task to low or something? I’d like to run realtime systems before it. And if there is additional time in frame only then this system should calculate.
Every system will execute every frame by default. Unless request otherwise, or system is still running (i.e. longer than a single frame).
You can use [UpdateAfter/Before] attributes, to tell system execute in certain priority.
If you create manually system, then you can check, if is still running. Probably you could check time spent on the job.
But you probably can not guarantee, how long will take for next job to run.
What type of problem / solution you are trying to tackle?
I’m thinking about simulating games world behind realtime gameplay (minecraft) and/or turnbased strategy with autobattles (conquest of elisium). I’m just trying to figure out how do things in ECS really.
I think you are risking fall into trap, of overthinking, before actually trying do anything.
I suggest to build any prototype. Make stress test and see, if you got results as you want, or performance issues.
From that point, you will have reference point and will be easier to assist on the problem, rather than guessing.
Keep in mind, mincraft with heavy mods manage without DOTS. That would be starting reference point in my view.
Also, once starting hitting performance bottle neck, next thing will be looking for algorithms and tricks optimization, rather building systems around, to accommodate duration of job execution. If your job is running longer than one frame, I would really put red flag on design. Unless it is some specialistic algorithm, or initialization.
In games, there is tons of things, which don’t need to run every frame. Make an illusion instead (smoke and mirrors) :).
Let’s hope this will be supported in the future…