D
D
DrSpritz2015-10-05 11:46:27
Game development
DrSpritz, 2015-10-05 11:46:27

How is network synchronization organized in flight simulators and racing?

Hello!
I recently decided to add multiplayer to one of my games (space-flyer-shooter-killer). In theory, I didn’t have any big questions, everything is typical and quite easy. And in principle, everything was fine, but when it came to network synchronization of the position of the players in the virtual space, and then I got a thorn in the fifth point.
To implement this task, I used standard approaches for synchronization, sent 10 packets per second and interpolated the position of clients between the received coordinates, though for a slightly longer time (~ 110ms), in order to avoid twitching during strong ping jumps, but in the end I received an additional delay in ping additives. And everything works, in principle, tolerably, the boats crawl, spin, but ... as soon as it is worth dispersing the boat to decent speeds, then problems immediately appear, the ship starts to sausage strongly, and the higher the speed, the more coblash. I tried to increase the interpolation time, the ship, in principle, began to behave more calmly, but the desynchronization turns out to be huge, if you move after someone, then the error in the actual location is about 5-7 ship hulls.
Guys, I honestly don't know, maybe this is normal, although for some thread of racing, I think such problems will be critical.
Can you please tell me how to solve the problem of network synchronization for very fast moving players (racing, flight simulators)?
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
gawozi, 2015-10-05
@gawozi

You may need to make a smooth transition from one position to another on the client

N
ndbn, 2015-10-05
@ndbn

I think all calculations should be done on the server and it should tell clients the position of them and neighboring ships (in the field of view).
For example: server, client1, client2
initial position: client1 - 0 units, client2 - 10
A tick (iteration) passes on the server, let's say ships move 2 units.
The server broadcasts (broadcast) on an event or on a ping request
client1 receives: client1 position - 2 units, client2 position - 12 units. Thus, the server always knows the exact positions of the ships, the possibility of cheating and sending information about a fake location to the server is excluded. (To be fair, I’ll say that I have nothing to do with game development)
client2 receives: position client1 - 2 units, position client2 - 12 units.
As soon as clients receive this information, they display it (move models, etc.).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question