We need a new protocol message spectate request which the client should send to the host.
The client needs to synchronize the game state within the server before starting spectating in real time.
We have two options for that:
- The host responds with a stream of the inputs from the beginning of the match until the client becomes synchronized.
- Concerns:
- could we use the same
InputMessage as a normal sync?
- would be better to have a new specialized callback on INetcodeSessionHandler?
- Pros:
- we already have an input sync infrastructure
- inputs are small
- Cons:
- the client will need to rebuild the game state frame by frame.
- The host responds with the current serialized game state.
- Pros:
- no state sync is needed
- we already have the state serialized deterministically
- Cons:
- state size can be big
- no infrastructure for large-body messages
UPDATE:
Now we can have the complete input history for a remote session, which can be used to sync late spectators states
We need a new protocol message spectate request which the client should send to the host.
The client needs to synchronize the game state within the server before starting spectating in real time.
We have two options for that:
InputMessageas a normal sync?UPDATE:
Now we can have the complete input history for a remote session, which can be used to sync late spectators states