Sign In Register

How can we help you today?

Start a new topic
Answered

Challenge over time with winning pot

Hi, I'm not sure if this question was already asked but I haven't come across anything that answer my questions.


I want to implement a challenge systems in my game with the following:


- Player creates the conditions that the challenge will be played with.

- Player sets the challenge fee (this is the amount of game currency that is needed to enter the challenge)

- Challenge is visible to all game players that meet the conditions

- A player can play the challenge multiple times by paying the fee each time

- All fees payed goes into a pot 

- the player with the highest score at the end of the week will take the pot

- the challenge will have leaderboard that lasts for the challenge week


What is the best way to implement such a challenge system with gamesparks?





Best Answer

Hi Mario, 

If by conditions you mean data specific to game state. This will be set in the scriptdata of the challenge. Here it can be referenced and manipulated by players for the duration of the challenge by referencing the challengeInstanceId through the challenge event you are using as the turn consumer.


As for setting a value of game currency to check for before a player can be added to the challenge instance: 

  1. This can be done by wrapping the challenge request in an event. Add a number attribute to the event. 
  2. Then in that events cloud code, reference that attribute value.
  3. Construct a challengeRequest and add that value to the challenges scriptdata
  4. Reference that value in the challenge issued message. If the player is willing to pay the amount, they can accept and both players can be debited that currency. If not simply decline the challenge invite

Challenge visibility. For this it would be better to matchmaking. Setting a matchgroup and only allowing that group to search for that specific match. This will also allow you to include drop in/ drop out functionality. 

Again this would be more specific to matchmaking and drop in/ drop out. 

The number value in the sciptdata of the challenge can be manipulated based on user input to the  challenge turn consumer event. Or whatever game logic you implement that handles that.


For you final two questions:
This could be done through the use of a scheduler. This scheduler could  draw/ win the challenge ,then credit the player you stipulate to  receive an amount of currency = to the value in the scriptdata of the challenge. Additionally in the cloud code of the respective challenge Won / Draw  message, you could handle the leaderboards etc. 

Does this make sense? Happy to assist further.
Best Regards, Patrick.  

1 Comment

Answer

Hi Mario, 

If by conditions you mean data specific to game state. This will be set in the scriptdata of the challenge. Here it can be referenced and manipulated by players for the duration of the challenge by referencing the challengeInstanceId through the challenge event you are using as the turn consumer.


As for setting a value of game currency to check for before a player can be added to the challenge instance: 

  1. This can be done by wrapping the challenge request in an event. Add a number attribute to the event. 
  2. Then in that events cloud code, reference that attribute value.
  3. Construct a challengeRequest and add that value to the challenges scriptdata
  4. Reference that value in the challenge issued message. If the player is willing to pay the amount, they can accept and both players can be debited that currency. If not simply decline the challenge invite

Challenge visibility. For this it would be better to matchmaking. Setting a matchgroup and only allowing that group to search for that specific match. This will also allow you to include drop in/ drop out functionality. 

Again this would be more specific to matchmaking and drop in/ drop out. 

The number value in the sciptdata of the challenge can be manipulated based on user input to the  challenge turn consumer event. Or whatever game logic you implement that handles that.


For you final two questions:
This could be done through the use of a scheduler. This scheduler could  draw/ win the challenge ,then credit the player you stipulate to  receive an amount of currency = to the value in the scriptdata of the challenge. Additionally in the cloud code of the respective challenge Won / Draw  message, you could handle the leaderboards etc. 

Does this make sense? Happy to assist further.
Best Regards, Patrick.  

Login to post a comment