Hello. Like title says, how should i add spectator players to my game? I just cannot add more playerSession to gameSession allowes me to. Can i somehow add more playersSessions to game or is it really fixed number? Should i add spectators to my matchmaking logic somehow and when i’m using party system i reserve xNum of playerSessions to spectators?
Firstly, you don’t have to use player sessions with GameLift - they are there as convience layer to manage/track connected players.
If your specters know the game session details then:
- They could connect directly as they have the ip and port for the session.
- You could modify your connection logic so they connect with with some special player identification that lets you know they’re a spectator (ie a one of claim code that starts with a known prefix etc) and bypass calling GameLift to accept the PlayerSession etc.
You could also as stated, provide a set number of slots ie 0-10 for spectators and let FlexMatch etc take care of this for you. The advantage here is that spectators are handled by your existing connection logic and GameLift will prevent too many joining etc.