Spielerando

Spawn enemies on a steady beat that does not drift or bunch up after a lag

Timers that add the interval to themselves drift over a long level, and after a lag spike the whole backlog of enemies appears at one spot in the same frame. Here is a schedule that stays on its beat for an hour and spreads late arrivals where they should be.

Why this works

A schedule should be looked up from the clock, not remembered step by step. When each arrival is worked out from the start time and its own number, small errors cannot pile up, and after a stall you know exactly which ones are late and by how much.

When not to use it

Do not use it when enemies should appear in reaction to the player, for example when the last one is beaten or when the player enters a room. Then wait for that event and start the beat from there.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • 28 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 "Spawn enemies on a steady beat that does not drift or bunch up after a lag" (read_entry enemy-wave-schedule-without-drift-or-bunching) 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