question

brendan avatar image
brendan asked

Daily missions/rewards

What's the best way to build a system that does daily challenges? For instance, if I want to give a player 3 daily missions randomly chosen from a set, with specified rewards.

Player DataTitle Data
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

First, set up your missions in Title Data. Use a simple JSON object format to define each with the parameters for completion and the rewards (if you want randomized rewards, this could be a Bundle or Drop Table reference).

In all cases below, when you choose missions, you're doing so as a random selection from that Title Data, in a Cloud Script, and writing that to User Read Only Data. You then check for completion and grant rewards in a Cloud Script as well.

If missions are only set at a certain time of day, have a handler that you call on login, to see if a new set is available. If not, just keep track of the time locally, and re-query once the right time of day is reached (but to prevent clock-changers from hammering the site with futile requests, use an exponential backoff on retries, starting with only re-querying after a minute has passed).

If you want to give them a new mission after a certain amount of time has passed after completion of a mission, you could use a regenerating VC to indicate how many missions the player has active. So, max regeneration rate and initial balance of the number of missions, and a regeneration rate based upon how often they should wait to get a new one. Note that this means if they finished all the missions quickly, they'd wait that regeneration time for one, then that time again for the second, etc. If you want all three to regenerate independently after X amount of time, use three separate regenerating VCs (or just record the time of completion in User Read Only Data, and check it in Cloud Script).

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

developerjazzhaq avatar image developerjazzhaq commented ·

Thanks Brenden... il work on this path and soon let you know.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.