Tutorial BAM How to add BAM DF1 physics to a Future Pinball table

TerryRed

Pinball Master
Joined
Feb 11, 2020
Messages
2,024
Solutions
9
Reaction score
2,467
Points
145
Favorite Pinball Machine
My Virtual Pinball Cabinet
NOTE: This is an old guide. DF1 physics are NOT the newest / most realistic physics for FP (currently that would be FizX). This guide does NOT show you how to add FizX physics to a FP table. To learn how to add FizX physics to a FP table goto this page:






********** 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 FP's physics to be opened up and dynamically changed on the fly in table script!


Benefits to adding BAM DF1 physics to a Future Pinball table:

- this can help improve how well many tables will play... in particular the flippers
- flipper accuracy is improved and can be adjusted in the table script
- older BAM xml physics files are no longer required, or used (they will be ignored)
- all the new physics settings are included in the table script!
- no need for any different version of the FuturePinball.exe to change physics (only use the original FuturePinball.exe !!!)


What this guide WONT do:

- make FP tables play the same as VPX tables
- make a table play the same as using shiva flippers
- make the table play the same as the newest FizX physics
- this will make FP tables play better... but not perfect or totally realistic for everyone's preferences


Examples of some tables that will have BAM DF1 physics added already:

- TerryRed's older releases
- SLAMT1LT's Ultimate Pro tables
- table updates from GeorgeH
- table updates from Gimli
- table updates from wild


Keeping it SIMPLE

This is a basic guide that is intended to be simple and easy for most users. It is not going super in depth about the different settings for physics that you can do in the table script.


BAM is Needed!

It goes without saying that you MUST install the latest BAM from here to use these newer physics:




NOT NEEDED FOR ALL TABLES!

Note: this applies only to tables that have NOT been updated already to use BAM physics!




************* HOW IT's DONE *************


Step 1: Copy new BAM physics code into your table


Copy all the code below into your table's script under Option Explicit


Code:
xBAM.CreateAllExt        'create BAM Extension commands. This should be at the top of the script (below Option Explicit)


'###########################################################################################
'#################################### PHYSICS SETTINGS #####################################

'=============================== PHYSICS XML ===========================
'<?xml version="1.0" encoding="utf-8"?>
'<document>
'  <!—Custom Physics  -->
'  <physics fps="296" threaded="1"></physics>
'  <ball newtonDamping="0" mass="70" gravity="6000" damping="0.65"></ball>
'  <flipper releaseOmega="18" rotationSpeedChart="{0.0,100.0}[0.0,100.0]" newtonDamping="1" mass="20150" omega="43" moeMethod="0"
'           leftXoff="0" leftYoff="500" leftZoff="0"
'           rightXoff="0" rightYoff="500" 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="5.0" gravity="2500.0" damping="0.25"></gate>
'  <kicker impulse="1200.0" vukImpulse="1400.0" impulseRandomness="2" vectorRandomness="1"></kicker>
'  <plunger mass="20000.0" force="30000.0"></plunger>
'  <slingshot impulse="650.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="80.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="240.0" impulseRandomness="25.0" warningLevel="350" leftAngle="60" upAngle="0" rightAngle="320"
'         vectorRandomness="5" visualDistance="3" waitPeriod="300" maxBallVelocity="500.0"></nudge>
'  <defaultMat softnessCoef="0.03" elasticCoef="0.1" staticFriction="0.01" kineticFriction="0.02"></defaultMat>
'  <playfieldMat softnessCoef="0.02" elasticCoef="0.1" staticFriction="0.01" kineticFriction="0.02"></playfieldMat>
'  <metalMat softnessCoef="0.01" elasticCoef="0.15" staticFriction="0.02" kineticFriction="0.02"></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.50" staticFriction="0.04" kineticFriction="0.055"></rubberHardMat>
'  <rubberIntMat softnessCoef="0.1" elasticCoef="0.72" staticFriction="0.05" kineticFriction="0.065"></rubberIntMat>
'  <rubberSoftMat softnessCoef="0.12" elasticCoef="0.83" 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

AddDebugText "BAM Version: " & BAM_VERSION

Dim RightFlipperExt,LeftFlipperExt
Dim omegaCorrectionR
Dim omegaCorrectionL

xBAM.BallSpeedLimit = 3000

Sub OnPreHitFlipperSettings(FlipperExt)
    OnPreHitFlipperSettings_bounceControl(FlipperExt)
End Sub

const MaxOmega  = 45  ' Omega at base of flipper.  Must be > MinOmega. Default = 45
const MinOmega  = 32  ' Omega at tip of flipper. Must be < MaxOmega. Default = 32

Sub LeftFlipper_prehit()
   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

Sub RightFlipper_prehit()
   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

Sub OnPreHitFlipperSettings_bounceControl(FlipperExt)
   ' PARAMETERS TO TWEAK
   const base_elasticCoef                        = 0.70 ' very bouncy flipper rubber
   const expected_ball_speed_after_hit           = 300  ' calc elasticCoef to get desired ball speed after ball hit flipper
   const minimum_elasticCoef_to_scale_fast_balls = 0.15 ' 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.15 ' 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

' ========= End of Dynamic Flipper Settings ===========


'############################### END OF  PHYSICS SETTINGS ###################################
'############################################################################################




Step 2: Make changes to the table editor

Save the table first!

Now you will need to make changes to the table in the editor. This is important to allow the table to match the newer physics.

I'm using Star Wars (Ultimate Pro) as an example. You can use other updated tables as well for reference.

Some of these may not need adjusting... but others will need to be based on your slope settings.


Adjust the table slope:

This will help the ball feel less floaty, and give it more weight. You will want to adjust this to your liking.

1605297151705.png


Adjust the Flippers

You can adjust the Strength and Elasticity. Note, that you will want to adjust this based on any changes you make in the Dynamic Flippers section in the table script.


1605297235778.png


Adjust the Slingshots (only if needed)


1605297788043.png


Adjust the Bumpers (only if needed)


1605298541491.png


Adjust Kickers (only if needed)


1605298871254.png


Autoplunger / Plunger

These may need adjusting to compensate for changes to slope.


1605298959685.png



Dynamic Flippers Code

- this is where you can adjust BAM dynamic flippers
- you may not need to make any adjustments
- the PARAMETERS TO TWEAK section is where you would typically make any changes
- @GeorgeH and @Gimli and @ravarcade would know how this all works much better than me


1605302742588.png



XML CODE

- this is FP's basic physics settings
- BAM used to load this from an xml file, but now we include it in the table script
- you can make changes to this section
- even though it's green and commented out, BAM will still understand it

1605302978051.png



Step 3 - Fine tune everything

- only adjust things if you feel you need to
- start with the slope adjustment for ball weight / speed preference
- adjust flippers in the editor / dynamic flipper section in the script if needed
- for many tables these are the main things that need adjusting
- then follow up with the rest as desired / needed
- you can make changes to the green xml code in the Physics Section of the table script if desired



SAVE THE TABLE, CLOSE FP and RELOAD!

- reloading the table over and over again (without closing FP) may cause it to run strangely or crash
- after making changes... SAVE the table... CLOSE FP and reload the table again to test!



Keep in mind, not all tables are the same!

Some tables will have better results than others based on how the author created it.

Some tables will need additional adjustments to geometry, or need hidden surfaces added to keep the ball under control, etc... but that is for more advanced updates!



I'm not a Physics guy!

Guys like @GeorgeH, @Gimli, and @ravarcade have a much better understanding of adjusting DF1 and xml code!



Another tutorial:

What are the chances of this happening... and on the same afternoon! I started typing this in the morning due to many requests on other groups.... and just as I posted this.... I noticed @GeorgeH posted his own tutorial for adding BAM physics to a table in the same afternoon!

Guess great minds think alike!

If you want a tutorial that explains more detail about the xml code and dynamic flippers, goto George's post here. He's more knowledgeable on the topic than I am!





===============================================================



DF1 physics are NOT the newest / most realistic physics for FP. FizX physics is now the newest most realistic physics for FP!

To learn how to add FizX physics to a FP table goto this page:




===============================================================
 

Attachments

  • 1605298612526.png
    1605298612526.png
    295.8 KB · Views: 143
  • 1605298750412.png
    1605298750412.png
    289.8 KB · Views: 146
Last edited:
Thanks. Gave this a try on the Wiz of OZ by Granit,Akira, ghostmachine. Made it more fun to play.
Question when doing the changes to the components i.e. bumpers, slingshots etc do you have to click every bumper/slingshot and change or does a change effect them all of that category ?
Is there a way to same time test ? In other words make a change and see how it results or have to save,restart and play to check ?
Thanks again.
 
Oh can we should we try new physics after making these changes or that won't help ? Thanks
 
You guys are acting like you need to become physics experts. I actually tested 20 tables but only 2 needed additional adjustments. Terry linked to my guide where I explain some of the the changes you can make but the changes are usually the exception and not the rule. My XML is a bit different than Terry's so you might try it.
 
I am a physics expert. I spent the night at the Holiday Inn Express... Not sure what makes you think that I was asking cuz I like to see the ball fly around like super speed. You say you tested 20 tables. Which ones for curiousity. Ones I want to change are older ones from like 2010 and the ball moves so slow and the bumpers barely bump. And it seems like Big Balls were the trending style back then.
SO its not physics expert its difference in game playing.
I tried yours. see post over there.
 
Yes, you need to adjust settings for each component in the editor (each bumper, each flipper, etc) as needed, as they may vary depending on what you want.

Many older FP tables were made with the expectation that you would be using a hacked futurepinball.exe with a different set of physics settings. That's why when you try some of those tables today, they play horribly (slow... some items barely work, etc) because we don't use hacked exes anymore, and they are using the wrong physics intended for the table. That's like taking a VP8 table and expecting it to work in VPX without needing any changes.

This post is about adding in simple DF1 physics (dynamic flippers 1).

Its not about adding newer more advanced shiva flippers (read the shiva flippers topic on this site for more info)...

...nor does it cover the newest FizX physics (formerly known as DFv2 / DPv1) being worked on that is used in Cosmic Princess as an example.
 
Is there a video or a little more in-depthness tutorial on how to do the table parts. I have been trying to change the slingshot on a couple tables and either they aren't set up like the above or I can't find the right thing to click on to get the slingshot parameters to show up. I get ornaments/toys and other stuff clicking around the slingshot. I have tried every line, component etc.
 
No video tutorial. You need to change layers until the slingshot rubber is visible and clickable. Each table is different in how items are layered.

I would wait a until new FizX tutorial comes out, as that is more recommended than DF1 is now.
 
Is there a video or a little more in-depthness tutorial on how to do the table parts. I have been trying to change the slingshot on a couple tables and either they aren't set up like the above or I can't find the right thing to click on to get the slingshot parameters to show up. I get ornaments/toys and other stuff clicking around the slingshot. I have tried every line, component etc.

You have to click on the rubber part of the slingshot. The rubber part is the band that goes around the posts. Slingshots tend to have many things stacked on top of each other. What you need to do is hold your shift key down and click on the numbers on the left pane. It activates single layers that have fewer objects on them. Keep holding the shift key down and clicking on the numbers until you find the layer that has the rubber bands for the slingshots. Then it will be easy to click on the rubber bands for the slings.
 
Thanks. I'll give it a try to see if I can do it.
 
General chit-chat
Help Users
You can interact with the ChatGPT Bot in any Chat Room and there is a dedicated room. The command is /ai followed by a space and then your ? or inquiry.
ie: /ai What is a EM Pinball Machine?
  • No one is chatting at the moment.
      Chat Bot Mibs Chat Bot Mibs: Flipper Hermann has left the room.
      Back
      Top