Take a defeated army's loot only as far as the bag has room
After a won battle the field is covered in piles, and the victorious hero's bag holds only a few more. Taking the first piles in list order fills it with rubbish. This entry tops up piles the hero already carries, then spends the empty places on the most valuable piles and leaves the rest on the field.
Why this works
Value and room are two different questions. Ranking by what a pile is worth decides what you want, but merging into a stack you already carry costs no room, so filling those first leaves the empty places for the best finds.
When not to use it
Don't use it when the player should choose by hand, such as a game about packing and agonising over weight, or when some loot is a quest item that must never be left behind. There, let the player pick and flag what is mandatory.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 34 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 "Take a defeated army's loot only as far as the bag has room" (read_entry take-loot-as-far-as-the-bag-allows) 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