I'm not sure what did you mean but I think the server just shares the data about car damage, car positions, player related data (name, car choise...) etc. ... and checks that the client has valid version of LFS
But wouldn't it be *** to have the server run the physics of the all cars too?
I think the system is more like this:
the server just shares the data. Meaning that that it gets data from player A's client and sends it to other players. Then these client machines check the positions of the other cars and compared it to the postion of your own car (also speed and other factors too). As the network system has lag and the physics system has lag, these two make this possible:
Let's imagine two cars racing on the track:
1. cars are 1 mm from each other
2. a data package is send to the server by both clients about their current situation
3. Server forwards the data back to clients
Let's assume these 3 steps take 0,2s to happen.
In the meanwhile the cars have moved forward and also closer to each others in their clients' LFS engine. The server does not know this yet. The real distance between them is now -5mm. So the cars are "overlapping". At the moment the client A thinks that the other car B is driving directly forward. The client A does not get any actual data about this but it predicts it. The same is done vice versa.
4. So the both clients think there is some distance between them. Now the clients recieve the packets from the server. The collision system (the rays system, as mentioned earlier) is ran and the prediction damage is calculated and shows up in the 3d model. (the ray models notices that the cars are overlapping)
5. The actual code handling the actual damage and physics is calculated (the bounding box, as said earlier). It gets some weird data about the distance and the speeds of the cars (the distance of the cars being now -5mm). As it was just just before positive and bigger. (This may or may not be the cause why we sometimes get some strange sky flying episodes, but I have some more to it. The physics engine may see that the other car has a lot more speed than it in reality has and therefore it thinks the impact is much higher...read on)
6. The physics are run in the clients' machines and clients send this data to the server, which forwards them as said earlier.
6.1 at the same time the car of the client gets its physics data and the physics are run. The car of the client A gets the force of the impact and moves slightly away from the the other car B (but the B doesn't see it yet, though he moves away also, but the A does not see this. They both see the other has moved when they get their packets from server.
7. The impact is not that big, so the cars don't change their lines much. So when the clients recieve the next packets the data on those says: Cars are still inside each other, distance being -3mm, but the speed of the both cars is away from each others too. Maybe the clients engine can't understand this (or the force factor is coded so that it is set as integer with values acceptable being over 0 and under 50000 (can't remember the right values for this, sorry). As it gets a negative value (or too big one) the integer gets "upside down" and becomes something really big. Or it gets a 0, meaning there is no effect at all.
But there is also a third option. As the bounding box sees the distance is negative it tells the phys engine to create a negative force too. As this force draws the other car close the value gets again negative and bigger, let's say -12mm. Now the bounding box gets the right values for the speed (cars gettting closer) and wrong values for the distance. So it just gives some berzerk values to the physics engine, which creates a big force between the cars.
8. So the client A gets a big value and flies off the skies while the B keeps driving and notices an airplane on the sky
. The client A sends the data to the server which just forwards it, and doesn't notice those ridiculous values about it's altitude.
I will read this once more, once I've got my head cleared up. So beware the obvious logical errors in it