question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Substantial delay in connecting a player to a multiplayer server running JoshariasSurvival

See original GitHub issue

What you were trying to do

Connect normally with a 2nd client to an already running game server without extensive load times. Varies based on modules enabled.

A hosting client doesn’t take an inordinate amount of time standing up the server and connecting to it. Issue does not present in plain CoreSampleGameplay.

With ManualLabor enabled (identified as a culprit in #4126) connecting took a moderate 30-45 seconds for player 2. With the rest of JS enabled it went to a full 3 minutes in one test.

What actually happened

Logging in for JoshariasSurvival did succeed after #4148 was merged, and didn’t slow down the host, however it took a full 2-3 minutes for no apparent constructive reason. @keturn has done some initial research noted on #4126 and on Discord (in #stabilization I think) that points to more potential issues like what #4148 fixes, that might be rooted in how Gestalt handles some stuff. So this may be a fix needed over there (either as a point release for the 5.x line or eventually by upgrading to 7.x)

Progress bar may hold some hints as to which parts are causing the delays. Asset scanning and system initialization seemed two big ones. Just trying to look real quick it seemed like about 45s for asset scanning. 1m for initializing systems for the first player to join a headless server. Think initialize systems took longer with a hosting client + client.

How to reproduce

  • Host a server via game client running JoshariasSurvival (or configure override.cfg and run a headless server)
  • Wait for the server to be fully online and connect to it with a second client
  • Observe the loading time, progress bar, and stages of game logging

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
keturncommented, Sep 19, 2020

Recapping some of my ramblings from #stabilization:

Watching the connection/loading process with a profiler does reveal some slow things.

When I looked at some of those things (which do relate to asset scanning and initialization), I found some places I believe have potential for optimization.

The hitch is that I’m new to these tools for profiling multi-threaded Java applications, and I’m new to those parts of the source, and I have very little surety that the things I was looking at are the same things responsible for making multiplayer so much dramatically worse than it was a release or two ago. After all, it’s not like gestalt v5 changed in that time.

(though now that I mention it, it’s possible we did change something about the gestalt dependency in the TeraNUI branch.)

Bisecting the history to discover when the issue started would be very useful. Not only would it provide more confidence that we were looking at the right problem, I think it would do wonders for morale and maintainability to be able to say “this is what changed and this is the impact it had” to replace my current vague dread that something changed but no-one can say what.

I’m daunted by the thought of conducting a search that requires navigating not only engine’s version history, but that of JoshariasSurvival and its dependencies as well. I don’t know if there’s someone more fearless who is willing to tackle that, or if we first need to set up some tooling to facilitate that kind of multi-repo search process.

0reactions
keturncommented, Aug 14, 2021

Now that Terasology is using gestalt-module v7, this is up for re-investigation.

See if we can still reproduce this. Maybe it was fixed by v7 itself.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Source Multiplayer Networking - Valve Developer Community
Low latency is a significant advantage when playing a multiplayer online game. Techniques like prediction and lag compensation try to minimize ...
Read more >
Factorio - MAssive multiplayer lag - Steam Community
When I play MP with friends we have one guy that is in college and uses its internet (it's bad) every time he...
Read more >
Setting Up Dedicated Servers - Unreal Engine Documentation
The server-client model used by Unreal Engine represents network multiplayer games with one server acting as the host of the game, and players...
Read more >
Setting Up Your Own Minecraft Server - iD Tech Camps
Connect to Your Server. Now that you've port-forwarded your connection, other players can connect using your external IP address. Have players ...
Read more >
Dedicated Servers - Space engineers
Dedicated servers in Space Engineers allow players to connect to a third party host, ... connection and a more fluent multiplayer performance with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found