i want to share some details about the replication progress, please share your thoughts.
it seems like this is a tough task, we have done a lot of reading and experimentation, basically for a server authoritative, responsive replication you need:
-server running the actual physics.
-a proper input synchronization with buffering.
-for the other players cars, receive transforms from server and interpolate(optionally use a dead reckoning technique).
-for your own car, run local physics to predict, when a correction comes from server, snap back or rewind and then replay.
it is not that hard in theory but client prediction seems difficult in practice. the problem could be physx, i have read about some attempts with the same techniques with physx and i have not seen a successful one yet(let me know if you have seen any). they are mostly abandoned or they used bullet engine like rocket league. in my experiments physx diverge a lot even with the same location and same forces, other bodies can change the course of simulation even if they are not interacted. in addition unreal engine does not use fixed time steps so it makes things a bit more difficult but fixed time steps does not help with physx as i have tested it on unity too.
so we are still working on it but this can take more time and we do not want to delay new versions. our plan is to give users 3 replication modes:
1-regular pawn replication : this what you currently get, has problems already. we only sync inputs, unreal does the rest. you will have 3 options for input sync:
- send a single unreliable input
- send a single reliable input
- send a buffer of unreliable inputs, do not clear the buffer until the input is acked back from server. this will use more bandwidth but protects you from bad network conditions.
2-client authoritative replication : this will have zero input latency, it will be like a local game for the player and server will send other cars transforms so you can show them smoothly. the three input sync options will be the same for the player. the downside is that this is completely open to hacking and one problem to solve in this technique is the collisions.
3-server authoritative replication : this is the actual technique to be implemented. for the next version we will include buffered input synchronization and interpolation but client prediction will not be available.
after the next release we will try to find a proper way to do the client prediction and make more bandwidth optimizations and bug fixes.