public sealed class PredictionSmoothingSystemDecays each predicted object's correction into an offset on its visuals.
As a system
- Phase
- PreRender
- Reads
- PredictionSmoothing
- Writes
- LocalTransform
- Runs before
- TransformSystem
Remarks
ClientPrediction reports corrections and deliberately does not hide them — "a rollback moves things, sometimes visibly, and smoothing that is a presentation problem with its own answer". This is that answer, wired: Take after a reconciliation, and the offset decays over HalfLife from there.
In PreRender and before TransformSystem, which is where PhysicsInterpolationSystem puts the same kind of work and for the same reason: what the renderer sees is the smoothed pose and what the simulation sees is the stepped one.
⚠ A correction larger than SnapDistance is not smoothed. Hiding a teleport is hiding the fact that the player is somewhere else, and a mesh sliding thirty metres across the level is worse than a cut. SnapCount says how often that happens.
Fields and properties (3)
public SystemAccess Accesspublic PredictionSmoother SmootherThe per-object error, its half life and its snap distance.
public int SmoothedCountHow many entities were offset on the last pass.
Methods (3)
public void Take(IReadOnlyList<PredictionCorrection> corrections)Takes the corrections a reconciliation produced.
public override JobHandle Update(in SystemContext context, JobHandle dependency)Runs the system.
public void Apply(World world, TimeSpan elapsed)Ages every error and writes the offsets.
Used by (1)
- PredictionSmoothingTestsVixen.Net.Engine.Tests