Gimli
Pinball Master
- Joined
- Feb 6, 2020
- Messages
- 1,341
- Reaction score
- 882
- Points
- 120
- Favorite Pinball Machine
- Monster Bash
I was posting about this at GoPinball when the curtain came down...I have found Future Pinball nudging to be a mystifying minefield but have discovered a few things.
-This thread will try to clarify what I have learned in terms of FP coding of Tilt and the xml tilt properties that we can tweak.
-This post will not discuss installing Digital /analog tilt mechanism in Pinball Cabs for FP which I know nothing about.
This thread reminds me of Monty Python:
Preamble
I don't know much about actual pinball tilt mechanisms or which manufacturers use whatever.
But I had a quick look at this:
It seems what I am discussing is pendulum switch emulation in the FP code/xml.
From what I gather the pendulum switch in a real machine or plumb bob tilt works like in this video
I also note that in some tables like Star Trek you get"Danger" Warnings prior to being able to TILT
So the Tilt mechanism physics seems to involve at very least:
1. Tilt Sensitivity Settings
2. Tilt Warning
3. Sensitivity Recovery / Warning Recovery ( I am not sure if Warning Recovery occurs..but I have decided to code this...)
3. Tilt
Future Pinball Coding
1. Table Editor Tilt Warning Settings
2. XML parameters
3. Script
1. Table Editor Tilt Warning Settings.
I will start with the simplest first . From table editor if you click your mouse on a blank spot on the table, you should see the "Table" menu along the right side of the screen and at the bottom you can set Tilt warnings. However it is not as easy as it sounds...as I have found that in order actually for the table to recognize your new settings you have to go through a bit of shell game.
It turns that "Warnings" in the code are dependent on "nvTiltWarnings" that are current in the fpRam file that is generated when you play FP.
so in order for your new Tilt Warning settings to take effect , after you change the number in table editor then you need reset the FPRam file. This is very easy to do. Simply go up to top of the screen menu section under Table/ Table Info and click on "Reset FP Ram File to Defaults".
So now the table will tilt after your final warning.
2. XML Parameters.
In the past the XML file was a mysterious imbedded section in FP program code that only the hackers accessed with all the Hacked versions of FP.
But recently the table Dev's and Tweakers like Slam, Terry, George and Wild etc.. have been adding the XML to the table script and BAM will overide the FP program code with your settings.
You can either copy and paste one of their codes into your table or if you have a table running by your own standards you can generate your own xml code as follows.
Load your table with BAM. Press "Q" or "~" on keyboard to load BAM Menu (Make sure you are in the "Advanced" BAM menu") go to "DEV Options" then "Physics Tweaks".
Press Control-Shift-C and it will say "ClipboardhysicsXML As a comment" ( Note if you just press Control-C it will say "Clipboard:xBAM.physics xml" you DON'T WANT THIS)
Now you have your xml code and all you need to do is go to any table script and press Control-V to paste it into you code anywhere you want outside of a Sub....End Sub routine.
The XML code will have the following Nudge Routine:
You can immediately surmise the reasons for each of the parameters and tweak them how you wish....
If you remember we are trying to emulate a pendulum and its sensitivity, you will see that "WarningLevel" and "WaitPeriod" jump out at you.
As it turns out "Warning Level" is the same thing as Sensitivity. At the default Warning Level of 160 it takes 1-3 nudges to generate a "Warning". This number is variable I presume based on the "Impulse Randomness" setting above. Anyways, if you set the Warning level lower to around 100 then every nudge will generate a warning. And if you set the Warning level high enough then no nudges will generate a warning and it is impossible therefore to tilt the table.
The Wait Period is the time between nudges that it will take for the pendulum to return to rest. So lets call this "Sensitivity Recovery"
3. Script
Most FP table authors start with the good old "new table" script as their starting point when creating a table.
The relevant code is as follows:
Notice it has 3 Sub Routines:
1.Sub FuturePinball_TiltWarning(ByVal Warnings)
2.Sub FuturePinball_Tilted()
3.Sub TiltRecoveryTimer_Expired()
Observations:
In virtually all FP tables, the Tilt Warnings will reset only between balls and between games played.
NOTE: if the ball saver is active and you drain a ball and another ball is released Tilt Warnings are NOT reset
NOTE: even if you wait between nudges Warning Levels are NOT Reset
So I don't know if actual tables have the Warning Level reset if you wait long enough between nudges...but I decided to code this as a feature as follows.
You need to create a timer named "TiltWarningRecovery" in table editor. And here is an example of the code:
I added this additional sub routine.
The above is a simple template and if any one is interested here is dummy "table" demonstrating it :
see below attachment
I set the warning level low just to demonstrate how every nudge generates a Warning. I set the Warnings to 4 then you will Tilt on the very next nudge. If you wait after the 4th warning for 5 seconds it will say "Recharged" and the Warning cycle will reset and your are free to nudge again.
I added simple code for both Gas Segments and DMDs for demonstration purposes.
For me at least this totally demystifies the FP Tilt coding and I can now tweak it as I see fit.
I like the feature of Warning Recovery , although I am not sure this translates to real tables
It adds a predictable element of strategy whereby if possible i will cradle the ball after the final warning until recharged. And I can then nudge freely during game play.
Cheers
-This thread will try to clarify what I have learned in terms of FP coding of Tilt and the xml tilt properties that we can tweak.
-This post will not discuss installing Digital /analog tilt mechanism in Pinball Cabs for FP which I know nothing about.
This thread reminds me of Monty Python:
Preamble
I don't know much about actual pinball tilt mechanisms or which manufacturers use whatever.
But I had a quick look at this:
It seems what I am discussing is pendulum switch emulation in the FP code/xml.
From what I gather the pendulum switch in a real machine or plumb bob tilt works like in this video
I also note that in some tables like Star Trek you get"Danger" Warnings prior to being able to TILT
1. Tilt Sensitivity Settings
2. Tilt Warning
3. Sensitivity Recovery / Warning Recovery ( I am not sure if Warning Recovery occurs..but I have decided to code this...)
3. Tilt
Future Pinball Coding
1. Table Editor Tilt Warning Settings
2. XML parameters
3. Script
1. Table Editor Tilt Warning Settings.
I will start with the simplest first . From table editor if you click your mouse on a blank spot on the table, you should see the "Table" menu along the right side of the screen and at the bottom you can set Tilt warnings. However it is not as easy as it sounds...as I have found that in order actually for the table to recognize your new settings you have to go through a bit of shell game.
It turns that "Warnings" in the code are dependent on "nvTiltWarnings" that are current in the fpRam file that is generated when you play FP.
so in order for your new Tilt Warning settings to take effect , after you change the number in table editor then you need reset the FPRam file. This is very easy to do. Simply go up to top of the screen menu section under Table/ Table Info and click on "Reset FP Ram File to Defaults".
So now the table will tilt after your final warning.
2. XML Parameters.
In the past the XML file was a mysterious imbedded section in FP program code that only the hackers accessed with all the Hacked versions of FP.
But recently the table Dev's and Tweakers like Slam, Terry, George and Wild etc.. have been adding the XML to the table script and BAM will overide the FP program code with your settings.
You can either copy and paste one of their codes into your table or if you have a table running by your own standards you can generate your own xml code as follows.
Load your table with BAM. Press "Q" or "~" on keyboard to load BAM Menu (Make sure you are in the "Advanced" BAM menu") go to "DEV Options" then "Physics Tweaks".
Press Control-Shift-C and it will say "ClipboardhysicsXML As a comment" ( Note if you just press Control-C it will say "Clipboard:xBAM.physics xml" you DON'T WANT THIS)
Now you have your xml code and all you need to do is go to any table script and press Control-V to paste it into you code anywhere you want outside of a Sub....End Sub routine.
The XML code will have the following Nudge Routine:
Code:
<nudge impulse=""100.0"" impulseRandomness=""25.0"" warningLevel=""160"" leftAngle=""65"" upAngle=""0.0"" rightAngle=""295""" & vbcrlf &_ " vectorRandomness=""4"" visualDistance=""2"" waitPeriod=""300"" maxBallVelocity=""1000.0""></nudge>
If you remember we are trying to emulate a pendulum and its sensitivity, you will see that "WarningLevel" and "WaitPeriod" jump out at you.
As it turns out "Warning Level" is the same thing as Sensitivity. At the default Warning Level of 160 it takes 1-3 nudges to generate a "Warning". This number is variable I presume based on the "Impulse Randomness" setting above. Anyways, if you set the Warning level lower to around 100 then every nudge will generate a warning. And if you set the Warning level high enough then no nudges will generate a warning and it is impossible therefore to tilt the table.
The Wait Period is the time between nudges that it will take for the pendulum to return to rest. So lets call this "Sensitivity Recovery"
3. Script
Most FP table authors start with the good old "new table" script as their starting point when creating a table.
The relevant code is as follows:
Code:
' The Played has Nudged the Table a little too hard/much and a Warning
' must be given to the player
'
Sub FuturePinball_TiltWarning(ByVal Warnings)
'AddDebugText "Tilt Warning" & Warnings
' play a sound at this point and put something on a display
End Sub
' The Player has tilted the machine (Too Many Warnings)
'
Sub FuturePinball_Tilted()
'AddDebugText "**Tilted**"
' play a sound
PlaySound "Tilt"
' ensure that the flippers are down (as the keys won't work from now on)
LeftFlipper.SolenoidOff
RightFlipper.SolenoidOff
' you may wish to turn off any lights at this point. (The Light Sequencer
' will make this very easy)
' start the tilt recovery timer which waits until all balls have drained
' before doing the end of ball sequence (or end of game)
TiltRecoveryTimer.Interval = 2000
TiltRecoveryTimer.Enabled = TRUE
End Sub
' The tilt recovery timer waits for all the balls to drain before continuing on
' as per normal
'
Sub TiltRecoveryTimer_Expired()
' disable the timer
TiltRecoveryTimer.Enabled = FALSE
' if all the balls have been drained then..
If (BallsOnPlayfield = 0) Then
' do the normal end of ball thing (this dosn't give a bonus if the table is tilted)
EndOfBall()
Else
' else retry (checks again in another second)
TiltRecoveryTimer.Interval = 1000
TiltRecoveryTimer.Enabled = TRUE
End If
End Sub
1.Sub FuturePinball_TiltWarning(ByVal Warnings)
2.Sub FuturePinball_Tilted()
3.Sub TiltRecoveryTimer_Expired()
Observations:
In virtually all FP tables, the Tilt Warnings will reset only between balls and between games played.
NOTE: if the ball saver is active and you drain a ball and another ball is released Tilt Warnings are NOT reset
NOTE: even if you wait between nudges Warning Levels are NOT Reset
So I don't know if actual tables have the Warning Level reset if you wait long enough between nudges...but I decided to code this as a feature as follows.
You need to create a timer named "TiltWarningRecovery" in table editor. And here is an example of the code:
Code:
Dim Bumps
Bumps = 0
Sub FuturePinball_TiltWarning(ByVal Warnings)
Bumps = Bumps + 1
Warnings = Bumps
'AddDebugText "Tilt Warning" & Warnings
' play a sound at this point and put something on a display
TiltWarningRecovery.Set False:TiltWarningRecovery.Set True, 5000 'Allows tilt to recover in 5 seconds
Select Case (Warnings)' Here is an example if you have 4 warnings chosen
Case 1:
DispDmd1.QueueText "Warning 1", seBlink, 100, True
DispSeg1.QueueText "Warning 1", seBlink, 100, True
HudDmd1.QueueText "Warning 1", seBlink, 100, True
HudSeg1.QueueText "Warning 1", seBlink, 100, True ' Or whatever you wish to say here
PlaySound "Warning1" 'Add whatever sound you wish...
Case 2:
DispDmd1.QueueText "Warning 2", seBlink, 100, True
DispSeg1.QueueText "Warning 2", seBlink, 100, True ' Or whatever you wish to say here
HudDmd1.QueueText "Warning 2", seBlink, 100, True
HudSeg1.QueueText "Warning 2", seBlink, 100, True ' Or whatever you wish to say here
PlaySound "Warning2"'Add whatever sound you wish...
Case 3:
DispDmd1.QueueText "Warning 3", seBlink, 100, True
DispSeg1.QueueText "Warning 3", seBlink, 100, True ' Or whatever you wish to say here
HudDmd1.QueueText "Warning 3", seBlink, 100, True
HudSeg1.QueueText "Warning 3", seBlink, 100, True ' Or whatever you wish to say here
PlaySound "Warning3"'Add whatever sound you wish...
Case 4:
DispDmd1.QueueText "Warning 4", seBlink, 100, True
DispSeg1.QueueText "Warning 4", seBlink, 100, True ' Or whatever you wish to say here
HudDmd1.QueueText "Warning 4", seBlink, 100, True
HudSeg1.QueueText "Warning 4", seBlink, 100, True ' Or whatever you wish to say here
PlaySound "Warning4"'Add whatever sound you wish...
End Select
End Sub
Sub FuturePinball_Tilted()
If Bumps < 4 then fpTilted = FALSE: Exit Sub 'this prevents table from tilting until after 4 warnings
DispDmd1.QueueText "Tilted", seBlink, 100, True
DispSeg1.QueueText "Tilted", seBlink, 100, True ' Or whatever you wish to say here
HudDmd1.QueueText "Tilted", seBlink, 100, True
HudSeg1.QueueText "Tilted", seBlink, 100, True ' Or whatever you wish to say here
PlaySound "Tilted"'
TiltRecoveryTimer.Interval = 1000
TiltRecoveryTimer.Enabled = TRUE
Bumps = 0
End Sub
Sub TiltWarningRecovery_Expired() 'to Lift tilt warnings and recharge tilt after 5 seconds of gentle play :)
If Bumps > 3 and fpTilted = FALSE then 'Will only recharge afer you reach critical last warning Bumps = 4
DispDmd1.QueueText "Recharged", seBlink, 100, True
DispSeg1.QueueText "Recharged", seBlink, 100, True ' Or whatever you wish to say here
HudDmd1.QueueText "Recharged", seBlink, 100, True
HudSeg1.QueueText "Recharged", seBlink, 100, True ' Or whatever you wish to say here
PlaySound "Recharged"
AddDebugText "R E C H A R G E D"
Bumps = 0
End if
AddDebugText " Bumps" & Bumps
AddDebugText "TiltWarningRecovery.Enabled" & TiltWarningRecovery.Enabled
End Sub
The above is a simple template and if any one is interested here is dummy "table" demonstrating it :
see below attachment
I set the warning level low just to demonstrate how every nudge generates a Warning. I set the Warnings to 4 then you will Tilt on the very next nudge. If you wait after the 4th warning for 5 seconds it will say "Recharged" and the Warning cycle will reset and your are free to nudge again.
I added simple code for both Gas Segments and DMDs for demonstration purposes.
For me at least this totally demystifies the FP Tilt coding and I can now tweak it as I see fit.
I like the feature of Warning Recovery , although I am not sure this translates to real tables
It adds a predictable element of strategy whereby if possible i will cradle the ball after the final warning until recharged. And I can then nudge freely during game play.
Cheers
Attachments
Last edited: