Set shop buy and sell prices so players cannot farm gold by trading
A charm discount at the shop and a bonus for selling sound like harmless perks, but combined with rounding they can let a player buy an item and sell it back for more. This entry makes one price rule that stays honest whatever bonuses stack up.
Why this works
A trade loop is only a risk when buying and selling can come out ahead. Making the shop always pay out less than it charged, whatever perks apply, closes the loop, because the gap is checked at the end, not hoped for along the way.
When not to use it
Do not force a gap in games where players trade with each other or the market moves, such as an economy of supply and demand. There profit from good timing is part of the fun. Set rules on the whole market instead.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 19 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 "Set shop buy and sell prices so players cannot farm gold by trading" (read_entry shop-prices-without-infinite-money) 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