Fix Your Netcode!
-
- Burner Inserter
- Posts: 13
- Joined: Tue Aug 11, 2015 9:38 pm
- Contact:
Fix Your Netcode!
O_O @_@ *old movie scream*
I was trying to play with my friend and it was working fine for awhile but today it was being really laggy. It's "working" but being very, very slow. So I wiresharked it again...and nearly VOMITED. Remember awhile ago when the game would crash because it would drop a UDP packet and fail. I said that a cheap and dirty solution would be to spam the same packets a number of times and hope that it picked one up. um...I DIDN'T MEAN ACTUALLY DO THAT...or at least not for this long, you should have switched to proper TCP by now. If this is not how the game is supposed to work, well it's doing that, so fix it. This should be top priority, cause this is B.A.D.
Do we need to use the force to get you to use TCP, or any other protocol used properly. Or at least have separate connections for local and remote. Because seriously...please no more duct tape solutions.
I was trying to play with my friend and it was working fine for awhile but today it was being really laggy. It's "working" but being very, very slow. So I wiresharked it again...and nearly VOMITED. Remember awhile ago when the game would crash because it would drop a UDP packet and fail. I said that a cheap and dirty solution would be to spam the same packets a number of times and hope that it picked one up. um...I DIDN'T MEAN ACTUALLY DO THAT...or at least not for this long, you should have switched to proper TCP by now. If this is not how the game is supposed to work, well it's doing that, so fix it. This should be top priority, cause this is B.A.D.
Do we need to use the force to get you to use TCP, or any other protocol used properly. Or at least have separate connections for local and remote. Because seriously...please no more duct tape solutions.
- StoneLegion
- Filter Inserter
- Posts: 687
- Joined: Fri Sep 05, 2014 7:34 pm
- Contact:
Re: Fix Your Netcode!
You are an idiot... I'm sorry but there is many reasons this game should not be TCP to the point that I'm not going to waste my time. I hate calling people idiots but then again you started attacking the developers with your comments... I highly doubt you even understand the inner workings and why it's the way it is....Cyberdragon wrote:O_O @_@ *old movie scream*
I was trying to play with my friend and it was working fine for awhile but today it was being really laggy. It's "working" but being very, very slow. So I wiresharked it again...and nearly VOMITED. Remember awhile ago when the game would crash because it would drop a UDP packet and fail. I said that a cheap and dirty solution would be to spam the same packets a number of times and hope that it picked one up. um...I DIDN'T MEAN ACTUALLY DO THAT...or at least not for this long, you should have switched to proper TCP by now. If this is not how the game is supposed to work, well it's doing that, so fix it. This should be top priority, cause this is B.A.D.
Do we need to use the force to get you to use TCP, or any other protocol used properly. Or at least have separate connections for local and remote. Because seriously...please no more duct tape solutions.
This is also not a bug maybe a suggestion but not a bug.
-
- Long Handed Inserter
- Posts: 71
- Joined: Sat Jan 31, 2015 7:36 am
- Contact:
Re: Fix Your Netcode!
Well, the packet spam is routinely killing my friend's router, making him disconnect the entire household from internet over there. And it only happens when we play Factorio. So, he is right in some regard, there is some fixing to be done.
-
- Burner Inserter
- Posts: 7
- Joined: Thu Sep 10, 2015 1:12 am
- Contact:
Re: Fix Your Netcode!
redacted
(I was clearly drunk when I originally made this comment)
(I was clearly drunk when I originally made this comment)
Last edited by ChucklesTheBeard on Thu Feb 28, 2019 8:00 pm, edited 1 time in total.
Re: Fix Your Netcode!
I, uh, hate to break this to you, but your friend's router may be crap.Berserker55 wrote:Well, the packet spam is routinely killing my friend's router, making him disconnect the entire household from internet over there.
- StoneLegion
- Filter Inserter
- Posts: 687
- Joined: Fri Sep 05, 2014 7:34 pm
- Contact:
Re: Fix Your Netcode!
They are always improving it... Take a game like Space Engineers and try it's MP... After a few Months from no netcode to netcode they have done amazing things. But this topic was more of an attack.
Their already using I think Lock step that you see in some the RTS games that helps cut down the traffic. But your talking about something massive vs 20 npc's running around the map..
Your Router issue or friends router might be really bad... I assume he can't torrent then if this kills his router.. If it's a ISP Router then gateway off and get a proper router.
Their already using I think Lock step that you see in some the RTS games that helps cut down the traffic. But your talking about something massive vs 20 npc's running around the map..
Your Router issue or friends router might be really bad... I assume he can't torrent then if this kills his router.. If it's a ISP Router then gateway off and get a proper router.
-
- Burner Inserter
- Posts: 13
- Joined: Tue Aug 11, 2015 9:38 pm
- Contact:
Re: Fix Your Netcode!
If there are reasons that factorio should be UDP when MAP DOWNLOADING, then give them. I've talked to other people who are computer savvy, who don't play this game, so they aren't bias, and even they think it's stupid to download files over the open internet with UDP. UDP is for LAN and streaming, not downloading.
And no, it has nothing to do with internet speed, this is a 2D sprite based game, it shouldn't take that much to play. I can play other games just fine but this one hogs the internet. And you people out their with your 50Mbps fiber connections or whatever who can take the packet spam till it slows down to 1% internet speed and still play just fine, you have no idea. I don't know what is causing the lag while playing, but I'm pretty sure it's down to poor netcode, given that the map downloading is this bad.
And no, it has nothing to do with internet speed, this is a 2D sprite based game, it shouldn't take that much to play. I can play other games just fine but this one hogs the internet. And you people out their with your 50Mbps fiber connections or whatever who can take the packet spam till it slows down to 1% internet speed and still play just fine, you have no idea. I don't know what is causing the lag while playing, but I'm pretty sure it's down to poor netcode, given that the map downloading is this bad.
Re: Fix Your Netcode!
Moved to General discussion.
I agree with you that UDP is not the best protocol to use when downloading the map. I've got a pretty old modem/router (>6 years) and it limits the download rate I get when downloading a map.
However, Factorio uses UDP because when you're ingame the state of the map is communicated every tick, 60 times per second. UDP is the better choice here. I guess when the devs added the map download they used the already working UDP code. In a LAN this works perfect, but over the internet there's always some peers who have old equipment/bad internet and the map download takes ages. The map download might be better handled with TCP.
The devs are aware of this issue, I hope they do something to change the current map download.
I agree with you that UDP is not the best protocol to use when downloading the map. I've got a pretty old modem/router (>6 years) and it limits the download rate I get when downloading a map.
However, Factorio uses UDP because when you're ingame the state of the map is communicated every tick, 60 times per second. UDP is the better choice here. I guess when the devs added the map download they used the already working UDP code. In a LAN this works perfect, but over the internet there's always some peers who have old equipment/bad internet and the map download takes ages. The map download might be better handled with TCP.
The devs are aware of this issue, I hope they do something to change the current map download.
Re: Fix Your Netcode!
Yeah, the devs must be idiots. That's why we repeatedly see suggestions of the form "It's so obvious! Why don't they just..." with popular choices for obvious things being
- make it multithreaded? It would be four times as fast on a quad core!
- use TCP for networking? It would be way more reliable!
- write to a temporary file in RAM first before copying it to disk? The game then wouldn't freeze during autosaves!
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
-
- Long Handed Inserter
- Posts: 71
- Joined: Sat Jan 31, 2015 7:36 am
- Contact:
Re: Fix Your Netcode!
It certainly is, but there's nothing he can do, as it's a shared flat.Narc wrote:I, uh, hate to break this to you, but your friend's router may be crap.Berserker55 wrote:Well, the packet spam is routinely killing my friend's router, making him disconnect the entire household from internet over there.
Re: Fix Your Netcode!
Graphical fidelity has very little to do with how much information needs to be exchanged. There's literally tens of thousands of entities in at any one time in the game. Those all need to be synchronized between the clients. In your average good looking AAA FPS, there's 64 people on a server at best. That doesn't need anywhere near the amount of data exchange for a synchronized game state.Cyberdragon wrote:And no, it has nothing to do with internet speed, this is a 2D sprite based game, it shouldn't take that much to play.
Ignore this
Re: Fix Your Netcode!
Yes, graphical fidelity has for Factorio nothing to do with network usage andGammro wrote:Graphical fidelity has very little to do with how much information needs to be exchanged. There's literally tens of thousands of entities in at any one time in the game. Those all need to be synchronized between the clients. In your average good looking AAA FPS, there's 64 people on a server at best. That doesn't need anywhere near the amount of data exchange for a synchronized game state.Cyberdragon wrote:And no, it has nothing to do with internet speed, this is a 2D sprite based game, it shouldn't take that much to play.
No, those tens of thousands moving items and activated buildings are NOT sent over the wire - that's the reason the game has to be always in deterministically determinable states (Factorio-speak: "synchronized") otherwise the simulation of the mutliple clients becomes divert ("desyncs").
I just don't understand why they have to use UDP, because every "tick" of the game can be sent out, but it does NOT have to be realtime.
For example have six clients and one suddently loses a burst of packages, then his simulation stops after the last received package.
Now, if user input could also be merged/muxed into the packet-input stream for the game engine to be processed, then the game could pause at any time for the lagging clients to catch up and continue from there - deterministically
- Kewlhotrod
- Fast Inserter
- Posts: 166
- Joined: Thu Apr 23, 2015 5:20 pm
- Contact:
Re: Fix Your Netcode!
^dis, plz fixprg wrote:Yeah, the devs must be idiots. That's why we repeatedly see suggestions of the form "It's so obvious! Why don't they just..." with popular choices for obvious things beingThe devs sure can be glad to have you guys around to tell them how to write a game.
- make it multithreaded? It would be four times as fast on a quad core!
- use TCP for networking? It would be way more reliable!
- write to a temporary file in RAM first before copying it to disk? The game then wouldn't freeze during autosaves!
ty <3
Re: Fix Your Netcode!
Huh, why doesn't it have to be real-time? You do know that the game can't simulate a tick until it's received all the player input for that tick, right?dee- wrote:I just don't understand why they have to use UDP, because every "tick" of the game can be sent out, but it does NOT have to be realtime.
Re: Fix Your Netcode!
I see we have tons of developers here. Why don't you all try to make your own game? Pfff
-
- Long Handed Inserter
- Posts: 97
- Joined: Tue Oct 28, 2014 3:33 pm
- Contact:
Re: Fix Your Netcode!
Reason: TCP requires packets to be acked/nacked in-order. Whereas as long as the packets have proper sequence numbers (which they have to have either way) you don't need packets to be in order - you can receive them in whatever order and then shuffle them around as needed, asking for retries as necessary. This is especially relevant on lossy connections (say: wifi), where a momentary connection interruption can cause a delay of (at minimum) a full round-trip.Cyberdragon wrote:If there are reasons that factorio should be UDP when MAP DOWNLOADING, then give them.
Reason: Poor window scaling on lossy connections. TCP is built around the assumption that most packet loss is due to congestion not external factors. And as a result it performs poorly on lossy connections.
-
- Filter Inserter
- Posts: 952
- Joined: Sat May 23, 2015 12:10 pm
- Contact:
Re: Fix Your Netcode!
reciever on a TCP has a buffer to hold the out of order arrivals.The Lone Wolfling wrote:Reason: TCP requires packets to be acked/nacked in-order. Whereas as long as the packets have proper sequence numbers (which they have to have either way) you don't need packets to be in order - you can receive them in whatever order and then shuffle them around as needed, asking for retries as necessary. This is especially relevant on lossy connections (say: wifi), where a momentary connection interruption can cause a delay of (at minimum) a full round-trip.Cyberdragon wrote:If there are reasons that factorio should be UDP when MAP DOWNLOADING, then give them.
Reason: Poor window scaling on lossy connections. TCP is built around the assumption that most packet loss is due to congestion not external factors. And as a result it performs poorly on lossy connections.
and wifi will retry on its own when packets don't go through
Re: Fix Your Netcode!
I think that's an important point: For connections, which are about to transfer much data, or over bad connections, a TCP-connection can run much more smooth, cause the devices in the route can fix problems in their connection in most cases themselves, they repeat the lost or wrong packets and can handle out very smart methods to make the communication as efficient as possible.
This is - AFAIK - not generally possible with UDP, because there is no "end-to-end" connection.
So on bad or laggy connections I think it might be useful to use TCP instead UDP.
This is - AFAIK - not generally possible with UDP, because there is no "end-to-end" connection.
So on bad or laggy connections I think it might be useful to use TCP instead UDP.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
- Darkestnoir
- Inserter
- Posts: 30
- Joined: Sun Nov 23, 2014 8:57 pm
- Contact:
Re: Fix Your Netcode!
Yeah, very slow download/upload speed over the Internet. I hope that will be fixed soon, 10mb download with 40kB/s are not funny.....