#SubApp for Server-authoritative, Client-side predicted Multiplayer?

2 messages · Page 1 of 1 (latest)

nocturne quartz
#

Hey folks. I'm looking to use Bevy for a multiplayer game I'm working on. The game will have server side authority with client side prediction (similar to the gdc talk for overwatch networking).

The gist is as follows:

  • client sends inputs to server for tick: n
  • server receives inputs for all clients (with some buffering) that it manages
  • server simulates tick: n and sends world state back to client for tick: n
  • because of latency, client receives server state for tick: n when the client is at tick: n+delta
  • client re-simulates from tick:n --> tick:n+delta all at once and applies that new, corrected state

My main questions are:

  • Is a SubApp with some custom scheduling the right way to handle the re-simulation? I.e. Copy relevant chunks from main app to a sub app running all of the same systems relevant to the simulation. Run from tick:n --> tick: n+delta as fast as possible. Copy chunks back into the main app.
  • Can I force this re-simulation to run entirely before the main app's FixedUpdate tick?

Loving Bevy so far, thanks for the hard work!

potent sonnet