We are wondering if the following is possible, and how it may be achieved. We are using UE4 if that matters, although most of this should be related to the GSparks events and what not.
1. We would like to create a party or group using GSparks and have player data of each party member delivered so that we can display UI widget with party member informations
2. Begin matchmaking as a party to fill in the remaining vacant slots OR choose to start a private match with only the current party members (based on user defined match settings)
3. Once the match has been filled (or contains the party members in case of private match) we would then have the player at index 0 in the player list contact our dedicated server service to create a server and wait until a reply is received. (The only GSparks interaction here is the notification of the match being "ready")
4. Once our server has replied, we need to transmit the data to each player in the current match to instruct them to connect to the dedicated servers IP address
5. Once the match as ended, player clients remove themselves from the match (and our dedicated server), but must remain in the party once returning to a menu
We do not see an implicit party or group functionality in GSparks and we do not see any "party matchmaking". Is what we outlined achievable with your services?
From my understanding, a Pending Match is automatically created upon the first MatchMakingRequest. You can verify this by querying the NoSQL system collection pendingMatches.
I've been trying to make the matchmaking, but I've encountered some kind of dead end.
If i need 4 players to start the match, and i have 5 players matchmaking (3 individual, 2 in a team), let's say this is the sequence they start the matchmaking:
- player 1 starts MMR and in the response he does FPM in cloud code and finds no match
- player 2 starts MMR and in the response he does FPM in cloud code and finds no match
- player 3 (that is in party with player 4) starts MMR and in the response he does FPM in cloud code and finds no match. here should he try to wait for a match, or create a pending match and add player 4 to it?
The problem is that if a pending match is create, there is no kind of response to trigger a script in order to make the decision for the match based on the teams.
So the question mostly is: is there a trigger script when a pending match is created from MMR? And how should i make the process of cloud scripts, which cloud scripts should i use (example on matchmaking request/response, matchfound request/response, etc..) in order to achieve the above scenario correctly?
Sorry if the scenario is not clear... and thanks in advance!
I did do it, I followed the example here with the same values and put it to manual
But still get that error
Thank you for the fast reply!
It is crystal clear now, but as I saw in the documentation I should start a MatchmakingRequest before creating a pending match, or try to find a pending match?
If not, then I won't be able to make use of the matchmaking algorithm of thresholds and such using the manual matchmaking, then I'll have to make my own algorithm for it.
And one more point - I still haven't thought about it - How am I to keep all the pending matches find each other in a way that no pending match would stay for long. For example, If a team creates a pending match, then two others create two more pending matches, those two others might get matched together, and the first one stays matching. It should be more of a first come first server thingy.
Thanks in advance!
You can use the following to create a pendingMatch in Cloud Code.
Spark.getConfig().getMatchConfig(shortCode).createPendingMatch(matchGroup, skill, players) //players should be an array of SparkPlayer objects
You could create a custom event that gets the member ids of a team/friends with a GetTeamRequest or a ListGameFriendsRequest. The GetTeamRequest is probably better as you can just consider the players in the team as the party members.Once in the pendingmatch the players will be matched with other players looking for a similar match. This could be a single player sending a MatchMakingRequest or another party that has been created with a pendingMatch.
To make use of the manual matching feature you would put players into a pendingMatch. You'd then send a FindPendingMatchesRequest to return a list of compatible matches and finally use a JoinPendingMatchRequest to join the match of your choice. I hope that clears it up for you. If you have any further questions just let me know.
Were u able to make this work using cloud code? I am trying to create a similar scenario where the matchmaking is done with a party. But unfortunately I am not that good in cloud code, trying different things with no success.
If you are able, or someone else maybe from customer support, to provide a working example of matchmaking with parties, that would be very useful to anyone trying to implement it.
Manually match players - For custom completion of the matching process. Select this if you do not want the Match to complete automatically when all matching criteria have been met, but want to use your own custom mechanism to complete the Match. The platform will find players that meet the matching criteria for you, but you control the choice of which players are put in the Match.