In my Simutrans-Experimental server (http://forum.simutrans.com/index.php?topic=8969.0), I have noticed that there seem to be fairly frequent desyncs, especially, but not only, when players interact with the world. To check the cause, I used a debugger to check where the calls to disconnect were coming from: all of them that I found (and there were several) came from this part of the code in network_cmd_ingame.cc:
if (get_sync_step() < welt->get_sync_steps()) {
if (!ignore_old_events()) {
dbg->warning("network_world_command_t::execute", "wanted to execute(%d) in the past", get_id());
welt->network_disconnect();
get_sync_step() was usually 1, sometimes 2, less than welt->get_sync_steps().
I think that I am right in deducing that this method will kick a client that has run ahead of the server. Am I further right in gathering that the server_frames_ahead and additional_client_frames_behind parameters in simuconf.tab are intended to prevent this, but possibly at the cost of command execution delay, and that increasing these numbers can reduce this type of desync? Does the server_frames_between_checks parameter make any difference here?
May I ask - what is the normal cause of the client running ahead of the server?
Normal causes (and also most possible ones): Server too slow or very varying ping times or timer troubles.
Hmm, thank you - somewhat difficult to counter any of those directly. I have found, however, that setting additional_client_frames_behind to a higher number seems to help quite a bit.