Spielerando

Bad Luck Protection

Bad luck protection keeps a player from going empty-handed for ever. The chance of a rare prize starts low and stays flat for a while. After that it rises with every miss, until one last try is certain. Only a hit sets the count of misses back to zero.

Also called: Pity timer, Pity system, Drop guarantee, Anti-streak protection.

A small robot angler on a dock at night hooks a leaping golden fish, while a row of lanterns along the dock grows brighter from a dull bulb to a blazing one beside it.
Tumblewick Pier, an invented neon fishing game. Invented game, image generated with AI.

Paste this to your AI

Copy it into Claude, Cursor or ChatGPT. It already has good values and the usual mistakes in it.

Add "Bad Luck Protection" to my game.

What it should do: A pure chance can hand some players a hundred misses in a row while others win at once. A rising chance and a certain last try give every player a fair worst case, and the rare prize still feels like luck.

Build it exactly as this state machine. First check that it fits my game, then build it like this:

```mermaid
stateDiagram-v2
  [*] --> normal
  normal: Base chance
  rising: Chance rising
  guaranteed: Next try sure
  normal --> normal: hit or miss
  normal --> rising: misses pile up
  normal --> guaranteed: cap comes close
  rising --> rising: another miss
  rising --> normal: a hit
  rising --> guaranteed: cap comes close
  guaranteed --> normal: the sure hit
```

Use these starting values:
- baseChance: 0.02
- softStart: 40
- softStep: 0.02
- hardCap: 60

Watch out for these common mistakes:
- Any drop resets the count: Tell your AI: keep one count for each protected prize, and reset it only when that prize drops.
- The sure hit comes one try late: Tell your AI: with a cap of 60, after 59 misses in a row the next try, number 60, is the certain one.
- The chance drifts or goes past 100 percent: Tell your AI: work the chance out from the count of misses each time, and cap it at one.
- A lucky early hit does not reset the count: Tell your AI: every hit, lucky or certain, sets the count back to zero.
- The count is lost when the game closes: Tell your AI: save the count with the player's game, and load it back before the first try.
- A new cap below the old count: Tell your AI: make a try certain when the count is at or above the cap minus one, not only when it is exactly equal.

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 pure chance can hand some players a hundred misses in a row while others win at once. A rising chance and a certain last try give every player a fair worst case, and the rare prize still feels like luck.

How it runs, as a diagram

Everything it can be in, and what moves it on. Your AI builds from exactly this.

hit or missmisses pile upcap comes closeanother missa hitcap comes closethe sure hitBase chanceChance risingNext try sure
How it runs, as a diagram
  • Base chance → Base chance: hit or miss
  • Base chance → Chance rising: misses pile up
  • Base chance → Next try sure: cap comes close
  • Chance rising → Chance rising: another miss
  • Chance rising → Base chance: a hit
  • Chance rising → Next try sure: cap comes close
  • Next try sure → Base chance: the sure hit

Good starting values

ValueStart withWhat it changes
baseChance0.02The chance of a hit on a fresh counter, as a share of one. 0.02 is 2 in 100. It is never zero, or a player with a fresh counter could not win before the rise starts.
softStart40How many misses in a row leave the chance at its base. Until then a miss costs nothing extra. At 40 with a base of 0.02, about 55 players in 100 have won before the rise begins.
softStep0.02What each further miss adds to the chance. 0.02 adds 2 points per miss. At 0 the chance never rises, and only the certain last try protects.
hardCap60The try number that is certain, so the longest dry spell a player can have. Choose the longest wait you would accept, and keep it above the soft start, or the rise never begins.

What usually goes wrong

Any drop resets the count

The count is shared by every prize. A common drop resets it, so the player who is waiting for the rare prize never gets protected.

Fix: Tell your AI: keep one count for each protected prize, and reset it only when that prize drops.

The sure hit comes one try late

The code makes the try after the cap certain instead of the try at the cap. A player with a cap of 60 waits for try 61, and the promise on the box is wrong.

Fix: Tell your AI: with a cap of 60, after 59 misses in a row the next try, number 60, is the certain one.

The chance drifts or goes past 100 percent

The code adds a step to the last chance after every miss. Small rounding errors pile up, and with a big step the chance climbs past one, which can break later checks.

Fix: Tell your AI: work the chance out from the count of misses each time, and cap it at one.

A lucky early hit does not reset the count

Only the certain try resets the count. A player who wins by luck at try 5 still carries 4 misses, and gets the rising chance far too soon for the next prize.

Fix: Tell your AI: every hit, lucky or certain, sets the count back to zero.

The count is lost when the game closes

The count lives only while the game runs. A player who has missed 50 times closes the game and starts again at zero, and the protection means nothing.

Fix: Tell your AI: save the count with the player's game, and load it back before the first try.

A new cap below the old count

An update lowers the cap from 60 to 30, and a player already has 45 misses. The code looks for exactly try 30 and never finds it, so the player gets no protection at all.

Fix: Tell your AI: make a try certain when the count is at or above the cap minus one, not only when it is exactly equal.

How to check it works

Works well with

Common questions

how does bad luck protection work in games

The game counts misses in a row. The chance stays flat for a while, then rises with every miss, and after a set number of tries the next one always wins. A win sets the count back to zero.

how many tries before a guaranteed drop

Pick the longest dry spell you would accept, usually 1.5 to 3 times the average wait without protection. With a 2 percent chance the average is 50, so a cap of 60 to 150 is a good range.

does bad luck protection change the real drop rate

Yes. With the starting values a plain 2 percent chance takes 50 tries on average, and with protection it takes about 31. Set the base chance with that in mind, or the prize becomes too common.

what do i tell my ai to add bad luck protection

Paste this: Count misses in a row for the rare prize. The chance is 2 percent for the first 40 misses, then rises 2 points per miss, and the 60th try always hits. Any hit sets the count to zero, and the count is saved with the game.

Where it comes from

We could not find a reliable origin for this one yet.

Where this mechanic comes from has not been researched yet.

Games are named only as references. Names and marks belong to their owners, and nothing here is endorsed by them.

What was checked

This is what separates the blueprint from a catalogue entry: the values on this page come from code that runs.

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