Hey there @BlankMauser!
I’m glad that you like coherence. Making it simple yet powerful is one of our top goals. I can’t wait to see what you can build with it
Let me try to address your points:
- Coherence input queues are the standard workflow.
It is one possible workflow, yes.
- Because this project is deterministic by nature, misprediction and rollback is handled automatically.
Not yet, but we do help with rollback via CoherenceInputSimulation<SimulationState>
(more on this in the docs). We are planning to make it automatic though.
- All thats necessary in this case is to set simulation to Client side
- In server-side auth, simulation must be called on client manually, and misprediction must be detected by comparing frame values manually too. (Presumably every other frame)
- In both workflows a SimulationState struct must be defined. But rollback is not called in server-side auth sims for obvious reasons. So I must call them manually using the OnNetworkReceived callback.
- Input buffer works in both modes. Allowing you to set input delay to manage mispredictions better.
CoherenceInputSimulation<T>
was built specifically for GGPO type of games and so it doesn’t play well with the server-side auth. It expects inputs from all clients to be delivered whereas in server-side auth mode input is delivered only to the Simulator (aka game server) that is producing and syncing the game state. As of today, we do not have any utilities for reconciliation in server-side auth mode, but full FPS support (prediction, reconciliation, lag compensation) is on our roadmap so stay tuned!
I’m also curious about one other aspect. GGPO has whats called “Frame Advantage.” This is where clients may slowly drift out of time sync with one another. Usually in this case, the client who is ahead will pause in lockstep to allow the other player to catch up. What does coherence do in this case?
All clients sync their frames with the replication server. Each client then uses Time.timeScale
to speed up or slow down the simulation to make the local frame match the server frame. If instead, you’d prefer to pause the simulation to let other players catch up, then you can disable the timeScale
control in the CoherenceMonoBridge
settings and pause the simulation manually.
Also does coherence allow us to set how many frames to simulate? Example, a player who has very high latency might have to simulate more frames than another player, in BOTH client-side or server-side auth workflows correct?
The number of frames that can be predicted is controlled directly via input buffer size (configurable via CoherenceInput
inspector). A buffer with a size of 5 allows for predicting 5 frames into the future. If we don’t get inputs from all clients within those 5 frames then a pause will be issued.
When it comes to players with high ping I don’t think there’s a single best solution. We can:
- Set big input delay for a high-ping player - this will make the game tough for the high-ping player (inputs will feel laggy) but smooth for low-ping player
- Introduce simulation frame delay for the high-ping player - high-ping player will get constant rollbacks
- Keep static input delay and simulation frames in sync - low-ping player will get constant rollbacks due to late inputs from the opponent. Smooth experience for the high-ping player
I hope this helps answer your questions and gives you a better understanding of how inputs work in coherence. If you have any further questions or run into any issues while using coherence, don’t hesitate to reach out!