Sign In Register

How can we help you today?

Start a new topic
Answered

Turn Based setting max attempts per turn

Hi,

     I'm working on challenges with turn based setup. 

I was wondering how we can achieve the below features.

1. Allow user to play for 2/3 chances per turn and then post the score for challenge result consideration (Not sure if this needs a separate event per each chance :| )

2. Does challenges needs events if so how are they used.

     On post of each event turn will get changed?

3. How to track the score per each turn played by the players?



Current tutorial isn't clear on how to store score/parameters  for each of the turns made by the player and deriving a winner from it. So please guide me on this.


Thanks,

Ayyappa.



Best Answer
Hey Ayyappa,

To begin with i would suggest that the turns are checked locally and whichever you want (the best i presume) is sent via the challenge. Im not really sure which way you want to use the chances per turn. For example if the challenge is between 1 turn, then i'd submit the best chance per turn. If the challenge is between each chance in a turn, then it can be done more or less the same way.

If you plan to have these chances in a leaderboard, you would need only 1 leaderboard per turn (if i have the game figured out correctly). You can set the leaderboard to only register the maximum from the player's score. therefore, only the highest out of the 3 chances will be registered.

You will need an event to submit the score either way. If you intend to use a leaderboard there needs to be an event which is used by the leaderboard to handle the running totals and to submit the scores. If there is only two players in the challenge you need to use cloud-code in the event to check each player's score and then program out the resulting action. You can check that out here. You submit these events using the LogEventRequest, and you dont have to worry about anything else, just check out the leaderboard docs to see how to setup the event.

If your challenge is turn based the turn will switch after each player has played.

You can track the score using the GetChallengeRequest which will return all the current players in the challenge, their details and their score.

Hope that helps,
-Sean
1 Comment

Answer
Hey Ayyappa,

To begin with i would suggest that the turns are checked locally and whichever you want (the best i presume) is sent via the challenge. Im not really sure which way you want to use the chances per turn. For example if the challenge is between 1 turn, then i'd submit the best chance per turn. If the challenge is between each chance in a turn, then it can be done more or less the same way.

If you plan to have these chances in a leaderboard, you would need only 1 leaderboard per turn (if i have the game figured out correctly). You can set the leaderboard to only register the maximum from the player's score. therefore, only the highest out of the 3 chances will be registered.

You will need an event to submit the score either way. If you intend to use a leaderboard there needs to be an event which is used by the leaderboard to handle the running totals and to submit the scores. If there is only two players in the challenge you need to use cloud-code in the event to check each player's score and then program out the resulting action. You can check that out here. You submit these events using the LogEventRequest, and you dont have to worry about anything else, just check out the leaderboard docs to see how to setup the event.

If your challenge is turn based the turn will switch after each player has played.

You can track the score using the GetChallengeRequest which will return all the current players in the challenge, their details and their score.

Hope that helps,
-Sean