Vixen
02b45cc4
csharp
public sealed class PredictedOwnershipSystem

Decides which objects this client predicts, from who owns them.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The policy that was missing, and it is the one everything else already answers. Predicted is a tag, and until now a game put it on by hand. What a client should predict is what it is allowed to decide — which is exactly NetworkRules.Write, the same question the rigid bodies and the animators ask. Inventing a second notion of "mine" beside the rules is how the two come to disagree, and the day they disagree is the day a client predicts something the server will overrule on every single tick.

It removes the tag as well as adding it, because ownership is transferable: a vehicle somebody else takes is one this client must stop predicting, and a predicted object whose prediction is never confirmed is a correction every snapshot for as long as it lives.

Fields and properties (5)

  • public NetworkRulesRegistry? Rules

    Who decides what. Without it nothing is predicted, which is the safe answer.

  • public PlayerId Local

    Which player this peer is.

  • public int PredictedCount

    How many objects are predicted right now.

  • public long AddedCount

    Objects that started being predicted.

  • public long RemovedCount

    Objects that stopped.

Methods (1)

  • public void Update(World world)

    Brings the tags in line with who owns what.

Used by (1)

  • PredictionWiringTestsVixen.Net.Tests