Option to make server wait for slowest client

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Loewchen
Global Moderator
Global Moderator
Posts: 9558
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Option to make server wait for slowest client

Post by Loewchen »

Right now (14.22) when a client can no longer keep up the simulation speed with the server he either gets dropped (rare) or ends up constantly jumping over missed ticks, which usually is unplayable for the slow client.
If the host wants the slow client to still be able to participate, he manually has to slow down the simulation (/c game.speed = 0.8).

But this method has the following flaws:
  • the host has to be made aware of the issue
  • the method to slow down the game has to be known
  • the speed reduction is not automatically adapting
  • the speed reduction is not automatically removed after the slow client has left
I therefore propose developing a (deactivated by default) server setting that would make the server automatically adapt the game speed until an adjustable minimum value (e.g. 0.5 of normal speed).
Maybe even differentiate between server admins and common players.

- Greetings Loewchen
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Option to make server wait for slowest client

Post by ssilk »

Added to viewtopic.php?f=80&t=32968 Collection of Of Ideas around Multiplayer: Lobby-Features, Joining, Mod&Game-Loading, ...
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Harkonnen
Fast Inserter
Fast Inserter
Posts: 207
Joined: Fri Sep 02, 2016 9:23 am
Contact:

Re: Option to make server wait for slowest client

Post by Harkonnen »

We actually had exactly same discussion inside the team not long ago. It has chance to appear in coming major releases.
ekimekim
Burner Inserter
Burner Inserter
Posts: 17
Joined: Wed Dec 13, 2017 11:40 pm
Contact:

Multiplayer adaptive game speed (slow down for slow clients)

Post by ekimekim »

I run a multiplayer server with a very large base, which hits up against UPS limits. The problem that we have is that some players' machines aren't as capable as the server. If the server is capable of running the base at 60 UPS, but the client is only capable of doing so at (say) 55 UPS, then the player falls behind then disconnects, or can't join in the first place. If it's borderline and the player can _just_ keep up, the game steals time from the render loop, lowering the FPS to maintain the UPS, creating an almost-unplayable experience.

My solution has been to manually set the game speed down via console command when certain players want to join, limiting the server to (say) 50 UPS so that a player that can barely do 55 UPS can both keep up and get a decent FPS.
However, this process is highly annoying and error-prone (I'll often forget to set game speed back up, so everything takes longer even if no-one is logged in).

Unfortunately I can't simply give console command access to my players even though they're trusted, because they can't even fully connect to the server (can't catch up) so they have no way to send a console command to slow the server down.

What I'd like to see is an optional feature that a server admin can enable, where the server will attempt to adapt its game speed value to match the slowest connected client. Then it can speed up again when the slow client disconnects.
Obviously this can be abused by a client that reports itself being unplayably slow, DoS-ing the server, so this option would only be appropriate for trusted clients (or you could cap the slowdown to some minimum value, say 0.5).
Zavian
Smart Inserter
Smart Inserter
Posts: 1650
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: Multiplayer adaptive game speed (slow down for slow clients)

Post by Zavian »

+1

I had thought that the devs were planning to do this, but I can't find post atm.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Multiplayer adaptive game speed (slow down for slow clients)

Post by eradicator »

Back in 0.15(or was it 0.14?) the server always completely paused while somebody is joining. "Catching up" didn't exist. I wonder if that's still a togglable option somewhere deep down in config.ini. For megabases that take very long to download and are very slow to catch up it would probably still be better.

Hm.. i wonder how feasible it would be to replace a large portion of the "catching up" phase, by sending a (binary) file-level-diff between the current game state and game state the server is at right now? Someone with a good megabase should test how large a diff of the uncompressed savegame is after 1/2/5 minutes.
Zavian
Smart Inserter
Smart Inserter
Posts: 1650
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: Multiplayer adaptive game speed (slow down for slow clients)

Post by Zavian »

eradicator wrote:Back in 0.15(or was it 0.14?) the server always completely paused while somebody is joining. "Catching up" didn't exist.
That must have been before 0.14, because in 0.14 I played a few weeks on a server where the download was 5 min, but the catch-up was 30 mins, (most of the time there wasn't someone already online to pause the game). Personally I think that the server should default to paused until a player is in the game (ie the player has finished downloading and caught up). Last time I played multiplayer regularly the server unpaused when the first player connected, but if you are struggling to catch up,your cpu is struggling, you can spend 30 mins in catch-up, with no-one online able to pause.
nuhll
Filter Inserter
Filter Inserter
Posts: 958
Joined: Mon Apr 04, 2016 9:48 pm
Contact:

Re: Multiplayer adaptive game speed (slow down for slow clients)

Post by nuhll »

Nice idea. Could be done via Mod, or? COuld also be usefull for Singleplayer?!
ekimekim
Burner Inserter
Burner Inserter
Posts: 17
Joined: Wed Dec 13, 2017 11:40 pm
Contact:

Re: Multiplayer adaptive game speed (slow down for slow clients)

Post by ekimekim »

Single-player already does this - if you can't maintain 60 UPS _and_ a decent FPS, it slows down and just runs as fast as it can.
The issue is when the MP server is faster than the client, since everyone needs to keep up with the server.
mrvn
Smart Inserter
Smart Inserter
Posts: 5969
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Multiplayer adaptive game speed (slow down for slow clients)

Post by mrvn »

I would think this shouldn't even be optional. The server should never run faster than players can keep up with. Additionally I would suggest that the speed is halfed while a player is joining to make catching up easier. Note that you can't even join as first player. The game should realy just pause while the first player connects. Why does it even start already while the download is ongoing?

Now you mentioned that a player can now DOS the game by being really slow. That's what admins are for. Simply kick the player. For that the game should be more reactive at slow speed. So even at 1UPS the GUI should react instantly and kicking a player should work at the speed the admins network connection allows. Not at the speed the DOSing players client can keep up with.

The GUI could also show the slowest player, updated once a minute or so. Players could then vote to kick him and if a (configurable) majority votes yes then he gets kicked. No need for everyone to be admin to handle bad players.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Multiplayer adaptive game speed (slow down for slow clients)

Post by eradicator »

If "last minute average milliseconds needed to compute a tick" was synchronized (like resolution is now) then almost all of this would suddenly become moddable.
User avatar
kizrak
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Thu Jul 19, 2018 1:27 am
Contact:

Re: Option to make server wait for slowest client

Post by kizrak »

Where is the proper place to show my support for such an amazing awesome improvement!?! 8-)

I was trying to do this via a (soft)mod without much success: Player API: latency buffer jumps
bobucles
Smart Inserter
Smart Inserter
Posts: 1708
Joined: Wed Jun 10, 2015 10:37 pm
Contact:

Re: Option to make server wait for slowest client

Post by bobucles »

It makes sense to throttle a server when no one is able to keep up and to autopause at the very least for the first player who connects. Everything beyond that is a matter of preference. Some admins may prefer to always throttle while some admins want to limit it.
Zavian
Smart Inserter
Smart Inserter
Posts: 1650
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: Option to make server wait for slowest client

Post by Zavian »

bobucles wrote:It makes sense to throttle a server when no one is able to keep up and to autopause at the very least for the first player who connects. Everything beyond that is a matter of preference. Some admins may prefer to always throttle while some admins want to limit it.
You might not want to throttle just because one user connects with a low clock speed laptop processor, but you probably want the server to auto-throttle before you get to the no-one can keep up stage. (One way to do achieve a semblance of auto-throttling currently, is to run the server on something mid range, perhaps an old 2.6 Ghz processor). But you can achieve a better and more fine-grained result if the server could autothrottle down to some admin set minimum speed.

Aslo if the server is set to auto-pause when no-one is connected, then I agree it shouldn't un-pause until the first player to connect actually finishes downloading the map.
Nidan
Filter Inserter
Filter Inserter
Posts: 275
Joined: Sat Nov 21, 2015 1:40 am
Contact:

Re: Option to make server wait for slowest client

Post by Nidan »

Zavian wrote:Aslo if the server is set to auto-pause when no-one is connected, then I agree it shouldn't un-pause until the first player to connect actually finishes downloading the map.
I would go one step further: Even if the server doesn't auto-pause, it should pause while the first (and only the first) player is connecting
mrvn
Smart Inserter
Smart Inserter
Posts: 5969
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Option to make server wait for slowest client

Post by mrvn »

And you could run the server at max(0.9 * second_slowest, slowest) or similar.
Aeternus
Filter Inserter
Filter Inserter
Posts: 835
Joined: Wed Mar 29, 2017 2:10 am
Contact:

Re: Option to make server wait for slowest client

Post by Aeternus »

Or, if it hasn't been implemented yet, a manual slider to reduce UPS to a specific factor? It'll also allow you to slow down games for folks who want a more relaxed experience ('though honestly, Factorio's pace is fine).
mrvn
Smart Inserter
Smart Inserter
Posts: 5969
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Option to make server wait for slowest client

Post by mrvn »

Aeternus wrote:Or, if it hasn't been implemented yet, a manual slider to reduce UPS to a specific factor? It'll also allow you to slow down games for folks who want a more relaxed experience ('though honestly, Factorio's pace is fine).
There are mods for that. Problem is you can't click a button to slow down when you are too slow to keep up. You can't even join the game, not even as first person.
TwentyEighty
Fast Inserter
Fast Inserter
Posts: 170
Joined: Thu Jan 10, 2019 3:11 pm
Contact:

Re: Option to make server wait for slowest client

Post by TwentyEighty »

Bumping thread since my bug report got moved to technical help. This is actually a bug though, not being able to join a server if you're slower than it. Everything else in this thread is a feature request but not being able to join the -auto paused- server at all should be considered a bug.
oloklir
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Dec 17, 2018 6:09 pm
Contact:

Mitigating multiplayer lag spikes by server performance tuning

Post by oloklir »

(Non-native speaker's partially auto-translated words)
TL;DR
Factorio server application needs the dynamic & active & smooth performance tuning feature which is client friendly.
What ?
Factorio server has to tune automatically its simulation performance for clients' smooth gaming experience.
Currently, in manual way, underclocking server's CPU to about 2.0 ~ 3.0 GHz (2.5 GHz average).
Reducing [game.speed] parameter is not smooth way to deal lag spikes( = low FPS / high UPS / high jumps ).
Why ?
Factorio multiplay is the process that clients catching up the server's speed.
In other words, clients must always be faster than the server to play smooth game.
Or, the server must always be slower than clients to make clients experiencing smooth game.

However, most of server owners don't know about this fact.
Some server owners think that the server should be fast. This is common sense in normal computer world.
But Factorio server is different.

They sometimes choose the worst. They even overclocks their server's CPU.
Rather, the server's CPU need to be properly underclocked for helping various clients' smooth game.

Too fast server will make clients uncomfortable if the base is large.
As the base grows, slow clients catching up hardly server's UPS start to experiencing lag spikes( = low FPS / high UPS / high jumps ).
Especially in situations of intense engagement, the server perceives the client's character as doing nothing while the client catching up.
If a client experiences lag spike in a dangerouse situation, the character will stop and only the threats can move, causing it to die.

Server managers often lower the [game.speed] parameter when clients are uncomfortable. However, this doesn't really help with lag spikes, it only slightly reduces the time catching up. Even in stable situations, the speed is not restored.

The most smooth way to mitigate lag spikes is to lower the server's processing speed. This can be achieved by underclocking the server's CPU.
Depending on my experience, underclocking to about 2.0 ~ 3.0 GHz (2.5 GHz average) generally satisfies a large number of clients.

However, this method affects the entire performance of the server computer, especially the map saving speed. This can make server owners be annoyed.

Factorio server application needs the dynamic & active & smooth performance tuning feature which is client friendly.
Post Reply

Return to “Ideas and Suggestions”