Daily Rewards
Daily rewards pay the player once for each calendar day they come back. Each day in a row pays more, and the last day of the cycle pays a big bonus. Missing a day can end the streak or be forgiven. Count days from one trusted clock, so the same day never pays twice.

Paste this to your AI
Copy it into Claude, Cursor or ChatGPT. It already has good values and the usual mistakes in it.
Add "Daily Rewards" to my game.
What it should do: A small gift for coming back gives the player a reason to open the game every day, and a streak makes each new day worth protecting.
Build it exactly as this state machine. First check that it fits my game, then build it like this:
```mermaid
stateDiagram-v2
[*] --> ready
ready: Can claim
claimed: Claimed today
finale: Prize taken
lapsed: Streak lost
ready --> claimed: claims a normal day
ready --> finale: claims the last day
ready --> lapsed: too many days missed
claimed --> ready: a new day starts
claimed --> finale: claims the last day
claimed --> lapsed: days missed in a row
finale --> ready: a new day starts
finale --> claimed: claims a normal day
finale --> lapsed: days missed in a row
lapsed --> claimed: claims and starts over
```
Use these starting values:
- baseReward: 20 coins
- rewardStep: 10 coins
- cycleLength: 7 days
- graceDays: 1 days
- finaleMultiplier: 3 x
Watch out for these common mistakes:
- The same day pays twice: Tell your AI: save the day of the last claim, and pay nothing if it equals today.
- Turning the clock back: Tell your AI: keep the newest day ever seen and never go below it. For anything that matters, take the day from your server and not from the device.
- Whose midnight: Tell your AI: pick one fixed time zone and one cut-off hour for the whole game, and turn the clock into a whole day number once, in one place.
- The cycle resets the streak: Tell your AI: keep counting the streak, and work out the place in the cycle from it with a remainder.
- Half a day or a broken number: Tell your AI: round the day down to a whole number, and ignore any value that is not a finite number.
- A long absence: Tell your AI: missed days are never paid later. After a gap longer than the grace days, the next claim starts again at day one.
Do not change anything else in the game. Do not claim anything without proof: model what it takes, and show me what your solution rests on and how I can see that it works. If you cannot show something, say you do not know. When you are done, tell me in plain words how to try it.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP
What it does
A small gift for coming back gives the player a reason to open the game every day, and a streak makes each new day worth protecting.
How it runs, as a diagram
Everything it can be in, and what moves it on. Your AI builds from exactly this.
How it runs, as a diagram
- Can claim → Claimed today: claims a normal day
- Can claim → Prize taken: claims the last day
- Can claim → Streak lost: too many days missed
- Claimed today → Can claim: a new day starts
- Claimed today → Prize taken: claims the last day
- Claimed today → Streak lost: days missed in a row
- Prize taken → Can claim: a new day starts
- Prize taken → Claimed today: claims a normal day
- Prize taken → Streak lost: days missed in a row
- Streak lost → Claimed today: claims and starts over
Good starting values
| Value | Start with | What it changes |
|---|---|---|
| baseReward | 20 coins | What day one of a cycle pays. Small on purpose, so a player who restarts loses little and a streak still feels like a climb. |
| rewardStep | 10 coins | How much more each further day of the cycle pays. Zero makes every day pay the same, which takes away the pull of the streak. |
| cycleLength | 7 days | How many days one round of rewards lasts before it starts again at the bottom. A week is easy to grasp, and a cycle of one day would have no climb. |
| graceDays | 1 days | How many missed days in a row the streak survives. One forgives a forgotten evening without making the streak meaningless. Zero is strict. |
| finaleMultiplier | 3 x | How many times more the last day of the cycle pays. It is the prize at the end of the climb, so it has to be clearly bigger than the day before. |
What usually goes wrong
The same day pays twice
The player taps claim twice, or the game is opened in two windows. Both taps look like a new day, and the reward is paid twice.
Fix: Tell your AI: save the day of the last claim, and pay nothing if it equals today.
Turning the clock back
A player sets the phone's date forward, claims, and sets it back. Or the date jumps back by accident. Days that already paid come up again, or the streak breaks.
Fix: Tell your AI: keep the newest day ever seen and never go below it. For anything that matters, take the day from your server and not from the device.
Whose midnight
Days are cut at the player's local midnight, so travelling or changing the time zone gives two claims in a day or none in two days.
Fix: Tell your AI: pick one fixed time zone and one cut-off hour for the whole game, and turn the clock into a whole day number once, in one place.
The cycle resets the streak
After the last day of the cycle the code sets the streak back to zero, so a player with a month of daily visits is shown as a beginner and loses any other reward tied to the long streak.
Fix: Tell your AI: keep counting the streak, and work out the place in the cycle from it with a remainder.
Half a day or a broken number
The day arrives as 10.9, as a missing value or as infinity. Comparing days then gives a claim that never matches or an endless streak.
Fix: Tell your AI: round the day down to a whole number, and ignore any value that is not a finite number.
A long absence
A player returns after three months and the game tries to hand out every missed day, or leaves them stuck on a day that is far in the past.
Fix: Tell your AI: missed days are never paid later. After a gap longer than the grace days, the next claim starts again at day one.
How to check it works
- A player who has never claimed. they claim on day 100: they get 20 coins and the streak is 1.
- A player claimed yesterday. they claim today: they get 30 coins and the streak is 2.
- A player already claimed today. they claim again: nothing is paid and the streak stays.
- A player claimed on day 1, with one grace day. they claim next on day 3: the streak goes on and is 2.
- A player has a streak of 3 and then stays away until day 7. they claim: the streak is 1 and they get 20 coins.
- A player has claimed six days in a row. they claim on the seventh: they get 240 coins, which is 80 times 3.
- A player claimed seven days in a row. they claim on the eighth: they get 20 coins again and the streak is 8.
- A player claimed on day 10. the device then reports day 5 and they claim again: the game still counts day 10, so nothing is paid.
- A player claimed on day 10. the next claim arrives as day 10.9, or as a value that is not a number: 10.9 counts as day 10 and pays nothing, and the broken value changes nothing.
Works well with
- Currency Wallet: The reward is an amount of coins. Let the wallet add it, so its limits and rounding apply. Pay into the wallet after the claim is accepted, never before.
- Loot Table: The finale can pay an item from a table instead of a number. Save the drawn item with the claim, so a second tap shows the same item. Draw the prize for the last day when the claim is accepted.
Common questions
how do daily login rewards work in games
The game remembers the day of the last claim. A new day pays once, each day in a row pays more, and a longer gap starts the streak again.
how many days should a daily reward cycle have
Start with seven. A week is easy to keep in mind and the prize at the end is within reach. Much longer cycles make players feel punished for one missed day.
should a missed day reset the streak
Start by forgiving one missed day in a row. A strict reset feels cruel when someone just forgot, and no grace at all makes players quit instead of coming back.
what do i tell my ai to add daily rewards
Paste this: Add a daily reward. Save the day of the last claim and pay once per day. Each day in a row pays 10 more, the seventh pays three times the sixth, one missed day is forgiven, and a longer gap starts again at day one. Never let the day go back.
Where it comes from
We could not find a reliable origin for this one yet.
What was checked
- 17 tests pass on the reference code.
- The state diagram was checked against the code, at the default values and at every listed low and high value.
Your AI gets the code
Tested example code comes through the Spielerando connection, so your AI can use it right away. How to connect it