Server with multiple rooms



I'm setting up GameLift, but I'm having some trouble wrapping my head around matchmaking and having servers that have multiple matches going on at the same time.

I've made a card game where 2 players can play against each other in a room. Each server could hold lets say 200 rooms.

I have an idea in my head on how this could work, but not sure if it would.

Two players enter the matchmaking queue and get paired up. GameLift then finds a server with room for 2 players and sends the client the details. The clients connect to that server and are thrown into a room based on some id or key or something (not sure if GameLift could generate this?).

asked 2 years ago199 views
4 Answers

GameLift would allow you to:

  • Match make 1v1 game sessions based on provided player attributes. Note: GameLift does not store player data for you, so you would need to track and update ELO rankings in something else assuming ranked matches are important to you.
    • Each player would open a matchmaking ticket with the attributes required for your matchmaking ruleset
  • Find open server processes to host the match and or scale a new server if required.
  • Player's 'see' their tickets fufilled, ticket contains player session details to connect on.

Thinks to note:

  • GameLift currently has a restriction that a server can run only one game session (if running hosted servers in GameLift). You can pack multiple game servers per instance but currently a single server cannot host multiple concurrent game sessions.
  • GameLift hosted servers are much cheaper if you can target Linux and Spot instances (ie tolerate some low interruption percentage)

If your server requirements are lightweight, GameLift Realtime could be a better fit for you or the new AWS GameSparks service (note: there is not a confirmed launch date).

answered 2 years ago

Thanks for the information!

So it looks like I'd need to update my game server to not host multiple rooms, but instead host a single match of 2 players.

The current server build holds X rooms and each room holds 2 players. The server then iterates over the rooms and updates/handles messages/ect.

So instead of rooms I'd just have 2 players in a single session. But a linux instance could handle multiple sessions.

Does that sound right?

answered 2 years ago

[quote="JamesM_Aws, post:4, topic:11089"] 50 processes per instance is the limitation at the time of this writing. We have plans to increase this limitation in the future. [/quote]


Please also considering adding support to support multiple rooms/games per process. It's important for certain genres - It may be not possible to spawn N processes for a memory reason, but you can spawn fewer processes and multiple rooms per process (using async / thread internally).

answered 2 years ago


Yup, your understanding is correct. You can concurrently run up to 50* game server processes on a single instance, and with each process handling 2 players, you could have up to 100 players playing on a single instance, provided that you have optimized you server processes well and/or selected a sufficiently powerful instance type to run 50 processes.

Once you have that set up, all you need to do is to call gamelift::StartMatchmaking for each player, and gamelift will automatically place 2 players in an available process for you in any of your active fleets' instances, and will give you the ip/port for your 2 clients to connect to the server process.

If you choose not to use gamelift's matchmaking service, you can group up players by yourself and call gamelift::StartGameSessionPlacement to place game session on the cheapest/least-latency instance in your fleets.

* 50 processes per instance is the limitation at the time of this writing. We have plans to increase this limitation in the future.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions