so currently i manually tick every system since i need to tick some systems every 0.1 seconds, but then i lose the “System” Window, which helps seeing how long some system takes.
I saw that there is now a newly added systemgroup which is called FixedStepSimulationSystemGroup.
I guess this allows me to remove my manual ticking code and use this one.
Add in you system [UpdateInGroup(typeof(FixedStepSimulationSystemGroup)]
“[UpdateInGroup] — specifies a ComponentSystemGroup that this system should be a member of. If this attribute is omitted, the system is automatically added to the default World’s SimulationSystemGroup (see below)”
source - System Update Order | Entities | 0.16.0-preview.21
Is not outdated. You are rushing versions. Is just 2 days old.
DOTS team mentioned, they will keep features unchanged on repo, for certain number of iterations, to make sure, others with older preview are not left behind.
But yeah, I did expect that should work too on 0.16. If does’t oh well, we may wait for official repo update. If that is what we looking for.
So I think the way this works is that you would create a ComponentSystemGroup for you 10hz update group, use UpdateInGroup to assign systems to that group, and then assign a new FixedRateUtils.FixedRateCatchUpManager(0.1f) to the FixedRateManager property on the component system group.
FixedRateCatchUp:
/// Configure the given ComponentSystemGroup to update at a specific fixed rate, using the provided timestep.
/// If the interval between the current time and the last update is bigger than the timestep,
/// the group’s systems will be updated more than once.
From what I understand you have to do it like this
First create This class
public class CustomFixedRateManager : IFixedRateManager
{
public bool ShouldGroupUpdate(ComponentSystemGroup @group)
{
if (IsTenthOfASecPassed())
{
return true;
}
return false;
}
public float Timestep { get; set; }
private bool IsTenthOfASecPassed()
{
return true;
}
}
than
var fixedStepSimulationSystemGroup = World.GetOrCreateSystem<FixedStepSimulationSystemGroup();
fixedStepSimulationSystemGroup.FixedRateManager = new CustomFixedRateManager();
Okay guys i got it down with the help of thebanjomatic thanks
public class TenHzSystemGroup : ComponentSystemGroup
{
public TenHzSystemGroup ()
{
FixedRateManager = new FixedRateUtils.FixedRateCatchUpManager(0.1f);
}
}
[UpdateInGroup(typeof(TenHzSystemGroup ))]
public class TenHzSystem: SystemBase
{
}
is working
make sure that you use GetEXISTINGSystem or else you override something and it will just run in non fixed timesteps