- Joined
- May 3, 2016
- Messages
- 2,897
- Solutions
- 7
- Reaction score
- 2,303
- Points
- 145
- Favorite Pinball Machine
- Attack From Mars
This tutorial can still be used although there is a new tutorial for FizX Lite Edition that you should consider using that is available here. It does require a little more work to add to your table.
Note: This tutorial requires that you have Better Arcade Mode (BAM) installed.
I wrote this tutorial assuming you know very little about FP so anyone can use it. There really is no such thing as perfect physics. A lot depends on your personal preferences. I have created physics for tables for some time now and quite a few people appear to like it although some increase the table slope to make the table play faster. Anyway, I think everyone will like these physics better than the terrible physics of the original FP program. To create this tutorial, I copied 20 tables selected at random to a new folder and started experimenting. I found an xml that works well on all 20 tables.
Select all the code below and copy it to the clipboard using Ctrl "C". Open the script for a table from the FP editor. Paste (Ctrl "V") the code below the line that says "Option Explicit" and save the changes. The xml code included below will be green when added to the script which means that it is saved as a comment but BAM will still use it. You must save changes and close the FP editor before you play the table in order for the xml code work.
The xml code works best when the table slope is set to 6.8 although you may want to increase this if you want the table to play faster. I posted a screenshot of how to change the slope below.
How to Make Adjustments
There are a few adjustments that may be needed after you save the code to the script and change the slope. You will have many tables where you won't need to make any of these adjustments. I included these directions to cover the exceptions.
Of the 20 tables I tested, two needed to have the strength of a vertical up kicker (VUK) adjusted. You can tell the VUK needs to be adjusted when it won't kick the ball hard enough to make it go all the way up to the ramp. The ball usually ends up being kicked repeatedly or the ball may just be kicked once and drop back down into the kicker. I posted a screenshot of how to adjust the kicker below.
The plunger on two tables only launched the ball partially up the launch lane and then the ball rolled back down to the plunger. When this happens, you need to increase the strength of the plunger. I posted a screenshot of how to adjust the plunger below.
There may be times when you may want to adjust the strength of the slingshots. None of the 20 tables I tested had specific problems caused by the strength of the slingshots. However, I would have adjusted a couple to make the table play better. I posted a screenshot of how to adjust the slingshots below.
None of the tables I selected had problems with the ramps. My experience with other tables is that the ball can partially go up a ramp and then roll back down. When you have this problem, you can't hit the ball hard enough so it will go all the way up the ramp. The usual fix is the increase the strength (omega) of the flippers. If this happens, open the script and scroll down to the section that looks like this:
const MinOmega = 30
const MaxOmega = 45
MinOmega is the strength of the flipper at the tip of the flipper. MaxOmega is the strength of the flipper at the base of the flipper. Midpoints on the flipper have strengths in between the values for MinOmega and MaxOmega. You can adjust MinOmega and MaxOmega by changing the blue numbers as shown in the example above. I usually adjust the MinOmega to make the flipper hit harder. Sometimes I want to cradle the ball and allow it to roll down the flipper to a midpoint and then hit the flipper to make a shot. Adjusting MaxOmega can help make that shot although you probably won't to change MaxOmega very often. There are some additional directions that have been saved to the comments in the script.
This concludes the tutorial. Please post any questions you have below.
Edit 11/15/20: It seems that TerryRed and I produced nearly the same tutorial and posted it on the very same afternoon without the knowledge of what the other was doing. Like Terry says, "Great minds think alike". Terry's physics are different from mine so you might try both:
Note that the code can be applied to electromagnetic (EM) tables as well as solid state.
The dynamic flippers will work on tables that have more the the two main flippers but the dynamics will only affect the main flippers. I always add dynamic flippers to all the flippers on a table but the improvement on the upper flippers is not as dramatic as the main flippers.
I always tweak the xml also so it is specific to the tables that I post but that is beyond what most folks will want to do. This generic xml works well enough to get you to 90 to 95 percent of the way there.
____________________ Adjusting Table Slope ______________________________ Adjusting Kicker Strength ___________
___
__________ Adjusting Plunger Strength __________________________ Adjusting Slingshot Strength __________
___
Note: This tutorial requires that you have Better Arcade Mode (BAM) installed.
I wrote this tutorial assuming you know very little about FP so anyone can use it. There really is no such thing as perfect physics. A lot depends on your personal preferences. I have created physics for tables for some time now and quite a few people appear to like it although some increase the table slope to make the table play faster. Anyway, I think everyone will like these physics better than the terrible physics of the original FP program. To create this tutorial, I copied 20 tables selected at random to a new folder and started experimenting. I found an xml that works well on all 20 tables.
Select all the code below and copy it to the clipboard using Ctrl "C". Open the script for a table from the FP editor. Paste (Ctrl "V") the code below the line that says "Option Explicit" and save the changes. The xml code included below will be green when added to the script which means that it is saved as a comment but BAM will still use it. You must save changes and close the FP editor before you play the table in order for the xml code work.
The xml code works best when the table slope is set to 6.8 although you may want to increase this if you want the table to play faster. I posted a screenshot of how to change the slope below.
How to Make Adjustments
There are a few adjustments that may be needed after you save the code to the script and change the slope. You will have many tables where you won't need to make any of these adjustments. I included these directions to cover the exceptions.
Of the 20 tables I tested, two needed to have the strength of a vertical up kicker (VUK) adjusted. You can tell the VUK needs to be adjusted when it won't kick the ball hard enough to make it go all the way up to the ramp. The ball usually ends up being kicked repeatedly or the ball may just be kicked once and drop back down into the kicker. I posted a screenshot of how to adjust the kicker below.
The plunger on two tables only launched the ball partially up the launch lane and then the ball rolled back down to the plunger. When this happens, you need to increase the strength of the plunger. I posted a screenshot of how to adjust the plunger below.
There may be times when you may want to adjust the strength of the slingshots. None of the 20 tables I tested had specific problems caused by the strength of the slingshots. However, I would have adjusted a couple to make the table play better. I posted a screenshot of how to adjust the slingshots below.
None of the tables I selected had problems with the ramps. My experience with other tables is that the ball can partially go up a ramp and then roll back down. When you have this problem, you can't hit the ball hard enough so it will go all the way up the ramp. The usual fix is the increase the strength (omega) of the flippers. If this happens, open the script and scroll down to the section that looks like this:
const MinOmega = 30
const MaxOmega = 45
MinOmega is the strength of the flipper at the tip of the flipper. MaxOmega is the strength of the flipper at the base of the flipper. Midpoints on the flipper have strengths in between the values for MinOmega and MaxOmega. You can adjust MinOmega and MaxOmega by changing the blue numbers as shown in the example above. I usually adjust the MinOmega to make the flipper hit harder. Sometimes I want to cradle the ball and allow it to roll down the flipper to a midpoint and then hit the flipper to make a shot. Adjusting MaxOmega can help make that shot although you probably won't to change MaxOmega very often. There are some additional directions that have been saved to the comments in the script.
This concludes the tutorial. Please post any questions you have below.
Edit 11/15/20: It seems that TerryRed and I produced nearly the same tutorial and posted it on the very same afternoon without the knowledge of what the other was doing. Like Terry says, "Great minds think alike". Terry's physics are different from mine so you might try both:
Tutorial - BAM - How to add BAM DF1 physics to a Future Pinball table
How to add BAM DF1 physics to a Future Pinball table This question comes up a lot, so I figured it was time to make a simple post to show how to add newer (simple) BAM DF1 physics to a Future Pinball table that hasn't been updated to use BAM features. BAM allows for pretty much all aspects of...
pinballnirvana.com
Note that the code can be applied to electromagnetic (EM) tables as well as solid state.
The dynamic flippers will work on tables that have more the the two main flippers but the dynamics will only affect the main flippers. I always add dynamic flippers to all the flippers on a table but the improvement on the upper flippers is not as dramatic as the main flippers.
I always tweak the xml also so it is specific to the tables that I post but that is beyond what most folks will want to do. This generic xml works well enough to get you to 90 to 95 percent of the way there.
____________________ Adjusting Table Slope ______________________________ Adjusting Kicker Strength ___________
___
__________ Adjusting Plunger Strength __________________________ Adjusting Slingshot Strength __________
___
Code:
'=============================== PHYSICS XML ===========================
'<?xml version="1.0" encoding="utf-8"?>
'<document>
' <physics fps="296" threaded="1"></physics>
' <ball newtonDamping="0" mass="80" gravity="7100" damping="0.9"></ball>
' <flipper rotationSpeedChart="{0.0,100.0}[0.0,100.0]" newtonDamping="1" releaseOmega="18" mass="20150" omega="43" moeMethod="0" leftXoff="0" leftYoff="0" leftZoff="0" rightXoff="0" rightYoff="0" rightZoff="0"></flipper>
' <bumper impulse="90.0" impulseRandomness="0" vectorRandomness="6"></bumper>
' <autoplunger mass="20000.0" force="60000.0"></autoplunger>
' <diverter mass="10000.0" omega="33.0"></diverter>
' <gate mass="0.010" gravity="100" damping="0.25"></gate>
' <kicker impulse="1000.0" vukImpulse="1400.0" impulseRandomness="2" vectorRandomness="1"></kicker>
' <plunger mass="20000.0" force="30000.0"></plunger>
' <slingshot impulse="700.0" impulseRandomness="15" vectorRandomness="3"></slingshot>
' <spindisk mass="10000.0" angularDamp="0.33" linearDamp="0.25"></spindisk>
' <spinner mass="60.0" gravity="100.0" angularDamp="0.25" angularAccel="5.25" spinDampLoose="0.55" spinBackLoose="1.70" spinDampNorm="0.75" spinBackNorm="1.80" spinDampTight="0.95" spinBackTight="1.90"></spinner>
' <emkicker mass="10000.0" omega="40.0"></emkicker>
' <varitarget mass="500.0" damping="0.9" tension="3.0" return="15.0"></varitarget>
' <magnet impulse="10.0" impulseRandomness="2"></magnet>
' <nudge impulse="120.0" impulseRandomness="25.0" warningLevel="250" leftAngle="60" upAngle="0" rightAngle="320" vectorRandomness="5" visualDistance="1" waitPeriod="300" maxBallVelocity="500.0"></nudge>
' <defaultMat softnessCoef="0.02" elasticCoef="0.1" staticFriction="0.02" kineticFriction="0.02"></defaultMat>
' <playfieldMat softnessCoef="0.03" elasticCoef="0.1" staticFriction="0.025" kineticFriction="0.015"></playfieldMat>
' <metalMat softnessCoef="0.01" elasticCoef="0.1" staticFriction="0.01" kineticFriction="0.01"></metalMat>
' <woodMat softnessCoef="0.03" elasticCoef="0.15" staticFriction="0.03" kineticFriction="0.02"></woodMat>
' <plasticMat softnessCoef="0.02" elasticCoef="0.2" staticFriction="0.02" kineticFriction="0.01"></plasticMat>
' <rubberHardMat softnessCoef="0.08" elasticCoef="0.32" staticFriction="0.04" kineticFriction="0.055"></rubberHardMat>
' <rubberIntMat softnessCoef="0.1" elasticCoef="0.42" staticFriction="0.05" kineticFriction="0.065"></rubberIntMat>
' <rubberSoftMat softnessCoef="0.12" elasticCoef="0.52" staticFriction="0.06" kineticFriction="0.075"></rubberSoftMat>
' <gateMat softnessCoef="0.05" elasticCoef="0.65" staticFriction="0" kineticFriction="0"></gateMat>
' <kickerMat softnessCoef="0.01" elasticCoef="0.05" staticFriction="0.8" kineticFriction="0.8"></kickerMat>
' <rampMat softnessCoef="0.01" elasticCoef="0.01" staticFriction="0.01" kineticFriction="0.01"></rampMat>
' <plungerMat softnessCoef="0.04" elasticCoef="0.55" staticFriction="0.02" kineticFriction="0.02"></plungerMat>
' <spindiskMat softnessCoef="0.05" elasticCoef="0.5" staticFriction="1.5" kineticFriction="2"></spindiskMat>
'</document>
'=============================== PHYSICS XML ===========================
' === Dynamic Flipper Settings ===
Const BAM_VERSION = 0 ' Note that BAM 233 implemented dynamic flippers but this table uses
' "xBAM.CreateAllExt" which requires BAM 254.
AddDebugText BAM_VERSION
If BAM_VERSION => 254 then
Dim omegaCorrectionL
Dim omegaCorrectionR
Dim BounceMix
xBAM.CreateAllExt
End If
' FLIPPER OMEGA
' You may want to adjust the strength (also called omega) of the flippers when you add dynamic flippers to other tables.
' Only change the values for "MaxOmega" and "MinOmega" These settings override the flipper omega listed in the XML.
' You probably will want to adjust MaxOmega between 40 and 50 and MinOmega between 26 and 33. This is not a strict rule
' but it gives you an idea of approximate values that work for me. You need to leave the section below "MaxOmega2"
' unchanged and then go on to "BOUNCE CONTROL" below.below.
If BAM_VERSION => 254 then
const MinOmega = 30 ' Omega at tip of flipper. Must be < MaxOmega. Default = 30
const MaxOmega = 45 ' Omega at base of flipper. Must be > MinOmega. Default = 45
End If
Dim ball_to_flipper_angle
''''''''''''''''''''''''''''''''''''''''''''Right Flipper Prehit Code'''''''''''''''''''''''''''''''''''''''
Sub RightFlipper_prehit()
If BAM_VERSION < 254 then Exit Sub
Dim ball
Set ball = xBAM.BallCloseTo(0,0)
If xBAM.Ball.Speed <= 200 then BounceMix = 1
If xBAM.Ball.Speed > 200 then BounceMIx = 2
OnPreHitFlipperSettings(RightFlipperExt)
omegaCorrectionr = MaxOmega - (RightFlipperExt.ContactPoint * ((MaxOmega - MinOmega)/1.2))
If RightFlipperExt.ContactPoint < 0.0 then RightFlipperExt.Omega = MaxOmega
If RightFlipperExt.ContactPoint > 1.2 then RightFlipperExt.Omega = MinOmega
If (RightFlipperExt.ContactPoint => 0.0) And (RightFlipperExt.ContactPoint =< 1.2) then
RightFlipperExt.Omega = omegaCorrectionr
End if
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''Left Flipper PreHit Code'''''''''''''''''''''''''''''
Sub LeftFlipper_prehit()
If BAM_VERSION < 254 then Exit Sub
Dim ball
Set ball = xBAM.BallCloseTo(0,0)
If ball.Speed <= 200 then BounceMix = 1
If xBAM.Ball.Speed <= 200 then BounceMix = 1
If xBAM.Ball.Speed > 200 then BounceMIx = 2
If BAM_VERSION < 254 then Exit Sub
OnPreHitFlipperSettings(LeftFlipperExt)
omegaCorrectionl = MaxOmega - (LeftFlipperExt.ContactPoint * ((MaxOmega - MinOmega)/1.2))
If LeftFlipperExt.ContactPoint < 0.0 then LeftFlipperExt.Omega = MaxOmega
If LeftFlipperExt.ContactPoint > 1.2 then LeftFlipperExt.Omega = MinOmega
If (LeftFlipperExt.ContactPoint => 0.0) And (LeftFlipperExt.ContactPoint =< 1.2) then
LeftFlipperExt.Omega = omegaCorrectionl
End if
End Sub
' BOUNCE CONTROL
Sub OnPreHitFlipperSettings(FlipperExt)
If BAM_VERSION < 254 then Exit Sub
If BounceMix = 1 then OnPreHitFlipperSettings_nobounceControl(FlipperExt)
If BounceMix = 2 then OnPreHitFlipperSettings_bounceControl(FlipperExt) 'Original Rav Bounce
End Sub
' Bounce control is the amount of bounce the ball makes when it hits a stationary flipper. If you want to increase or decrease
' bounce, it can be difficult because there are 4 parameters that you have to adjust. To make it easier, I have provided the
' following list of values that can be entered into the code below. Replace the numbers in blue with numbers from one of the 12
' columns below. I think the changes from one column of settings to the next result in fairly small changes in bounce but you
' can use the midpoint between two sets of values also. Note that bounce control overrides flipper elasticity listed in the XML.
' Suggested values from low bounce on the left to high bounce on the right
' Group: 1 2 3 4 5 6 7 8 9 10 11 12
' base_elasticCoef 0.55 0.57 0.59 0.60 0.62 0.64 0.66 0.68 0.70 0.71 0.73 0.75
' expected_ball_speed_after_hit 146.00 170.00 195.00 219.00 243.00 267.00 292.00 316.00 340.00 365.00 389.00 413.00
' minimum_elasticCoef_to_scale_fast_balls 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.09 0.10 0.11
' reduction_for_flipper_in_motion 0.23 0.22 0.21 0.20 0.19 0.19 0.18 0.17 0.16 0.16 0.15 0.14
Sub OnPreHitFlipperSettings_bounceControl(FlipperExt)
If BAM_VERSION < 254 then Exit Sub
' PARAMETERS TO TWEAK Default = Group 4.5 settings
const base_elasticCoef = 0.61 ' very bouncy flipper rubber
const expected_ball_speed_after_hit = 231 ' calc elasticCoef to get desired ball speed after ball hit flipper
const minimum_elasticCoef_to_scale_fast_balls = 0.04 ' we will add this to calculated elastiCoef, so ball after hit will have aditional 5% of speed before hit
const reduction_for_flipper_in_motion = 0.20 ' if flipper is not in starting point, reduce elasticCoef by 20%
If FlipperExt.Hit Then
Dim elasticCoef
Dim maxElasticCoef
Dim ballSpeed
ballSpeed = (FlipperExt.BallVSpeed + xBAM.Ball.Speed) * 0.5 ' averge speed of
maxElasticCoef = base_elasticCoef
If FlipperExt.AngleDiff > 1 Then maxElasticCoef = maxElasticCoef - reduction_for_flipper_in_motion
elasticCoef = base_elasticCoef
If ballSpeed > 1 Then elasticCoef = expected_ball_speed_after_hit / ballSpeed
elasticCoef = elasticCoef + minimum_elasticCoef_to_scale_fast_balls
If elasticCoef > maxElasticCoef Then elasticCoef = maxElasticCoef
FlipperExt.SetMaterial elasticCoef
End If
End Sub
Sub OnPreHitFlipperSettings_nobounceControl(FlipperExt)
RightFlipperExt.SetMaterial 0.62, 0.12, 0.06, 0.075
LeftFlipperExt.SetMaterial 0.62, 0.12, 0.06, 0.075
End Sub
' === End of Dynamic Flipper Settings ===
Last edited: