Sync Point between System.

What is the best way to ensure system execution order and sync points? Currently, im using
[UpdateBefore(typeof())] but it’s hard to manage and I need to set some sync point between systems

For example, I have a hex tile board with each tile as an entity. During run time the board can be wiped and regenerated but I need to have a sync point ensuring all the system that generates the board are complete before the rest of the simulate system run.

Any insight into how people have been dealing with this would be greatly appreciated

The alternative to attributes is explicit system ordering, in which you manually list out the order of systems to update. This typically requires a custom ComponentSystemGroup subclass to get right. I prefer this, so I wrote a very elaborate mechanism for setting it up.

[AlwaysSynchronizeSystem] ? (if it needed every frame)

Ok so if I don’t want to write a custom solution I will need to stick with UpdateBefore and after attribute?

as for the [AlwaysSynchronizeSystem] is the idea to create a barrier system with this attribute and run all my generate tiles before and sim systems after ?

One more thing you can do [UpdateInGroup(typeof(SimulationSystemGroup), OrderFirst = true, OrderLast = true)]
Not explicit ordering but put them ahead or behind. Like those End/Start***CommmandBufferSystem

Also, you can Define your own system group and put your system in that group.
that will make sure that they are updated right after eachother. No other system will ever Jump into the queue.

    [UpdateInGroup(typeof(SimulationSystemGroup)),UpdateAfter(typeof(TransformSystemGroup))]
    public class MySystemGroup:ComponentSystemGroup{};
  
    [UpdateInGroup(typeof(MySystemGroup))]
    public class MySystem:SystemBase{};

As for the systems in your group will only be your own system. ordering them would be much easier

1 Like

Ah yea , I’ll give this a try Thank you