All posts

A table that tests its own shots

A test that sweeps 63 launches off a flipper and passes the moment one of them trips the shot's switch.

On this page
What a shot test doesKeeping the dialogs awayThe stand-in shot

A whitewood is only finished when every shot can be made. Checking that by hand after every change would take an evening each time, so the table learned to test itself.

What a shot test does

The test starts Visual Pinball in a small window with the sound off and places one ball just above the named flipper’s tip at the end of its swing. Then it launches and watches. A launch ends the moment the ball:

  • trips the shot’s switch,
  • drains,
  • comes to rest, or
  • has been in flight for 2.5 seconds.

One launch proves very little, because a real flip’s timing decides where the ball goes. So the test sweeps:

21headings, 40° left to 40° right, 4° apart
3speeds, from a soft flip to one that reaches the top

A pass means the shot is makeable, not that it’s easy, which is exactly the question the whitewood needs answered.

Keeping the dialogs away

An error box popping up mid-test would freeze everything, so the test guards against it three ways:

  1. The table is checked for errors before the test starts, and the run stops if anything is wrong.
  2. A problem during the run ends the test with a clear result instead of a pop-up.
  3. If something still hangs, the test closes Visual Pinball once its time runs out.

When a test fails, it says why, by name:

  • No such switch. The table doesn’t have the shot the test asked for.
  • Missed. No launch reached the switch, and the test reports how close the nearest one came.
  • A script broke. Something went wrong in the table’s script during the run, and the test ends with that result instead of freezing.

The stand-in shot

The real shots don’t exist yet, so the first test runs against a stand-in: one switch in open playfield with a light that flashes when it’s hit. That light is the same sign a player will see when a shot registers, and it’s what the test reads.