Jump to content



Photo
- - - - -

Ninuzzu's Ball Shadow Patcher

Ball Shadow

  • Please log in to reply
11 replies to this topic

#1 Pmax65

Pmax65

    Enthusiast

  • Platinum Supporter
  • 135 posts
  • Location:Romentino - Italy

  • Flag: Italy

  • Favorite Pinball: Addams Family

Posted 03 February 2021 - 09:52 AM

Hi there,

I attached to this message a little tool that I designed thought to patch the ninuzzu's subroutine that adds a shadow on the table below the ball. Despite the subroutine gives a better realistic look to the ball, when the ball rolls close to the left and right sides of the table, its shadow looks as if the ball was floating above table because the shadow is shifted too much away from the ball.

 

I developed this tool because many tables already designed by some VPX artists use the ninuzzu's ball shadow routine, so manually searching for which tables embed the routine and patching them would take a long time. This patcher does it for you automatically.

 

Note that the first time you run the patcher some anti-virus programs may warn you about the possibility of harmful code, this happens because I used VB6 to develop it and VB6 has been for a long time the preferred compiler for viruses designing.

 

I checked the patcher only under Windows 7, but it should work fine under Windows 10 too.

 

Please read the document shown in lower part of the patcher window before start a patching task, especially take care of the “Some suggestions” and the “DISCLAIMER” parts at the end of it.
 

I hope you'll enjoy it.

 

Massimo

EDIT:
Attached patch example
 

 

Attached Files


Edited by Pmax65, 05 February 2021 - 09:43 AM.

Everywhere a ball rolls, there's fun!


#2 Gravy

Gravy

    Pinball Fan

  • VIP
  • 1,147 posts

  • Flag: Australia

  • Favorite Pinball: Simpsons pinball party



Posted 03 February 2021 - 11:43 AM

Interesting, thankyou. Any chance you could include a before and after shot of the results.


Pinball Addict


#3 Pmax65

Pmax65

    Enthusiast

  • Platinum Supporter
  • 135 posts
  • Location:Romentino - Italy

  • Flag: Italy

  • Favorite Pinball: Addams Family

Posted 03 February 2021 - 01:21 PM

Hi Gravy,

 

Interesting, thankyou. Any chance you could include a before and after shot of the results.

 

I tried to put the image of the "before & after" indeed, but this forum automatic moderation reported me that I don't have the rights to post images.

I don't know how to get that rights.

Anyways, if you downloaded the tool, you can get the images into the document viewer located in the lower part of the tool window, I also tried to explain why balls resting on a plane can't have their casted shadow detached from the ball as ninuzzu's routine does at the sides of the table.

 

Have a great day.

 

Massimo


Everywhere a ball rolls, there's fun!


#4 Gravy

Gravy

    Pinball Fan

  • VIP
  • 1,147 posts

  • Flag: Australia

  • Favorite Pinball: Simpsons pinball party



Posted 03 February 2021 - 09:52 PM

Had a look at the images in the installer and certainly is a good fix for the floating ball issue.

There is however some issues with the program itself on windows 10, it seems to stay in front of all other windows and cannot be moved the usual way. When installing it also seemed to want to install some features from MS Office for some reason, not sure what that is?

I have not yet run it on my files though.


Pinball Addict


#5 goldchicco

goldchicco

    Enthusiast

  • Members
  • PipPipPip
  • 281 posts

  • Flag: United States of America

  • Favorite Pinball: Stargate

Posted 03 February 2021 - 10:55 PM

THANK YOU!!!

I tried it and I like it.



#6 Gravy

Gravy

    Pinball Fan

  • VIP
  • 1,147 posts

  • Flag: Australia

  • Favorite Pinball: Simpsons pinball party



Posted 04 February 2021 - 04:26 AM

I attempted to try it out on chokeee's mod of Elvis table by JPSalas, but after it ran it told me there was nothing to patch, then I realised that table already has a modified version of the values your program patches (not the same values as your fix though).

So then I tried Flupper's whitewater as I was thinking this is a good one to test as it has a feature where you can roll the ball around with the arrow keys (after enabling the feature) and I was thinking it would be easier to see the end result. Then realised that Flupper seems to have created a custom subroutine to create the ball shadow, albeit also suffering the same floating issue as Ninuzzu's solution.

I'll try it on a few other tables until I find one that works (hesitant on applying to my entire collection at present). But in the meantime, is there any chance you could have a look at Flupper's Whitewater and see if you can suggest some edited values that are similar to your fix.

Thanks either way, it looks like a useful tool even if it is a bit quirky in windows 10, always staying in foreground.


Pinball Addict


#7 wiesshund

wiesshund

    VPF Legend

  • Members
  • PipPipPipPipPipPipPip
  • 11,859 posts

  • Flag: United States of America

  • Favorite Pinball: How many can i have?

Posted 04 February 2021 - 05:39 AM

Heh

I was going to use this, but it did not work

 

Then i realized, not it's fault

I had already removed ninzzu's shaddow code and the shadow objects and replaced them with flasher shadows

and jp's shadow routine, from all my tables (I must not have enough tables then, right?)

 

So i will try it on the next table i add


If you feel the need to empty your wallet in my direction, i don't have any way to receive it anyways

Spend it on Hookers and Blow


#8 Pmax65

Pmax65

    Enthusiast

  • Platinum Supporter
  • 135 posts
  • Location:Romentino - Italy

  • Flag: Italy

  • Favorite Pinball: Addams Family

Posted 04 February 2021 - 10:37 AM

Hi Gravy.

There is however some issues with the program itself on windows 10, it seems to stay in front of all other windows and cannot be moved the usual way. When installing it also seemed to want to install some features from MS Office for some reason, not sure what that is?

That's not a bug indeed, I made the window to stay on front to avoid it to fall down and hide under the VPinballX windows called by the tool and also its static position is wanted, not a bug.

In case you think that it's a problem I can make it movable, but I don't suggest to change the stay on front feature because this tool is not intended to be used while running other applications. Once you fixed all the tables by the tables folder patch task, you should use it only at the installation of a new table, just before adjusting the table properties for your pleasure.
The MS Office features could be about the document viewer located in the lower part of the tool window that I used, because the referenced file is a RTF standard document, which is part of the MS Office pack. Anyways, I'll check, maybe I missed to remove some useless libraries from the compiler settings.
 

About Flupper's whitewater: I'll take a look this night. The tool works only with the original not patched ninuzzu's routine indeed.

 

 

(hesitant on applying to my entire collection at present)

I hope that I don't scared you with my suggestion to make a backup before use that task.

The tables folder patcher is not dangerous in itself. I wrote that suggestions just because, after started, it take a long time and it writes lot of data on the disk and for example in case of missing power, the disk could be damaged if it was writing on the disk during the power down.

 

Have a great day

 

Massimo

UPDATE:

I finally checked the compiled package. The only reason I found  about the MS Office features installation requirements is the RTF reader. I think it requires that because Windows 10 installs only the 64 bit version of the DLLs used by MS Office, while the VB6 objects use the 32 bit version. It's just a guess, since the VB6 compiler add those DLL automatically depending on the features used by the compiled application.


Edited by Pmax65, 05 February 2021 - 12:36 AM.

Everywhere a ball rolls, there's fun!


#9 Pmax65

Pmax65

    Enthusiast

  • Platinum Supporter
  • 135 posts
  • Location:Romentino - Italy

  • Flag: Italy

  • Favorite Pinball: Addams Family

Posted 04 February 2021 - 10:47 AM

Hi wiesshound,

yes, in case you already removed the ninuzzu's routine or you already changed the coefficients or equations, this tool ignores the table.

About jp' shadow routine, it's much better and realistic. I had some messages exchange with him about it and I fully agree that usually the environment where a pinball cabinet is used has a diffused light, so the shadow casted behind the ball should be a circular shaped disc centered under the ball.

ninuzzu's routine is simulating a single spot light source centered on the pinball table.

 

Have a great day.

 

Massimo


Edited by Pmax65, 04 February 2021 - 01:38 PM.

Everywhere a ball rolls, there's fun!


#10 Pmax65

Pmax65

    Enthusiast

  • Platinum Supporter
  • 135 posts
  • Location:Romentino - Italy

  • Flag: Italy

  • Favorite Pinball: Addams Family

Posted 05 February 2021 - 01:04 AM

Hi Gravy,

about Flupper's Whitewater ball shadow, he used a different routine, and only now I just see how exaggeratedly far from the ball that shadow it was. 

To fix it just change the original line as I evidenced in the ###### text:

' *****************************************************
' *** Ball Shadow code / Primitive Flipper Update *****
' *****************************************************

Dim BallShadowArray : BallShadowArray = Array (BallShadow1, BallShadow2, BallShadow3)

Sub GraphicsTimer_Timer()
	
	' *** move ball shadows ***
	If BallShadow then 
		Dim BOT, b : BOT = GetBalls
		For b = 0 to UBound(BOT)
'  ##################################################
'  ###### CHANGE THIS LINE WITH THE BELOW ONE  ######
'  ##################################################
'               	BallShadowArray(b).X = BOT(b).X + (BOT(b).X - whitewater.Width/2)/8 : BallShadowArray(b).Y = BOT(b).Y + 30 : BallShadowArray(b).Z = BOT(b).Z - 24
			BallShadowArray(b).X = BOT(b).X + (BOT(b).X - whitewater.Width/2)/21 : BallShadowArray(b).Y = BOT(b).Y + 4 : BallShadowArray(b).Z = BOT(b).Z - 24
		Next
	End If
	
	' *** move primitive bats ***
	batleft.objrotz = LeftFlipper.CurrentAngle + 1 : batleftshadow.objrotz = batleft.objrotz
	batright.objrotz = RightFlipper.CurrentAngle - 1 : batrightshadow.objrotz  = batright.objrotz
	batrightupper.objrotz = URightFlipper.CurrentAngle - 1 : batrightshadowupper.objrotz  = batrightupper.objrotz
End Sub

Have a great day and enjoy the table.

 

Massimo


Edited by Pmax65, 05 February 2021 - 01:07 AM.

Everywhere a ball rolls, there's fun!


#11 Gravy

Gravy

    Pinball Fan

  • VIP
  • 1,147 posts

  • Flag: Australia

  • Favorite Pinball: Simpsons pinball party



Posted 05 February 2021 - 03:49 AM

Thankyou Pmax65, that works much more realistically than the previous values. Thankyou also for explaining why your software is always in front of other windows. Not being able to move it was a bit of an issue for me as I was attempting to visually compare the values that were written in your documentation with script in a VP table and it was getting in the way on a single monitor.

Your MS Office component explanation makes sense, I think Ive seen it happen before many years ago on some other software install.

I can see this software being of further value if you were to perhaps create a further modified version that allows the user to customise what text they are attempting to find and replace as it would then allow for a much broader range of use, outside of simply fixing the ball shadow issue. So a type of Global find and replace app.

 

 

Hi Gravy,

about Flupper's Whitewater ball shadow, he used a different routine, and only now I just see how exaggeratedly far from the ball that shadow it was. 

To fix it just change the original line as I evidenced in the ###### text:

' *****************************************************
' *** Ball Shadow code / Primitive Flipper Update *****
' *****************************************************

Dim BallShadowArray : BallShadowArray = Array (BallShadow1, BallShadow2, BallShadow3)

Sub GraphicsTimer_Timer()
	
	' *** move ball shadows ***
	If BallShadow then 
		Dim BOT, b : BOT = GetBalls
		For b = 0 to UBound(BOT)
'  ##################################################
'  ###### CHANGE THIS LINE WITH THE BELOW ONE  ######
'  ##################################################
'               	BallShadowArray(b).X = BOT(b).X + (BOT(b).X - whitewater.Width/2)/8 : BallShadowArray(b).Y = BOT(b).Y + 30 : BallShadowArray(b).Z = BOT(b).Z - 24
			BallShadowArray(b).X = BOT(b).X + (BOT(b).X - whitewater.Width/2)/21 : BallShadowArray(b).Y = BOT(b).Y + 4 : BallShadowArray(b).Z = BOT(b).Z - 24
		Next
	End If
	
	' *** move primitive bats ***
	batleft.objrotz = LeftFlipper.CurrentAngle + 1 : batleftshadow.objrotz = batleft.objrotz
	batright.objrotz = RightFlipper.CurrentAngle - 1 : batrightshadow.objrotz  = batright.objrotz
	batrightupper.objrotz = URightFlipper.CurrentAngle - 1 : batrightshadowupper.objrotz  = batrightupper.objrotz
End Sub

Have a great day and enjoy the table.

 

Massimo


Edited by Gravy, 05 February 2021 - 04:16 AM.

Pinball Addict


#12 Pmax65

Pmax65

    Enthusiast

  • Platinum Supporter
  • 135 posts
  • Location:Romentino - Italy

  • Flag: Italy

  • Favorite Pinball: Addams Family

Posted 05 February 2021 - 10:29 AM

Hi Gravy,

 

 

Not being able to move it was a bit of an issue for me as I was attempting to visually compare the values that were written in your documentation with script in a VP table and it was getting in the way on a single monitor.

If you want to see how the script is changed after the patch, just check the [Patch in External Scripts Only] option and run the [Patch Single Table] task. Doing that, at the end of the patch the table VPX is left unchanged (with the original ninuzzu's constants), while you can get the VBS script file with the very same name of the VPX file which is patched. Rename the VBS file to TXT, so that it can't be loaded by the simulator and open it with Notepad, then you can compare the patched script (in Notepad) with the original script (by opening the table for edit into the simulator) and evaluate the patch changes.

 

I can see this software being of further value if you were to perhaps create a further modified version that allows the user to customise what text they are attempting to find and replace as it would then allow for a much broader range of use, outside of simply fixing the ball shadow issue. So a type of Global find and replace app.

I know what you mean and honestly I already thought to do so, it's a good idea in the intentions, but I evaluated that it could be dangerous. That because the same string could appear in different parts of the script and maybe that the patch could change unwanted (and unknown) parts of the script. In this patcher the changes are applied if and only if the three constants are found in the context of ninuzzu's equations of shadow displacement.

Have a great day.

Massimo


Edited by Pmax65, 05 February 2021 - 10:31 AM.

Everywhere a ball rolls, there's fun!






Also tagged with one or more of these keywords: Ball, Shadow