How to implement a party matchmaking

0

Hi everyone

I'm currently working on a party matchmaking and I know the same party members have the same TicketId. So I put code below into Lambda. For testing, four client have the same ticket id as players and one client have another ticket as monster.

            match_response = gl_client.start_matchmaking(
ConfigurationName = [MATCHMAKING_CONFIGURATION_NAME],
Players = [ { "PlayerId" : playerId, "PlayerAttributes" : playerAttr } ],
TicketId = ticketIdForParty )

And I'm using an example of "players_vs_monster_5_vs_1" in a document of GameLift

   { "name":"players_vs_monster_5_vs_1",
"ruleLanguageVersion":"1.0",
"playerAttributes":[ { "name":"skill",
"type":"number",
"default":10
},
{ "name":"desiredSkillOfMonster",
"type":"number",
"default":10
},
{ "name":"wantsToBeMonster",
"type":"number",
"default":0
}
],
"teams":[ { "name":"players",
"maxPlayers":5,
"minPlayers":5
},
{ "name":"monster",
"maxPlayers":1,
"minPlayers":1
}
],
"rules":[ { "name":"MonsterSelection",
"description":"Only users that request playing as monster are assigned to the monster team",
"type":"comparison",
"measurements":[ "teams[monster].players.attributes[wantsToBeMonster]"
],
"referenceValue":1,
"operation":"="
},
{ "name":"PlayerSelection",
"description":"Do not place people who want to be monsters in the players team",
"type":"comparison",
"measurements":[ "teams[players].players.attributes[wantsToBeMonster]"
],
"referenceValue":0,
"operation":"="
},
{ "name":"MonsterSkill",
"description":"Monsters must meet the skill requested by all players",
"type":"comparison",
"measurements":[ "avg(teams[monster].players.attributes[skill])"
],
"referenceValue":"max(teams[players].players.attributes[desiredSkillOfMonster])",
"operation":">="
}
],
"expansions":[
{ "target":"teams[players].minPlayers",
"steps":[ { "waitTimeSeconds":30,
"value":4
},
{ "waitTimeSeconds":60,
"value":3
}
]
}
]
}

If I don't put TicketId as a parameter of start_matchmaking(), it works well. However, if I use TicketId, status of tickets are already "SEARCHING".

What should I do?

질문됨 5년 전375회 조회
10개 답변
0
수락된 답변

To use parties you need to submit all players for the ticket in the same request. Just using the same ticket id will not work.

e.g., something like:

  1. match_response = gl_client.start_matchmaking(
  2. ConfigurationName=[MATCHMAKING_CONFIGURATION_NAME],
  3. Players=[{"PlayerId": firstPlayerId,"PlayerAttributes": firstPlayerAttr }, {"PlayerId": secondPlayerId, "PlayerAttributes": secondPlayerAttr}, etc...],
  4. TicketId= ticketIdForParty )
답변함 5년 전
0

Thank you so much and I have one more question. Does that mean all party members share their attributes with each other to request their matchmakings like above start_matchmaking()? So if a party has 4 members, start_matchmaking() will be called with the same parameters four times. is it right?

답변함 5년 전
0

Each player in the party has their own separate attributes which are then passed in on a single start matchmaking request. Typically the game developer will have a game service or similar where the party will be formed. Once the party is set and ready for matchmaking a single call (yes, only one call per ticket, regardless of the party size) will be made for that group of four. When the completion is observed (typically via SQS) the game service would notify each of the four players in the party that the game is ready to be joined.

Does that help?

답변함 5년 전
0

It helped me. Thank you very much.

답변함 5년 전
0

Sorry to bring up an old thread, but to confirm... this means that since players have their own attributes that are passed onto flexmatch, the players in a party can end up on different teams depending on the ruleset that is used. Correct?

답변함 4년 전
0
답변함 4년 전
0

@REDACTEDUSER

Otherwise, this is probably the best pre-canned answer: from (https://forums.awsgametech.com/t/does-flexmatch-support-startmatchmaking-where-the-team-is-already-big-enough-to-satisfy-the-rule-used/5243/10)

"If you know all the players that you want to be together on a team, you submit all of them on a single ticket, and then the matchmaker will find players for the other team (assuming you have a match with 2 teams).

If you have all of the players you want for both teams, FlexMatch won’t be able to put the teams together in the same match – you would need to just start your game session by creating it and the player sessions directly."

If that doesn't help, could you describe the scenario you're trying to make work

답변함 4년 전
0

I think you've answered my question. So I basically have all of my players for a match, and I was creating a flexmatch ticket with both players in the hopes that a game session would be created from that. The reason being is that the game server is built to use the player attributes that are passed through to flexmatch. If I don't go through flexmatch, I will have to do all of that manually which I was trying to avoid. But it seems that's the direction I need to go.

Thanks Pip!

답변함 4년 전
0

Hey @REDACTEDUSER

답변함 4년 전
0

Just to close this thread out - FlexMatch matchmaking data is only set for matchmaking generated game sessions and player session data is not set by FlexMatch at this time.

If you are making your own matches then you need a hybrid approach, ie read the matchmaker data if it exists, or send it along via GameSession data/properties or via player session data when it doesn't (ie manual match mode)

답변함 4년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠