By using AWS re:Post, you agree to the AWS re:Post Terms of Use

Concurrent create game session requests to join one game session

0

Hello,

How do I make multiple users that made simultaneous create game session requests to join into one game session? I am using lambda to handle requests.

asked 15 days ago11 views
1 Answer
0

To handle multiple users making simultaneous create game session requests and join them into one game session using AWS Lambda, you should implement a queueing system with Amazon GameLift. Here's how you can approach this:

  1. Instead of directly creating game sessions for each request, use Amazon GameLift's matchmaking feature, FlexMatch, in combination with game session queues.

  2. When a user makes a request, your Lambda function should initiate a matchmaking request using the StartMatchmaking API call to GameLift FlexMatch. This request should include the player's information and any relevant matchmaking criteria.

  3. FlexMatch will then attempt to match this player with others who have made similar requests. If a suitable match is found with other players, it will create a new game session for all matched players. If not, it will keep searching or potentially create a new session if configured to do so.

  4. Once a match is made and a game session is created or found, GameLift will send a MatchmakingSucceeded event to an Amazon SNS topic.

  5. Set up your Lambda function to process these events from the SNS topic. When a MatchmakingSucceeded event is received, your function can update a DynamoDB table with the match status and game session information.

  6. Have your game clients poll for updates on their match status. When a successful match is found, provide them with the necessary information (IP address, port, player session ID) to join the game session.

This approach allows GameLift to handle the complexities of managing concurrent requests and ensures that players are grouped appropriately into game sessions. It also provides flexibility in defining matchmaking rules and can help optimize server utilization by filling game sessions more efficiently.

Remember, the maximum number of players per game session in GameLift is 200, which is not adjustable. Ensure your game design and matchmaking rules account for this limitation.

By using this method, you can effectively manage multiple simultaneous requests and group players into appropriate game sessions, even when the requests come in concurrently.
Sources
Guidance for Multiplayer Session-Based Games on AWS
CreatePlayerSessions - Amazon GameLift
CreatePlayerSession - Amazon GameLift

profile picture
answered 15 days ago
profile picture
EXPERT
reviewed 15 days 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