Information about GameLift local

Hi There,

We are using GameLift on a fairly large multiplayer project. So far things have been pretty smooth, clients and server are communicating happily enough and performance is good.

However as the project develops its getting more and more time consuming to upload builds, debug server code, add fixes, reupload etc. So I’ve been looking into running the server on my local machine to test and debug the server quickly and easily.

I have followed the amazon guide, but I become stuck at the point of connecting a client to the server. I can run the server locally after running GameLiftLocal.jar, which correctly detects my server starting. I then changed the IP address it connects to use my local IP (tried both localhost and manually entering the IP). But I cannot get the client to connect to the server successfully.

Reading the documentation it doesnt explicitly state GameLiftLocal is meant for the purpose. Should I be able to fully test all aspects of the game locally? Or am I misunderstanding its use and actually it is only meant to verify gamelift API calls?

From our point of view we really need to test everything locally, the game logic is fairly complex and having to reupload builds every time we need to test a change to server logic is going to be too time consuming in the long run.

Any info will be greatly appreciated.
Thanks.

GameLift local is a local simulation of GameLift that enables you to test most parts of GameLift outside of FlexMatch and process termination (both are highly requested features that hopefully will get added some day).

You should be able to easily test:

  • Server initialization
  • Game session creation
  • Player connecting with that game session.

For example I do the following all the time (all cribbed from here: https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-testing-local.html)

Start GameLift local (note am using port 9080, defaults to 8080 if -p is not provided)

cd C:\Amazon\GameLift_04_16_2020\GameLiftLocal-1.0.5
java -jar GameLiftLocal.jar -p 9080

Start my server (in this case I’m using Lumberyard so I tell it the port to use; ignore the rest of the params as they aren’t important. Note: If your server needs to call GameLift then it needs to override the client config to be the local endpoint http://localhost:9080

MultiplayerSampleLauncher_Server.exe +sv_port 33435 +gamelift_start_server +map MultiplayerSample

Now in Lumberyard local I should see my server connect, call InitSDK and ProcessReady and my server is now ready to host a game session.

Now am going to place a session on gamelift local; not fleet id is immaterial here can be anything

aws gamelift describe-game-sessions --endpoint-url --endpoint-url http://localhost:9080 --fleet-id 1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d --region us-west-2
aws gamelift create-game-session --endpoint-url http://localhost:9080 --maximum-player-session-count 2 --fleet-id fleet-1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d --region us-west-2

Should see GameLift local calling OnGameSession hooks in my local server and server than calling ActiveGameSession when ready. Returns the game session id

Create a player session if required (using game session id from create game session call)

aws gamelift create-player-session --game-session-id "arn:aws:gamelift:local::gamesession/fleet-1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d/gsess-abb00eeb-c8c4-41d5-8dcf-b4a2f03c4fc9" --player-id 12345 --endpoint-url--endpoint-url http://localhost:9080 --region us-west-2

How you test client/server connection is then up to you’ve wired getting game session/player session ids to your client.

If you client needs to call GameLift to get this information (ie describe game session/player id) then you’ll need to overide its client config to talk to GameLift etc http://localhost:9080

Your client at this point should get the ip address of the session and its port and connect via its normal route. If your client is failing at this point, check all the normal client/server connection troubleshooting spots:

  • Your server is listening on the port that it reported in ProcessParameters
  • Your game session is reported to be on that port
  • The client is using the right port
  • If you are using TLS/OpenSSL you have your certs correctly installed for communication
  • Your server is accepting connections etc.