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.
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.
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).
Thanks Brenden... il work on this path and soon let you know.
2 People are following this question.