Hi there,
im coding a multiplayer game with player reconcilation.
The problem is that everytime the player runs against an enemy and a collide happens,
the reconcilation of the last tick takes place, applys "setVelocity(x, y) by the amount the client is ahead of the server and snaps through the minion because the concilation amount seems to be too big of a jump in pixels.
is there a way i can do collision substeps with matter js?
i tried the following:
playerInput.forEach((input) => {
const payload: PlayerInputPayloads[ClientEvents.MoveToDirection] = input.payload;
const deltaModifier = payload.frameDuration / 1000;
const distanceToMoveX = payload.vector.x * this.movementspeed * deltaModifier;
const distanceToMoveY = payload.vector.y * this.movementspeed * deltaModifier;
this.setVelocity(distanceToMoveX * 10, distanceToMoveY * 10);
const timings = this.scene.matter.world.engine.timing;
this.scene.matter.world.update(timings.timestamp, this.scene.matter.world.getDelta());
})
This seems to work with a world update after every reconcilation input but
it speeds up all the other entities in my game:
suggestions?