Register    Login    Forum    FAQ    PinSimDB.org

Board index » Future Pinball » BAM corner




Post new topic Reply to topic  [ 225 posts ]  Go to page Previous  1 ... 12, 13, 14, 15, 16, 17, 18 ... 23  Next
Author Message
 Post subject: Re: BAM Dynamic Flipper Breakthrough !!
 Post Posted: Fri Dec 14, 2018 3:31 pm 
Offline

Joined: Thu Aug 16, 2012 11:12 pm
Posts: 2520
Location: Arkansas, USA
I ended up adding the code myself. I had to change the amount of bounce because there was too much bounce. I also used the XML file I created for CFTBL. Then I took an original copy of CFTBL and added dynamic flippers the way I normally do. I think I made the flipper settings the same as yours although I am not sure what these 2 lines do:

RightFlipperExt.Omega = 47
LeftFlipperExt.Omega = 43

The idea is to compare your enhancement to a version that does not have it. To be honest, I couldn't tell much difference between the 2 versions. Maybe I didn't set something up correctly. ...But You can try the 2 versions I created to see what you think:

https://www.dropbox.com/sh/jhrlmdlsoo8f ... bPKDa?dl=0

Our standard dynamic flipper setup does improve the aiming considerably. I need to publish a new version of CFTBL.

George


Top 
 Profile  
 
 Post subject: Re: BAM Dynamic Flipper Breakthrough !!
 Post Posted: Fri Dec 14, 2018 3:58 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2857
Location: Ontario, Canada
Thanks George I'll check tomorrow night . The bounce will come down to personal preference , but aiming is key...and it does makes sense to me that we mainly need to control bounce when ball is going to bounce.


Top 
 Profile  
 
 Post subject: Re: BAM Dynamic Flipper Breakthrough !!
 Post Posted: Fri Dec 14, 2018 6:13 pm 
Offline

Joined: Thu Aug 16, 2012 11:12 pm
Posts: 2520
Location: Arkansas, USA
Gimli wrote:
Thanks George I'll check tomorrow night . The bounce will come down to personal preference , but aiming is key...and it does makes sense to me that we mainly need to control bounce when ball is going to bounce.


I doubt that bounce affects aiming all that much but I had to change it to a point where I live with it. Otherwise I would not be very objective in comparing the 2 versions. If I hadn't changed it, all I would see is that I don't like either version.

George


Top 
 Profile  
 
 Post subject: Re: BAM Dynamic Flipper Breakthrough !!
 Post Posted: Fri Dec 14, 2018 6:44 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2857
Location: Ontario, Canada
RightFlipperExt.Omega = 47
LeftFlipperExt.Omega = 43

This isn't necessary but basically this becomes the default settings instead of XML ....on several tables Indy and CFTBL specifically I find it harder to hit right ramp with left flipper
And so a slightly slower base omega seemed better.

I believe Rav has it such that certain prehit tweaks like omega temporarily change based on contact point or whatever but will automatically reset to the default settings

Elastic coef I believe does not reset automatically and so that is why the bam_init code and now the bounce control smothered the bounce across the board...I believe having elastic coefficient revert back to the table authors XML choice during non bounce occasions makes sense

And I see an important diff but you don't and perhaps most won't either. So I receive that while "secretly" think the bounce is still anemic...


Top 
 Profile  
 
 Post subject: Re: BAM Dynamic Flipper Breakthrough !!
 Post Posted: Sat Dec 15, 2018 12:03 am 
Offline

Joined: Thu Aug 16, 2012 11:12 pm
Posts: 2520
Location: Arkansas, USA
Gimli,

What you think is important. Try watching this video. To me, the bounce of the ball off a stationary flipper seems similar to CFTBL.

https://www.youtube.com/watch?v=hA0GCpRtdvU

Would someone else try one or both of these versions? We need to know if you think the bounce of the ball off a stationary flipper has too much or too little bounce. Blue are you around? I know this might seem like a loaded question but we need more input, otherwise I won't be posting what everyone wants.

https://www.dropbox.com/sh/jhrlmdlsoo8f ... bPKDa?dl=0

George


Top 
 Profile  
 
 Post subject: Re: BAM Dynamic Flipper Breakthrough !!
 Post Posted: Sat Dec 15, 2018 12:51 am 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2857
Location: Ontario, Canada
I agree the table that guy is playing has low bounce...


Top 
 Profile  
 
 Post subject: Re: BAM Dynamic Flipper Breakthrough !!
 Post Posted: Sat Dec 15, 2018 3:18 am 
Offline

Joined: Tue May 01, 2012 11:13 pm
Posts: 415
Location: Abbotsford
The bounce in the script you gave me had way too much bounce. I think the main problem is we have no idea of all the things BAM can do, and I admit I gave up trying to figure it all out months ago. Was just running around in circles blind.

so, anyway can only do what I know. i had a bit more time than I thought, so was able to get a lot done on my work table. So even though some things are already built into BAM, I put them in anyway because it's just a lot easier to use for me ( and I suspect others as well) Here is al list of what's done so far, hopefully I can have a basic version available shortly.

- Multi BAM XML support. Very simple way actually, I know you can do that in BAM, but there is no way to know what it is and takes too long to find the proper one anyway. The next idea is to rewrite it so people can input numbers for things like base_elasticCoef, as a lot of that bounce code is exactly the same anyway.
Code:
' Left flipper code
' This depends on which XML package you select (xPhysicsXML Variable top of the script)
Sub LeftFlipper_prehit()
   ' Adjusts Ball bouncing off flipper based on speed of the ball
      Dim ball
      Set ball = xBAM.BallCloseTo(0,0)
      If BAM_VERSION < 233 then Exit Sub
   ' BAMTeam XML (xPhysicsXML=0)
      If xPhysicsXML=1 Then
      If xBAM.Ball.Speed <= 200 then xPhysicsXML_bounceControl "BAMTEAM_Slow" 'BounceMix = 1 'Ball Speed Measures 150 rolling down left fliper from cradled ball so this should capture it
      If xBAM.Ball.Speed > 200  then  xPhysicsXML_bounceControl "BAMTEAM_Fast"
         ball_to_flipper_angle =  Atn2( LeftFlipperExt.BallHSpeed, LeftFlipperExt.BallVSpeed )
         OnPreHitFlipperSettings(LeftFlipperExt)
         omegaCorrection = 43 - (LeftFlipperExt.ContactPoint * 14)
         If LeftFlipperExt.ContactPoint < 0.0 then LeftFlipperExt.Omega = 43
         If LeftFlipperExt.ContactPoint > 1.2 then LeftFlipperExt.Omega = 28.2
         If (LeftFlipperExt.ContactPoint => 0.0) And (LeftFlipperExt.ContactPoint =< 1.2) then
            LeftFlipperExt.Omega = omegaCorrection
         End If
      End If
   ' Jungle Girl XML (xPhysicsXML=1)
      If xPhysicsXML=2 Then
      If xBAM.Ball.Speed <= 200 then xPhysicsXML_bounceControl "JGirl_Slow" ' BounceMix = 1 'Ball Speed Measures 150 rolling down left fliper from cradled ball so this should capture it
      If xBAM.Ball.Speed > 200  then  xPhysicsXML_bounceControl "JGirl_Fast" ' BounceMIx = 2
         OnPreHitFlipperSettings(LeftFlipperExt)
         LeftFlipperExt.Omega = MinOmega   ' Set Basic Flipper Omega before we calculate contact point
         If LeftFlipperExt.ContactPoint >= 1.3 then LeftFlipperExt.Omega = (MinOmega):Exit Sub:End If
         If LeftFlipperExt.ContactPoint >= 1.2 then LeftFlipperExt.Omega = (MinOmega+1.5):Exit Sub:End If
         If LeftFlipperExt.ContactPoint >= 1.1 then LeftFlipperExt.Omega = (MinOmega+3):Exit Sub:End If
         If LeftFlipperExt.ContactPoint >= 1.0 then LeftFlipperExt.Omega = (MinOmega+6):Exit Sub:End If
         If LeftFlipperExt.ContactPoint >= .9 then LeftFlipperExt.Omega = (MinOmega+12):Exit Sub:End If
         If LeftFlipperExt.ContactPoint >= .5 then LeftFlipperExt.Omega = (MaxOmega):Exit Sub:End If
         If LeftFlipperExt.ContactPoint >= .4 then LeftFlipperExt.Omega = (MinOmega+12):Exit Sub:End If      
         If LeftFlipperExt.ContactPoint >= .3 then LeftFlipperExt.Omega = (MinOmega+8):Exit Sub:End If
         If LeftFlipperExt.ContactPoint >= .2 then LeftFlipperExt.Omega = (MinOmega+4):Exit Sub:End If   
         If LeftFlipperExt.ContactPoint >= .1 then LeftFlipperExt.Omega = (MinOmega+2):Exit Sub:End If
      End If
   If Use_xDebugDisplay=1 Then xDebugDisplay "Show_LeftFlipper" ' Debug display
End Sub

- I put in all of Gimli's code, folded in some of mine, and restructured it. This is a work table for physics/bounce control and other things, so down the road, have it available and adjustable while playing, and hopefully can have it generate a text file in script code.

- The script is structure so the section you need can be copied and pasted. All the main physics stuff will be variables, the script is partially set to write those variables in textdebug, so you would need to copy and paste them with the control script. Maybe I can write the code so that it generates the entire script needed for the physics into a text file, but FP is so flaky about those things. The sub routines have been recoded so the main physics variables can be in one place. If you like a tables settings that use this format, you can add the flipper/bounce physics quite easily.
Code:
Dim XML_bouncesettings

Sub xPhysicsXML_bounceControl (XML_bouncesettings)
   Select case XML_bouncesettings
      Case "BAMTEAM_Slow"
         ' Uses the  same XML settings as defined by xPhysicsXML in this script for very slow ball. We have to repeat those settings here
         ' rubberSoftMat softnessCoef="0.12" elasticCoef="0.62" staticFriction="0.06" kineticFriction="0.075"

         'RightFlipperExt.SetMaterial       0.62,        0.12,       0.06,      0.075       ' written as (elasticCoef),(softnessCoef),(staticFriction),(kineticFriction)
         'LeftFlipperExt.SetMaterial       0.62,        0.12,       0.06,      0.075
         base_elasticCoef                        = 0.62    ' flipper rubber
         expected_ball_speed_after_hit           = 300    ' 400 calc elasticCoef to get desired ball speed after ball hit flipper
         minimum_elasticCoef_to_scale_fast_balls = 0.05    ' we will add this to calculated elastiCoef, so ball after hit will have additional 5% of speed before hit
         reduction_for_flipper_in_motion         = 0.15    ' if flipper is not in starting point, reduce elasticCoef by 15%
         If Use_xDebugDisplay=1 Then xDebugDisplay "Show_BounceSlow":End If
      case "BAMTEAM_Fast"
         ' Bounce settings for faster ball
         base_elasticCoef                        = 0.90    ' george .95 ' very bouncy flipper rubber
         expected_ball_speed_after_hit           = 370    ' 400 calc elasticCoef to get desired ball speed after ball hit flipper
         minimum_elasticCoef_to_scale_fast_balls = 0.20    ' we will add this to calculated elastiCoef, so ball after hit will have additional 20% of speed before hit
         reduction_for_flipper_in_motion         = 0.15    ' if flipper is not in starting point, reduce elasticCoef by 15%
         'HudDmd5.Text= "bounce= BAMTEAM_Fast"
         If Use_xDebugDisplay=1 Then xDebugDisplay "Show_BounceFast":End If
      Case "JGirl_Slow"
         ' Uses the  same XML settings as defined by xPhysicsXML in this script for very slow ball. We have to repeat those settings here
         ' rubberSoftMat softnessCoef="0.12" elasticCoef="0.52" staticFriction="0.06" kineticFriction="0.075"

         'RightFlipperExt.SetMaterial       0.52,        0.12,       0.06,      0.075      ' written as (elasticCoef),(softnessCoef),(staticFriction),(kineticFriction)
         'LeftFlipperExt.SetMaterial       0.52,        0.12,       0.06,      0.075
         base_elasticCoef                        = 0.52    ' flipper rubber
         expected_ball_speed_after_hit           = 280    ' 400 calc elasticCoef to get desired ball speed after ball hit flipper
         minimum_elasticCoef_to_scale_fast_balls = 0.05    ' we will add this to calculated elastiCoef, so ball after hit will have additional 5% of speed before hit
         reduction_for_flipper_in_motion         = 0.15    ' if flipper is not in starting point, reduce elasticCoef by 15%
         If Use_xDebugDisplay=1 Then xDebugDisplay "Show_BounceSlow":End If
      case "JGirl_Fast"
         ' Bounce settings for faster ball
         const base_elasticCoef                        = 0.8                                ' very bouncy flipper rubber
         const expected_ball_speed_after_hit           = 350                                ' 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 15% of speed before hit
         const reduction_for_flipper_in_motion         = 0.15                               ' if flipper is not in starting point, reduce elasticCoef by 15%
         If Use_xDebugDisplay=1 Then xDebugDisplay "Show_BounceFast":End If
   End Select
         'HudDmd6.Text= "base_elasticCoef= " & (base_elasticCoef)
         'HudDmd7.Text= "expected_ballspeed= " & (expected_ball_speed_after_hit)
         'HudDmd8.Text= "minelasticCoefscale= " & (minimum_elasticCoef_to_scale_fast_balls)
         'HudDmd9.Text= "reducflippermotion= " & (reduction_for_flipper_in_motion)
End Sub

Sub OnPreHitFlipperSettings_bounceControl(FlipperExt)

  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


- Figured out a way for the script to recognize a flipper hit, and when the ball leaves the flipper. It writes the info into DebugText, just a bug in releasing the code after it writes to the file. I was too tired to fix it yesterday (was up till 3) but first thing next time. It's not a elegant solution, but it works so far. bounce physics variables though do not show their values no matter what, but maybe I will come up with a work around. I have both flippers, and ball info based on the partial list gimli posted, but without a explanation or a actual list of scriptable commands, it makes it a bit tough to improve.

- Everything is displayed in real time in a group of DMD displays. It's very clunky, but again, that is a FP thing because of the lack of support for some things. Simple MsgBoxes give FP fits for example. No excuse for that
Anyway, a lot of my VP code, even though it was written in VBScript 15 years ago, won't work.

So, here's next on my list.
-Rewrite code so it's as small and generic as possible.
-I have the debug only write code at the first instant of a hit on the flipper, and then a second group of code the millisecond the ball leaves the flipper. That good enough?
-I intend to write a menu system for adjustments on the fly for flipper settings and bounce that can also save those values as script for easy copy and pasting. It's sort of setup the way I did it in VP, which is not great. input boxes do work, but I lost code to do it I used 10 years ago, and just don't have the time to spend hours looking for things like that anymore. If someone wants to take that time, then I would need a fully 100% working example with all code like support for check boxes, droppable text boxes etc. good luck.... ;)
Here's the basic display code for the DMD, everything is all self contained in one sub.
Code:
Sub xDebugDisplay(xDebugDisplayCase)
   ' Exit Sub  ' UNREMARK THIS TO PREVENT ERRORS IF YOU DON"T INCLUDE THE HudDmd(x) OBJECTS IN YOUR TABLE EDITOR
   If BAM_VERSION < 233 then Exit Sub
   If Use_xDebugDisplay=1 Then
   Select Case xDebugDisplayCase
      case "Show_xPhysics"
      HudDmd1.Text= "[f2]XML Used: " & (xAuthor)
      HudDmd2.Text= "BallSpeedLimit = " & (xMaxBallSpeed)
      HudDmd3.Text= "L Flipper OmegaMax = " & (MaxOmegaL)
      HudDmd4.Text= "L Flipper OmegaMin = " & (MinOmegaL)
      HudDmd5.Text= "R Flipper OmegaMax = " & (MaxOmegaR)
      HudDmd6.Text= "R Flipper OmegaMin = " & (MinOmegaR)
      'HudDmd6.Text= " = " & ()
      'HudDmd7.Text= " - " & ()
      'HudDmd8.Text= " = " & ()
      'HudDmd9.Text= " - " & ()
      'HudDmd10.Text= " = " & ()
      case "Show_BounceFast"
         HudDmd1.Text= "[f2]bounce= " & (xAuthor) & "_Fast"
         HudDmd2.Text= "base_elasticCoef= " & (base_elasticCoef)
         HudDmd3.Text= "expected_ballspeed= " & (expected_ball_speed_after_hit)
         HudDmd4.Text= "minelasticCoefscale= " & (minimum_elasticCoef_to_scale_fast_balls)
         HudDmd5.Text= "reducflippermotion= " & (reduction_for_flipper_in_motion)
      case "Show_BounceSlow"
         HudDmd1.Text= "[f2]bounce= " & (xAuthor) & "_Slow"
         HudDmd2.Text= "base_elasticCoef= " & (base_elasticCoef)
         HudDmd3.Text= "expected_ballspeed= " & (expected_ball_speed_after_hit)
         HudDmd4.Text= "minelasticCoefscale= " & (minimum_elasticCoef_to_scale_fast_balls)
         HudDmd5.Text= "reducflippermotion= " & (reduction_for_flipper_in_motion)
      case "Show_TimerRFDebug"
         HudDmd6.Text="[f2]Ball Info"
         HudDmd7.Text= "Ball Speed - " & (xBAM.Ball.Speed)
         HudDmd8.Text= "Ball x - " & (xBAM.Ball.Position.X) & " " & "y - " & (xBAM.Ball.Position.y)
         HudDmd9.Text= "Vel x -  " & (xBAM.Ball.Velocity.X) & " " & "y - " & (xBAM.Ball.Velocity.Y)
      case "Show_LeftFlipper"
         HudDmd10.Text="[f2]Left Flipper"
         HudDmd11.Text= "LF Omega -  " & (LeftFlipperExt.Omega)
         HudDmd12.Text= "LFHSpeed -  " & (LeftFlipperExt.BallHSpeed)
         HudDmd13.Text= "LFVSpeed -  " & (LeftFlipperExt.BallVSpeed)
         HudDmd14.Text= "LF Contact -  " & (LeftFlipperExt.ContactPoint)
         HudDmd15.Text= "LF Angle -  " & (LeftFlipperExt.Angle)
      case "Show_RightFlipper"
         HudDmd16.Text="[f2]Right Flipper"
         HudDmd17.Text= "RF Omega -  " & (RightFlipperExt.Omega)
         HudDmd18.Text= "RFHSpeed -  " & (RightFlipperExt.BallHSpeed)
         HudDmd19.Text= "RFVSpeed -  " & (RightFlipperExt.BallVSpeed)
         HudDmd20.Text= "RF Contact -  " & (RightFlipperExt.ContactPoint)
         HudDmd21.Text= "RF Angle -  " & (RightFlipperExt.Angle)
   End Select
   Else
      Exit Sub
   End If
End Sub


pretty basic stuff really. I will release builds as I move along, see what suggestions you guys have. I would rather work on my game, but I could use something like this myself.

Okay finally.

@Rav
- Is it possible to have a scriptable command for setting the start angle and the swing as in the editor? I have noticed that the XML files are pretty useless unless the flippers are set correctly, for example Gimli's script plays far more differently using T4 flippers and in a new table. Mine plays like crap now. Even in BAM, running through all those XML's, the vast majority don't play that great because most authors balance their XML based on their flippers, so if there was a way to set the flipper start and the swing in the script editor, and over ride the settings in the editor, then we can code them in to match the XML's.

_________________
_____________________________________

Latest projects and rants at My Facebook Page
_____________________________________

Latest Project: fpxEngine


Top 
 Profile  
 
 Post subject: Re: BAM Dynamic Flipper Breakthrough !!
 Post Posted: Sat Dec 15, 2018 3:45 am 
Offline
User avatar

Joined: Sun Sep 13, 2015 1:16 pm
Posts: 535
I tried your last template script GIMLI in MOTU Mastered (my version that didnt have any changes from you or George)..and Tron Legacy SLAM Original. Again, I didnt change anything else...i just pasted in the code.

Wow...what a difference! MOTU is coming close to playing similar to the recent VPX version I helped test (and do DOF and PUP code) for randr from VPinball. This was with no changes to the table...so I'm sure someone who knows this stuff better than me can make it play even better.

Same with Tron Legacy (SLAM original Ultimate). I am now making those shots to that ramp almost every time now! A huge difference in a positive way for those two examples!

I also found that ball bounce from the flippers was close to normal...maybe a little bit low sometimes depending on where it hit the flipper.

I can only imagine how much better they will play when this all matures and is refined even more!


Top 
 Profile  
 
 Post subject: Re: BAM Dynamic Flipper Breakthrough !!
 Post Posted: Sat Dec 15, 2018 10:09 am 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2857
Location: Ontario, Canada
Thanks George, Terry and Paul (blue) for testing and of course Rav for enabling this !

Thanks blue for working on a template. I hope to check it out later today...we have Christmas family guests over...

I agree that a template that works when simply pasted yet is easily tweakable in a way people can understand is a great idea . It seems bounce is highly subjective. With George and blue liking less.

Thanks for the feedback Terry , I am glad you had the same experiance as me...I thought I was losing my mind :)


Top 
 Profile  
 
 Post subject: Re: BAM Dynamic Flipper Breakthrough !!
 Post Posted: Sat Dec 15, 2018 1:43 pm 
Offline

Joined: Thu Aug 16, 2012 11:12 pm
Posts: 2520
Location: Arkansas, USA
I was really just looking for someone to try the table at the following link and tell me if you think the bounce off a stationary flipper is set too high or too low. I wasn't looking for any coding. Just try the table and let me know what you think:

https://www.dropbox.com/sh/jhrlmdlsoo8f ... bPKDa?dl=0

George


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 225 posts ]  Go to page Previous  1 ... 12, 13, 14, 15, 16, 17, 18 ... 23  Next

Board index » Future Pinball » BAM corner


Who is online

Users browsing this forum: No registered users and 4 guests

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron