BAM Dynamic Flipper Breakthrough !!
Page 6 of 23

Author:  hlr53 [ Fri Jul 27, 2018 2:07 pm ]
Post subject:  Re: BAM Dynamic Flipper Breakthrough !!

Great stuff! It's one thing deriving classical mechanics equations in engineering physics classes and another thing programming this stuff for games.

I may have to buy you a case of Lech :-)

Author:  Gimli [ Fri Jul 27, 2018 3:58 pm ]
Post subject:  Re: BAM Dynamic Flipper Breakthrough !!

It's another thing still after Rav has had a case of Lech :lol:

Having a Stella as I type this

Author:  ravarcade [ Sat Jul 28, 2018 4:32 pm ]
Post subject:  Re: BAM Dynamic Flipper Breakthrough !!

Here is BAM v235 (release candidate):

Change log:
1. modified log/charts created for flipper when "SolenoidOn" and "SolenoidOff" is called:
- removed "grean" line (i think it is not usefull).
- red (flipper angle) and yellow (omega) both are as function of time. (Previously omaga was function of angle).
- adder maximum and minimum Omega valuses.

2. Moddified way how omega is calculated from flipper-rotation-chart (only for SolenoidOn). Now from chart is calculated "force" when it is applied to flipper. Where is difference:
- if there is no ball on flipper, no hit, then flipper will move exaclll same way as previous;
- ... but if ball lays on flipper and is heavy (in relation to flipper) it will reduce finall flipper rotation speed. So, in next frame omega applied to flipper will not be just value taken from chart, but it will be calculated like for "force" applied and result omega will be little smaller.
It seams complicated to explain, but now flipper rotation work more like result of rotation force than blind constant rotation.

Demo table:

I spend whole day on tweaking it... and i'm not very happy with results. Maybe someone else will be able to make more. I'm giving up here.
Whole demo is focused on ball controll with flipper.

Here is list what i did and why:
1. Ball must have weight, = 80. So it is 4 times havier than FP.
2. Gravity set 9000, Damping = 0.25
That was easy part. For me this gives me ball move as i want.

3. Flipper mass.... first i try 600. So, Flipper mass / Ball mass = 7.5.
I set it this way, because i want to see how flipper moves when it is hit by fast ball. See video:
But at end i have set it to 2000 and this is completly invisible. Reason: see No. 7.

4. elasticCoef - OnPreHitFlipperSettings_bounceControl.
I use _prehit subroutine to change ball bounce on flipper. Nothing else is controled in _prehit.
Also i moddified it little bit:
- elasticCoef is calcuated base on FlipperExt.BallVSpeed. Previously it was xBAM.Ball.Speed. I change for 2 reasons: (1) only VSpeed have meaning in real world (or in 95%), (2) when ball is roling horizontaly over flipper (from "inline") change "elasticCoef " have big (random) impact on how ball flys. See No. 7.

5. Rotation Chart for "SolenoidOn":
With points:
   0 ms =   3.0 %
  20 ms =   5.0 %
38.5 ms =  11.7 %
  55 ms =  30.0 %
  77 ms = 100.0 %

Goal is: slow flipper move after button is pressed.
This allows me to make: "tap pass" ... -tap-pass/
On my cheap membrane keyboard without long training ~30 % times

6. Rotation Chart for "SolenoidOff":
With points:
  0.0 ms = 200.0 %
  5.0 ms =   5.0 %
 30.0 ms =  15.0 %
 60.0 ms = 100.0 %

You may think it is odd. Big "jump" at begin, right after button was released then long slow move and at end fast again.
Goal is: right after button was release flipper should stay for some time near "maximum angle" position, but not at that "maximum" angle but little below. So, when i press button again quickly i should be able to make: "tip pass" ... -tip-pass/
This i hard to do it on my keyboard, i have less than 5 % successed passes. I belive better keyboard will make it easier.

Here is result how flipper moves when button is pressed and release:

7. Captured flipper rotation log/charts:
A. Without ball:
B. With ball and flipper weght = 600
C. With ball and flipper weght = 2000
So, low flipper mass results in slow ball speed at end, flipper rotation speed accelerate when ball is not in contact with flipper, flipper speed is reduced whem ball hit flipper and accelerate again. This repeats few times, at end it is hard to hit "target".
Something like in "C" was visible, when i used xBAM.Ball.Speed instead FlipperExe.BallVSpeeed.
Smothes chart i get, even is set elasticCoef = 0. (No bounce at all), but this is not "realistic" value for this param.

8. From Left flipper i was able to do few time "slingshot pass", but it was extremly hard. I think it is beter to move little bit sligshot, or flipper, or change angle of flipper instead try to modify params and charts to make it possible.

9. Target practice for "inlane" (build in test in BAM):
On video you can see how i do "target practice" to check what is in range for flipper.
You can change ball starting position, speed, direction.
This test work like this:
1. When you press start, ball will roll. When ball "hit" flipper, BAM will simulate "button press". BAM will also count how many physics simulation frames passed from test start... and ofcource it will log ball position for 1000 ms. (one red line).

2. BAM will repeat everything from start, but next time it will press "button" given number of frames later (3 frames are default)... and repeat it few times, until it will find, that ball falls from flipper before button was pressed.

3. ... now BAM repeat everything, but button will be pressed 3 frame earlier.... and repeat until flipper will stop moving befor ball hit it.

You can check what will change, when you modify flipper mass, omega

Author:  Gimli [ Sun Jul 29, 2018 12:00 am ]
Post subject:  Re: BAM Dynamic Flipper Breakthrough !!

Thanks Rav!
Very cool stuff!
I will try to have quick look tomorrow

Author:  blue [ Mon Jul 30, 2018 12:19 am ]
Post subject:  Re: BAM Dynamic Flipper Breakthrough !!

having a quick look shortly. One thing, using the stock flippers in your example, the ball is sinking through the flippers so I will try the zed version flippers instead.

Author:  GeorgeH [ Mon Jul 30, 2018 5:26 pm ]
Post subject:  Re: BAM Dynamic Flipper Breakthrough !!

I have never been able to figure out how to use this. How do you add points to the graph?


Author:  ravarcade [ Mon Jul 30, 2018 6:35 pm ]
Post subject:  Re: BAM Dynamic Flipper Breakthrough !!

Go to line: "Idx: 1" and press Insert to add point, Delete to remove, left/right arrows to select point.
Example how to change from one point [0 ms, 100%] to 2 points [0 ms, 30%, 30 ms 100%]
1. Go to line "Idx: 1".
2. Press Insert on keyboard
3. Press 2 times arrow down (you should be in line "precent: 100%")
4. Enter on keyboard "30"
5. Go to line "Idx: 1".
6. Press Right arrow. You should see, "Idx: 2"
7. Press 1 time arrow down (you should be in line "time: 1.0 ms"
8. Enter on keyboard "30", you should see now "time: 30.0 ms"

One more tip for everyone:

When you are in BAM "Physics Teaks" menu and you press CTRL+C you will get in clipboard ready to past something like this:
xBAM.PhysicsXML = "" & vbcrlf &_
   "<?xml version=""1.0"" encoding=""utf-8""?>" & vbcrlf &_
   "<document>" & vbcrlf &_
   "  " & vbcrlf &_
   "  <!-- Physics processing -->" & vbcrlf &_
   "  <!-- Note. Changing the FPS will effect how how all the other values interact with each other and should " & vbcrlf &_
----------- a lot more lines with VBScript code ----------------

... but if you press CTRL+SHIFT+C (note SHIFT key) you will get something like this:
'=============================== PHYSICS XML ===========================
'<?xml version="1.0" encoding="utf-8"?>

'  <!-- Physics processing -->
'  <!-- Note. Changing the FPS will effect how how all the other values interact with each other and should
'  be a high value due to the fact the ball in a pinball is moving very fast and lower values will cause the ball
----------- a lot more lines as "comment"  -----------

This you can put in sciprt.

Both are used to change physics params .... but hey are not 100% same. There are few differences:
1. CTRL+C version (as xBAM.PhysicsXML =....):
+ you can change param, run table and changes are implemented.... but
- ... no all params can set this way. Some will be still loaded from XML in FP.exe. That pramas are for example "FPS", bumper params (and all objects parms). Only BALL, FLIPPER and Materials can be set this way

2. CTRL+SHIFT+C version (as comment):
- you must save script and table to disk, before after modifications params can be loaded.
+ ... ALL params will be interpreted as normal XML

So, if you want to change FPS, FP objects params, you should use CTRL+SHIFT+C ("as comment") version.

New BAM (v237) was released to everyone.

changes beteween v234 & v237:
1. New things of flipper "charts":
- Finall BallSpeed as result of fipper activation is displayed on chart, also "contact point"
- On charts you can see now "circles" and "big dots". Dots are just marks for frames when ball have contact with flipper.
- If you use one of tests for flipper, you may see green charts. This chart is "finall ball speed" as function of "flipper activation delay".

2. FlipperExt.BallVSpeed for _prehit subroutine in calculations take into account flipper rotation speed. This is only "aproximation", but for example if "ball hange in air above flipper" (ball speed = 0) and flipper is rotating, then you can get quite high "BallVSpeed".

Note, Finall Ball Speed is recorded before "BallSpeedLimit" is applied, so, even if you set in script speed limiti to 2300, you can easly get values above 4000.

Maybe your best option is to increase speed limit and increase FPS? If you set FPS=512, you should not have problems with balls move speed near 4600?

Author:  GeorgeH [ Mon Jul 30, 2018 7:08 pm ]
Post subject:  Re: BAM Dynamic Flipper Breakthrough !!


I think I am missing something here. I used "BAM.PhysicsXML" to add XML to POTO and it has items for FPS and bumpers. Do these parameters not work?

The XML file as comment does seem to have the fail safe built into it so it seems to have an advantage to me.


Author:  ravarcade [ Mon Jul 30, 2018 7:33 pm ]
Post subject:  Re: BAM Dynamic Flipper Breakthrough !!

@GeorgeH: Yes. FPS, Bumpers params are not used.

... and XML as comment was added to BAM in 2014? 2013?

Author:  GeorgeH [ Mon Jul 30, 2018 10:03 pm ]
Post subject:  Re: BAM Dynamic Flipper Breakthrough !!

OK, I won't use "BAM.PhysicsXML" anymore.

Thanks for the info.


Page 6 of 23 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group