You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The client should be able to predict the result of most actions, so that it can play it's animations when the user interacts, instead of waiting for the server to tell it. There should be some anticipation system, here's my idea of how to do it:
When you recieve your next response, created a filtered version of the new events, by filtering out the predicted events.
Commit the filtered events
Now to check that you've anticipated correctly, you need to create two game states to check for equality:
- settle each unfiltered event to the backed up version of the game state, call this the accurate state
- settle each event in the event queue to a copy of the current game state, call this the predicted state.
If the stringified json of the accurate game state matches that of the predicted game state, then clear the backup and do nothing. Otherwise, clear the event queue, change the game state to the accurate one.
The text was updated successfully, but these errors were encountered:
The client should be able to predict the result of most actions, so that it can play it's animations when the user interacts, instead of waiting for the server to tell it. There should be some anticipation system, here's my idea of how to do it:
- settle each unfiltered event to the backed up version of the game state, call this the accurate state
- settle each event in the event queue to a copy of the current game state, call this the predicted state.
The text was updated successfully, but these errors were encountered: