Vixen
02b45cc4
csharp
public sealed class PredictionSmoothingSystem

Decays each predicted object's correction into an offset on its visuals.

Read the guide page for this →

As a system

Phase
PreRender

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 Access
  • public PredictionSmoother Smoother

    The per-object error, its half life and its snap distance.

  • public int SmoothedCount

    How 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