Blog search

Friday Facts #149 - Deep down in multiplayer

Posted by kovarex on 2016-07-29

Hello! I have been deep down in the multiplayer internals the whole time since the last Friday facts. I think about multiplayer when I eat, I think about it when I ride my bike, I even have dreams about packets travelling from place to place, when my wife asks me what do I think about, I'm almost afraid to tell the truth. So obviously there is nothing else I could write about than the multiplayer in this Friday facts. This is going to be somewhat technical.

Friday Facts #302 - The multiplayer megapacket

Posted by Twinsen, Klonan on 2019-07-05

The multiplayer megapacket Twinsen Last month I joined KatherineOfSky's MMO event as a player. I noticed that after we reached a certain number of players, every few minutes a bunch of them got dropped. Luckily for you (but unluckily for me), I was one of the players who got disconnected every, single. time, even though I had a decent connection. So I took the matter personally and started looking into the problem. After 3 weeks of debugging, testing and fixing, the issue is finally fixed, but the journey there was not that easy. Multiplayer issues are very hard to track down. Usually they only happen under very specific network conditions, in very specific game conditions (in this case having more than 200 players). Even when you can reproduce the issue it's impossible to properly debug, since placing a breakpoint stops the game, messes up the timers and usually times out the connection. But through some perseverance and thanks to an awesome tool called clumsy, I managed to figure out what was happening. The short version is: Because of a bug and an incomplete implementation of the latency state simulation, a client would sometimes end up in a situation where it would send a network package of about 400 entity selection input actions in one tick (what we called 'the megapacket'). The server then not only has to correctly receive those input actions but also send them to everyone else. That quickly becomes a problem when you have 200 clients. It quickly saturates the server upload, causes packet loss and causes a cascade of re-requested packets. Delayed input actions then cause more clients to send megapackets, cascading even further. The lucky clients manage to recover, the others end up being dropped. The issue was quite fundamental and took 2 weeks to fix. It's quite technical so I'll explain in juicy technical details below. But what you need to know is that since Version 0.17.54 released yesterday, multiplayer will be more stable and latency hiding will be much less glitchy (less rubber banding and teleporting) when experiencing temporary connection problems. I also changed how latency hiding is handled in combat, hopefully making it look a bit smoother.

Friday Facts #156 - Massive Multiplayer

Posted by Tomas on 2016-09-16

Hi all, sometimes, writing FFF feels like spitting out blood - there is simply very little to write about. Yet the Factorio blog subscriber crowd is there and waiting ... Sometimes it is the opposite and there is abundance of interesting topics available. Today it is the latter case. Enjoy!

Friday Facts #53 - Multikulti Multiplayer

Posted by kovarex on 2014-09-26

Hello, the summer is officially over soon. I have this tradition of denying it by wearing just a t-shirt as long as possible, so I'm getting less and less comfortable outside until I accept the defeat by the cold weather. The experience is, that the short days and ugly weather speeds up the work on Factorio as we tend to stay inside and code all the time.

Friday Facts #152 - Team production challenge

Posted by kovarex on 2016-08-19

Hello, it has been quiet here the last week, Rseding is back in America, Albert is in Spain, and some people have holidays. I have been programming until 9:30pm and then I realized I have to write Friday Facts, so it is going to be shorter today, although this happens quite often to me.

Friday Facts #139 - Wrapping Up MP UI

Posted by Tomas on 2016-05-20

Hello everybody, the work on the 0.13 is slowly getting to the final phase and hence it feels like a good time to give an overview of actual multiplayer changes that have been implemented over past couple of weeks. This is a recap and extension of a FFF post that mentioned the Multiplayer improvements while there were in progress.

Friday Facts #330 - Main menu and File Share Shenanigans

Posted by Twinsen, wheybags on 2020-01-17

The main menu rework Twinsen Up until I looked at the source code, I was always confused about the differences between "Start campaign", "New game" and "Scenarios". New game seems like the same thing as "Scenarios"->"Freeplay", but are there any differences? We then later added a few more bonus scenarios, but they are hidden in the scenarios menu, with no explanation about what each is, what to expect or if it works in multiplayer. I believe it's very important to communicate to new players information about the game's content. It's also important to show that freeplay is the intended way to play. So all this prompted me to rework the main menu a bit. I started with the structure. The structure always seemed odd to me, compared to what I'm used to from other games. Important options like "Load game" are lost among options that are never used (like "Replay game"). So I came up with a new structure. It looks like this: Continue Single player New game Load game Multiplayer Host new game Host saved game Browse public games Browse LAN games Connect to address Map Editor New scenario Convert save Settings ... Mods About The first new thing to notice is the "Continue" button. Since "start the game and continue my last save" is probably the most common thing players will do, it makes sense that there is an option for this right at the top of the main menu. The button will contain the name of your latest save. Pressing it will immediately load the game and get you in game. Due to implementation complications, for now it only handles save games and it will NOT connect you to the last server you played on if your last play session was multiplayer, but I might implement that if it's highly requested. Next, everything was grouped into either Single player or Multiplayer. There are much fewer options, since "Replay game" was moved as a small button in "Load Game", and every way to start playing the game was moved to the new "New Game" GUI. The "New game" GUI shows all the ways to play the game. It also groups them nicely, places freeplay on top, shows a description and even a nice image. This GUI is used for new game, multiplayer hosting and map editor, thus simplifying the menu quite a bit. For modders, scenarios can now contain a description.json file. In the file "order" determines the sorting in the New Game GUI; "multiplayer-compatible" determines whether the scenario is shown when trying to host multiplayer games. "multiplayer-compatible" was added to description.json file of campaigns also.

Friday Facts #66 - Merry christmas

Posted by kovarex on 2014-12-26

You would expect that we wouldn't have anything new during christmas, but you couldn't be more wrong, as the Factorio development never stops.

Friday Facts #157 - We are able to eat paper, but we don't do it

Posted by kovarex on 2016-09-23

Hello, we have written a lot about multiplayer in the past weeks, it started by the reports at the beginning of the rewrite, and now it finishes with our reports of mega games being played. But as most of our time still goes to bug hunting to achieve 0.14 stable as soon as possible, I just can't help myself: