Spielerando

The game gets slower and heavier with every scene change

Backgrounds and sounds of finished scenes stay in memory until a phone gives up, yet unloading too eagerly makes shared pictures flicker or reload at every change. Here is a bookkeeping rule that frees exactly what nobody uses and keeps what the next scene shares.

Why this works

Memory has no sense of what a scene is. It only knows whether something is still wanted. If you count who wants each picture and sound, you can free exactly what has no user and keep what the next scene will need again.

When not to use it

Counting is overkill for a small game whose pictures and sounds all fit easily in memory. Load everything once and keep it. It also does not help against a leak caused by something else, like listeners that are never removed.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 4 common mistakes and the fix
  • 37 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 "The game gets slower and heavier with every scene change" (read_entry game-gets-heavier-with-every-scene-change) 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