Skip to content

v0.47.0 — the ball moves at a rate

Choose a tag to compare

@ralyodio ralyodio released this 12 Aug 20:08
afce0d7

v0.45.0 fixed the clock and v0.46.0 fixed the grid. Both were real, and the ball was still slow and still jiggly, because neither of them was the thing that decides when a step happens.

Rounding the true position to the lattice every tick moves the ball whenever it happens to cross a column edge or a half-row edge — and those two are on unrelated schedules. A ball with the two periods close but not equal, which is what a near-diagonal is and what breakout launches at, beats between them. Measured, breakout held one drawn position for 16ms, then 80ms, then 48ms, five times a second. The steps were the right size and it still looked like the ball was struggling, because nothing was moving at a rate.

So the true position no longer decides when the ball is drawn, only which way it owes a step. When that step is paid is decided by a clock ticking at the ball's own speed: debt accrues at the distance the true ball covers, measured in the units the drawn one travels in, and a whole unit buys one step. The drawn ball therefore moves every 1/speed ticks at any angle, trailing the true one by less than half a character.

The slowness was just slowness — the old ball took three seconds to cross the board, which is a ball being carried rather than hit. Both games are now played at 1.9× the pace they were tuned at, scaled through every constant at once so the machine in pong speeds up with the ball and the angle off a paddle is the one it always was. Breakout's paddle moves three columns a press instead of two, to stay ahead of the faster ball.

drawn steps/sec longest stall biggest jump
pong 20.4 → 42.6 64ms → 32ms 1.41 → 1.00
breakout 20.5 → 43.7 80ms → 48ms 1.41 → 1.00

Diagonal lurches are gone entirely: no step is ever larger than one lattice unit. The balance tests that make the machine beatable off the end of the paddle and not from the middle pass unchanged at the new pace.

Full changelog: v0.46.0...v0.47.0