BAM Physics/XML About physics ......For a better gameplay!

@Gimli
@Popotte

Thanks for your explanations and codes...
but I need these codes to be called by the PlungerKicker or emkicker, and tell me where I should increase or decrease the speed ....
I would add a timer after plunger release code and paste my code there and only apply the effect if the ball is in the plunger lane
 
I would add a timer after plunger release code and paste my code there and only apply the effect if the ball is in the plunger lane
would be a solution, but adding it to the plunger release code would not be enough, because in that lane there is also an emkicker ....

your code, it must be a code that I can insert into the two kickers (plunger kicker and emkicker) with a timer, it would be much better, because I can decide when to activate it, like TimerBallSpeed.set true, 300...

in practice is how did you realize the code of the fin, that if you keep it remuted it increases your speed ... here instead it is a kicker that pushes the ball, obviously when the kicker is activated

Sub PlungerTimer_Expired()
PlungerPercentage = PlungerPercentage +7
If PlungerPercentage > 100 Then PlungerPercentage = 100
If PlungerPercentage < 0 Then PlungerPercentage = 0
Plunger.Pull(PlungerPercentage)
'plungerPull
End Sub

don't put your code(kickerballspeed you like the name9 in this(above) ... this is just an example

your code would be a great way to create an alternative, to have a stronger kicker, since in the editor it is no longer possible to increase the strength (I have reached the limit) .. in this case (your code) we replace the strength with the ball velocity
 
Try this Paolo
I put my stuff at the end of script
and also look for "Gimli"

I made the "boost" 10 x ball.speed which is too much , tweak it how you wish

Code:
Sub PlungerBoost_Expired()
 PlungerBoost.Set False

If bBallInPlungerLane = True then
AddDebugText "Bost applied"
Dim SpeedNumber
Dim ball
    Set ball = xBAM.BallCloseTo(0,0 )
SpeedNumber = ball.speed * 10 '''''' Or any number you choose
    ball.SetVelocity SpeedNumber*sin(BallTrajectory * DegToRad), -SpeedNumber*cos(BallTrajectory  * DegToRad), 0
End if
End Sub
 

Attachments

  • DragonsKeep (Maxis)Boost.fpt
    43.8 MB · Views: 70
Try this Paolo
Yes....great job!!!

I'm adding it to my version,i just have to adjust the speed, but i have a question in this way the kickers have no input,right?

This magic code:cool:? can be applied, in any object (I think) but in this case in plunger-lane or kicker or emkicker above all
where it is necessary to have more strength when you have reached the limit in fp editor, but in this case it is the Velocity (precisely ball.SetVelocity) to have the keystone, and not the strength.

As I said before, sometimes changing the physics of the ball or the table, among which: "mass and gravity" and why not, even the "Slope" which in DK I set it to 10, kickers suffer from strength,fail to push the ball even if you put it at maximum in fp editor, this method solves the problem.

Many thanks Gimli(Bob) and popotte!


'------------------------------------------------------------------
' Ball Boost by gimli
'------------------------------------------------------------------

Dim BallTrajectory

const RadToDeg = 57.295779513082320876798154814105
Const DegToRad = 0.01745329251994329576923690768489


Function Atn2(x, y)
If x > 0 Then
Atn2 = Atn(y / x) * RadToDeg
ElseIf x < 0 Then
Atn2 = 180 - RadToDeg * Atn(y / -x)
ElseIf y > 0 Then
Atn2 = 90
Else
Atn2 = -90
End If
Atn2 = Atn2+90
End Function


Sub NewtonPhysicsTick()
dim ball
Set ball = xBAM.BallCloseTo(0,0 )
BallTrajectory = Atn2( xBAM.Ball.Velocity.X, xBAM.Ball.Velocity.y )
End Sub

Sub TimerBallBoost_Expired()
TimerBallBoost.Set False
AddDebugText "Bost applied"
Dim SpeedNumber
Dim ball
Set ball = xBAM.BallCloseTo(0,0 )
SpeedNumber = ball.speed * 2 'speed ball 1/10
ball.SetVelocity SpeedNumber*sin(BallTrajectory * DegToRad), -SpeedNumber*cos(BallTrajectory * DegToRad), 0
End Sub

Note: added the timer "TimerBallBoost" in editor of fp.

PS: in my opinion, you should open a thread dedicated to this magical code, which solve the problem of lack of strength of the kickers,in certain physical custom.
 
Yes....great job!!!

I'm adding it to my version,i just have to adjust the speed, but i have a question in this way the kickers have no input,right?
Yes they do ! They set the ball.speed that is in the math equation
This magic code:cool:? can be applied, in any object (I think) but in this case in plunger-lane or kicker or emkicker above all
where it is necessary to have more strength when you have reached the limit in fp editor, but in this case it is the Velocity (precisely ball.SetVelocity) to have the keystone, and not the strength.

As I said before, sometimes changing the physics of the ball or the table, among which: "mass and gravity" and why not, even the "Slope" which in DK I set it to 10, kickers suffer from strength,fail to push the ball even if you put it at maximum in fp editor, this method solves the problem.

Many thanks Gimli(Bob) and popotte!




PS: in my opinion, you should open a thread dedicated to this magical code, which solve the problem of lack of strength of the kickers,in certain physical custom.
 
Yes they do ! They set the ball.speed that is in the math equation
therefore it is necessary to adjust the strength also in these kickers in the fp editor, to have an optimal setting?
 
therefore it is necessary to adjust the strength also in these kickers in the fp editor, to have an optimal setting?
Yes
Whatever the table developer wants to do

It is the same with variable fliippers above. The dynamic flipper code causes the ball.speed
 
Yes
Whatever the table developer wants to do

It is the same with variable fliippers above. The dynamic flipper code causes the ball.speed
Yes......and if you improve it, (I'm ready to support you) it could solve a lot of problems.

unfortunately I can not insert it in DK this time, even if I would like it very much ....., but there would be too much work done, to be disassembled to be able to insert it, but I am sure that at the next table that I update I will add it ..... so it is worth the worth improving, so others might use it too.

EDIT:
having two ways of DF in the same table is not a trivial matter
 
Ok,I did this test, but obviously there is something I have wrong, or that does not work as I thought,or maybe too many "subs"

I set 9 kickers, (see photo) each one with its own strength 1/9, and added the "boost" to each kicker with its speed 1/9, I added my own custom physics, with mass, gravity, slope , damping, and newton damping, modified, according to my view for DK

Cattura1.JPG


sub TimerKickerBoost1_Expired()
TimerKickerBoost1.Set False
Dim SpeedNumber
Dim ball
Set ball = xBAM.BallCloseTo(0,0 )
SpeedNumber = ball.speed * 1 'speed ball 1/10
ball.SetVelocity SpeedNumber*sin(BallTrajectory * DegToRad), -SpeedNumber*cos(BallTrajectory * DegToRad), 0
End Sub

Sub TimerKickerBoost2_Expired()
TimerKickerBoost2.Set False
Dim SpeedNumber
Dim ball
Set ball = xBAM.BallCloseTo(0,0 )
SpeedNumber = ball.speed * 2'speed ball 1/10
ball.SetVelocity SpeedNumber*sin(BallTrajectory * DegToRad), -SpeedNumber*cos(BallTrajectory * DegToRad), 0
End Sub

Sub TimerKickerBoost3_Expired()
TimerKickerBoost3.Set False
Dim SpeedNumber
Dim ball
Set ball = xBAM.BallCloseTo(0,0 )
SpeedNumber = ball.speed * 3 'speed ball 1/10
ball.SetVelocity SpeedNumber*sin(BallTrajectory * DegToRad), -SpeedNumber*cos(BallTrajectory * DegToRad), 0
End Sub

Sub TimerKickerBoost4_Expired()
TimerKickerBoost4.Set False
Dim SpeedNumber
Dim ball
Set ball = xBAM.BallCloseTo(0,0 )
SpeedNumber = ball.speed * 4 'speed ball 1/10
ball.SetVelocity SpeedNumber*sin(BallTrajectory * DegToRad), -SpeedNumber*cos(BallTrajectory * DegToRad), 0
End Sub

Sub TimerKickerBoost5_Expired()
TimerKickerBoost5.Set False
Dim SpeedNumber
Dim ball
Set ball = xBAM.BallCloseTo(0,0 )
SpeedNumber = ball.speed * 5'speed ball 1/10
ball.SetVelocity SpeedNumber*sin(BallTrajectory * DegToRad), -SpeedNumber*cos(BallTrajectory * DegToRad), 0
End Sub


Sub TimerKickerBoost6_Expired()
TimerKickerBoost6.Set False
Dim SpeedNumber
Dim ball
Set ball = xBAM.BallCloseTo(0,0 )
SpeedNumber = ball.speed * 6 'speed ball 1/10
ball.SetVelocity SpeedNumber*sin(BallTrajectory * DegToRad), -SpeedNumber*cos(BallTrajectory * DegToRad), 0
End Sub


Sub TimerKickerBoost7_Expired()
TimerKickerBoost7.Set False
Dim SpeedNumber
Dim ball
Set ball = xBAM.BallCloseTo(0,0 )
SpeedNumber = ball.speed * 7 'speed ball 1/10
ball.SetVelocity SpeedNumber*sin(BallTrajectory * DegToRad), -SpeedNumber*cos(BallTrajectory * DegToRad), 0
End Sub

Sub TimerKickerBoost8_Expired()
TimerKickerBoost8.Set False
Dim SpeedNumber
Dim ball
Set ball = xBAM.BallCloseTo(0,0 )
SpeedNumber = ball.speed * 8 'speed ball 1/10
ball.SetVelocity SpeedNumber*sin(BallTrajectory * DegToRad), -SpeedNumber*cos(BallTrajectory * DegToRad), 0
End Sub

Sub TimerKickerBoost9_Expired()
TimerKickerBoost9.Set False
Dim SpeedNumber
Dim ball
Set ball = xBAM.BallCloseTo(0,0 )
SpeedNumber = ball.speed * 9 'speed ball 1/10
ball.SetVelocity SpeedNumber*sin(BallTrajectory * DegToRad), -SpeedNumber*cos(BallTrajectory * DegToRad), 0
End Sub

This video only proves that I did something wrong, but it can give the idea, that when for reasons of custom physics, "mass or gravity" the ball becomes heavy to be pushed only by the force of the kickers that you set in the FP editor.
View attachment kickerboost.mp4
so according to my understanding by adding the magic code that gimli set up using the ball.SetVelocity function, we could have more thrust ..... in DK it works for plunger-kicker, in plunger -line ... but i haven't tested for other kickers .... so I did this test, to try and optimize this idea.

@Gimli

I send you the demo via PM, to be optimized,and for fixed them.


EDIT:
but there is a problem the boost did not work as I thought, in fact in this video, you only see the strength set in the editor, but not the boost....It also seems that it creates a problem that the ball disappears, groping in the dark
 
Last edited:
Not always. Just if I'm interested by the new features or if I play a table wich require the new version (but I play rarely with FP or VP).
 
I usually copy the files over the existing ones unless I have problem in which case, I do a fresh install.
I also update as soon as I know there's a new version.
 
I always update BAM using he newest zip file, and overwrite all files except for default.cfg.

I keep my default.cfg file, because the settings I use are very important for cabinet users for proper pov and other settings.

I won't use a beta unless I'm testing new features... but yah I'll always update BAM if a new table needs it.
 
Ok...thanks.....so more or less, we don't necessarily install the current version of bam, but also just replace it .....ok

another question (I wait in the meantime , that of rav) have you ever noticed any difference in physics, in your tables, between an installation or replacement of a new version of bam?
 
Not normally. There was a small time months ago when ravacade changed something in BAM that had an effect on some table's physics. Some liked it for the better, but it had a bad effect on many tables old and new (Halloween couldn't launch the ball,etc). So ravarcade put the changes back and made it possible to use the new changes he made in a BAM command.

I can't remember where this was mentioned... but this was many months ago, and there were no problems since then.
 
@TerryRed
That change was on the world size in BAM v312 and reverted in v315 to pre312 values.
You can still control that however. It's just that it has to be explicit.

@wild
That is a very tough question for me to answer. Even without changing BAM version I find some issues. Example, sometimes it's like the table has to "warmup" and the first couple of ball hits on the flippers are a bit off.
I'm also positive that the best way to test physics in case you change something is to save, restart FP and then launch the table again.

This is why it is tough for me to answer because I don't know if it is the newer version or FP being FP :)

BAM v312 was an exception. Even without issues like ones reported in Halloween you could tell if you played a table you more or less knew. Was pretty obvious.
 
Ok, I try to explain my questions .....

FP being FP...ok but if it is without bam

The small problem that happened in the 315, I don't know because I had neither installed nor replaced it ......
I had the 290 installed, then replaced it with 2 version, I don't remember exactly which ones but 318,323 .... then I installed the 329

so the facts are 2, or I'm going crazy(perhaps the xBAM.Ball.Velocity function entered my brain like a virus in the pc) and I don't remember how I made my tables anymore,or I have something strange with the versions of bam between 290 and 329.....is happen

because I have tried some of my tables that I have published here, that I have asked George to try, and that I find them slow, since my last play and try....I had this feeling on DK .... now I also found it on Circus World-Cup 1978 Charlie's Angels I don't remember these slow ones

and I wanted to understand what is happening to me, if it is a question of Bam version or other.

EDIT:
the answer I expect from rav, is if with each updated version of bam, it requires always and more PC resources ... so maybe that's what I have the feeling of slowness in physics

now these three tables above are simple tables, they are not heavy,that they require a lot of resources ..... maybe it is the code of the "bounce sound" or maybe the "dinamic light" ..... but something happened. .... to create such slow tables, I don't explain it
 
Last edited:
@wild,
I have no technical incite or solution to this problem but have to agree with you 100%.
When creating or modding a table we all end up playing that table too many times to count.
I started watching Youtube videos of real tables and trying to get all aspects, ball mass, bounce, flipper strength how often it drains and general game play. Then I go back and play tables I have posted. WTF!! ball feels like a marshmallow, or bounces around at 3000 MPH.
Flippers can't hit past halfway or they punch the ball through the glass. RANDOM???
I truly think now FP really does need to "warm up" and have always asked myself the question.
I have not updated my BAM or anything FP related and my older mods play completely different than what they did before?
I think FP does need time to "warm up", minimum 2-3 games before there is any type of constant without insanity in game play.
My PC and cabinet both have enough CPU and GPU to run any FP table with ease, but my cabinet fairs much better with the only difference being
I don't upgrade windows 10 on my cabinet, cheers!
 
I think the "warm up" is not FP... but ourselves.

FP / VPX / FX,etc all play different. When you are used to playing one of them for a long time, then when playing another your brain needs time to adjust.
 
I think the "warm up" is not FP... but ourselves.

FP / VPX / FX,etc all play different. When you are used to playing one of them for a long time, then when playing another your brain needs time to adjust.
I totally agree with you. Physic is physic, and none have an incredible physic. So, as you say, it's just a brain adjust to do.
 
Last edited:
Yes! I totally agree.
They all play different, FX2/3 for me is the best physics available to date, but even with all the fruit it offers, I still find it somewhat boring.
Obviously FP is my chosen poison, "end up playing that table too many times to count". So is it us being familiar or that FP is Random....
 
Problem is, I'm only playing FP for months...
 
Well...as far as i am concerned, I only play with fp, and sometimes with vpx, when I rebuild a table from vpx to fp ..... so I only have my brain, only with fp....with this I do not feel I am the best, on the contrary I am the worst ... because I think "we" can find an optimal configuration for all tables as I said Here ......wiht this
I have never looked at the "xml" physics of another table, I never had the need, a technicolor dream, it would be to have a single physics applicable for all tables, so as to have optimal gameplay, neither too fast nor too slow, in between, I mean

I understand that the gravity of a game is not comparable to the real one which is constant, for everyone and in everything, but here we are talking about a game ... of which we have: standard fp physics, which I don't know on what basis it was conceived, and on the other part we have a Bam,which helps us to improve the physics of fp.

the keystone...... is to find out how.
the fact is that: each of us makes tables according to "what"? with what "criterion"? based on what "vision"?

I have always made tables with standard FP physics, I have only changed the "slope" and in the editor about fins,kickers and bumpers and slinshot ..... but I have never been satisfied with the gameplay, except in some other tables of mine where I have added the dynamic fins ...... but I have never interacted very well with physics, indeed I would say almost non-existent......and if I have to be honest also in other tables of other authors.

so I wonder now ..... with bam we can find a configuration that satisfies us all?

George, is almost the only one to talk about physics in the tables, as far as I remember ..... but he too, is subject to make a lot of changes in his "mods", this suggests to me that he too always has some difficulties , with physics .... my idea is to join forces to try to create something (special) that satisfies everyone to use on all tables

Jp, says that the real physics of an "EM" table is also the same as modern ones .... so why can't we find the same physics for all FP tables
Thomas Alva Edison, did he collect 2000 failures? ... no .... he simply said that he found 2000 ways of not making the filament of the light bulb .... but he only needed to find ONE way, to turn on the light bulb....
 
Last edited:
...
Jp, says that the real physics of an "EM" table is also the same as modern ones .... so why can't we find the same physics for all FP tables
....
Only for old EM's:
- small flippers (really not the same physic than tall flippers),
- rubbers: you have passive bumpers who need good rebounds (not critical for moderm pinballs),
For EM's:
- you have a lot of skill shoots (upper lanes), so plunger are to be really fine (if you have graduations on the plunger, it is not by chance).
But, overall, it's the same.
 
It would still be a lot easier to adjust rubber properties instead of everything. It's not unlike changing rubbers on a real table anyway :)

Regarding flippers, does anyone know the weight of a real flipper?
 
General chit-chat
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.
      Chat Bot Mibs Chat Bot Mibs: dizzeee has left the room.
      Back
      Top