Spielerando

When I pick up or combine stacks, a few items disappear

A full stack and a few extra items should keep the extras, not swallow them. This entry gives your AI the exact order of filling existing stacks and empty slots, with the leftover handed back to the world instead of lost.

Why this works

Adding items is a sum with a ceiling per slot. Top up partly filled stacks first, then use empty slots, and always return what did not fit, so the total stays right.

When not to use it

In games where each item is its own object with its own wear, stacks do not exist; track each item by itself instead.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 2 common mistakes and the fix
  • 33 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 "When I pick up or combine stacks, a few items disappear" (read_entry survival-stacks-lose-items-when-merged) 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