Register    Login    Forum    FAQ    PinSimDB.org

Board index » Future Pinball » BAM corner




Post new topic Reply to topic  [ 2242 posts ]  Go to page Previous  1 ... 189, 190, 191, 192, 193, 194, 195 ... 225  Next
Author Message
 Post subject: Re: Better Arcade Mode - MOD for Future Pinball
 Post Posted: Wed Jul 24, 2019 2:03 am 
Offline

Joined: Thu Aug 16, 2012 11:12 pm
Posts: 2512
Location: Arkansas, USA
GeorgeH wrote:
ravarcade wrote:
BAM Update v.254

4. Lights controled in script.
You can control lights in script. There is 9 new commands... ... and as usualy you can use CTRL-C in Lights or postprocessing menu to get ready to paste in script code with values.


Rav,

It is not all that critical but you might add "Ball Brightness" to your list of parameters. I find I need to adjust it fairly often when I set up the lighting. If the end user has different settings

George


Rav,

I just realized something else that would be more critical to add to the control of lights in the script. It is the parameters for "PostFX". PostFX has a significant effect on the brightness of lighting.

George


Top 
 Profile  
 
 Post subject: Re: Better Arcade Mode - MOD for Future Pinball
 Post Posted: Wed Jul 24, 2019 4:47 am 
Offline

Joined: Mon Mar 25, 2013 4:02 pm
Posts: 1001
GeorgeH wrote:
It is not all that critical but you might add "Ball Brightness" to your list of parameters.

I'm not sure is it good idea. Ball brighness is depth inside BAM menu and end user may have trouble to change params if he/she don't like values from script.
Also, soon i will add little more options in script to control ball look, so it will be too complicated to controll all that.


GeorgeH wrote:
I just realized something else that would be more critical to add to the control of lights in the script. It is the parameters for "PostFX". PostFX has a significant effect on the brightness of lighting.

Again, i don't like that. First, PostFX params are "global", for all tables. So, you change it on one table and it will have impact on all. Second, it have big impact on performance (FPS).
In my opinion it is way to make users angry.

_________________
http://www.ravarcade.pl
Better Arcade Mode
current BAM version: v1.4-267, released: Nov 9, 2019


Top 
 Profile  
 
 Post subject: Re: Better Arcade Mode - MOD for Future Pinball
 Post Posted: Wed Jul 24, 2019 8:55 am 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2855
Location: Ontario, Canada
ravarcade wrote:
Also, soon i will add little more options in script to control ball look


Is it possible to add Francisco ballshadows so they will be applied even during multiball?


Top 
 Profile  
 
 Post subject: Re: Better Arcade Mode - MOD for Future Pinball
 Post Posted: Wed Jul 24, 2019 2:53 pm 
Offline
User avatar

Joined: Mon Aug 15, 2011 10:02 am
Posts: 1889
Location: Argentina
Gimli wrote:
ravarcade wrote:
Also, soon i will add little more options in script to control ball look


Is it possible to add Francisco ballshadows so they will be applied even during multiball?


Yes please *insert here a little dog with please face*


Top 
 Profile  
 
 Post subject: Re: Better Arcade Mode - MOD for Future Pinball
 Post Posted: Wed Jul 24, 2019 6:10 pm 
Offline

Joined: Mon Mar 25, 2013 4:02 pm
Posts: 1001
I will look how to make good ball shadows.

_________________
http://www.ravarcade.pl
Better Arcade Mode
current BAM version: v1.4-267, released: Nov 9, 2019


Top 
 Profile  
 
 Post subject: Re: Better Arcade Mode - MOD for Future Pinball
 Post Posted: Wed Jul 24, 2019 6:26 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2855
Location: Ontario, Canada
Thanks Rav !


Top 
 Profile  
 
 Post subject: Re: Better Arcade Mode - MOD for Future Pinball
 Post Posted: Wed Jul 24, 2019 9:21 pm 
Offline

Joined: Thu Aug 16, 2012 11:12 pm
Posts: 2512
Location: Arkansas, USA
Rav,

I don't know if you have been following this thread but Francisco has been able to create shadows for one ball but has not been able to create shadows for several balls during multiball:

viewtopic.php?f=86&t=9117

George


Top 
 Profile  
 
 Post subject: Re: Better Arcade Mode - MOD for Future Pinball
 Post Posted: Wed Jul 31, 2019 6:21 pm 
Offline

Joined: Mon Mar 25, 2013 4:02 pm
Posts: 1001
beta version with ball shadows for testings:
https://www.ravarcade.pl/beta/BAM.dll

If you find errors or want to change default params for ball shadows when you have few days to let me know before it will be released.


https://youtu.be/N_AdMHrKdeo
(video will be ready in ~1h)

New things:
- ball shadows (enabled by default)
- flipper shadows (more bellow)
- added new ball manipulation script functions

Demo table:
http://www.ravarcade.pl/beta/ballDemo9.fpt

About ball shadows:
They are not "real" shadows. It is just added dark spot under ball. This method have no impact of performance and works allways. It may create some "errors" but in most cases it looks realy good.

There is no point in adding real shadows calculated for every light position. First, it may work only in new-renderer, second it will have huge impact of performance, third it may not look any better.

New ball shadows are enable by default. You can find options to change it in Addons menu.
- dark level - (default: 0.7) - if you want to disable shadows, set value to 0.0. It determines how dark is shadow.
- radius soft - (default: 1.8) - how far from ball shadow will be drawed [in ball radius units]. This is "soft" edge of shadow.
- radius hard - (default: 0.0) - "hard" edge of shadow. You "hard" = "soft" when whole spot under ball is uniform. If "hard" < "soft", between that 2 edges shadow will be blured.

Please play with that params. Maybe you will finde better default values.

Script:
xBAM.SetBallShadows dark_level, radius_soft, radius_hard, maxLevelAbovePlayfield, removeShadowsFromInvisibleBall

Note, you have 2 more params than in BAM menu.
By default, when ball is above playfield, shadow under ball is smaller. If ball is ~13.5mm above (1 ball radius) shadow will disappear.
- maxLevelAbovePlayfield - (default value = 1.0) - you can increase how far from playfield ball shadow will diappear.
- removeShadowsFromInvisibleBall - (true/false, default true), If you have invisble balls on table (with opacity = 0.0), when ball will don't have shadow. So, in script you can set this to false and even invisible ball will have shadow. This is added in case if someone have wird ball on table with attached miniplayfield and wan't have shadow.

If you skip last 2 params in call to xBAM.SetBallShadows, when default value will be used.

Flippers shadows.
Shadows under flippers are drawed ONLY if in script flipper have own "Ext" object.

If you want to add shadow to old table without any "dynamic flipper" stuffs you need add only ONE line in script:
Code:
xBAM.CreateAllExt()


Shadows under flippers is drawed same way as for balls.

NEW CUSTOM BALLS IN SCRIPT
Goal is to make custom ball manipulations easy and fun.
So, we have few new properties and functions in BallInfo object.
Note:
Every time you call xBAM.BallCloseTo you get in return this object. Also in every something_hit() subroutine you have access with xBAM.Ball to info what ball hit that "somthing" (like Sub LeftSlingshotRubber_Hit())
Here is list of new things:
- xBAM.Ball.Id - unique id for every custom ball. It is =-1 if it is "normal" ball, not custom.

- xBAM.Ball.Name - you can GET or SET ball "type".
In previous BAM version if you want to change ball texture you need to define ball "type" with xBAM.BallManager.DefineCustomBall and you need to pass this "type" as param to xBAM.BallManager.CreatCustomBall.
If you want to change how ball look in "_hit()" subroutine, you need call xBAM.BallManager.UpdateBall with custom ball "Id" and "Name" of ball type.
You would need a lot of code in script to trace custom ball "Id" and "Name".
Now it is simple. In _hit() subroutine to change that one ball you need only:
Code:
xBAM.Ball.Name = Ball_A


- xBAM.Ball.UpdateBall red, green, blue, dirtTextrureName, reflectionTextureName, reflectionInPlayfieldTextureName - change custom ball look.
Now, you don't need to define custom ball with xBAM.BallManager.DefineCustomBall, you can change look of one single custom ball any time in script.
You can change texture or color of ball. (ONLY CUSTOM BALL).

- xBAM.Ball.Opacity - set ball opacity... like with xBAM.BallManager.SetBallOpacity function, but easy way
- xBAM.Ball.SetBallOpacityWithEasing Opacity, Time, Easing - set ball opacity... like with xBAM.BallManager.SetBallOpacityWithEasing function, but easy way

- xBAM.Ball.ExtTimer1[b], xBAM.Ball.[b]ExtTimer2[b], xBAM.Ball.[b]ExtTimer3[b] - every ball on table have 3 own timers. Unit is 1 second. You can use it in script. Also, [b]ExtTimer1 is starte when ball is created. So, when you read it you will get how long that one ball is on table. Every disable timer will return 0.0. Every enabled timer will return value bigger than 0.0.

- xBAM.Ball.ResetExtTimer timerIdx - (timerIdx = 1 or 2 or 3), you can use this function to reset timer
- xBAM.Ball.StopExtTimer timerIdx - (timerIdx = 1 or 2 or 3), stop timer.

About demo table
1. In demo table you will see ball blinking red color for first 15 seconds.
I use ExtTime1 to count that 15 seconds and to calc at what part of interval we are. Color is changed smooth way base on time.

2. If ball hit left LeftSlingshotRubber i change ball color to green for 0.2 seconds and if ball hit RightSlingshotRubber i change to blue.
To do this i use ExtTimer2 to measue time and ExtInt2 to mark "left" or "right" slingshot rubber. So, in LeftSlingshotRubber_Hit() subroutine:
Code:
   xBAM.Ball.ResetExtTimer 2
   xBAM.Ball.ExtInt2 = 1 ' green flash

and in RightSlingshotRubber_Hit() subroutine:
Code:
   xBAM.Ball.ResetExtTimer 2
   xBAM.Ball.ExtInt2 = 2 ' blue flash


How it works:
1. All balls are create as "custom balls":
Code:
Sub CreateCustomBall (source)
   Dim bi
   Set bi = xBAM_BallManager.CreatCustomBall(0)
   Source.CreateBall bi.Red, bi.Green, bi.Blue, bi.BallNumber
End Sub

Note: i don't define any "custom ball" with xBAM.BallManager.DefineCustomBall, i just pass 0 (zero) as argument to xBAM_BallManager.CreatCustomBall. I can change ball textures any time i want.

2. DrawFrameTick subroutine. This is same type subroutine as NewtonPhysicsTick. If you have that subroutine in script it will be called right before new frame will be rendered.
This is new thing added to BAM.
Code:
Sub DrawFrameTick()
   xBAM.EnumBalls 100, 0, "BlinkBalls"
End Sub

Line xBAM.EnumBalls orders BAM to call BlinkBalls subroutine once for every ball on table with "BallInfo" object as argument. So, if we have 3 balls on table, BlinkBalls will be called 3 times.

In previous BAM you can do exacly same thing with NewtonPhysicsTick, but NewtonPhysicsTick will be called 5 or 6 times for 1 drawed frame. It will be just waste of time.

3. BlinkBalls subroutine.
Here we make ball blink for 15 second after ball creation:
Code:
Const BlinkInterval = 0.5  ' sec
   Const BLinkDuration = 15.0 ' sec

   Dim a

   If ball.ExtTimer1 > 0.0 Then ' ExtTimer1 is not 0.0 when it is started after ball creation
      If ball.ExtTimer1 > BlinkDuration Then
         ball.UpdateBall 192, 192, 192
         ball.Opacity = 1.0
         ball.StopExtTimer 1
      Else         
         a = ball.ExtTimer1 / BlinkInterval
         a = (a - CLng(a)) * 2.0
         If a < 0 Then  a = -a

         ball.UpdateBall 60 + CInt(192*a), 60, 60
      End If
   End If

So, in first "If" we check if ExtTimer1 is still running. If so, we check if that 15 seconds passed.... If, so set ball color to normal values and we disbale timer with ball.StopExtTimer 1.
If ExtTimer1 value is between 0 and 15 second we change ball color with ball.UpdateBall subroutine.

Second part of BlinkBalls is used to "flash" ball after slinshot rubber is hit.
Only difference is we use ExtTimer2 to count time (0.2 sec) after _hit() event and we set ball color base on ExtInt2 value.
Code:
   Const FlashDuration = 0.2
   If ball.ExtTimer2 > 0.0 Then
      If ball.ExtTimer2 > FlashDuration Then
         ball.StopExtTimer 2
         ball.UpdateBall 192, 192, 192
      Else
         Select case ball.ExtInt2
            case 1
               ball.UpdateBall 60, 255, 60
            case 2
               ball.UpdateBall 60, 60, 255
            case else
               ball.UpdateBall 255, 255, 255
         End Select
      End If
   End If


----------------
Have fun with new BAM beta.

_________________
http://www.ravarcade.pl
Better Arcade Mode
current BAM version: v1.4-267, released: Nov 9, 2019


Top 
 Profile  
 
 Post subject: Re: Better Arcade Mode - MOD for Future Pinball
 Post Posted: Wed Jul 31, 2019 10:05 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2855
Location: Ontario, Canada
Thanks again Rav !


Top 
 Profile  
 
 Post subject: Re: Better Arcade Mode - MOD for Future Pinball
 Post Posted: Wed Jul 31, 2019 10:39 pm 
Offline

Joined: Thu Aug 16, 2012 11:12 pm
Posts: 2512
Location: Arkansas, USA
Thanks Rav,

George


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 2242 posts ]  Go to page Previous  1 ... 189, 190, 191, 192, 193, 194, 195 ... 225  Next

Board index » Future Pinball » BAM corner


Who is online

Users browsing this forum: No registered users and 5 guests

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to: