Hi everyone! I once more seek your help!
For the start, here is the topic about my vehicles networking model for context: Topic
So, all of my vehicles are based on PhysX engine, however I don't use their vehicles model, I use my own physics by pushing boxes with forces etc. Results are very deterministic and use fixed time step simulation with state machines. My vehicles model is based on Rocket League mostly, so I predict all of the vehicles local, remotes, everything. Which means that all the vehicles we observer are in "Current Time" from our perspective. Usually prediction is close enough, so there is not that many rollbacks etc. We have done a lot of playtests, with a lot of people, and they were very successful.
However... our characters are not predicted. I found it extremely difficult to predict characters, because of their fast rotation and acceleration, they are nowhere near as easy to predict as vehicles are. So we only predict local character. Remote characters are always viewed from a few milliseconds from the past depending on latency. Effectively, we used fixed number of frames, that we are observing remote characters, so for example if you have 60ms ping, you will see remote clients from 65ms ago etc.
Our game offers leaving and entering vehicles with characters much like GTA etc.
Here is where the problems begin. Because we predict vehicles and we don't predict characters, it causes a lot of weird mismatches of the locations.
Basically our present version of the vehicle hits past version of the remote character, which is a huge problem, and causes characters to be forced inside vehicles and other weirds stuff. This is because our fixed time step simulation, before each next frame starts, forces all entities to their locations at that frame, so that they are all starting from the same state of the game at that point in time.
Too bad, characters are a few milliseconds from the past, so they were pretty much around our windshield this X amount of time ago, but our current vehicle is there.
It makes sense, these problems are something I completely understand, I understand they origin, but I can't seem to figure out a solution for it. Any kind of smoothing or interpolations won't work, because then we have character that is also pushed into vehicle, but slower, anything like that won't work here. Also, sweeping character capsule to check for collisions would be an option, but push out location is usually on the side of the vehicle or elsewhere, because it's the shortest path, and it's wrong comparing to the real location.
Does any of you have idea how other games such as GTA do stuff like this?
I came up with the solution to temporarily enable prediction for characters when they are hit, but that is very fragile system, and as soon as we mispredict the hit, it all falls apart. Characters go back and forth, and amount of time which we will be predicting for is also unknown.
Any ideas?