I'm not table dev, so stuffs here will not give you ready to use solution. It will be more guide how to tweak.
First here is another demo table with few "bounce control" functions:
https://www.ravarcade.pl/beta/Ramp-VUK- ... c-ctrl.fptRun this table in FP debug mode (F9).
Press B to switch "bounce control" subroutines. (In FP debug window you will have message with selected mode).
Here is video how i use BAM to test it:
https://youtu.be/LmARVkTH5CMHere is starting "Bounce Control" function:
http://gopinball.com/forum/viewtopic.ph ... rol#p86695Now something harder. Charts created in spreadsheet:
https://docs.google.com/spreadsheets/d/ ... au/pubhtmland spreadsheet if you want to tweek it:
https://docs.google.com/spreadsheets/d/ ... output=odsWhat is on first chart: "Ball speed after hit as function of ball speed before hit".
- Green line - default FP behaviour. Here is just for comparision
- Blue line - "Bounce Control" when filpper button is not pressed and flipper is in starting position. As you can see, for slow balls flipper is VERY bouncy bounced but for fast balls is become less bouncy. Important thing: if you increase ball speed before hit, after hit ball become faster too.
- Red line - "Bounce Control" when filpper button is pressed or flipper is in motion. ... Like forfor "blue line", but little less bounce. Please look what is happening when ball speed is incressing from 330 to 1400... ball becom slower when you increase ball speed. This is wrong. You may see this effect on my video, time 1:15 - 1:35
- Orange line - "Bounce Control" when filpper button is pressed or flipper is in motion with FIX. So, if you increase ball speed before hit you will always increase ball speed after hit. But you can control speed of ball after hit.
Second chart: "elastic_coef as function of ball speed before hit".
Now fixed "Bounce control" subroutine:
Code:
Sub OnPreHitFlipperSettings_bounceControl(FlipperExt)
' Params to tweak
const base_elasticCoef = 0.8 ' very bouncy flipper rubber
const expected_ball_speed_after_hit = 240 ' calc elasticCoef to get desired ball speed after ball hit flipper
const minimum_elasticCoef_to_scale_fast_balls = 0.05 ' we will add this to calculated elastiCoef, so ball after hit will have aditional 5% of speed before hit
const reduction_for_flipper_in_motion = 0.20 ' if flipper is not in starting point, reduce elasticCoef by 20%
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
Now descriptions of params:
1. base_elasticCoef - use to control how bouncy if flipper for slow balls. That is very simple.

2. expected_ball_speed_after_hit - same as name, expected ball speed after hit. It is easier to set this value than use complicated math function with exponents. Use it to limit ball speed after hit.

3. minimum_elasticCoef_to_scale_fast_balls - positve value is resposible for "increase ball speed before hit you will always increase ball speed after hit".

Some explanation:
Flipper is: plastic/matalic core with rubber band around it.
When ball hit flipper, rubber work like spring: it takes energy from ball and later it gives back big part of that energy to ball.
But... rubber is thin. It have limited capcity. If ball have more energy (higher speed) than rubber capacity, when that energy will not return to ball.
... Not from rubber. Behind rubber is plastic/metalic core of flipper. It will also recive energy and will also give that energy back to ball later... but rubber is more "effective" in storing/restoring energy (elasticCoef is high) than plastic/metal (elasticCoef). So....
base_elasticCoef - is rubber...
expected_ball_speed_after_hit - .... is rubber capacity for energy to store/restore ....
minimum_elasticCoef_to_scale_fast_balls - .... flipper core (plastic/metal) elastic coef ....
4. reduction_for_flipper_in_motion -

If flipper is at base position, it is holded by solid elements. So, when ball hit flipper, flipper will not move. If flipper is in motion (or holded at max angle when you press button), it is holded by electromagnets. In that position, when flipper is hit, part of energy will go to that electromagnets and will not return to ball.... So, we can reduce flipper elasticCoef to simulate this.
5. min_elasticCoef - (remove) not needed after fixing original "Bounce Control".
Original "Bounce Control" have few problems: if ball speed before hit was to high and flipper was in motion ("reduction_for_flipper_in_motion" was aplied), when ball speed after hit was reduced "too much". Some times to zero or below zero (yup, it does not make sense). So, to prevent it i have to add check for too small "elasticCoef". After fix, when reduction_for_flipper_in_motion is aplied different, it is not needed.

Now comparision of different "Bounce-Control" functions in demo table.
1. OnPreHitFlipperSettings_bounceControl.
If you compare it with original function from this post:
http://gopinball.com/forum/viewtopic.ph ... rol#p86695:
- added variable ballSpeed to store local value of xBAM.Ball.Speed. In other "OnPreHitFlipperSettings_....." functions i will use different ball speed, so i added variable to minimize changes
- added check, if ball speed is lower than "1". Sometimes ball speed is almost zero or zero. If it is zero we will have "div by zero" error in script... so it is only small fix for possible error
2. OnPreHitFlipperSettings_bounceControl_fixed
- "reduction_for_flipper_in_motion" is applied different way to prevent errors in ball behave when fast ball is bounced from "activated" flipper.
- min_elasticCoef is removed
3. OnPreHitFlipperSettings_bounceControl_vertical
- FlipperExt.BallVSpeed is used as ball speed, instead of xBAM.Ball.Speed. See this image:
https://www.ravarcade.pl/beta/NewFlippe ... erties.pngGimli asked about usage of "vertical" ball speed.
I have found, that with that setting when ball goes thru inlines, when it is hard to stop ball on activated flipper. If ball speed is "medium" ball vertical speed is very low. It makes ball bouncy for flipper. So, ball can bounce few times on flipper and without friction when ball is not in touch with flipper it will not stop easly.
4. OnPreHitFlipperSettings_bounceControl_verticalAverge
- as BasllSpeed is use averge value of FlipperExt.BallVSpeed and xBAM.Ball.Speed. So, for fast "horizontal" balls flipper will become less bouncy.
In other words, you may find better way to calc "ball speed" before it will be used by "bounce control" routine.
Thats all folks.