Register    Login    Forum    FAQ    PinSimDB.org

Board index » Future Pinball » Tables WIP




Post new topic Reply to topic  [ 627 posts ]  Go to page Previous  1 ... 56, 57, 58, 59, 60, 61, 62, 63  Next
Author Message
 Post subject: Re: Monster Bash
 Post Posted: Sun Jul 01, 2018 12:07 am 
Offline

Joined: Tue May 01, 2012 11:13 pm
Posts: 330
Location: Abbotsford
had some spare time so had a quick look. haven't really looked at adjusting the code, so some base observations here.

- Didn't see any angle corrections in the script, so the ball as it comes off the flippers the angles are still very severe, as the ball kept hitting the opposite side sling. leftYoff and rightYoff should be higher values.
- The Omega should be slower with a faster ball as stated. The omega should also be a bit slower if the ball is trapped by the flipper and released. (so it slowly rolls down the flipper)
- Not sure about the mass of the flippers, but the ball to my eye plays too fast and a bit loose.

Nice work though guys. Makes what I want to do with flippers and having far more sensitive omega values possible depending on the speed and mass of the ball and where it is on the flipper (as the values can vary greatly depending on the situation). All this new stuff though means I end up spending all my time on working the new stuff out, and not on my actual game though. :(

Still, fun isn't it?

_________________
_____________________________________

Latest projects and rants at My Facebook Page
_____________________________________

Latest Project: FPx Template Engine


Top 
 Profile  
 
 Post subject: Re: Monster Bash
 Post Posted: Sun Jul 01, 2018 8:53 am 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2113
Location: Ontario, Canada
Thanks blue !
Very fun . I am excited to see your findings !


Top 
 Profile  
 
 Post subject: Re: Monster Bash
 Post Posted: Sun Jul 01, 2018 2:03 pm 
Offline

Joined: Thu Aug 16, 2012 11:12 pm
Posts: 1685
Location: Arkansas, USA
When I played it, I thought it did play a bit fast also. It is a bit odd but, but Gimli set the higher omega/mass values about the same as what is in the XML file but the speed of the ball off the flippers is much faster than it was without the new coding. I don't understand it.

George


Top 
 Profile  
 
 Post subject: Re: Monster Bash
 Post Posted: Mon Jul 02, 2018 12:45 am 
Offline

Joined: Tue May 01, 2012 11:13 pm
Posts: 330
Location: Abbotsford
I had the same problem. I think the values are not being cleared out in BAM with the new ball code, or it's adding the two together. The flippers are fine. I saved my table, and when I reloaded the table the next day, it was fine. Sometimes, changes in the script do not take effect, you have to exit out of FP and then reload it to see changes. I've noticed this with other things. For example, if you play with Ball Size on one table, then load another table, the ball size retains the value from the previous table. (So a big ball in the first table is a big ball in the second, so you have to define a ball size in the script of the second table) Looks like you need to redefine some values to reset some things back to FP default with a esc keypress.

As for the code, had some spare time, so working on it. No idea how to use Function Atn2(x, y) to control the angle of the ball, so waiting for the explanation. I have found my Blues mod is still needed, if anything it works better now. Working on v3 of that to take advantage of the new ball script, and reworked it to fix a bug and have better performance.

Anyway, this is what I have so far, ways to go though.... seems to work quite well at the moment (Note that these are for Bally flippers, not Williams)

Code:
' --------------------- Dynamic Flippers Physics -------------------------------

   Dim RightFlipper2Ext, LFExt, RFExt,RightFlipperExt,LeftFlipperExt                ' Needed for BAM
   Dim xRightFlipperOmega,xLeftFlipperOmega,xLFOmega,xRFOmega,xRightFlipper2Omega    ' swapable Omega values for Flippers
   Dim xRightFlipperMass,xLeftFlipperMass,xLFMass,xRFMass,xRightFlipper2Mass          ' swapable Mass values for Flippers
   Dim RadToDeg                                                                     ' something to do with ball angles
   Dim prehitidx                                                                     ' No idea what this does either
   Set RightFlipperExt       = xBAM.Flipper("RightFlipper")
   Set LeftFlipperExt       = xBAM.Flipper("LeftFlipper")
   Set RightFlipper2Ext     = xBAM.Flipper("RightFlipper2")
   Set LFExt                = xBAM.Flipper("LF")
   Set RFExt                = xBAM.Flipper("RF")

' Define initial base values
   xRightFlipperOmega=46:xRightFlipperMass=5400               '
   xLeftFlipperOmega=46:xLeftFlipperMass=5400               '
   xLFOmega=46:xLFMass=4000
   xRFOmega=46:xRFMass=4000
   xRightFlipper2Omega=46:xRightFlipper2Mass=5400

   RightFlipperExt.Mass    = (xRightFlipperMass)
   RightFlipperExt.Omega   = (xRightFlipperOmega)
   LeftFlipperExt.Mass    = (xLeftFlipperMass)
   LeftFlipperExt.Omega   = (xLeftFlipperOmega)
   RightFlipper2Ext.Mass    = (xRightFlipper2Mass)
   RightFlipper2Ext.Omega   = (xRightFlipper2Omega)
   LFExt.Mass               = (xLFMass)
   LFExt.Omega              = (xLFOmega)
   RFExt.Mass               = (xRFMass)
   RFExt.Omega              = (xRFOmega)
   RadToDeg = 57.295779513082320876798154814105
   prehitidx = 0

' *** Ball Angle Control? ***
Function Atn2(x, y)
   If x > 0 Then
      Atn2 = Atn(y / x) * RadToDeg
      ElseIf x < 0 Then
      Atn2 = Sgn(y) * (180 - RadToDeg * Atn(Abs(y / x)))
      ElseIf y = 0 Then
      Atn2 = 0
   Else
      Atn2 = 180
   End If
   Atn2 = Atn2+90
End Function

Sub RightFlipper_prehit()
   If xBAM.Ball.Speed < 100 then
      RightFlipperExt.Mass      =      (xRightFlipperMass*1.4) '2000
      RightFlipperExt.Omega     =       (xRightFlipperOmega/1.3) '40
   End if
   If xBAM.Ball.Speed >= 100 <=300 then
      RightFlipperExt.Mass      =      (xRightFlipperMass*1.3) '2000
      RightFlipperExt.Omega     =       (xRightFlipperOmega/1.2) '40
   End if
   If xBAM.Ball.Speed >= 300 <600 then
      RightFlipperExt.Mass      =      (xRightFlipperMass*1.2) '2000
      RightFlipperExt.Omega     =       (xRightFlipperOmega/1.15) '40
   End if
   If xBAM.Ball.Speed >= 600 <900 then
      RightFlipperExt.Mass      =      (xRightFlipperMass*1.1)
      RightFlipperExt.Omega     =       (xRightFlipperOmega/1.1) '25
   End If
   If xBAM.Ball.Speed >= 900 <1200 then
      RightFlipperExt.Mass      =      (xRightFlipperMass)
      RightFlipperExt.Omega     =       (xRightFlipperOmega/1.05) '25
   End If
   If xBAM.Ball.Speed >= 1200 <2000 then
      RightFlipperExt.Mass      =      (xRightFlipperMass)
      RightFlipperExt.Omega     =       (xRightFlipperOmega) '25
   End If
   If xBAM.Ball.Speed >= 2000 <2250 then
      RightFlipperExt.Mass      =      (xRightFlipperMass*1.1)
      RightFlipperExt.Omega     =       (xRightFlipperOmega/1.1) '25
   End If
   If xBAM.Ball.Speed >= 2250 <2500 then
      RightFlipperExt.Mass      =      (xRightFlipperMass*1.2)
      RightFlipperExt.Omega     =       (xRightFlipperOmega/1.15) '25
   End If
   If xBAM.Ball.Speed >= 2500 <2750 then
      RightFlipperExt.Mass      =      (xRightFlipperMass*1.3)
      RightFlipperExt.Omega     =       (xRightFlipperOmega/1.2) '25
   End If
   If xBAM.Ball.Speed >= 2750 then
      RightFlipperExt.Mass      =      (xRightFlipperMass*1.4)
      RightFlipperExt.Omega     =       (xRightFlipperOmega/1.3) '25
   End If
   prehitidx = prehitidx + 1:FlipperDebug()
End Sub

Sub LeftFlipper_prehit()
   If xBAM.Ball.Speed < 100 then
      LeftFlipperExt.Mass      =      (xLeftFlipperMass*1.4) '2000
      LeftFlipperExt.Omega     =       (xLeftFlipperOmega/1.2) '40
   End if
   If xBAM.Ball.Speed >= 100 <=300 then
      LeftFlipperExt.Mass      =      (xLeftFlipperMass*1.3) '2000
      LeftFlipperExt.Omega     =       (xLeftFlipperOmega/1.2) '40
   End if
   If xBAM.Ball.Speed >= 300 <600 then
      LeftFlipperExt.Mass      =      (xLeftFlipperMass*1.2) '2000
      LeftFlipperExt.Omega     =       (xLeftFlipperOmega/1.15) '40
   End if
   If xBAM.Ball.Speed >= 600 <900 then
      LeftFlipperExt.Mass      =      (xLeftFlipperMass*1.1)
      LeftFlipperExt.Omega     =       (xLeftFlipperOmega/1.1) '25
   End If
   If xBAM.Ball.Speed >= 900 <1200 then
      LeftFlipperExt.Mass      =      (xLeftFlipperMass)
      LeftFlipperExt.Omega     =       (xLeftFlipperOmega/1.05) '25
   End If
   If xBAM.Ball.Speed >= 1200 <2000 then
      LeftFlipperExt.Mass      =      (xLeftFlipperMass)
      LeftFlipperExt.Omega     =       (xLeftFlipperOmega) '25
   End If
   If xBAM.Ball.Speed >= 2000 <2250 then
      LeftFlipperExt.Mass      =      (xLeftFlipperMass*1.1)
      LeftFlipperExt.Omega     =       (xLeftFlipperOmega/1.1) '25
   End If
   If xBAM.Ball.Speed >= 2250 <2500 then
      LeftFlipperExt.Mass      =      (xLeftFlipperMass*1.2)
      LeftFlipperExt.Omega     =       (xLeftFlipperOmega/1.15) '25
   End If
   If xBAM.Ball.Speed >= 2500 <2750 then
      LeftFlipperExt.Mass      =      (xLeftFlipperMass*1.3)
      LeftFlipperExt.Omega     =       (xLeftFlipperOmega/1.2) '25
   End If
   If xBAM.Ball.Speed >= 2750 then
      LeftFlipperExt.Mass      =      (xLeftFlipperMass*1.4)
      LeftFlipperExt.Omega     =       (xLeftFlipperOmega/1.3) '25
   End If
   prehitidx = prehitidx + 1:FlipperDebug()   
End Sub

Sub FlipperDebug()
   'AddDebugText "Ballxy: " & xBAM.Ball.Position.X & ", " & xBAM.Ball.Position.Y & " S:"
   'AddDebugText "BallSpeed: " & xBAM.Ball.Speed
   'AddDebugText "Ballvel: x " & xBAM.Ball.Velocity.X & ", y  " & xBAM.Ball.Velocity.Y & " dir: " & Atn2(xBAM.Ball.Velocity.X, xBAM.Ball.Velocity.Y)
   'AddDebugText "LeftFlipperMass: " & (xLeftFlipperMass) & ", LeftFlipperOmega: " & (xLeftFlipperOmega)
   'AddDebugText "RightFlipperMass: " & (xRightFlipperMass) & ", RightFlipperOmega: " & (xRightFlipperOmega)
End Sub

' *** Blues flipper Mod v3 ***

' Sets small hidden flipper to be active or not for center shots
Dim UseRightFlipperMid,UseLeftFlipperMid   ' variables to detirmine trigger hit to activate smal non-rendered flipper
UseRightFlipperMid=0:UseLeftFlipperMid=0

' The User Has Pressed A Key on the Keyboard..

Sub AddKeyEvent(KeyEventVariable)
   Select Case KeyEventVariable
      case "LEFTFLIPPER-PRESSED"
         ' Check to see if TriggerRFM hit, then use small hidden flipper for center shots.
         IF LastSwitchHit IS TriggerLFM Then UseLeftFlipperMid = 1
         If UseLeftFlipperMid = 1 then
            LF.SolenoidOn
            TimerLF.Interval = 25:TimerLF.Enabled = True          ' Makes sure small flipper is up before main flipper, prevents interference with shot
         Else
            LeftFlipper.SolenoidOn                                  ' Trigger not hit, so just main flipper pressed
         End If
         TimerFL.Interval = 150:TimerFL.Enabled = True            ' flipper wall colliable=false. Allows time for ball to roll down flipper
         PlaySound "FlipperUp",(constSoundVolume):
         IF GuideLaneChange=1 THEN AlternateGuidesRight()
      case "LEFTFLIPPER-RELEASED"
         LeftFlipper.SolenoidOff:LF.SolenoidOff
         TimerFlipL.Set True,100                                 ' Sets timer to pop up heavy flipper wall
         PlaySound "FlipperDown",(constSoundVolume)
      case "RIGHTFLIPPER-PRESSED"
         ' Check to see if TriggerRFM hit, then use small hidden flipper for center shots.
         IF LastSwitchHit IS TriggerRFM Then UseRightFlipperMid = 1
         If UseRightFlipperMid = 1 then
            RF.SolenoidOn
            TimerRF.Interval = 25:TimerRF.Enabled = True          ' Makes sure small flipper is up before main flipper, prevents interference with shot
         Else
            RightFlipper.SolenoidOn:RightFlipper2.SolenoidOn       ' Trigger not hit, so just main flipper pressed
         End If
         TimerFR.Interval = 150:TimerFR.Enabled = True             ' flipper wall colliable=false. Allows time for ball to roll down flipper
         PlaySound "FlipperUp",(constSoundVolume)
         IF GuideLaneChange=1 THEN AlternateGuidesLeft()
      case "RIGHTFLIPPER-RELEASED"
         RightFlipper.SolenoidOff:RightFlipper2.SolenoidOff:RF.SolenoidOff
         TimerFlipR.Set True,100                                 ' Sets timer to pop up heavy flipper wall
         PlaySound "FlipperDown",(constSoundVolume)
      case "SPECIAL1-PRESSED"
      case "SPECIAL1-RELEASED"
      case "SPECIAL2-PRESSED"
      case "SPECIAL2-RELEASED"
      case "HUDDISPLAY-SHOWING"
      case "HUDDISPLAY-HIDDEN"
      'case "MENU-SHOWING"
      'case "MENU-HIDDEN"
      'case "INSTRUCTIONS-SHOWING"
      'case "INSTRUCTIONS-HIDDEN"
      'case "UPARROW-PRESSED"
      'case "UPARROW-RELEASED"
      'case "DOWNARROW-PRESSED"
      'case "DOWNARROW-RELEASED"
      'case "LEFTARROW-PRESSED"
      'case "LEFTARROW-RELEASED"
      'case "RIGHTARROW-PRESSED"
      'case "RIGHTARROW-RELEASED"
   End Select
End Sub

' Two triggers for the small flippers
Sub TriggerLFM_Hit():UseLeftFlipperMid = 1:AddDebugText "UseLeftFlipperMid = 1":set LastSwitchHit=TriggerLFM:End Sub
Sub TriggerLFM_UnHit():UseLeftFlipperMid = 0:AddDebugText "UseLeftFlipperMid = 0":End Sub
Sub TriggerRFM_Hit():UseRightFlipperMid = 1:AddDebugText "UseRightFlipperMid = 1":set LastSwitchHit=TriggerRFM:End Sub
Sub TriggerRFM_UnHit():UseRightFlipperMid = 0:AddDebugText "UseRightFlipperMid = 0":End Sub

' Only Main Flipper up, so turn off wall, raise hidden flipper to match main flipper, and make sure the trigger variable is set to yes (hit event)
Sub TimerFL_Expired()
   TimerFL.Enabled = False:FlipWallLeft.Collidable=FALSE:LF.SolenoidOn:UseLeftFlipperMid = 1
end sub

' sets delay for a flipper flip if TriggerRFM_Hit. The main flipper swings only after a short delay to allow the hidden flipper to go first and hit the ball
Sub TimerLF_Expired()
   TimerLF.Enabled = False:LeftFlipper.SolenoidOn
end sub

' Restores wall if main flipper down (Flipper key Released)
Sub TimerFlipL_Expired():
   TimerFlipL.Enabled = False:FlipWallLeft.Collidable=TRUE:UseLeftFlipperMid=0
End Sub

' Only Main Flipper up, so turn off wall, raise hidden flipper to match main flipper, and make sure the trigger variable is set to yes (hit event)
Sub TimerFR_Expired()
   TimerFR.Enabled = False:FlipWallRight.Collidable=FALSE:RF.SolenoidOn:UseRightFlipperMid = 1
end sub

' sets delay for a flipper flip if TriggerRFM_Hit. The main flipper swings only after a short delay to allow the hidden flipper to go first and hit the ball
Sub TimerRF_Expired()
   TimerRF.Enabled = False:RightFlipper.SolenoidOn:RightFlipper2.SolenoidOn
end sub

' Restores wall if main flipper down (Flipper key Released)
Sub TimerFlipR_Expired():
   TimerFlipR.Enabled = False:FlipWallRight.Collidable=TRUE:UseRightFlipperMid = 0
End Sub

_________________
_____________________________________

Latest projects and rants at My Facebook Page
_____________________________________

Latest Project: FPx Template Engine


Top 
 Profile  
 
 Post subject: Re: Monster Bash
 Post Posted: Mon Jul 02, 2018 7:57 am 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2113
Location: Ontario, Canada
Very cool blue !!
As you probably know, you can dynamically change flipper XML properties as well
Code:
If xBAM.Ball.Speed >= 2750 then
RightFlipperExt.SetMaterial elasticCoef = whatever
End if
 


Top 
 Profile  
 
 Post subject: Re: Monster Bash
 Post Posted: Mon Jul 02, 2018 10:51 am 
Offline

Joined: Thu Nov 24, 2016 7:46 pm
Posts: 137
Nice! I am reading every message. Unfortunately I dont understand much in the cade. Cant wait to see an MB upload that contains improved flipper physics. If this really works like it sounds, this could be cool sh*t.


Top 
 Profile  
 
 Post subject: Re: Monster Bash
 Post Posted: Mon Jul 02, 2018 12:23 pm 
Offline

Joined: Tue May 01, 2012 11:13 pm
Posts: 330
Location: Abbotsford
Thanks Gimli. I didn't know that, must have missed it (very easy to do with all the pages to go through) Is this just for flippers (and the ball as well has some properties) still, and not the other objects? Still, all I can say is Finally... so happy, despite the fact it means another months work on scripting when this damn game of mine should have been done 6 months ago.

Every little bit helps, this will be very fun as I have a few ideas... :)

Still, the game I'm working on is playing just awesome. I had said on another forum that we may never get to VPX level in terms with physics, but maybe we can get it to a decent VP9 game. I actually think we can do better than that now.

_________________
_____________________________________

Latest projects and rants at My Facebook Page
_____________________________________

Latest Project: FPx Template Engine


Top 
 Profile  
 
 Post subject: Re: Monster Bash
 Post Posted: Mon Jul 02, 2018 1:22 pm 
Offline

Joined: Thu Aug 16, 2012 11:12 pm
Posts: 1685
Location: Arkansas, USA
blue wrote:
I had the same problem. I think the values are not being cleared out in BAM with the new ball code, or it's adding the two together. The flippers are fine. I saved my table, and when I reloaded the table the next day, it was fine. Sometimes, changes in the script do not take effect, you have to exit out of FP and then reload it to see changes.


Rav, can you help us out here?

I think something is not right with this beta version of BAM. I have not changed the code at all and the flippers are too fast on my PC. I tried setting the mass and omega of the flippers in the XML file to 0 and got a meditation error when I played the table. It was weird but one of the flippers disappeared when I got the error. The table appears to play normally if you delete the XML file.

George


Last edited by GeorgeH on Mon Jul 02, 2018 10:53 pm, edited 1 time in total.

Top 
 Profile  
 
 Post subject: Re: Monster Bash
 Post Posted: Mon Jul 02, 2018 7:46 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2113
Location: Ontario, Canada
blue wrote:
Thanks Gimli. I didn't know that, must have missed it (very easy to do with all the pages to go through) Is this just for flippers (and the ball as well has some properties) still, and not the other objects? Still, all I can say is Finally... so happy,.


Awesome blue , I hoped this would unteather FP !!

I believe the prehit works with all collidable objects that generate a hit event...


Last edited by Gimli on Mon Jul 02, 2018 10:23 pm, edited 2 times in total.

Top 
 Profile  
 
 Post subject: Re: Monster Bash
 Post Posted: Mon Jul 02, 2018 10:11 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2113
Location: Ontario, Canada
GeorgeH wrote:
Rav, can you help us out here?
George

Thanks George !

I have pm'd Rav too, he hopes to have a look tomorrow

Pretty cool stuff....we may be on the cusp of a break through ?

Hopefully we can get Popotte, Smoke, Franzleo and Wild testing this too..

It would be cool if this could bring back some of the prodigals

Lets hope :)


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 627 posts ]  Go to page Previous  1 ... 56, 57, 58, 59, 60, 61, 62, 63  Next

Board index » Future Pinball » Tables WIP


Who is online

Users browsing this forum: No registered users and 3 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