Rotate a shop's wares each day without the stock changing on reload
A merchant who sells the same things forever is dull, and one whose shelves change on every reload is a slot machine. Players want a reason to come back tomorrow, and a fair price for waiting. This entry also covers what happens to sold-out wares and to the days a player was away.
Why this works
A shop should be a place, not a slot machine. Deriving the shelves from the day and the shop alone gives a reason to return tomorrow, while loading the game ten times shows the same wares, so there is nothing to gain from reloading.
When not to use it
Don't rotate wares when players need a dependable source for key items, such as a healing potion every run, or when the story needs one specific merchant stocked. Keep a fixed core on the shelves and rotate only the extras.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 32 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 "Rotate a shop's wares each day without the stock changing on reload" (read_entry shop-stock-changes-each-day-and-stays-the-same-on-reload) 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