Keep a battlefield from filling with bodies: fade the oldest out, no sudden pops
A long battle leaves thousands of bodies, which cost speed and hide the living. Deleting them after a timer makes whole piles vanish in one frame, and deleting the oldest when a limit is hit makes single bodies pop away in front of the player. Here is a rule with a limit and a gentle fade that behaves the same in every situation.
Why this works
A battlefield should show what happened, but every body costs memory and clutters the view. Letting the oldest go first, and letting them fade rather than vanish, keeps the recent story on screen while nothing visibly pops out of existence.
When not to use it
Wrong when the bodies are part of the game: a graveyard the player must clear, corpses used for magic or healing, or a story where the dead must stay. Keep those as real objects with their own rules.
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 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Keep a battlefield from filling with bodies: fade the oldest out, no sudden pops" (read_entry battlefield-corpses-fade-out-and-the-oldest-go-first-when-too-many) 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