Enemies on a curved flight path speed up and slow down along the bends
A wave of ships follows a smooth curve, but they rush through some parts and crawl through others, bunching up and spreading out. Here is why moving the curve's own parameter evenly does that, and how to get an even pace with a small lookup table.
Why this works
A curve's own parameter does not move at an even pace: it runs fast where the control points sit close together and slowly where they are far apart. Moving by real distance instead, and translating back with a small lookup table, gives an even speed.
When not to use it
Skip it when speeding up and slowing down is what you want, such as a swooping dive that picks up pace through the bend, or when the curve is nearly even already. For a straight line or a circle you can just calculate the position directly.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 39 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 "Enemies on a curved flight path speed up and slow down along the bends" (read_entry constant-speed-along-a-curve) 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