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.

Localised strings

We were talking about automated tests already, but finally their count and coverage is slowly starting to grow. One of the determinism test was failing for cube. It was really strange, because he had two testing directories for Factorio and it failed just in one of those. The aha moment was when we found out that one of the Factorio installations had different language setup. This is a problem, because there are lot of things in the game state that are affected by the current language (The "flying text", error messages in the console, script-based gui elements, message dialogs etc.). This image illustrates what can be seen by different players when they mine the same chest:

The solution of this problem is almost finished, and it is based on the principle, that all the texts in the game are stored as localisation keys (with parameters that can be localisation keys, that can have parameters etc.), and evaluated when needed, so different players in the multiplayer game will see different texts, but the game state will still be the same. It brings some complications as the scripts need to work with the localised strings without actually accessing their value. This means that all of the mods that work with localisation will have to be updated in 0.11.

FPS versus UPS

One of the problems we had while playing multiplayer was, that the game was laggy when Tomas zoomed out and his computer couldn't handle the 60 FPS. When is the slower computer rendering the frame for too long, the update thread is waiting for it to finish, this means the game stops for a small while (get slower), but as all the players in the MP game need to be synchronised, all of them have to slow down as well. As the game update runs in a different thread the solution was not so complicated. The update can now simulate more than one logical game steps (up to 3 currently) without rendering it, to catch up with the time-schedule. This results in laggy (but not slowed) experience for the player with slower computer, but it doesn't slow down all the other players. This also means, that the low-fps mode is no longer needed, as it is automatically solved by this system as an side-effect.

Office 2.0

As we said last week, the first office was cancelled, but the good news is, that we already found great alternative. It has enough space for a lot of the team reinforcements and it is located in the center of Prague. We really like the place and are quite enthusiastic to finally move there. We had small "Factorio level up party" yesterday and apart our friends one of the Factorio player arrived as well, so hello to Kuba :)

This is the set of the biggest pizzas I saw in my life :)

The regular comment thread at our forums is ready.