#System sorting is inaccurate

1 messages · Page 1 of 1 (latest)

fiery canopy
#

I have these two groups, BeginPredictedFixedStepGameplayGroup supposed to be update before PhysicsSystemGroup and EndPredictedFixedStepGameplayGroup after PhysicsSystemGroup But yet somehow, Unity decides to put EndPredictedFixedStepGameplayGroup infront of PhysicsSystemGroup in ClientWorld only. In ServerWorld it is correct. I am loosing my mind. I tried to mark m_systemSortDirty to true with reflection. Doesnt solve it. So sorting is buggy i guess?

    [UpdateInGroup(typeof(PredictedFixedStepSimulationSystemGroup), OrderFirst = true)]
    [WorldSystemFilter(WorldSystemFilterFlags.ClientSimulation | WorldSystemFilterFlags.ThinClientSimulation | WorldSystemFilterFlags.ServerSimulation)]
    public partial class BeginPredictedFixedStepGameplayGroup : GameSystemGroup { }
    
    [UpdateAfter(typeof(PhysicsSystemGroup))]
    [UpdateAfter(typeof(BeginPredictedFixedStepGameplayGroup))]
    [UpdateInGroup(typeof(PredictedFixedStepSimulationSystemGroup), OrderLast = true)]
    [WorldSystemFilter(WorldSystemFilterFlags.ClientSimulation | WorldSystemFilterFlags.ThinClientSimulation | WorldSystemFilterFlags.ServerSimulation)]
    public partial class EndPredictedFixedStepGameplayGroup : GameSystemGroup { }```
fiery canopy
#

Just realized this sorting system is an abysmal mess.

mortal rain
#

how are you measuring what's before what? debug.log? or a gui?

#

also, what's GameSystemGroup?

#

and, i don't suppose you have any warnings in the console?

foggy turtle
#

FYI: Netcode for Entities does the incredibly unintuitive thing of moving the physics systems (see PredictedPhysicsConfigSystem) in OnUpdate to the prediction groups, but it should still respect the sort order given to it before the move. Therefore, IIRC, you can set your system groups to [UpdateInGroup(typeof(FixedStepSimulationSystemGroup))] (keeping the other UpdateBefore/After attributes), and they should be both sorted & auto-moved by netcode automatically, as well.

I.e. The issue I think you're seeing is that the UpdateBefore/After calls likely fail, as they cannot find the PhysicsSystemGroup inside the PredictedFixedStepSimulationSystemGroup. You should be seeing warnings in the console to this effect?

mortal rain
#

@fiery canopy ^