• Google Translate to French or Other Languages Click on the link and a new tab will open with this page translated into French.
    Click on the "To:" pull down option to select a different language. Users will not be logged in on the new Google tab.

Twilight Zone

GeorgeH

Flippered Out
Staff member
Site Supporters
I have added switchable table slope with a key press. I have noticed that aiming changes a bit when you change the slope. I don't think there is anything I can do about it. Maybe providing this option is not a good idea?
 

GeorgeH

Flippered Out
Staff member
Site Supporters
I decided to add the BAM code that allows scores to exceed 2 billion points. I have never actually gotten a score higher than 1/2 billion points but I watched to video of someone on a real table that did exceed it. There a few requirements like you cannot use "SetValue" and "AddValue" coding with scores, the " mod " operator and a back slash (\) operator. I fixed 4 slash (\) operators that were actually errors in the script that FP never detected. For some reason. FP recognized [\b] as [/b] which stops the blinking on an DMD. Funny how FP lets me know any error I make in the script pretty quickly.

With everything fixed, all I have to do is add this to the script:

' xBAM.FixScore

You really need to test to be sure it is working. It is easy enough to test. Just add this to the key code section of the script and press "V" when you play the table:

If keycode = 47 then ' V key
AddScore(900000000000001)
End if

The end user must use the new BAM high score screen which is turned on by default.
 

GeorgeH

Flippered Out
Staff member
Site Supporters
Today I added a custom ball that looks like the ceramic ball used on the real table. On the current version, you can select the color of the power ball. I think the originators did this because you didn't couldn't create a white ball on FP when this table was built, Of course, with BAM it is now possible. ...So I removed all the color versions and added a white power ball. I imitated the code that Gimli used on his Indy table in order to add it to the script. I started with a white custom ball that is available that is available. Then I found a photo of a replacement ball for the table and created my own ball based on it. I may edit it a bit but it is good for now.

```Twilight Zone ULTIMATE 1.024.png


```Twilight Zone ULTIMATE 1.025.png
 

GeorgeH

Flippered Out
Staff member
Site Supporters
I have finished converting the video frames to "Power of 2". The table with the old video loaded in about 107 seconds. My version with the exact same video with the "Power of 2" video frames loaded in 46 seconds, saving about 1 minute in loading time. I am pretty sure that the table would take longer to load if you have a lower end graphics card.
 

GeorgeH

Flippered Out
Staff member
Site Supporters
Today I finished coding the physics of the white power ball that kicks out of the gumball machine. I think I am the first to change the ball physics during a game mode. This is the only table I have ever seen where changing the physics during a game makes sense. The power ball in the real game is ceramic and is lighter than the steel ball so it has different physics. I used the xBAM.PhysicsXML code for this and the switchable table slope that I discussed earlier. I don't normally recommend using the xBAM.PhysicsXML code because it has parameters that don't function. All the parameters are listed in the code but they don't all work. Only the parameters that appear in BAM's "Physics Tweak" option in game actually work. ...So I saved a copy of the XML as comment into the script also. Set up like this, BAM will use the parameters from the XML as comment that don't work in the xBAM.PhysicsXML code.

Anyway I am satisfied with how it works. As far as I know, all the balls in play must have the same physics. Luckily, the power ball does not mix with the steel balls during game play. It comes out by itself and then either drains or hits the gumball kicker that destroys the ball. When you hit the gumball kicker, power ball mania starts with 3 steel balls.
 

GeorgeH

Flippered Out
Staff member
Site Supporters
I tried adding Paolo's code and sound file to make a bumping sound when the ball hits the flippers. When I followed his tutorial, the physics of the game slowed down and it seemed that the ball damping was reduced dramatically. Evidently, my CPU was not up to the task. I got no stuttering at all which is probably due to my 2nd generation Nvidia video card but my CPU is much older. This is the first time I have even had a problem with the performance of my CPU. Of course, you have to consider that I have added Shiva's flippers which has a tremendous amount of code.

Enter my friend, AnonTet. I was thinking I would have to remove Paolo's code but AnonTet figured out a way to make the code more efficiently. Dynamic flippers and bounce control run the entire subroutine every time the ball hits the flippers so it has to run quickly. We discovered that calls to run subroutines requires a lot more CPU power than having everything in one subroutine (something to remember). Paolo's code has a subroutine that has a call to run inside each flipper sub. AnonTet figured out a way to run Paolo's code in one subroutine. He moved Paolo's code inside the bounce control code which runs for all flippers. It makes the code more efficiently so I don't get glitches anymore when I run Paolo's code. I may add a switch so the end user can turn off Paolo's code if they encounter any glitches in performance.

I decided to make the video that plays at the end of every game switchable so you can turn it off. When I started working on it, I discovered several problems. When the end of game video finished playing, Rod Steiger's video (which normally plays during the attract mode) would start playing with no voice. So you just saw Rod mouthing words. Then I discovered the end of game video was playing the wrong audio file. Anyway, I fixed both problems.

I have found some images to use on the initial table loading screen. This one is for desktop use:

Image1.jpg


This is the portrait version for pinball cabinets:

Image3.jpg


I changed the color of the text so it doesn't stand out so much. This is the way it looked before the change:

Image2.jpg


As you can see, the text is so bright you don't even notice the image in the background. I use a technique where I add the complement of a color to darken it. It makes the color look richer than just reducing the luminosity of the color in the FP editor. I identify the complement of a color from this web site:


Then I mix the original color and its complement using this wed site. It produces several combinations of 2 colors. Equal amounts of a color and its complement will make a brown or grey color so you don't want to add too much complement.

 

wild

No Bam no Play
Chat Moderator
I think your pc is more powerful than mine,right?...if you say that you have had slowdowns, after using the "sound bounce" code I believe it, but....
there are some considerations to make, in my opinion

1) the TLZ table, is already a complex table of its own, being a table that has modified "slam" therefore very "heavy"(video-clip, high -texture, many model (I don't know if they are reduced or not)) for fp, both in loading, and both for low PC.
2) in this table i believe you have added other things, including the shiva code.

now it's just my opinion, but there is always something to learn and discover in all of this.....

I always added the "sound bounce" in my tables, as you see it and inserted in the thread that I opened, Rav, in this way he sent it to me, and I had no problems, but this only because I always inserted it in tables not complex.

Now by a strange coincidence, I found a similar slowness on DK, but it was not for the "sound bounce" but for other things, and this confirms my opinion, which depends on which table you work on.

Therefore, having said that, I also used the method that you and Anontet, you have designed and implemented directly in the code of "dynamic flippers" inside DK, if for you it was better this way, then it means that it is right to act like this.

PS: @GeorgeH I did not understand what you mean by this(in black below), could you explain me better,please? ball damping what is?
and it seemed that the ball damping was reduced dramatically
 

AnonTet

Pinball Hall of Famer
Site Supporters
If my memory serves me well, damping is the capacity of an object to dissipate energy. Basically is used to slow down an object.

If anyone remembers that particular physics class, please chime in :)
 

wild

No Bam no Play
Chat Moderator
damping is the capacity of an object to dissipate energy
it means that: if I hit the ball (point A) with a force (or energy) equal to 100, and to get to point B, I think and believe it only takes a force of 70, with damping I can dissipate those 30 more ?

if it is so, what value should i put in damping? i think i saw it in bam menu, this damping
 

wild

No Bam no Play
Chat Moderator
We discovered that calls to run subroutines requires a lot more CPU power than having everything in one subroutine (something to remember). Paolo's code has a subroutine that has a call to run inside each flipper sub. AnonTet figured out a way to run Paolo's code in one subroutine.
I should probably update the do "sound bounce" thread and insert this method for complex tables.

But.. @GeorgeH please you try this table, Charlie's Angels or World-Cup or Circus are EM table, see if you have any slowdowns
 

GeorgeH

Flippered Out
Staff member
Site Supporters
I don't really know what damping is or many of the other parameters in the XML. I have learned by intuition what each parameter does but I don't really know how any of it is defined.

I mention previously that I used Shiva's flipper code which is 1000 lines long for each flipper so I am sure it uses a lot of CPU power. I am pretty sure my PC has more capability than yours.

I pasted below the entire bounce control subroutine I am currently using. The red code is Gimli's bounce mix code that can be deleted if desired. The code in blue text is your (Paolo's) flipper bounce sound which was modified very slightly. The constants are in green text can be used in the location I pasted below but I moved them to run in the "FuturePinball_BeginPlay()" subroutine to save CPU power. (Actually, I made the constants switchable in game but I won't go into that here).

Sub OnPreHitFlipperSettings(FlipperExt)
If BAM_VERSION < 254 then Exit Sub
Dim ball
Set ball = xBAM.BallCloseTo(0,0)

If xBAM.Ball.Speed <= 85 then ' 85 is the speed of the ball from a cradled release to the tip of the flipper.
adddebugtext "noBounce"
LeftFlipperExt.SetMaterial 0.62, 0.12, 0.06, 0.075
RightFlipperExt.SetMaterial 0.62, 0.12, 0.06, 0.075
Flipper1Ext.SetMaterial 0.62, 0.12, 0.06, 0.075
Flipper2Ext.SetMaterial 0.62, 0.12, 0.06, 0.075
End If


If Not FlipperExt.Hit Then Exit Sub ' we don't expect hit

If FlipperExt.BallVSpeed > 100 Then ' 100 = min ball speed
Dim vol
vol = FlipperExt.BallVSpeed / 1000 ' 1000 = max ball speed
If vol > 1 Then vol = 1
PlaySound "fx-rubber3", vol*2 ' sound volume

AddDebugText "vol = " & vol & ", CP = " & FlipperExt.ContactPoint
End If


If xBAM.Ball.Speed <= 85 then Exit Sub

const base_elasticCoef = 0.60 ' very bouncy flipper rubber
const expected_ball_speed_after_hit = 219 ' calc elasticCoef to get desired ball speed after ball hit flipper
const minimum_elasticCoef_to_scale_fast_balls = 0.04 ' 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
 
Last edited:

AnonTet

Pinball Hall of Famer
Site Supporters
You can edit it in the XML.

Unfortunately I cannot calculate that in such linear way because I have no idea how it is calculated/used by FP physics engine, i'm sorry.

And because the exact same physics work different from table to table for some reason (there's a thread about this dark magic around here started by me I think), the best way it to still try. Use damping at 1 and at 0.1 - it should be noticeable.
 

wild

No Bam no Play
Chat Moderator
I mention previously that I used Shiva's flipper code which is 1000 lines long for each flipper so I am sure it uses a lot of CPU power. I am pretty sure my PC has more capability than yours.
I believe it, but as I said above, it is not only the fact that "sound bounce" is the cause, but in my opinion, all the code of "dynamic flippers" including that of shiva, which as you say takes a lot of CPU.

but as I said above all this helps us to understand better, for possible improvements.
I will try and report back.
ok, thanks

You can edit it in the XML.

Unfortunately I cannot calculate that in such linear way because I have no idea how it is calculated/used by FP physics engine, i'm sorry.

And because the exact same physics work different from table to table for some reason (there's a thread about this dark magic around here started by me I think), the best way it to still try. Use damping at 1 and at 0.1 - it should be noticeable.
are you answering to me?

if yes...ok....but why in xml? I saw this on bam menu, from there it is not possible?

(there's a thread about this dark magic around here started by me I think),
I don't understand this, sorry......are you accusing yourself of something? but of what?

I'm just saying and discussing a problem that can happen to anyone, it's good if we understand what and why happen ,so we can then help.
 

AnonTet

Pinball Hall of Famer
Site Supporters
are you answering to me?

if yes...ok....but why in xml? I saw this on bam menu, from there it is not possible?
Yes I was answering you forgot the @ :)
You can change damping under "DEV options" - "Physics Tweaks" in BAM menu. When you find a value that works for you can put it in the XML line:
Code:
 <ball newtonDamping="0" mass="80" gravity="9800" damping="0.80"></ball>"

I don't understand this, sorry......are you accusing yourself of something? but of what?

I'm just saying and discussing a problem that can happen to anyone, it's good if we understand what and why happen ,so we can then help.
Don't bother reading but I was recalling this thread from almost a year ago. My point is, I can't help with the math because FP is FP and physics math is even worse to understand than normal math (for me) - same as dark magic :D
 

wild

No Bam no Play
Chat Moderator
If my memory serves me well, damping is the capacity of an object to dissipate energy. Basically is used to slow down an object.
it looks like you guessed it, and you remember well ...... I tried on DK, that's what I think

there are two voices,with standard value
1) damping 0.250
2) newton damping 0.000

while playing, I tried damping.... 0.500, 1.000,2000 5000,I noticed a perceptible slowing of the ball when I put 5000
instead if I touch newton damping it has a negative effect, it almost completely blocks the ball at 0.500

so in my opinion, as is happening to me in DK, that: to have fast gameplay, I had to modify quite a few things (omega) and also things that I hardly ever touched (gravity, mass), and now damping too to slow down a bit of the frenzy of the ball .... I know it's a contradiction, but it could work ,soI continue to make the test.
 

AnonTet

Pinball Hall of Famer
Site Supporters
@wild

newton damping is a lot "stronger". Maybe it is more accurate. I don't know. I do know it requires very low values and it is clamped between 0.1 and 1 as far as I could discover.

Maybe the difference is angular (spinning or rotation of the ball) vs linear (direction of the ball) damping and we should be using both? I have no clue.

But now you understand why I call it black magic :D
 

GeorgeH

Flippered Out
Staff member
Site Supporters
But.. @GeorgeH please you try this table, Charlie's Angels or World-Cup or Circus are EM table, see if you have any slowdowns

I tried deleting your flipper bounce sound code from all 3 tables and all of them played slightly faster. There wasn't as big a difference in the speed as there was on Twilight Zone but the difference is noticeable. Then I revised the code in the same way as was done on Twilight Zone and noticed it played about the same as with the code deleted. I am sure these tables would not present a significant challenge to the CPU on my PC so I don't know what is at play here. I sent you a private message with the revised tables attached. You can decide if the change is significant enough to revise the tables.

By the way, I always set newton damping to 0. When you change it, it produces an extremely strong effect.
 

Popotte

Flipper is good for you!
Site Supporters
@wild
...
Maybe the difference is angular (spinning or rotation of the ball) vs linear (direction of the ball) damping and we should be using both? I have no clue.
But now you understand why I call it black magic :D
Without documentation, it's a little bit difficult, indead.
 

wild

No Bam no Play
Chat Moderator
I tried deleting your flipper bounce sound code from all 3 tables and all of them played slightly faster. There wasn't as big a difference in the speed as there was on Twilight Zone but the difference is noticeable.
ok, so the conclusion is: it is better to put the sound code inside the DF code.
if you noticed that a slight difference means that something changes then it is recommended to add it in DF.
I am sure these tables would not present a significant challenge to the CPU on my PC
it was just a way to have further confirmations, that's why I asked you to try my tables, that the sound code is not inserted directly into the DF code so as I said before, it is better to insert it into DF.

I know,that they weren't a challenge for your pc, but this was not the meaning of this test ..... but only to have more confirmation, than in a pc faster than mine, like yours .... the code of the sound could create "problems", even in such simple tables ..... in fact you noticed some difference if you put it directly in DF, as you did .so.....it is better to insert it into DF.

I don't know what is at play here
G,at stake here, there is nothing of how you mean it, you reflect ... and only one way a test, which I asked you to do, to try the sound code in these simple tables of mine, in fact you did that which I expected, ie you entered the sound inside code in DF, and this was better for yuo,so also for me.
 

wild

No Bam no Play
Chat Moderator
newton damping is a lot "stronger". Maybe it is more accurate. I don't know. I do know it requires very low values and it is clamped between 0.1 and 1 as far as I could discover.

Maybe the difference is angular (spinning or rotation of the ball) vs linear (direction of the ball) damping and we should be using both? I have no clue.

But now you understand why I call it black magic
it is black magic only because "we" have no reason to search for an optimal configuration....and so sometimes we don't even notice of certain commands and so sometimes we don't even notice "damping / newton damping",
but in this case I'm trying to create ("out of logic in terms of understanding") a gameplay different, I hope for the best.
I know it's hard to understand what I mean .....

maybe popotte is right, a manual would help, but not for me if written in english,explaining what certain parameters are.
however I am having quite a few problems, not to mention hammer blows in the head....trying to get better physics in DK, but it happens that, you touch one thing, and break another, you improve the gameplay speed, and the kickers no longer work well, you increase the omega to try to hit a target in the distance or take the ramp, and then you find yourself having a superball, which as soon as it hits an object near the fins the ball splashes all over .... in short there are too many things to evaluate, if I were rich, I mean money, because rich in other things are already .... I would buy real pinball machines instead of creating them, then solve a big problem that is to always ask for help from my teacher jedy, who among other things has a lot of patience with me:oops:
......
 
Last edited:

AnonTet

Pinball Hall of Famer
Site Supporters
I'm fighting the same war as you :)

A manual would help but you'd still have to make everything work so the end result would be the same... lots of work :)
 

GeorgeH

Flippered Out
Staff member
Site Supporters
I have added what I call glow bulbs under the plastics. Slamt1lt developed this method to improve the way lights show a halo through the plastics. It is set up with a rendered bulb that sets on the playfield and you use an option called "Send to Back" to make it not glow through the plastics. Then you place an unrendered bulb above it that is set to "Send to Front" so it produces a halo through the plastic.

When I was working on this, I noticed there were very few bulbs in the back of the table. I think this may be due to the limit of 800 objects when this table was built. We can exceed that now. I watched some videos and added bulbs in the locations I saw.

I also changed the glow on the bulbs that are on the signs and a few others that indicate that a mode is ready. These were originally set with an extreme amount of glow which I think was done to make them brighter. I changed them to decrease the glow but increase brightness which couldn't be done when this table was originally built.

When I watched the videos, I noticed that when the kicker below the slot machine kicked out a ball, it bounces off an unraised right flipper over to the left flipper. I changed this table by changing the kicker strength and rotation so it does the same thing.

Anyway this is a screenshot of the current version of he table. Be aware that I have just started the lighting and it will look better later.
```Twilight Zone ULTIMATE 1.024.png


On this bulb on the lane divider, I set the bottom bulb to an off white and the glow bulb is blue. The blue bulb helps to enhance the color of the plastic.
```Twilight Zone ULTIMATE 1.025.png
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • @ 20degree:
    ** ***** ***** ****** * **** ***** ***** ** **** * **** *** ***** **** ***** *** * **** **** *** *** ***** ***** ****** ** ** ****** * *********** ****** **
    Quote
    @ 20degree: ** ***** ***** ****** * **** ***** ***** ** **** * **** *** ***** **** ***** *** * **** **** ***...
    Top