BAM BAM Update v337

ravarcade

Pinball Wizard
Joined
Feb 8, 2020
Messages
101
Reaction score
232
Points
49
Favorite Pinball Machine
AFM

- New Ball properties: OutVelocity, OutSpeed, OutPosition, OutPositionGlobal.
All that properties are similiary to Velocity, Speed, Position... but,
if you in script read it in _Hit() event you will get values AFTER hit and in Velocity, Speed, etc, will be value BEFOR hit.
- For objects receive from xBAM.FindObject you have new properties:
> mass - read/write
> lineardamping - read/write
> angulardamping - read/write
and method
> SetMaterial with 4 args: elasticCoef, softnessCoef, staticFriction, kineticFriction]
With that new stuffs you can change properties of physics objects without name in FP editor.
- New function: xBAM.Camera.POI(X,Y,Z) return vector with 3 values:
> X = distance from camera to point on table
> Y = distance from point on table to line of sight (so, in mm how far is given point from center of screen)
> Z = angle between point on table, camera and line of sight. (=0 if object is on center)
Works only in desktop mode in FP. In arcade mode it don't make sense. In VR - not finished
- xBAM.FindObject can get as argument FP object or name of FP object.
So, instead of xBAM.FindObject LeftFlipper.X, LeftFlipper.Y you can just write xBAM.FindObject LeftFlipper
- Generic_prehit() - like other _prehit event, but can be used for objects without name in FP editor.
- Commands to control DMD work again with new drivers.
- Added plugin extensions needed to directly read DMD&Segment displays params, bitmaps. Needed by dmdext plugin.
- One reason of BAM_Crash.log creation on FP close - fixed.
 
Last edited:
Few demo tables.
I forgot about one more change:
You can call xBAM.EnumBalls many times with different functions.
 

Attachments

  • POI-demo.fpt
    224 KB · Views: 74
  • ball-speed-locked.fpt
    223.5 KB · Views: 76
  • spinner-counter-2.fpt
    226 KB · Views: 67
@ravarcade

Thanks for adding more and more capabilities to FP through BAM.

I have a question about the Hi Score plug-in.

Can we change the colours used for that (instead of the default green, etc) in the table script somehow?
 
Okay, paint me heavily biased, but it really does seem like FP-BAM + Shiva Physics / DynamicFlippers have pretty much leap-frogged VP as the cutting-edge freeware pin-sim simulation software. Unbelievable. oO

I mean... I'm sure VP & FP-BAM+ still have their comparative strengths & weaknesses. Yet for example-- is VP anywhere close to being able to pull off something like this? Even just as a feature test?

So... not that the aim of VP is to create billiard tables (heh), but to me it moreso demonstrates how incredibly flexible FP-BAM has become. Indeed, regularly demonstrated by @TerryRed's projects, like RetroFlair, etc.

And now for a plug! :D

Given all that, the FP-BAM Wikipedia project could really use some contributors in describing all the various BAM+ advancements. Particularly, since sadly, I get the sense that most pin-sim fans still aren't quite aware about how amazing FP-BAM+ has become, over the years.

P.S. You don't need an acct to edit. You can just start editing away anonymously, on the honor system. Have a go?
 
Nice update. Thanks!
 
But some bug when I play the spinner test table. And I have downloaded the V337 from your site as your link on your first post is for the V334.
 
Last edited:
Corrected: just a typo line 149 linerdamping instead of lineardamping.
 
- New function: xBAM.Camera.POI(X,Y,Z) return vector with 3 values:
> X = distance from camera to point on table
> Y = distance from point on table to line of sight (so, in mm how far is given point from center of screen)
> Z = angle between point on table, camera and line of sight. (=0 if object is on center)
Works only in desktop mode in FP. In arcade mode it don't make sense. In VR - not finished
Hi Rav
All this sounds great, thank you so much !
Using X,Y, and Z will be a little confusing to me here as they don't seem to be referencing the X,Y,Z coordinates or Axes as per usual code convention in FP.

I wonder if "D,C,A" might be more memorable ?

D- Distance from a point on table
C-Distance to centre of screen
A-angle between point and camera
 
@ravarcade
@GeorgeH
@TerryRed
@Popotte
@AnonTet
@NitroNimbus

I am trying to locate the codng Rav provide in a BAM update where you can retask a given MP to temporarily grab something else and then reset back to your original settings.

It was something like:

Code:
redim Miniplayfield_Whatever bla bla bla

and

Code:
restore Miniplayfield_Whatever bla bla bla
 
Hmmmm.... never knew about that one or used it.

If needed, I would just change the mp parameters as needed on the fly.... something that would have made SW DSA ESB much easier to do without needing multiple models for one animation.
 
All this sounds great, thank you so much !
You are right, the genius of Rafal, he is simply great, and I will tell you more some new functions listed by Rafal, have been devised, for the "arkanoid" table ..... which I hope will one day could be completed.
 
You are right, the genius of Rafal, he is simply great, and I will tell you more some new functions listed by Rafal, have been devised, for the "arkanoid" table ..... which I hope will one day could be completed.
Sounds great
 
I found the attached demo table on "Generic_prehit" but it doesn't make sense to me. I got it here:

https://pinballnirvana.com/forums/threads/xml-arguments-and-explanations.20433/page-8#post-128904 (Tutorial - "XML" Arguments and Explanations)

When I play the demo table in debug mode, there is no debug display that has been added like in the code below.

There is "xBAM.FindObject(22, 496, 28". Apparently, the 28 refers to rubber of plastic. What do 22 and 496 refer to?

Code:
Dim lf  : Set lf  = xBAM.FindObject(LeftFlipper)
Dim rf  : Set rf  = xBAM.FindObject(RightFlipper)
Dim rub : Set rub = xBAM.FindObject(22, 496, 28) ' 24 - hard rubber, 28 - intermediate, 32 - soft rubber
Dim peg : Set peg = xBAM.FindObject(22, 496, 20) ' 20 - plastic


Sub Generic_prehit(phi)
    If phi is lf  Then AddDebugText "left: " & xBAM.ball.Speed
    If phi is rf  Then AddDebugText "right: " & xBAM.ball.Speed
    If phi is rub Then AddDebugText "rub: " & xBAM.ball.Speed : phi.SetMaterial 100 / xBAM.ball.Speed
    If phi is peg Then AddDebugText "peg: " & xBAM.ball.Speed : phi.SetMaterial 100 / xBAM.ball.Speed
End Sub

Does anyone understand this better than me?
 

Attachments

  • gph.fpt
    223.5 KB · Views: 43
I found the attached demo table on "Generic_prehit" but it doesn't make sense to me. I got it here:

https://pinballnirvana.com/forums/threads/xml-arguments-and-explanations.20433/page-8#post-128904 (Tutorial - "XML" Arguments and Explanations)

When I play the demo table in debug mode, there is no debug display that has been added like in the code below.

There is "xBAM.FindObject(22, 496, 28". Apparently, the 28 refers to rubber of plastic. What do 22 and 496 refer to?

Code:
Dim lf  : Set lf  = xBAM.FindObject(LeftFlipper)
Dim rf  : Set rf  = xBAM.FindObject(RightFlipper)
Dim rub : Set rub = xBAM.FindObject(22, 496, 28) ' 24 - hard rubber, 28 - intermediate, 32 - soft rubber
Dim peg : Set peg = xBAM.FindObject(22, 496, 20) ' 20 - plastic


Sub Generic_prehit(phi)
    If phi is lf  Then AddDebugText "left: " & xBAM.ball.Speed
    If phi is rf  Then AddDebugText "right: " & xBAM.ball.Speed
    If phi is rub Then AddDebugText "rub: " & xBAM.ball.Speed : phi.SetMaterial 100 / xBAM.ball.Speed
    If phi is peg Then AddDebugText "peg: " & xBAM.ball.Speed : phi.SetMaterial 100 / xBAM.ball.Speed
End Sub

Does anyone understand this better than me?
It works in debug for me george
lf is left flipper
rf is right flipper
I separated the peg from its rubber and debug senses both of them

I 22, 496 is the x,y location of the peg

View attachment Future Pinball 2021-08-08 17-43-39-48.mp4
 

Attachments

  • gph2.fpt
    223.5 KB · Views: 52
Last edited:
No problem for me, George.
 
If I had had an education up to a degree, I would have done it in mathematics......so I can't explain certain codes or ways that Raf invents, and how they work too.But I can tell you that in certain types of codes created by rav, there is always my crazy hand.

Raf, has created a response mode in relation to the "velocity/strength" of the ball in some objects hit, but the coding is a bit particular for me, but this always falls on the subject of physics, in fact you see it in my thread "XML" Arguments and Explanations .....

I have not yet understood how to do it implement this new function, but I would like it to be used as a physics, because if you hit a "peg" that is positioned in the center of the table, and hit it with a strong omega because of the ramps, you will see the ball squirt all over when you hit the peg, here with the new function, which you have to code in its original position, "x / y", you can check the response of the peg and I believe it is workable for other objects.
 
Last edited:
My bad. Sorry! I was still using BAM 330. The debug works with BAM 337. I am surprised I didn't get an error message.

Does anyone know what "phi.SetMaterial 100" is and why it is divided by ball speed?

The comments define these material codes:
24 - hard rubber, 28 - intermediate, 32 - soft rubber, 20 - plastic
Anyone know the codes for metal and wood or if there are any other new codes?

Anyone know how to use this stuff?
- For objects receive from xBAM.FindObject you have new properties:
> mass - read/write
> lineardamping - read/write
> angulardamping - read/write
and method
> SetMaterial with 4 args: elasticCoef, softnessCoef, staticFriction, kineticFriction]
 
Last edited:
Anyone know how to use this stuff?
great question ....but in my opinion better than Raf, who could.

ask him here.....

here is the post of raf

Catturaxx.JPG


and if you understand how to do it,then please explain it to me too, since it is something that I had asked Raf, which unfortunately I do not understand what needs to be done in terms of code.......what a beautiful story for me?
 
Last edited:
My only question is: you can access to whatever you want with XBam.FindObject, but why couldn't change all the parameters for the object found?
Or: what are the parameters we couldn't change?
I.e. for spinner: we can't change AngularAccel, SpinBack or SpinLoose
But, thanks to Rav for his work (and Chris too, don't forget the FP's creator).
 
Hmm, interesting...

Rav, can I ask you put all your BAM and demos releases in this board? Makes it a lot easier to find things and in my case, update my code as I missed a couple releases with your explanation. After I found the others, this makes a lot more sense to me.

One question. If I figured this out right, would this new code be able to and be worth the time involved to replace the existing prehit code for Sub OnPreHitFlipperSettings_bounceControl(FlipperExt) ?
 
- New Ball properties: OutVelocity, OutSpeed, OutPosition, OutPositionGlobal.
All that properties are similiary to Velocity, Speed, Position... but,
if you in script read it in _Hit() event you will get values AFTER hit and in Velocity, Speed, etc, will be value BEFOR hit.
Hi Rav,
I am finally having a lttle look at some of the new BAM stuff

@JLou5641 asked if there was a way correct OutVelocity based on prehit contact point.

Particularly to adjust OutVelocity.x a little especially if ball is hits the tip of the flipper

It other words for example lets say Prehit contact point is > .7 , to make the OutVelocity.x = OutVelocity.x + 100 after ball is hit by the right flipper

I called the correction value "RightFlipperVelocityXCorrection"

Code:
Dim RightFlipperVelocityXCorrection

Sub RightFlipper_prehit()
   If BAM_VERSION < 233 then Exit Sub
   OnPreHitFlipperSettings(RightFlipperExt)
  If (RightFlipperExt.ContactPoint => 0.7)  then
         RightFlipperVelocityXCorrection = 100 'or whatever'
      End if
End Sub

Sub RightFlipper_hit()
ball.SetVelocity ball.OutVelocity.x + RightFlipperVelocityXCorrection,ball.OutVelocity.y, ball.OutVelocity.Z
End Sub

What would you recommend ?
 
Hi Rav,
I am finally having a lttle look at some of the new BAM stuff

@JLou5641 asked if there was a way correct OutVelocity based on prehit contact point.

Particularly to adjust OutVelocity.x a little especially if ball is hits the tip of the flipper

It other words for example lets say Prehit contact point is > .7 , to make the OutVelocity.x = OutVelocity.x + 100 after ball is hit by the right flipper

I called the correction value "RightFlipperVelocityXCorrection"

Code:
Dim RightFlipperVelocityXCorrection

Sub RightFlipper_prehit()
   If BAM_VERSION < 233 then Exit Sub
   OnPreHitFlipperSettings(RightFlipperExt)
  If (RightFlipperExt.ContactPoint => 0.7)  then
         RightFlipperVelocityXCorrection = 100 'or whatever'
      End if
End Sub

Sub RightFlipper_hit()
ball.SetVelocity ball.OutVelocity.x + RightFlipperVelocityXCorrection,ball.OutVelocity.y, ball.OutVelocity.Z
End Sub

What would you recommend ?
@ravarcade
please see above
To explain to other member, i asked it to @Gimli to make a velocity correction script, like nfozzy/Rothbaueur do for VPX.. FP Prehit work very great at 600fps. With a velocity correction, we will able to correct all trajectory along the flipper if we want, like we do with nfozzy physics in VPX.
I hope it will possible to make this.
 
Forum activity
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.
      Mibs Mibs: Poor Man's Pinball Podcast has posted a new reply in the thread "Poor Man's Pinball Podcast".
      Back
      Top