Sign In Register

How can we help you today?

Start a new topic
Answered

Join random challenge by criteria

Hi.


I'm working on the asynchronous turnbased game which has specific requirements for matchmaking. I'm not sure what's the best way to implement it with GameSparks, so I'm asking for your help.


The matchmaking is asynchronous and should work in the following way:
1. Player 1 creates a new game and sets options for it: adjusts the level properties, day/night, etc. I assume that CreateChallenge with accessType set to PUBLIC will work for this.

2. Player 2 wants to join the game and he has filters for some (but not all) game properties, for example only day/night. So he selects Day and taps Random Join button. The game should find the existing challenge with appropriate settings and with a challenger who has same or almost same rating as Player 2. The challenger isn't required to be online that moment. I was thinking about making a new event and calling FindChallengeRequest from cloud code, then filter the chalenges and call JoinChallengeRequest for one of them. The problem is that FindChallengeRequest returns max 50 challenges and I need to call it many times.


Is there any better way? Or will this approach work well?


Thanks.

Best regards,

Anatolii


Best Answer
Hi Anatolli
When calling CreateChallengeRequest you can set eligibilityCriteria like .SetEligibilityCriteria({"timemode":"night"})
You can also use eligibility criteria when calling FindChallengeRequest like .SetEligibility({"timemode":"night"})

Thanks
Katie



Hi Anatolii
You can use segments to give certain players different things. For example you could have different levels based on score or rating.You can give challenges segments.So if you are level 1  FindChallengeRequest will return challenges with level 1.This will cut down the number of response and they will already be filtered.
Would this help you?

Thanks
Katie

 

Hi Katie.

I'm not sure that segments are what I need. As I understand segments are applied to players, not to challenges. And they can help me find a player with same score or rating.

But I need a search not for a player but for a public challenge that fits my criteria.

In my game every player can create his own tournaments and setup them as he likes: number of players, day/night, turn speed, tournament type, etc.
When another player looks for tournament to participate in he can select filters, i.e. search only for tournaments with fast turn speed and in a night mode, or he can set no filters at all and join any random tournament.

Even if all players are from same segment, have same experience, etc. it's not enough. Since those players can have no tournaments created or their tournaments won't suit selected filter options.


Thanks for your help.

Best regards,

Anatolii

Answer
Hi Anatolli
When calling CreateChallengeRequest you can set eligibilityCriteria like .SetEligibilityCriteria({"timemode":"night"})
You can also use eligibility criteria when calling FindChallengeRequest like .SetEligibility({"timemode":"night"})

Thanks
Katie


Looks like EligibilityCriteria is what I was looking for.

Thanks.

Login to post a comment