I am a programmer and I don't have much background in mathematics. I know this question might look much more clear to you if I could articulate it in mathematical terminologies. The problem is this is my first question here and I don't know how to ask it in maths languages! So bare with me...
I am making a car-racing game where multiple players on the Internet can compete with each other. Each player drives a car whose position and rotation changes continuously over time. To let players over the network share the same game I have to quickly deliver each player's position and rotation to all other player. The problem is there is always going to be a network latency between data being sent and being received. In other words, by the time a piece of data reaches another player, it is already dated.
I think the solution to my problem is to make a function that can predict the position and rotation of other cars based on the previous data collected. When newer data arrives, the function should have a feedback so that error could be corrected. Parameters used for prediction should also be modified, maybe.
For example, I am thinking about sampling the position as well as velocity of my car evenly over time, and sending them to other player one by one. Now before other players receive my new data, they can use their own "predicted velocity" to approximate my movement. Once the new data arrives, they can use the new position and velocity to do error correction and make new predictions.
Some additional requirements about the function includes:
- Efficiency: the prediction and error correction function must be efficient because it is going to be computed by computer every tens of milliseconds.
- Robust: I will sample evenly but the other players won't receive data at an even speed, due to network uncertainties.
- Error Bound: it would be great if there is a way to confine error within a certain range.
I have been googling papers for such functions but I haven't found much useful information. Maybe it's because I don't have the correct keywords. So any answer/comment that
- helps to identify & clarify the problem in the math realm
- points to papers of solutions
is highly appreciated!