Package ac.boar.anticheat.prediction
Class UncertainRunner
java.lang.Object
ac.boar.anticheat.prediction.UncertainRunner
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptBoatTakeover(float yawShift) Shift to the center of the envelope's set.boatTakeoverShift(UncertainRunner.BoatTakeoverStart start, Vec3 prior) How far to shift our start so this tick ends at the claimed position, or null for no shift.boatTakeoverStart(EntityCache entity) A possible start position only.floatboatTakeoverYawShift(UncertainRunner.BoatTakeoverStart start, float predictedYaw) Takeover yaw: how many degrees to turn our start yaw so this tick ends at the boat yaw the client sent (VehicleRotation yaw).floatextraOffset(float offset) voidNote: for anticheat developers on other platform, this code if when the player have the flag PUSH_TOWARDS_CLOSEST_SPACE if there isn't, the player can be instantly push out by bruteforce direction to push out then getting the direction with the smallest value (...) I can't remember the max value to be pushed out, maybe around 0.8+? but yep.
-
Constructor Details
-
UncertainRunner
public UncertainRunner()
-
-
Method Details
-
boatTakeoverStart
A possible start position only. The caller must run the normal boat tick from it and check the result. -
boatTakeoverShift
How far to shift our start so this tick ends at the claimed position, or null for no shift. The client's start can be another point on the boat's recent path, because its interpolation timing differs from ours. - The client's start (our start plus the end difference) must be inside the set FollowerEnvelope kept at the first-control step (FollowerHistory.envelopeControlSet). The set is built only from times Boar saw, plus float slack, nothing else. There is no distance cap on top: a cap below the set would only decline a true start (a fast boat on ice) and send a correction. - The shift must not move the boat through blocks (knownBoatShiftClear). - The normal boat tick from the shifted start must then end at the claim (acceptBoatTakeover). Why a set and not a fixed radius: in-game testing showed true client starts that a fixed radius declined, and none outside the set.prior: null on the first try. On the second try (BoatTicker.takeover) it is the shift a run already used. The new shift is prior plus what is left between that run's end and the claim. All checks apply to the total shift. Why a second try: pushing a box out of the floor (depenetration) can move two starts differently, so the first shift can miss. In-game testing showed this in flowing water: our start was pushed up and forward onto a block edge, the client's start straight up.
-
boatTakeoverCenterShift
Shift to the center of the envelope's set. Used when the end-difference shift was declined or missed. Why: our own start (the nominal interpolation) can be off the set, and physics from a wrong start can miss in another axis. In-game testing showed this on ice: our boat sat too low, the floor push-out moved it sideways, and the client's boat rested at the set's single point. The normal boat tick from this start must still end at the claim (acceptBoatTakeover). Null when the set is not trusted, the shift is below acceptance, or it would move the boat through blocks. -
boatTakeoverYawShift
Takeover yaw: how many degrees to turn our start yaw so this tick ends at the boat yaw the client sent (VehicleRotation yaw). 0 means no turn. Why: on a turning boat the client's interpolation timing gives it a different yaw at takeover, the same way it gives a different start position (boatTakeoverShift). - The turn must fit the envelope's yaw range at the first-control step (FollowerHistory.envelopeControlYawOffsets): the yaws the client can show at that step, as offsets from our own yaw. No range, or a range the envelope does not trust, declines the turn. A declined turn, or one outside the range, is not taken, and the position-only try runs as before. - Our yaw change in one tick does not depend on the start yaw (BoatTicker.simulate), so the end difference is also the start difference. This needs VehicleRotation to be the yaw after the client's tick. acceptBoatTakeover still checks the end yaw. In-game testing showed turning takeovers got a correction a few ticks later without this, and none with it. -
acceptBoatTakeover
public boolean acceptBoatTakeover(float yawShift) -
uncertainPushTowardsTheClosetSpace
public void uncertainPushTowardsTheClosetSpace()Note: for anticheat developers on other platform, this code if when the player have the flag PUSH_TOWARDS_CLOSEST_SPACE if there isn't, the player can be instantly push out by bruteforce direction to push out then getting the direction with the smallest value (...) I can't remember the max value to be pushed out, maybe around 0.8+? but yep. You can either do uncertainty or calculate it that way. However, without the flag getting into crawling mode is annoying and who knows is mojang going to break it or not. -
extraOffset
public float extraOffset(float offset)
-