- Newest
- Most votes
- Most comments
Based on your setup and requirements, here are some insights and recommendations for your multiplayer game infrastructure:
- Matchmaking Management: Matchmaking is indeed necessary for your setup, especially given the need to separate premium and normal players. To manage player balancing and room assignments efficiently:
- Use a database like DynamoDB to track room states, including capacity, player types, and availability.
- Implement a matchmaking service that continuously updates this database and assigns players to rooms based on their type and available capacity.
- Consider implementing a "fill-up" strategy where you prioritize filling existing rooms before creating new ones to minimize wasted capacity.
-
NLB and Matchmaking: While the NLB can route based on least connections, it doesn't account for player types or specific room assignments. Matchmaking is crucial for your setup to ensure premium and normal players are separated and to manage room capacities effectively.
-
NLB Routing to Correct Room: The NLB alone cannot ensure routing to a specific ECS task. To address this:
- Implement a session directory service that maps player tokens to specific ECS task IP addresses and ports.
- When a player connects, have your game server validate the token against this session directory.
- If the connection is invalid, implement a retry mechanism on the client side.
-
Token Validity: Tokens are a valid approach, but they need to be used in conjunction with a session directory service as mentioned above. This allows you to maintain the mapping between tokens and specific game server instances.
-
Retry Logic: Implement retry logic on the client side. When a connection is rejected:
- The client should request a new token from the matchmaking service.
- The matchmaking service should then either reassign the player to a new room or confirm the existing assignment.
- The client then retries the connection with the new or confirmed token.
- Removing the NLB: While it's technically feasible to remove the NLB and have the matchmaking service provide direct IP and port information, it's not recommended for several reasons:
- Reduced flexibility in scaling and managing your infrastructure
- Increased complexity in handling IP changes and task failures
- Potential security risks by exposing your ECS tasks directly
Instead, consider using the NLB in conjunction with a session directory service to manage connections more effectively.
Given your team size and constraints, focus on implementing a robust matchmaking service that works alongside your NLB. This service should manage room assignments, track capacities, and handle player types. Utilize a database like DynamoDB to store real-time game session information, and implement client-side retry logic for connection failures. This approach will provide a scalable and efficient solution that meets your requirements for separating premium and normal players while effectively managing room assignments and scaling.
Sources
Game server - Games Industry Lens
Game server processes - Games Industry Lens
Monitoring - Games Industry Lens
Multi-Region and hybrid architecture for low-latency games - Games Industry Lens
Relevant content
- asked a year ago
- Accepted Answerasked 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago