Extrapolated physics is a very nifty way of doing physics based on values such as Ping where instead of interpolating between values you already have, you try to predict ahead slightly both on server and on client based on how long it took that physics information to get there. This means if someone was going 10 u/s west
and was at <0, 0, 0>
, if it took 0.2s
for that information to go from one client to the other, the client (and server in total) should have the position adjusted to <-2, 0, 0>
to compensate. This means that what you see on each machine is roughly syncing ahead with velocity and rotvelocity. One of the challenges with doing this manually is when there are many constraints to evaluate, and moving things manually might make them react poorly. Here are the advantages of this form of physics networking:
- Syncs “ahead,” keeping objects like vehicles and characters in roughly the same position on all machines
What’s the difference?
Car A wins on their screen, but Car B is the real winner, maybe? Client A could have won server-side if their ping was low and Client B has high ping.
Positions synced accurately, Car A is the unquestioned winner.
- More locally simulated physics at a larger scale results in more accurate collisions and interactions
Since the positions are more synced, that means if 2 vehicles hit each other, the collision accuracy is far better as the vehicles would react on time and realistically.
How does this look?
Interpolation:
- Improper momentum transfer due to delayed impact and reaction
1st Perspective (Huge impact delay):
https://cdn.discordapp.com/attachments/399314021934825487/771280372419657738/Ex1Client1.mp4
2nd Perspective (Car hits late and stops early):
https://cdn.discordapp.com/attachments/399314021934825487/771280361015214080/Ex1Client2.mp4
- Inaccurate collisions due to delayed replication
1st Perspective (Car does not react to impact, also occurs if trying to hit someone who is moving fast):
https://cdn.discordapp.com/attachments/399314021934825487/771280383924371496/Ex2Client1.mp4
2nd Perspective (Hitting past hitbox, therefore not colliding with current hitbox):
https://cdn.discordapp.com/attachments/399314021934825487/771280394721034280/Ex2Client2.mp4
Extrapolation:
- Proper momentum transfer from syncing position data more accurately
1st Perspective (Momentum transfer occurs locally first then is corrected to actual outcome from server):
https://cdn.discordapp.com/attachments/399314021934825487/771280439859871774/Ex1Client1.mp4
2nd Perspective (Hit occurs locally at the right time):
https://cdn.discordapp.com/attachments/399314021934825487/771280434842697738/Ex1Client2.mp4
- Accurate collisions due to extrapolated replication
1st Perspective (Same reason as above):
https://cdn.discordapp.com/attachments/399314021934825487/771280443974221834/Ex2Client1.mp4
2nd Perspective (Same reason as above):
https://cdn.discordapp.com/attachments/399314021934825487/771280443731345408/Ex2Client2.mp4
Further demonstrations of extrapolated physics:
https://cdn.discordapp.com/attachments/399314021934825487/771270666946740224/Example1.mp4
https://cdn.discordapp.com/attachments/399314021934825487/771270675293011978/Example2.mp4
I feel like this is something that the physics system has been needing for quite some time and it would greatly reduce the number of headaches spent over attempts at manual replication, as well as improving the quality of standard racing, derby, and shooting games by more accurately syncing the physics information (although, at a cost to physics performance impact). This is something that most engines already allow you to change, usually with some sort of toggle or menu, so it would be great if it was a feature in this one.