Physics Engine Tuning¶
This guide covers techniques for tuning VPX physics to achieve realistic ball behavior, focusing on flipper mechanics, ball control, saucer behavior, subway construction, and rubber materials.
Flipper Physics¶
Return Strength for Ball Control¶
Flipper return strength significantly affects tip passes, cradle separation, and post passes. When tuning flippers:
- Return Strength: Reduce from 0.055 to 0.048
- EOSReturn (script): Reduce from 0.025 to 0.018
These values should be adjusted proportionally when flipper strength changes. Lower return strength gives players finer control over the ball and improves flick pass responsiveness. (rothbauerw, Indy)
Flipper Triggers and Rubberizer¶
Critical: Misaligned flipper trigger areas cause excessive ball bounciness. The flipper trigger area must align precisely with the visible flipper position. When the ball rolls along the flipper trigger perimeter, the flipper cannot contact it enough to slow it down.
On Indiana Jones v1.0, flipper triggers were accidentally moved from their correct positions before release, causing balls to roll off flipper tips without settling. This was NOT a rubberizer tuning issue but a physical geometry problem. (iaakki, rothbauerw, Indy v1.11 fix)
Rubberizer and Live Catch¶
Improved rubberizer code activates the rubber dampener only when the flipper is in the up position (at end angle), preventing unwanted ball stops during inlane rolling:
Updated rubber dampener profile with higher elasticity at low velocity for improved lane guide bounces:
RubbersD.addpoint 0, 0, 1.11
RubbersD.addpoint 1, 3.77, 0.99
RubbersD.addpoint 2, 5.76, 0.942
RubbersD.addpoint 3, 15.84, 0.874
RubbersD.addpoint 4, 56, 0.64
(rothbauerw, Indy)
Saucer and Kicker Physics¶
Saucer Hit Height and Containment¶
Changing saucer hit height to prevent ball rejects can cause the ball to fly out vertically without proper containment. Solution:
- Add an angled ramp primitive (e.g.,
sw31_prot) above the saucer - Set top side height to 0, bottom side height to ~70
- Set physical walls to 0
This prevents vertical rejects while allowing the ball to enter the saucer properly. (rothbauerw, Indy)
Subway Construction¶
Best Practices¶
- Prefer walls over ramps: Balls can fall through ramps if they stop on them, especially on steep inclines
- Wall height: Ensure physical wall heights extend above the highest point of the subway
- Catch balls at holes: Add collidable prim scoops to catch balls entering holes
- Prevent ricochets: After converting kickers to switches, add ramp-end vinyl or similar elements
- Test edge cases: Test for scenarios where multiple balls enter the subway simultaneously
(rothbauerw, sixtoe, Indy)
Rubber Materials and Behavior¶
Rubber Types in Real Machines¶
Real pinball machines use different rubber types that significantly affect bounce behavior:
- Black rubbers: Quite stiff, not very bouncy (used on fast tables like Simpsons)
- Red rubbers: More bouncy (Transporter had reds, easier game)
- Green rubbers: Super bouncy, makes tables harder to play (Fish Tales)
The rubberizer should be tuned per table era and rubber type. The team debated whether to allow players to disable rubberizer (setting to 0), as competition players used this for easier ball control, undermining realistic physics. (iaakki, Indy)
Rubber Bands¶
Rubber bands should be split into separate physics sections with different elasticity values:
- Post/curve section: Tighter rubber around posts, stiffer elasticity
- Straight section: Loose rubber between posts, more elastic
- Middle section (for larger bands): Third section with its own physics material
Important: High-poly rendered meshes should NOT be used as collidables. Export low-poly versions from C4D/Blender as invisible collidable primitives, then apply different VPX physics materials to each section.
Physics materials were shared as .mat files within the community. (benji084, bord1947, Star Wars DE)
Lower Playfield Adjustments¶
Rotation Compensation for Angled Playfields¶
Drop targets on angled lower playfields need rotation compensation. On Haunted House's lower playfield (-11 degrees):
- Standard drop target animation code modifies RotX and resets it to zero
- Lower playfield targets need an 11-degree offset added to their RotX values
- Fix: Add a Z-position check in the drop target animate sub
- If the target is on the lower playfield, add the playfield angle offset
Additionally, lower PF target primitive orientations get corrupted on each new toolkit import and must be manually re-fixed. (apophis79, rothbauerw, Haunted House)
Drop Target Physics¶
Kicking Standup Targets¶
Haunted House has standup targets that function as mini-slingshots, kicking the ball back on solid hits:
- Uses modified drop target code with adjustable kick strength
- Requires displacement threshold before kick fires
- A grazing hit causes the target to lean back without scoring
- Single leaf switch actuates both the score and the coil
This code was later proposed for Bad Cats' plunger target (vari-target). (rothbauerw, apophis79, cyberpez, Haunted House)
RotZ vs ObjRotZ Bug¶
Drop target primitives must use RotZ (not ObjRotZ) when setting their angle in the Roth drop target code. The script calculates animation angles based on the RotZ property.
Using ObjRotZ caused drop targets to appear unresponsive to hits on some systems while working on others, depending on how VPX initialized object rotation values. Changing all DT primitive references to RotZ fixed the issue universally. (apophis79, Star Wars DE)