In part 2 of the “nFozzy Physics How-To” I’ll cover the steps needed to implement nFozzy’s physics extensions for rubber posts, rubber pegs, and rubber sleeves. nFozzy felt the elasticity and elasticity fall-off settings were somewhat limited in simulating the correct behaviors for these objects. From what I can recall, he determined this by directly comparing VPX behavior to real world behavior through a series of controlled tests. Using the results, he developed scripting that gave him better control over the elasticity fall-off curve. Similar to his flipper solution, it allows the author to create a profile of elasticities over a range of velocities. Given the amount of science behind nFozzy’s work, I recommend authors leverage the profile he created as part of his solution.
The first step is to create the physical objects in the editor. nFozzy was a fan of using simple primitive objects (boxes and cylinders) as the collidable objects for rubbers, posts, pegs, and sleeves. I didn’t initially understand his preference, but over time I’ve become a big fan of this method. It allows for easier/better control over the differences in physics between posts and bands. The one exception to this is using a wall object instead of a primitive box for slings. Below is an example of using simple primitives and a wall object to replace rubbers as the collidable objects.
I recommend using physics materials for controlling the physics settings for your collidable rubbers. I will cover that more in Part 3. For now, I recommend you use the following settings for your rubber posts, rubber pegs, rubber sleeves, and rubber bands.
|Elasticity||Elasticity Fall-off||Friction||Scatter Angle|
The second step will be to create two new collections. Name them “dPosts” and “dSleeves”. Edit the collections and make sure “Fire Events for this collection” is checked.
The third step is to add all rubber posts and rubber pegs to the “dPosts” collection and all of the rubber sleeves to the “dSleeves” collection. Make sure “Has hit Event” is checked for all objects in these collections and set the hit threshold to “0.5”.
The fourth step will be to add the rubber elasticity (dampener) scripts to your table. This includes hit events for the “dPosts” and “dSleeves” collections and initialization of the elasticity curves.
You’ll also need a function called CorTracker. This tracks the velocities of the balls and allows the script to appropriately adjust the velocity of ball. CorTracker is also used by Fleep’s sound package on the drop target tutorial. You’ll need to add a new timer in the editor called “RDampen”. Enable it with an interval of “10”.
Some of the supporting functions are included in the Flipper Functions script. If you haven’t already completed Part 1 of the tutorial on your table, make sure to also include the Flipper Functions script in your table.
I’ve included an example table that includes both Part 1 and Part 2 of the tutorial.