Huge amounts of lag in multiplayer

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
jleprince
Manual Inserter
Manual Inserter
Posts: 3
Joined: Mon Sep 21, 2020 1:54 am
Contact:

Huge amounts of lag in multiplayer

Post by jleprince »

I have a massive amount of lag when playing multiplayer. It seems to be a somewhat common issue from the posts I've spent my night browsing... but most of the answers result in some form of "Your UPS/FPS is causing issues, "server desync because your PC can't keep up", etc. That is NOT the issue I'm experiencing.

The server is hosted in NYC, I'm in the Midwest. I have two friends in the Midwest as well, both playing on the same server, both have latency below 10 (in ticks). When I connect, the minimum latency (in ticks) I have is 40... but it is in constant flux between that and 256. The buffer also varies wildly, and I have periods where it stutters, the "jumps" statistic climbs very high, and then goes back down to 0.

We have tried hosting on one of their computers as well. When my friend hosts, he and my other friend can play fine while my issues persist. When I host, I can play fine while they both have lag spikes and stuttering issues. I had an offsite server start a new game, to ensure that it wasn't an FPS/UPS issue; as soon as the game launches, I stutter all over the place and have massive tick latency.

It seems like the problem is my network, right? But I only have latency to the server when I'm connecting to it THROUGH Factorio. When I ping the server in cmd or my router diagnostics, I have a stable 50ms or so of latency. No ping spikes, minimal packet loss.

Can someone help me troubleshoot why I'm having such massive issues with this game? No other multiplayer game that I've played on my network (dozens) has given me ping above 60, anywhere in the country. Why is Factorio giving me such a hard time?

Some stats:
Spectrum Fiber, 200mbps down, 20mbps up, 2ms jitter, 31ms ping (to Chicago)
Intel Core i5-9600K 3.70GHz
16.0 GB of DDR4-3200 RAM
GeForce 1070 w/8GB vRAM
Windows 10.0.19041 64-bit

In Task Manager...
Memory shows about 30% utilization while running Factorio
CPU usage shows about 20%
Ethernet data shows minimal usage

In Factorio, the debug time-usage shows all values under 1, except for:
Sleep (about 14.5)
and Frame Cycle (about 16.5)

I'm running Factorio version 1.0.0, it's the first version I've ever tried multiplayer on, so I'm not sure if my issue resides with the update or if it would have occurred in previous builds as well. Uninstalling and reinstalling through Steam hasn't helped.

Does anyone have more troubleshooting steps I could try?

Thank you in advance

Zavian
Smart Inserter
Smart Inserter
Posts: 1641
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: Huge amounts of lag in multiplayer

Post by Zavian »

I would start by posting your logfile (after a session with the issue), and maybe the rest of the info in viewtopic.php?f=7&t=68653.

(I know you have said this isn't a performance issue, but there was a recent case where Windows was running the client cpu at only 1 GHz, and some of the info you posted is consistent with possible performance issues).

Other than that my best guess is a network or firewall issue. Possibly network congestion. (Are your friends using the same isp, or a different isp? Is it possible to test from their place, using their network connection? Comparing traceroutes to the server between you and your friends might also be interesting).

If I recall correctly there have also been some issues in the past that were traced to firewalls deciding to rate limit upd packets.

If you are using a wifi/wireless connection then try using a wired connection instead.

jleprince
Manual Inserter
Manual Inserter
Posts: 3
Joined: Mon Sep 21, 2020 1:54 am
Contact:

Re: Huge amounts of lag in multiplayer

Post by jleprince »

Hey, thanks for the response

Here's a log file from a session yesterday. I don't know much about it, but the latency updates obviously are what stand out to me...

I'm on a wired connection. And the game is not being interrupted by a firewall. The next time my group is on I'll have them do a traceroute to the server we're currently using.

Can you think of any reason why I can ping the server just fine in cmd and router diagnostics, and get good results... But the game itself struggles so much to do the same?
Attachments
factorio-current.log
(13.6 KiB) Downloaded 135 times

starlinvf
Fast Inserter
Fast Inserter
Posts: 145
Joined: Sat Dec 14, 2019 6:28 pm
Contact:

Re: Huge amounts of lag in multiplayer

Post by starlinvf »

jleprince wrote:
Tue Sep 22, 2020 3:10 am
Can you think of any reason why I can ping the server just fine in cmd and router diagnostics, and get good results... But the game itself struggles so much to do the same?
For one.... Traffic shaping. This is why net neutrality and the torrent throttling debate is always so heated. ISPs, among almost every other tech industry that can be publicly bench marked, have been known to optimize speed tests for good metrics, but have their normal traffic behavior be on the level of 3 different types of dumpster fires. For all we know, you could also have a man in middle acting proxy for all your uncategorized traffic, or put on bulk traffic priority. If you wanna test that, and assuming your router can support it, you can categorize Factorio's traffic as something with higher priority tags, like VOIP or video, and see what it does.

Second..... Local Proxy. Anti-virus and security suites are notorious for this. Like Norton, AVAST and McAffee. They run all network traffic through a local loopback that points to proxy process that scans all traffic payloads.... a process that can be slow and CPU intensive. This is most commonly attached to the "PII monitoring" features, but reroutes all network traffic on the machine out of operational necessity.

Third.... High error rates on the Line. Tends to be a problem on network systems that don't do smart throttling.... but you'd be noticing a lot of other issues if this were the case.

Forth..... Congestion. See one to understand why speed tests aren't reflective of greater scope network performance.

Fifth..... weak router throughput. This gets more complicated then it sounds. Depending on what your router is doing with packets, you can have a wide range of issues ranging from slow handling processes (like DPI, and QOS stalling) to fragmentation problems. I've seen a number of AUTH processes on steamAPIs go ballistic with certain consumer grade routers, due to fragmentation handling.


As to why it can be unique to factorio? well..... we'd have to talk about the ludicrous amount of bespoke whitelisting and optimization that goes on with the vast majority of Security software, definitions, heuristics systems, drivers, OS, and even ISP level Network management; to which AAA side of the industry can afford to throw their weight around and get consideration for, while indie dev and players of such games would have to argue for, and probably get ignored.

Your case is probably kiddie pool side of potential problems....... but the rabbit hole in its totality is quite vast and deep.


And I've also completely skipped over the difference between a complete process to process network loop, verses an ICMP only test. The latter of which is what a Ping falls under. Fun Fact. Most modern multiplayer games have an artificial latency built-into its update cycle, ranging from 50ms to as high as 500ms in some larger scale games. Shockingly, this is to compensate for network jitter and processing overhead, rather then build in more robust error handling/correction behaviors needed for low latency performance.

jleprince
Manual Inserter
Manual Inserter
Posts: 3
Joined: Mon Sep 21, 2020 1:54 am
Contact:

Re: Huge amounts of lag in multiplayer

Post by jleprince »

Appreciate the response... and the info. But do you have any specific advice on what I can do to troubleshoot the issue?
To summarize:
- Tracert to the server shows nothing abnormal, ping at the last hop is around 60ms consistently (which is normal for me going to the East Coast)
- Pinging the server through cmd constantly while playing tells me I have around 60ms through cmd, but the latency in game still fluctuates between 60 (ticks) and 254(ticks)
- My friend ran a tracert to the server, with almost identical results to me; he has slightly lower latency, but he lives closer to the server anyway
- I've tried running the game while using my VPN service (PIA). The hops in tracert are significantly different, but the issue in-game persists.
- The issue persists on every server I connect to. I've tried multiple public servers... and new games on the server we use.
- I pulled out an old laptop, installed Factorio, and connected to multiple severs. All have the same issue of high latency in multiplayer.
- I don't think it's a straight congestion issue. The issue persists at 6pm, 3am, and everywhere in between. I have the issue during periods of heavy network usage, and when I'm the only one in the house.
- The only thing I HAVEN'T tried is bypassing my router entirely...

If it's an ISP issue, what sort of information do they need from me in order to work on it? If it's an issue with my in-home network, is there any way that I can pin it down? Is there a way to send Factorio data specifically along a different route? Would that even help?

Again, appreciate you guys trying to help.

Koub
Global Moderator
Global Moderator
Posts: 7199
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Huge amounts of lag in multiplayer

Post by Koub »

In case that could help, note that Factorio uses UDP, not TCP. That might help you troubleshoot your issue. I remember a black magic issue that was solved at some point due to some UDP packets being filtered out by an ISP if they had a specific checksum, which prevented multiplayer (source).
Koub - Please consider English is not my native language.

starlinvf
Fast Inserter
Fast Inserter
Posts: 145
Joined: Sat Dec 14, 2019 6:28 pm
Contact:

Re: Huge amounts of lag in multiplayer

Post by starlinvf »

I'm at an overall loss. if it follows machines on your network, it suggests its something with the network. If it was me, I'd be going deep on the router to see what its doing, and hope for clues.

Post Reply

Return to “Technical Help”