***** UPDATED 10/31/2020 *****
VPX physics have come a long way in the past few years. Authors have been optimizing settings and have produced amazing results using different methods. I personally have been very happy with a wide variety of physics by different authors and often study what different authors are doing. As a result of those studies, I’ve found nFozzy’s physics to be the closest to real pinball. He’s done some pretty amazing work that extends the physics capabilities of VPX! This tutorial is an introduction on how to add nFozzy’s flipper physics to a table.
A couple of years ago I released a flipper trajectory testing table. It allowed the user to adjust flipper settings and visualize the ball trajectories and velocities when flipping at various locations along the length of the flipper. What I found was that a number of shots didn’t have appropriate trajectories or velocities compared to real flippers. For example, backhands were too vertical and the velocities were too low. In addition, trajectories tended to group at various locations along the length of the flipper. The middle third of the flipper often had tightly grouped trajectories that made certain shots either super easy or super difficult.
nFozzy took what I did to an entirely different level. He built in the ability to test VPX flippers and compare them directly to real flipper performance. He then developed scripting that allowed him to “adjust” the profile of the flipper trajectories and velocities to more closely match those of a real flipper.
Implementing nFozzy’s Solution
There are several steps for taking advantage of nFozzy’s flipper solution. At a high level we’ll need the following:
- flippers with specific physics settings
- custom triggers for each flipper
- an object or point to tell the script where the tip of the flipper is at rest
- and, special scripting
The following settings are a solid starting point for various eras of pinballs.
Flipper Physics (assumes a ball mass of 1 and diameter of 50)
|EM’s||late 70’s to mid 80’s||mid 80’s to early 90’s||
mid 90’s and later
|Strength||500-1000 (750)||1400-1600 (1500)||2000-2600||3200-3300 (3250)|
|Coil Ramp Up||2.5||2.5||2.5||2.5|
|EOS Torque Angle||4||4||6||6|
* requires special scripting to prevent a “springy” flipper when the flipper is held in the up position (covered below)
A common mistake I see on many tables is incorrect flipper length. A 3-inch flipper with rubbers will be about 3.125 inches long. This translates to about 147 vp units. Therefore, the flipper start radius + the flipper length + the flipper end radius should equal approximately 147 vp units.
Flipper Polarity and Velocity Correction
I find that flipper polarity and velocity correction is not needed on EM tables. I only use them for late 70’s and later machines (solid state). I also would not use polarity and velocity correction for short (2-inch) or vertical flippers (like the upper flipper on Dr. Who or Jurassic Park).
Flipper Triggers and Flipper End Points
For each flipper that we’ll apply polarity and velocity correction we’ll add a trigger to the table using the trigger shape “TriggerNone”. For example, one for the left flipper (TriggerLF) and one for the right flipper (TriggerRF). The image below shows the approximate shape of the triggers. Essentially, they should surround the shape of the flippers from start angle to end angle. I recommend the trigger be 23 vp units larger than the flipper objects (no larger and no smaller). I’ve used a 23 x 23 wall in the image below to help me properly size the triggers. Set the hit height of the triggers to 150.
Also add end points for each flipper. Use a standard primitive with 30 sides and an XSize and YSize of 2 times the end radius of the flippers. Place them a closely as possible to end of the flippers and name them “EndPointLp” for the left flipper and “EndPointRp” for the right flipper. Make sure they are not visible and are not collidable.
Select and add a trajectory and velocity profile for the table you’re updating.
Flipper Correction Initialization late 70s to early 80s
Flipper Correction Initialization mid 80s
Flipper Correction Initialization late 80s to early 90s
Flipper Correction Initialization early 90s and after
Note, you may need to update the following lines if you’re applying trajectory correction to more than two flippers or are using different names for your flippers, endpoints or trigger objects.
dim LF : Set LF = New FlipperPolarity
dim RF : Set RF = New FlipperPolarity
dim x, a : a = Array(LF, RF)
LF.Object = LeftFlipper
LF.EndPoint = EndPointLp
RF.Object = RightFlipper
RF.EndPoint = EndPointRp
Sub TriggerLF_Hit() : LF.Addball activeball : End Sub
Sub TriggerLF_UnHit() : LF.PolarityCorrect activeball : End Sub
Sub TriggerRF_Hit() : RF.Addball activeball : End Sub
Sub TriggerRF_UnHit() : RF.PolarityCorrect activeball : End Sub
Next we’ll need to replace the flipper.rotatetoend statements with the following (typically in the SolLFlipper and SolRFlipper subs):
Finally, download and include the necessary supporting functions in your table script.
Similar to above, you may need to modify the following line in the AddPt Sub if you’re applying correction to more than two flippers.
dim a : a = Array(LF, RF)
If you have completed the above steps correctly, your flippers should now have polarity and velocity correction enabled.
Next, we need to add code to enable flipper tricks physics. This code addresses deficiencies in the VP flipper physics to prevent a “springy flipper” when the flipper is held in the up position, enhances the coil ramp up curves allowing for drop catches and tap passes, simulates the absorption of ball momentum (allowing for live catches), and corrects some buggy behavior in the flipper code that at times causes weird bouncing behavior.
Add the following script to your table. Note this uses the right flipper timer in case you’re using for some other purpose.
Once again, you may need to modify the following lines if you’re applying this code to more than two flippers.
FlipperTricks LeftFlipper, LFPress, LFCount, LFEndAngle, LFState
FlipperTricks RightFlipper, RFPress, RFCount, RFEndAngle, RFState
dim LFPress, RFPress, LFCount, RFCount
dim LFState, RFState
dim RFEndAngle, LFEndAngle
LFEndAngle = Leftflipper.endangle
RFEndAngle = RightFlipper.endangle
You will also want to modify the EOSTnew and EOSReturn Consts based on the era of table.
- “1” for EM’s to late 80’s
- “0.8” for 90’s and after
- “0.055” for EM’s
- “0.045” late 70’s to mid 80’s
- “0.035” mid 80’s to early 90’s
- “0.025” mid 90’s and after
Finally, we need to add the following to the KeyDown and KeyUp subs:
If keycode = LeftFlipperKey Then FlipperActivate LeftFlipper, LFPress
If keycode = RightFlipperKey Then FlipperActivate RightFlipper, RFPress
If keycode = LeftFlipperKey Then FlipperDeActivate LeftFlipper, LFPress
If keycode = RightFlipperKey Then FlipperDeActivate RightFlipper, RFPress
Please note that geometry can be very important when designing a table for flipper tricks. For example, the position of lane guides in relation to the flipper can have significant impacts on the ability to post pass. If the lane guides are too high, the ball may deflect of the guide preventing if from achieving the necessary trajectory.
Attached is an example table that applies these techniques to the flippers.