Minimal Server Latency of 6 ticks

This subforum contains all the issues which we already resolved.
Post Reply
Eximius
Burner Inserter
Burner Inserter
Posts: 10
Joined: Tue Jun 11, 2019 8:47 am
Contact:

Minimal Server Latency of 6 ticks

Post by Eximius »

Hello,

Seems that while the game efficiently uses udp connections, the latency of games is still ridiculously high, probably due to a semantic error.

This is not an isolated case: https://www.reddit.com/r/factorio/comme ... r_latency/

I believe this should be a priority since it affected and continues to affect _all_ multiplayer games to a high degree of annoyance.

Whenever playing on LAN with a friend, we had notoriously high latency ~10 ticks (as measured by multiplayer statistics). At some point, we did switch to ad-hoc, because routers are shit, so we were running on effectively few-hundred-micro-second latency. The best latency we could get in-game was ~7 ticks (120ms~?).

I ran two instances of the game on my computer and connected them to each other in multiplayer. The lowest latency was still ~6 ticks. On loopback. Literally ~80us packet latency at worst. Limiting the FPS/UPS to 18, the latency was still 6 ticks.

Version 0.17.47, linux x64 on Archlinux

I would not believe this is by design, as not only does it make the game severely handicapped for connected lan friends (not even talking about multiplayer), the game is built to only send required synchronization data (on largest games, only on the order of ~10KB/s).

In the unlikely event this is by design, would it be too much to ask to add a 'you are on your own' flag for "no packet delay"?

Hope this can be resolved soon.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Minimal Server Latency of 6 ticks

Post by kovarex »

There will be always some minimal latency, to minimize the amount of packets, packets are send every two ticks and the packets have to go from client to server and then back. It could be lowered a bit, and we could probably provide an option to send packets every tick, but solving this isn't a big priority now, as we have the latency hiding and other problems.

One day, we might try to look at that.

movax20h
Fast Inserter
Fast Inserter
Posts: 164
Joined: Fri Mar 08, 2019 7:07 pm
Contact:

Re: Minimal Server Latency of 6 ticks

Post by movax20h »

I noticed the same issue. When using on the LAN or running multiple instances on the same machine connected to headless server, using loopback (127.0.0.1 / ::1), I see 7, or 8 ticks of latency. Sometimes it does jump higher, to 11, 13, even 19. All on an empty freshly generated map with 0 entities total and players (2 connected players for example) are not moving or doing any actions. It is in peaceful mode with bitters disabled. Vanilla (no mods every installed or enabled).

I would really appreciate to be able to set maximum tick latency somehow.

I am testing this using 0.18.32, and Linux (non-steam client + headless server). My machine can easily handle 20 instances running from my tests. It is on AMD Threadripper 2950X (32 threads), and 128GB of RAM. Each factorio process (clients and server) is using less than 0.14 of a core, ~9-14% CPU% in top). Usually just 11% CPU. And less than 1% of total available memory.

tmzasz
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sat May 07, 2016 6:03 pm
Contact:

Re: Minimal Server Latency of 6 ticks

Post by tmzasz »

kovarex wrote:
Tue Jun 11, 2019 11:09 am
There will be always some minimal latency, to minimize the amount of packets, packets are send every two ticks and the packets have to go from client to server and then back. It could be lowered a bit, and we could probably provide an option to send packets every tick, but solving this isn't a big priority now, as we have the latency hiding and other problems.

One day, we might try to look at that.
sorry about brushing off the old necro shovel here but is there any updates as to when this will get looked at? 7 tick minimum latency kinda makes playing the game at times un-enjoyable on a server as 200ms to accept a command is a really long time game wise

Twinsen
Factorio Staff
Factorio Staff
Posts: 1329
Joined: Tue Sep 23, 2014 7:10 am
Contact:

Re: Minimal Server Latency of 6 ticks

Post by Twinsen »

The issue is quite fundamental to how the game synchronizes it's game updates, network updates and how things are buffered.
Hornwitser took a look at at the many issues causing unnecessary delays. In Version 1.1.43 you should see latencies as low as 2 ticks (33ms) on LAN.

Moved to resolved after 2 years :)

luc
Fast Inserter
Fast Inserter
Posts: 218
Joined: Sun Jul 17, 2016 9:53 pm
Contact:

Re: Minimal Server Latency of 6 ticks

Post by luc »

Twinsen wrote:
Mon Oct 25, 2021 11:05 am
The issue is quite fundamental to how the game synchronizes it's game updates, network updates and how things are buffered.
Hornwitser took a look at at the many issues causing unnecessary delays. In Version 1.1.43 you should see latencies as low as 2 ticks (33ms) on LAN.
A friend of mine and me are very interested in a writeup of this. If this could be included in a future FFF, that would be really awesome!

Post Reply

Return to “Resolved Problems and Bugs”