Connection to dedicated server times out

Greetings everyone,

I am working on a game in Unreal Engine 4 and currently have troubles with my server connection over gamelift. This is a wierd problem so hear me out.

What I am doing:
I am using my game and server build from the same source. I am using the Steam OnlineSubsystem of Unreal Engine.
I know all the stuff needed like ports, .ini files, build targets, creating fleets, including the right SDKs etc.
The Matchmaking works fine and in local testing I could also connect with and without using steam. (Tested with multiple machines)

Then I uploaded the build to GameLift and made a fleet out of it: fleet-6e12d73d-5a0d-42f8-8148-5443c9b8c2e3Connection worked and everything was fine.

Today I tried connecting over Matchmaking and also over Searching and Creating a GameSession again, but the connection now times out.

I had this problem before. Basically it is the same as this problem @chiefGui had found here: https://forums.awsgametech.com/t/cant-connect-to-gamelift-server/5180/1

The only difference is the following weird behaviour:The same fleet already worked, and the archived GameSessions proof it.

I don’t know what changed, there is even the same Instance and THE SAME SERVER PROCESS still running since it first started.

I have no idea what else I could test, I need some more help.

Kind regards,

Stefan

The following fleet with it’s corresponding game build does also not work anymore.

fleet-1215a522-a9d5-44ca-82ba-623d4db026b0

Okay, nevermind the last comment. fleet-1215a522-a9d5-44ca-82ba-623d4db026b0 and client are actually able to connect after restarting steam?? The game was already the correct build before restarting though…

Hey @spReiste, sounds like you’re up and running now.

In the future, it can be helpful to differentiate between a connection to GameLift timing out, and the connection directly to your game server timing out.

Connections to GameLift would be the HTTP calls made to the APIs like StartMatchmaking or SearchGameSession. Timeouts in these calls would be very unexpected, the more likely problem would be permissions related where you should received well formed error messages and HTTP 4xx responses.

If you successfully create a game session and you get an IP / Port to create a direct connection between your game client and game server, I’ll list what the mostly likely causes to help with troubleshooting:

  • Port mismatch between what the game server is listening on and what the client is trying to connect to.

  • Security settings on your GameLift Fleet. In the Fleet settings, you need to open up both the port AND the protocol (TCP or UDP). Not opening the port at the fleet level would cause connection timeouts.

  • Game server health. It’s possible GameLift might think your server is healthy, but it isn’t healthy or isn’t starting your game up correctly. (If the game session transitions from PENDING to ACTIVE, that would be a good sign that your server is healthy and starting the game session).

We unfortunately don’t have any experience with integrating Steam and don’t have any insights into how to debug Steam interactions in Unreal if that is the issue.

Hey @Geoff, thanks for your reply!

I think I found out why the connection was timing out, and it is not a problem with GameLift. Sorry for the false alarm. Also I am not sure how to work around that. The timeout is hardcoded (to 15 seconds) in UE4s Engine code and would need a custom engine build to be changed at all. This is also only present in the steam subsystem and not in the UE4 standard one. (Connection takes about 18 to 25 seconds.)

Do you have any advice on speeding up a connection to a server running on GameLift? Trying to do the connection locally does not time out. (Besides the region I launch the fleet in. I already chose the closest region for setting up my fleet.)

Kind regards, Stefan