Animate far-away units less often without making them move in slow motion
A battle with thousands of units cannot update every skeleton every frame, and updating only some of them naively gives distant soldiers that crawl, or a spike every fourth frame when they all update together. This entry shows how to spread the work evenly and which time step each unit must be given.
Why this works
Far units are small, so the eye cannot tell a coarse update from a smooth one, but it can tell slow motion. So skip work, not time: update less often, yet advance by all the time that has passed, and spread the updates so the load stays even.
When not to use it
Not worth it when you have few units and the game already runs smoothly, or when the camera zooms close so every unit stays large. Then it adds bugs for no gain. Measure first and cut only where the slowdown is real.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 23 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 "Animate far-away units less often without making them move in slow motion" (read_entry far-away-units-animate-less-often-with-the-right-elapsed-time) 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