Skip to content

Commit

Permalink
time delta faster lerp
Browse files Browse the repository at this point in the history
  • Loading branch information
andylippitt committed Mar 10, 2019
1 parent 6d0b113 commit 50fa68e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Game.Engine/wwwroot/js/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ connection.onView = newView => {
interval = setInterval(updateButton, 1000);
}

lastOffset = view.time - performance.now() + Math.random();
lastOffset = view.time - performance.now();
if (!serverTimeOffset) serverTimeOffset = lastOffset;
serverTimeOffset = 0.99 * serverTimeOffset + 0.01 * lastOffset;
serverTimeOffset = 0.95 * serverTimeOffset + 0.05 * lastOffset;

const groupsLength = newView.groupsLength();
const groups = [];
Expand Down

0 comments on commit 50fa68e

Please sign in to comment.