Before I dig into possibly improving the client-side input prediction, I've just been familiarizing myself with the code. While giving it a quick look, I saw that storeServerUpdate() seemed be doing two things: storing the server update, AND re-playing player input. It feels like these should be separate concerns (so that we can re-play player input on client render frame loops and not when the server sends more data). To that end, I did a small refactor contained in this pull request.
Before I dig into possibly improving the client-side input prediction, I've just been familiarizing myself with the code. While giving it a quick look, I saw that storeServerUpdate() seemed be doing two things: storing the server update, AND re-playing player input. It feels like these should be separate concerns (so that we can re-play player input on client render frame loops and not when the server sends more data). To that end, I did a small refactor contained in this pull request.