Fix star ratings that are one star off exactly at the limit, or drop on replay
A player finishes in exactly the number of moves the level promises and gets one star less, or replays a level more badly and loses the stars they had earned. This entry shows how to make the AI draw the lines clearly and keep the best result.
Why this works
A promise made on screen must be kept to the letter. If the level says a certain count earns three stars, then exactly that count has to earn them. Also, a record is a thing the player earned, so a worse try later cannot take it away.
When not to use it
Fixed stars do not fit games where difficulty should adapt to each player, or where there is no single best way to play, such as a creative sandbox. There, rate against the player's own past runs, or leave out the rating and let the result speak.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- A diagram of every state
- 25 lines of example code with 5 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Fix star ratings that are one star off exactly at the limit, or drop on replay" (read_entry star-rating-wrong-at-the-limit) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP