Best Practices - Level Completion and Rewards
-
We are setting up our server storage and would like to use BreainCloud's built-in tools as much as possible to avoid recreating the wheel.
Our game will have levels you must complete to advance to the next. You can go back and replay those levels for smaller rewards.
Milestones look like a good option for handling the items/currency/xp you get for finishing a level but all of these appear to be tied into stats. What is best practice for these? Do we need to set up a stat (0 to 1) for each of these as they are earned to trigger milestones and rewards or should we roll our own approach for this? Ideally we'd like to have a way in the UI to configure a milestone for each board (named by the board id) and assign what they get in each milestone. Then as they complete we have them trigger, but I can't seem to find a way to do this directly and making a stat for each board seems overly convoluted. Am I missing something that would be better/easier?
Thanks for any pointers.
-
Hi Chuck,
Milestones are normally used for triggering things like achievements - and yes, the generally trigger across common stats like levelsCompleted, civiliansSaved, gamesWon - that sort of thing. Keeping track of each level passed as a separate stat is probably annoying and wasteful.
As for keeping track of level completion - one would normally just use a User Entity - probably via the Singleton API (though that is up to you).
And as for awarding certain amounts of currency, items, etc. of level completion - you could set up:
- a Global Entity type of "Levels" for that sort of thing - each level entry could contain those rewards
- or Unowned Custom Entity <- same idea
And then have a cloud code data handle the reward calculations server-side...
Anyway - hope that helps!
Paul.
-
Currently when created via the portal - rewards are limited to XP, currencies and statistics. The SYS APIs allow you to attached "extraData" JSON though - which you could use for anything.
-
My bad - the UI does support extra data - though as you indicate - it's limited to key + value pairs.
-
That said - any system you want can be constructed with cloud code.
Hope that helps!