I am creating a game for Android/iOS. The game has a server that communicates with my appengine database. I want to implement daily quests as motivation for the players to return every day, but I need some help on how create a smart solution for this.
So far this is my thought process:
1 - Randomly pick a quest from the DailyQuests table
DailyQuests ID | Quest |Goal 1 | Win 3 games in a row | 3 2 | Win 2 rounds of "ex" | 2 ... 2 - Add entity "q_progress" (maybe q_ID) to a table storing user stats
3 - Display Quest and progress userStats.q_progress / dailyQuests.goal
4 - After a game (consisting of 5 rounds Bo5) is finished - Save the progress somehow. How do I keep track of consecutive wins? how do I save the progress if the quest has some specific requirement like "win 2 rounds of "ex""
Is the only way to do an if-statement for like quest-ID after each game is finished? Like:
if(q_id == 1){ consecutiveWins += 1; userStats.saveProgress(consecutiveWins); } else if(q_id == 2){ rockDodgerWins += 1 userStats.saveProgress(rockDodgerWins); } ... I feel like this is highly unpractical and might not even work in practice if I really think about it, I only bring it up to maybe give a better view of where my head is at right now.
I don't need any code or anything like that, just someone who is smarter than me that might have experience with something similar or can think of a smart way to accomplish what I need.