Jump to content



Photo
- - - - -

New VP plunger mods


  • Please log in to reply
76 replies to this topic

#1 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,069 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 28 March 2015 - 07:48 AM

I've been working on some improvements to the VP plunger object that I'm ready to share with the community.  This is skunkworks stuff outside of the official VP development group, but I've been in touch with Toxie, and he seems okay with what I have in mind.  If all goes well with the testing, and people generally think this is an improvement worth keeping, I think we can get it absorbed into the official VP code base.

 

Testing versions are now available for VP 9.9.1, Physmod 5, and VP 10.0 beta.

 

Here's a download link.  This is a ZIP file with the modified VP executables (ALL VERSIONS), documentation, and a bunch of graphics resources as examples and starting points for your own custom work.  It also includes the modified VP source code (all versions) in case you want to compile your own from scratch.  (Just pull a snapshot of the appropriate branch from sourceforge and substitute the modified source files from the zip below.)

 

    https://www.dropbox....-14-15.zip?dl=0

 

Read on for details of what this is all about.  I'd like to invite anyone who's interested to test it out and see what you think.  Feedback is welcome, in terms of general opinions on the new features as well as specific bug reports.

 

Goals of the project

My primary goal was to make the built-in plunger object look good enough and act realistically enough that I could use it to replace the scripted "fake" plungers in all of the tables on my cabinet where the analog plunger input doesn't work.

 

Analog plunger support has been one of the ongoing headaches with my cab.  The majority of tables don't work out of the box with it.  Some are relatively easy to get working, others are quite difficult, but even the easy ones take a fair amount of time to deal with.

When I set out on this project, my original thinking was that I'd just come up with the One True Script Hack for plungers.  I was going to analyze the various hacks that people have used over the years, find the best one, and come up with a recipe to apply it to all of my tables.  But after a bit of study, I realized that this was the wrong approach.  For one thing, I don't think there really is a single best hack; there seem to be trade-offs, which is probably why everyone doesn't already use the same approach.  But more importantly, coming up with a better hack would just be treating the symptom.  The real problem here is that the built-in plunger isn't good enough for table designers to use.  The real solution would be to fix the plunger.

 

Summary of the changes

The new code addresses the two areas where I've heard complaints about the existing plunger, and had complaints myself: the visual appearance, and the physics.  For the visuals, I added two new style options, and a bunch of new properties that go with them.  I think the new styles are flexible enough for table authors to get exactly the appearance they want out of the plunger, with much less work than the comparable scripting approaches.   For the physics, I basically rewrote everything, and added some new tweakability there as well.

 

Visual changes

The big change is that I added two new drawing styles for the plunger.  The first is a "Flat" style, which renders an image (which can have alpha transparency) onto a flat, rectangular surface.  More interestingly, it can render a series of animation cells onto the surface.  I think this can serve as a drop-in replacement for all of the animation tricks that most of the scripted plungers use - with vastly less work, since everything happens automatically without any scripts or timers.  The second new style, which I think is even better, is the "Custom" type.  This is a 3D model along the lines of the existing "Modern" type, but it has two things Modern doesn't.  It lets you customize the size and shape of all of its parts.  And it has a fully 3D modeled, animated spring that expands and contracts as you move the plunger.

 

Here are a couple of examples of the Custom plunger.  These are just taken from VP screen shots.

 

vpplungerrendering.png  vpplungerrendering2.png

 

Those are basically identical plungers in that they use the default settings that you get when you use the Custom type; the only difference is the texture maps.  Those texture maps and several others are included in the Zip file above.  The texture is hardly all you can change, though: you can change the entire shape of the tip, the geometry of the E-ring, the width of the shaft, the gauge of the spring wire, the diameter of the spring windings, the density of the spring coils, and the number of those little tight end loops at the top of the spring.

 

Also, keep in mind that these are 3D models, so the perspective adjusts automatically to your layback and other camera settings.

 

Physics changes

I didn't set out to do this, but I ended up rewriting most of the plunger physics.  This isn't like the Physmod5 or even VP10 physics rewrites, though, in that you shouldn't have to rejigger existing tables to deal with the changes.  What I tried to do was to keep things working the way they were supposed to work all along, but without all the weird non-linearities and bad behavior.  

 

Here are the main problems that should be fixed in the new code:

 

- If you set "mech enabled" on the old plunger, and tried to use it from the keyboard interface, short pulls produced release speeds that were much too high.  Part of the reason is that the plunger tip would do a full-speed dash all the way from the rest position to the fully forward position, even for the tiniest tap on the Return key.  That's fixed.  Short pulls now produce proportional release speeds whether or not "mech enabled" is set.  The "bounce" in the firing motion is now proportional to the strength.

 

- There used to be a big discontinuity in the release speed-vs-pull length curve.  There was a dividing line somewhere along the pull distance where you'd get a big jump in release speed - pull back just slightly less than that line and you get a really weak shot, pull back just slightly more and you get a really strong shot.  This created a zone of strengths you just couldn't access.  Terrible for sensitive skill shots.  This was caused by the "break over velocity" algorithm.  Does anyone even know what "break over velocity" did?  I do now, but only because I spent quite a while deciphering the source code that applies it, and I don't think its real purpose was ever documented.  I've removed it and replaced it with a different approach that doesn't require a mysterious parameter like this, and which doesn't have any of the non-linearities of the old system.

 

- With analog plungers, the release speed was way too inconsistent for a given pull length.  On a real machine, there's certainly some variation due to the vagaries of friction and so forth, but nothing like the randomness we used to see with VP.  The new code fixes this.  In the course of developing the Pinscape Controller, I studied what was going on here in some depth, and I came up with a solution that I implemented in the controller firmware.  Now I've applied a similar approach on the VP side.  This should improve the analog launch behavior for any plunger controller with any sensor technology.

 

- Release strength was too variable in general, whether through the keyboard or analog interface.  The root cause was that the strength was (indirectly) a function of the physics loop timing; this introduced what amounted to sizable random term in every calculation.  The new code factors this out.

 

I also added a few nice little enhancements:

 

- There's a new "momentum transfer" property that lets you tweak the release strength without any effect on the animation.  One of the complaints I heard about the old plunger is that the only way to reduce the strength was to reduce the Release Speed property, which also slows down the visual animation of the release motion.  It wasn't always possible to get the right strength without making the animation look wrong.  The new momentum transfer property addresses this by giving you an independent knob that only affects the strength.  This is a factor that's just multiplied into the regular speed-based calculation.  The default is 1, which obviously has no effect in a multiplication.  If you want to make the release twice as strong, set it to 2.  If you want to make it half as strong, set it to 0.5.

 

- The old plunger had some code that attempted to let you use a mech plunger to control an Auto Plunger in the simulation.  I'm not sure if anyone ever used this code or if it even worked; from what I can piece together from the code, there was some cooperation required by the table scripts that I don't think is documented anywhere.  But just in case, I carried the code forward, and I also removed the hoops that scripts had to jump through - it's now automatic and transparent to scripts.  This is described more completely in the documentation, but here's the executive summary: when you pull back the mech plunger and let go, if the software plunger has the Auto Plunger property set, VP will generate a synthetic Return key press.  So firing the analog plunger translates into a Launch Ball button press, even if you don't have a Launch Ball button on your cab.  This is all done without the script even knowing about it; the script just sees a Return key event.

 

- There's now two-way momentum transfer between ball and plunger.  If a moving ball strikes a stationary plunger, the plunger will get a little bump that you can see in the animation.  (Sorry, it doesn't move your analog plunger knob yet. :))  The strength of the bump is proportional to the strike speed.  Along the same lines, when the moving plunger hits a stationary ball, it saps some of the momentum out of the plunger.  If you've ever closely observed a real machine, you might have noticed this effect in reality - a plunger that strikes a ball transfers most of its momentum to the ball and so doesn't rebound much off the barrel spring.  A plunger fired without a ball present bounces around quite a bit because its momentum all goes into the spring rebound.  This stuff is all just special effects with no functional benefit, but I think it subtly contributes to the realism even if you don't consciously notice it.

 

Try it out and post your feedback!

I think that about covers it.  I'm pretty excited about the new plunger features - I've already used it to fix a few of the most recalcitrant tables I have on my cab (the ones where I just couldn't figure out how to make their scripts work property with the analog device), so if nothing else it accomplishes my original goals.  But I'm really hoping that table designers will like the new plunger options well enough that they'll happily use them for future tables instead of scripting tricks, so that cab builders with analog plungers will eventually be able to assume that a newly downloaded table will just work.


Edited by mjr, 14 April 2015 - 06:58 PM.


#2 vampirolatino2

vampirolatino2

    Pinball Fan

  • Members
  • PipPipPipPip
  • 1,430 posts

  • Flag: Spain

  • Favorite Pinball: Medieval Madness

Posted 28 March 2015 - 08:57 AM

mjr for president! :dblthumb:  Thank you very much!


any table with this new feature to see it working? I'm not a table builder to make these changes quickly :tongue3:



#3 blashyrk

blashyrk

    Pinball Fan

  • Members
  • PipPipPipPip
  • 549 posts
  • Location:Norway

  • Flag: Norway

  • Favorite Pinball: Attack from Mars, Medieval Madness, White Water

  • PS3 Gamer Tag: Blashyrk

Posted 28 March 2015 - 08:58 AM

mjr for president! :dblthumb:  Thank you very much!

+1 :)

#4 ClarkKent

ClarkKent

    Pinball Fan

  • Members
  • PipPipPipPip
  • 1,551 posts

  • Flag: Austria

  • Favorite Pinball: Q*Bert's Quest, Red's and Ted's Road Show, Dialed In, Big Bang Bar

Posted 28 March 2015 - 10:57 AM

mjr you are my true hero! :) Finally someone fixes the weird analogue plunger behavior! WOW!

 

I just tried the new exe and this is just INCREDIBLE!!!! I can control the plunger like on a real machine! :) No sudden unwanted shoot outs anymore!

 

I hope this will be used in VP10 soon and I also hope that you will release new Accelleration Mods of VP9.9 and PM5 to improve old tables! :)


Edited by ClarkKent, 28 March 2015 - 11:12 AM.


#5 mpad

mpad

    Enthusiast

  • Members
  • PipPipPip
  • 335 posts

  • Flag: Germany

  • Favorite Pinball: AFM, TOM; Timeshock (!), Secrets of the Deep (fx2)

Posted 28 March 2015 - 11:42 AM

Sounds freakin awesome just by reading it. Have to try later.
So what table changes are needed? Or does it work out of the box with most tables?
I second the need for physmod5 version, as I play 90% pm5 tables...

Edited by mpad, 28 March 2015 - 11:43 AM.


#6 boiydiego

boiydiego

    Pinball Fan

  • Members
  • PipPipPipPip
  • 978 posts
  • Location:baal

  • Flag: Belgium

  • Favorite Pinball: flinstones,t2 chrome edition,wcs,afm,fish tales,medieval,rollercoaster tycoon,taxi

Posted 28 March 2015 - 12:24 PM

nice fix mjr , only the tilt problem is more a problem for me then the plunger ever was ;-)


Edited by boiydiego, 28 March 2015 - 12:27 PM.

boiydiego___gebruik-n2kbkyc.png


#7 dstott

dstott

    Enthusiast

  • Members
  • PipPipPip
  • 289 posts
  • Location:Ocala, Florida

  • Flag: United States of America

  • Favorite Pinball: Twilight Zone

Posted 28 March 2015 - 01:29 PM

I can't wait to load it up and give it a whirl.  Thank you for your time and effort towards resolving the frustration that has been the tuning of the plunger, table by table.


Dave

 

“The Earth is God's pinball machine and each quake, tidal wave, flash flood and volcanic eruption is the result of a TILT that occurs when God, cheating, tries to win free games.” Tom Robbins


#8 boiydiego

boiydiego

    Pinball Fan

  • Members
  • PipPipPipPip
  • 978 posts
  • Location:baal

  • Flag: Belgium

  • Favorite Pinball: flinstones,t2 chrome edition,wcs,afm,fish tales,medieval,rollercoaster tycoon,taxi

Posted 28 March 2015 - 01:31 PM

so only replace the exe thats all ? is the acceleratormod mod included in the exe ? no changing in tablescript needed ?


boiydiego___gebruik-n2kbkyc.png


#9 ClarkKent

ClarkKent

    Pinball Fan

  • Members
  • PipPipPipPip
  • 1,551 posts

  • Flag: Austria

  • Favorite Pinball: Q*Bert's Quest, Red's and Ted's Road Show, Dialed In, Big Bang Bar

Posted 28 March 2015 - 01:51 PM

This should really be the new standard! I hope toxie and fuzzel will allow this.

#10 blashyrk

blashyrk

    Pinball Fan

  • Members
  • PipPipPipPip
  • 549 posts
  • Location:Norway

  • Flag: Norway

  • Favorite Pinball: Attack from Mars, Medieval Madness, White Water

  • PS3 Gamer Tag: Blashyrk

Posted 28 March 2015 - 02:52 PM

Yes please do a physmod5 version :) thats the only version I use

#11 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,069 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 28 March 2015 - 06:12 PM

So what table changes are needed? Or does it work out of the box with most tables?
I second the need for physmod5 version, as I play 90% pm5 tables...

 

Right, it should just work for existing tables, provided they use a real plunger object.  Lots of tables use scripting tricks that either don't use a real plunger at all or use it in some kind of sneaky way that doesn't let it connect with the ball.  Tables like that won't work out of the box with this, obviously.

 

I'll try to do a physmod5 version of this too.  I don't think that'll be a problem - I think that the plunger code is pretty untouched in pm5 vs the regular 9.9, so hopefully it'll just be a matter of using the same changes I made in 9.9.1.

 

 

is the acceleratormod mod included in the exe ?

 

Yep, the accelerometer code is in there - that's part of the official 9.9.1 now, too.  You have to turn it on with a checkbox in the options.  Go to the Keys prefs and click the Enable Nudge Filter box.



#12 blashyrk

blashyrk

    Pinball Fan

  • Members
  • PipPipPipPip
  • 549 posts
  • Location:Norway

  • Flag: Norway

  • Favorite Pinball: Attack from Mars, Medieval Madness, White Water

  • PS3 Gamer Tag: Blashyrk

Posted 28 March 2015 - 06:50 PM

I'll try to do a physmod5 version of this too.  I don't think that'll be a problem - I think that the plunger code is pretty untouched in pm5 vs the regular 9.9, so hopefully it'll just be a matter of using the same changes I made in 9.9.1.


Thank you mjr :) much appreciated.

#13 fuzzel

fuzzel

    spaghetti code

  • VP Dev Team
  • PipPipPipPipPip
  • 2,818 posts

  • Flag: Germany

  • Favorite Pinball: yes I have

Posted 28 March 2015 - 08:37 PM

This should really be the new standard! I hope toxie and fuzzel will allow this.

I have no problem with this. Once it's tested we can add the changes to VP10. I don't know how much we have to change because this is all on the old VP9 basis but it's doable.



#14 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,069 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 28 March 2015 - 09:26 PM

This should really be the new standard! I hope toxie and fuzzel will allow this.

I have no problem with this. Once it's tested we can add the changes to VP10. I don't know how much we have to change because this is all on the old VP9 basis but it's doable.

 

That's great to hear.

 

I'm actually planning to do the VP10 porting as the next stage of this, so I should be able to give you new code that you can just drop in.  I've already surveyed it, and the changes to the existing plunger code aren't too huge going from 9.9.1 to 10.  I don't think it'll take me too long.

 

The one thing I'm uncertain about is that the Type property was removed in VP10, so I feel a little bad about having to add it back.  I assume the property was removed in VP10 only because it became unnecessary when the number of available types was reduced to one ("Modern") after the "Original" type was removed (which itself makes perfect sense in that no one would ever use "Original" in a real table).  Hopefully no one has a philosophical or design-level objection to the whole idea of a Type property.



#15 vampirolatino2

vampirolatino2

    Pinball Fan

  • Members
  • PipPipPipPip
  • 1,430 posts

  • Flag: Spain

  • Favorite Pinball: Medieval Madness

Posted 28 March 2015 - 09:42 PM

lol mjr, they are traumatized and will get scared?!

 

:otvclap:  thanks for the time you put in this!

 

cheers.

 

PS: This week all the stuff for the DIY plunger I order come in the mail. Just so you know and hide because I will be bothering you :tongue3:



#16 Sir Cheddar

Sir Cheddar

    His Sharpness

  • VIP
  • 383 posts

  • Flag: ---------

  • Favorite Pinball: Tales of the Arabian Nights



Posted 28 March 2015 - 10:16 PM

Thank you. I fixed and replaced plungers more often than I care to remember on my cab and I'm so I consider this very good news :)



#17 fuzzel

fuzzel

    spaghetti code

  • VP Dev Team
  • PipPipPipPipPip
  • 2,818 posts

  • Flag: Germany

  • Favorite Pinball: yes I have

Posted 28 March 2015 - 11:03 PM

 

This should really be the new standard! I hope toxie and fuzzel will allow this.

I have no problem with this. Once it's tested we can add the changes to VP10. I don't know how much we have to change because this is all on the old VP9 basis but it's doable.

 

That's great to hear.

 

I'm actually planning to do the VP10 porting as the next stage of this, so I should be able to give you new code that you can just drop in.  I've already surveyed it, and the changes to the existing plunger code aren't too huge going from 9.9.1 to 10.  I don't think it'll take me too long.

 

The one thing I'm uncertain about is that the Type property was removed in VP10, so I feel a little bad about having to add it back.  I assume the property was removed in VP10 only because it became unnecessary when the number of available types was reduced to one ("Modern") after the "Original" type was removed (which itself makes perfect sense in that no one would ever use "Original" in a real table).  Hopefully no one has a philosophical or design-level objection to the whole idea of a Type property.

 

Yes the type property was removed because no one used the "Original" plunger object (and besides that the object was really ugly ;) ). So if you port your code to the VP10 code please remove the type also.



#18 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,069 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 29 March 2015 - 12:05 AM

Yes the type property was removed because no one used the "Original" plunger object (and besides that the object was really ugly ;) ). So if you port your code to the VP10 code please remove the type also.

 

Actually, what I was meant was that I'll have to *add it back* to VP in order to port the changes.  The main visual enhancements involve two new styles, "flat" and "custom", so the Type (or something equivalent) becomes necessary again.

 

(I certainly wouldn't add back the "Original" option to the type list, though.  It would just be to add the two new types alongside Modern.)


Edited by mjr, 29 March 2015 - 12:06 AM.


#19 fuzzel

fuzzel

    spaghetti code

  • VP Dev Team
  • PipPipPipPipPip
  • 2,818 posts

  • Flag: Germany

  • Favorite Pinball: yes I have

Posted 29 March 2015 - 12:07 AM

ah ok...well as Nike said: "Just do it" :D



#20 RYSr

RYSr

    Pinball Fan

  • Charter Member
  • 510 posts
  • Location:Mercerville (Central) NJ, USA

  • Flag: United States of America

  • Favorite Pinball: TZ - G&R - MB - CV - Metallica

Posted 29 March 2015 - 12:18 AM

Mjr.

 

Thank you so much for first fixing the nudging for Cab accelerometers and now for the Cab Analog Plungers. :otvclap: :otvclap:

 

Please add the quote below: from your post in your DIY thread to the instructions sheet or the top of this thread, I found very usefull.

------------------------------------------------------------------------------------------------------------------------------------------------------

If you pull that testing version of VP, here's my new recipe for fixing a table with a non-working plunger:

 

1.  Open the table in the VP editor.

2.  Open the table's script.  Search for "plunger".  If you see a section like "So and so's plunger hack", delete it all.  If you see anything involving timers in the KeyDown or KeyUp code related to the PlungerKey, delete it.

3.  Import one of the texture maps that came with the VP test version (choose one that fits the table style if you want).

4.  If the table already has a real plunger object positioned at the right spot, make it visible, make it Mech Enabled, set its type to Custom, set the Image to the texture you imported.  If the table doesn't have a plunger, create one and do all these same things with it, and make sure it's positioned properly.
5.  If the table had a plunger that was positioned off-screen or so that it couldn't hit the ball, move it to the real plunger position.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
A couple questions..
 
Why not just add the custom type option, why would one want to use the flat type, what's the difference, benefits of each?
 
When I tried the flat type the motion jumped four notches at a time after the first 2 or 3 notches that worked smoothly..
 
Can you also post some excerpts of code you have removed from some table scripts as examples? I assume when you say remove the code we could just rem it out as well?
 
Thanks again,
Rich
 
PS: the only remaining problem I see with the accelerometer physics is that when you nudge your cab up to make the ball bounce off of a post like the center bottom post it seems to soften the bounce instead of strengthening it. If I use a flat table test, the balls roll the right way when I tilt the cab so I know my mounting settings are correct. Perhaps you can look into this for your next project? This seems to be consistent for all versions of VP. :help: :clapping:
 

Edited by RYSr, 29 March 2015 - 12:43 AM.