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

Questions tagged with Amazon GameLift

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

Client not receiving RTS message

I'm having trouble with one particular piece of code that is supposed to be sending a message to a client. Both pieces of code below are from my Realtime Server Script: ``` function onPlayerAccepted(player) { logger.info("..New player accepted: " + player.peerId); const newPlayerMessage = session.newTextGameMessage(OP_CODE_PLAYER_ACCEPTED, session.getServerId(), JSON.stringify(galaxyAndLocalPlayerState)); session.sendReliableMessage(newPlayerMessage, player.peerId); } ``` The above block within my realtime server script runs when a player is accepted, and the message is successfully received by the client (Unity). On the client side, logs show that OnDataReceived() **is called**. RTS Logs for above call: 02 Mar 2022 03:59:32,191 [INFO] (ManhuntServerScript.js) 96: ..New player accepted: 1 02 Mar 2022 03:59:32,191 [INFO] (index.js) 333: Received custom game message from sender: -1 with opCode: 100, targetPeerId: 1, targetGroupId: 0 ``` function onMessage(gameMessage) { switch (gameMessage.opCode) { case OP_CODE_TRAVEL_REQUEST: logger.info("..Travel Request Received from Peer " + gameMessage.sender + " to PlanetId: " + gameMessage.getPayloadAsText()); const travelResponseMessage = session.newTextGameMessage(OP_CODE_TRAVEL_BEGIN, session.getServerId(), JSON.stringify(playerStates)); session.sendReliableMessage(travelResponseMessage, gameMessage.sender); break; default: logger.info("..Unrecognized Op Code received: " + gameMessage.opCode); break; } } ``` The above block shows the message is being sent in the server logs, but is not received by the Unity client. I have ensured the op codes match. On the client side, logs show that OnDataReceived() **is NOT called**. RTS logs for above call: 02 Mar 2022 03:59:36,628 [INFO] (index.js) 333: Received custom game message from sender: 1 with opCode: 200, targetPeerId: -1, targetGroupId: 0 02 Mar 2022 03:59:36,628 [INFO] (ManhuntServerScript.js) 136: ..Travel Request Received from Peer 1 to PlanetId: 2 02 Mar 2022 03:59:36,629 [INFO] (index.js) 333: Received custom game message from sender: -1 with opCode: 102, targetPeerId: 1, targetGroupId: 0 --- The only thing I can think of is that possibly a realtime server can't send a message within onMessage() but that seems silly to me. Thanks in advance for any insight!
9
answers
0
votes
14
views
asked 7 months ago

FlexMatch long matchmaking time

We are using the following matchmaking ruleset with a standalone configuration ``` { "name": "MatchmakingRuleset", "ruleLanguageVersion": "1.0", "algorithm": { "backfillPriority": "high", "batchingPreference": "random", "strategy": "exhaustiveSearch" }, "playerAttributes": [ { "name": "tournamentDefinitionID", "type": "string" }, { "name": "skill", "type": "number", "default": 0 } ], "teams": [ { "name": "player", "minPlayers": 0, "maxPlayers": 1, "quantity": 4 } ], "rules": [ { "name": "SameTournament", "description": "Match players to play in the same tournament type", "type": "comparison", "operation": "=", "measurements": ["flatten(teams[*].players.attributes[tournamentDefinitionID])"] } ] } ``` Since minPlayers is 0 for all teams, that means that when there are no other players matchmaking at the moment and no backfilling tickets, players can get a successful match with just their own ticket, in which event we create a new game, and the player enters this game alone. We then call startMatchBackfill with the same configuration and repeat the process until the game is full. This mean that at any given moment, any submitted ticket "should" always result in a MatchmakingSucceeded callback, so theoretically there should be no waiting for matchmaking. For some reason we are experiencing wait times of 5-10 seconds from when we call startMatchmaking until our matchmaking event listener lambda is called (wired through EventBridge), is there any way to speed this up? Is this a technical constraint? Is FlexMatch waiting for more tickets to enter the pool, and is there a way to configure this?
4
answers
0
votes
25
views
asked 7 months ago