Spielerando

Stack several build discounts without letting a cost drop to zero

A guild gives ten percent off, a technology twenty, and a festival fifty. Applied one after another with rounding in between, the same discounts give different prices, and enough of them make a wall cost nothing. This entry adds them up with a ceiling, rounds once at the end and keeps a minimum.

Why this works

Discounts that multiply or round at every step drift in ways players cannot predict. Adding the percentages first, limiting the sum and rounding once at the end gives one clear number to explain, and a minimum keeps cheap things from becoming free.

When not to use it

Skip it when a single discount is all the game ever offers, or when free things are the point, such as a tutorial gift. Also skip it if you want rewards to snowball; then multiply on purpose and tell the player.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 4 common mistakes and the fix
  • 13 lines of example code with 3 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "Stack several build discounts without letting a cost drop to zero" (read_entry stack-build-discounts-with-floor) 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