***** UPDATED TO INCLUDE PHYSICS FOR FLIPPER TRICKS *****

VPX physics have come a long way in the past two 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 physics to a table.

nFozzy’s Terminator 2 and Space Station are great example tables of what his physics can do and how he’s implemented some of the methods I will walk through.  I encourage you to dig into these tables if you’re interested in what he’s doing.

Flipper Physics

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.  Playing either Terminator 2 or Space Station and you’ll quickly feel the difference and more even distribution of shots along the length of the flippers.

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:

  1. flippers with specific physics settings
  2. custom triggers for each flipper
  3. an object or point to tell the script where the tip of the flipper is at rest
  4. 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)

late 70’s to mid 80’s mid 80’s to late 80’s

early 90’s and later

Mass 1 1 1
Strength 1200-1800 2100-2500 2800-3300
Elasticity 0.88 0.83 0.83
Elasticity Falloff 0.15 0.13 0.13
Fricition 0.9 0.9 0.9
Return Strength 0.14 0.1 0.066
Coil Ramp Up 2.5 2.5 2.5
Scatter Angle 0 0 0
EOS Torque 0.275* 0.275* 0.275*
EOS Torque Angle 6 6 6

* requires special scripting to prevent a “springy” flipper when the flipper is held in the up position (covered below)

Flipper Triggers and Flipper End Points

We’ll add two triggers to the table using the trigger shape “TriggerNone”.  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.

For the end points, 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.

Scripting

First, download and include the necessary supporting functions in your table script.

Flipper Functions

Second, create two new objects using the FlipperPolarity Class.

dim LF : Set LF = New FlipperPolarity ‘Left Flipper
dim RF : Set RF = New FlipperPolarity ‘Right Flipper

Third, configure the profile to adjust trajectory (polarity) and velocity.  Note that the name of the left flipper and right flipper are assigned to the corresponding objects and the end point primitives we created in a previous step are assigned.  The example below corresponds to the flipper profile for Terminator 2 (90’s and beyond pinballs).

InitPolarity

Sub InitPolarity()
dim x, a : a = Array(LF, RF)
for each x in a
‘safety coefficient (diminishes polarity correction only)
x.AddPoint “Ycoef”, 0, RightFlipper.Y-65, 1
x.AddPoint “Ycoef”, 1, RightFlipper.Y-11, 1

x.enabled = True
x.TimeDelay = 44
Next

‘rf.report “Velocity”
addpt “Velocity”, 0, 0, 1
addpt “Velocity”, 1, 0.2, 1.07
addpt “Velocity”, 2, 0.41, 1.05
addpt “Velocity”, 3, 0.44, 1
addpt “Velocity”, 4, 0.65, 1.0’0.982
addpt “Velocity”, 5, 0.702, 0.968
addpt “Velocity”, 6, 0.95, 0.968
addpt “Velocity”, 7, 1.03, 0.945

‘rf.report “Polarity”
AddPt “Polarity”, 0, 0, -4.7
AddPt “Polarity”, 1, 0.16, -4.7
AddPt “Polarity”, 2, 0.33, -4.7
AddPt “Polarity”, 3, 0.37, -4.7
AddPt “Polarity”, 4, 0.41, -4.7
AddPt “Polarity”, 5, 0.45, -4.7
AddPt “Polarity”, 6, 0.576,-4.7
AddPt “Polarity”, 7, 0.66, -2.8
AddPt “Polarity”, 8, 0.743, -1.5
AddPt “Polarity”, 9, 0.81, -1.5
AddPt “Polarity”, 10, 0.88, 0

LF.Object = LeftFlipper
LF.EndPoint = EndPointLp  ‘you can use just a coordinate, or an object with a .x property.
RF.Object = RightFlipper
RF.EndPoint = EndPointRp
End Sub

Forth, add hit and unhit subs for the flipper triggers.

‘Trigger Hit – .AddBall activeball
‘Trigger UnHit – .PolarityCorrect activeball

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

Fifth, we need to replace the flipper.rotatetoend statements with the following (typically in the SolLFlipper and SolRFlipper subs):

LF.fire ‘LeftFlipper.RotateToEnd
RF.fire ‘RightFlipper.RotateToEnd

The script for steps 2-4 are included here for three eras of pinballs.  I recommend not changing the profiles unless you really know what you’re doing.

Flipper Init late 70’s to mid 80’s
Flipper Init mid 80’s to late 80’s
Flipper Init early 90’s and later

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 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.

First, we’ll add the following to the key down sub:

	If keycode = LeftFlipperKey Then LFPress = 1
	If keycode = RightFlipperKey Then rfpress = 1

Second, we’ll add the following to the key up sub:

	If keycode = LeftFlipperKey Then 
		lfpress = 0
		leftflipper.eostorqueangle = EOSA
		leftflipper.eostorque = EOST
	End If
	If keycode = RightFlipperKey Then 
		rfpress = 0
		rightflipper.eostorqueangle = EOSA
		rightflipper.eostorque = EOST
	End If

Third, we’ll add the remainder of the attached scripting.  Note this uses the right flipper timer in case you’re using for some other purpose.

Flipper Tricks Physics Code

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 uses the steps above to implement these flipper physics for a late 80’s to mid 90’s table.

Example_Table

11 Comments
  1. randr 5 months ago

    Amazing work as always roth. Thanks for all your contributions you have done to vp!

  2. Author
    rothbauerw 5 months ago

    @nFozzy deserves all the credit.

  3. Herweh 5 months ago

    Awesome stuff, nFozzy. Will try to add this pretty soon.
    And thank you so much, roth, for your perfect explanation, for summarizing all and for more upcoming physics infos. I love all you‘re doing for the community.

  4. bord 5 months ago

    Really excited for this how-to. Can’t wait to implement it and read part 2. Thanks, @rothbauerw and @nfozzy!

  5. Thalamus 5 months ago

    I know you on several occasions already has mentioned nFozzy’ flipper physics. And I’ve looked and came to the conclusion that it was something to revisit for the future as I had hard time following what was actually being done. With this article, I feel I’m still able to understand the why’s and how’s. So thank you very much Roth for taking your time to explain it to us in more detail.

  6. bord 5 months ago

    Any changes needed if there is an upper left or right flipper?

  7. Author
    rothbauerw 5 months ago

    I’m not aware that this has been tried on upper flippers. I can’t think of a reason it wouldn’t work, but it might need a different profile. We’ll have to experiment with it and I can add it to the tutorial once we figure it out.

  8. Ben Logan2 5 months ago

    Awesome stuff, nfozzy. Your contributions to the community have been amazing.

  9. wrd1972 3 months ago

    Roth,
    I’m trying to add this to BBBB. I think I have everything in. But when I start the table, I am getting script error “Variable is undefined “addpoint”.

    Any idea what I am missing?

    • Author
      rothbauerw 3 months ago

      Not without seeing the script. PM me what you have and I’ll take a look.

Leave a reply

©2019 VPinBall.com

Log in with your credentials

or    

Forgot your details?

Create Account