Defender¶
Early Blender lightmapper toolkit test case featuring rendered projected textures, GI ON/OFF mesh fading with Lampz, and dynamic shadows for drop targets.
Build Notes¶
Playfield Dimensions¶
Table height was set to 1968 (instead of standard 2000+) to match the playfield scan aspect ratio without distorting the image.
Rendered Projected Textures vs Baked Textures¶
Bord offered to do rendered projected textures rather than baked textures. He reused many parts from Flash and Stellar Wars builds since the Williams era tables share similar components. Modeled a new classic Williams apron from a Pinside scan find that fits better than the generic one.
GI ON/OFF Mesh Fading with Lampz¶
GI ON and OFF states use separate meshes with material fading controlled by Lampz. Created ON_Prim (Layer 2) and OFF_Prim (Layer 3) collections.
Toggle GI from debugger:
- SetLamp 0,0 (off)
- SetLamp 0,1 (on)
Reducing DL (diffuse level) on mesh_off primitives controls brightness of objects during GI-off state.
Roth Drop Target and Standup Target Implementation¶
Modified the Roth drop target code to animate two DT primitives together (one for GI ON, one for GI OFF) so both get animated even though only one is visible at a time. First implementation of Roth standup target code for apophis.
Version 019 added dynamic shadows and drop target shadows. Separate drop target shadows can be scripted in when targets move.
VR Room with Hybrid Mode¶
Uncle Paulie added a fully working hybrid mode for desktop, cab, and VR. VR options include two rooms, a clock, a topper, and 2 posters. Animated backglass for VR and desktop.
Script controls:
- VR_Room = 0 or 1
- cab_mode = 0 or 1
- Desktop is both zeros
Auto-detect cab_mode¶
Auto-detect cab_mode instead of requiring manual script changes:
Dim cab_mode, DesktopMode: DesktopMode = Table1.ShowDT
If Not DesktopMode and VR_Room=0 Then cab_mode=1 Else cab_mode=0
The VR_Room flag overrides DesktopMode, so users only need to set VR_Room.
Wire Height Below Flippers¶
Wires below flippers were originally 15 units high, causing a cab nudge exploit where the ball bounced off them instead of draining.
Fix: Wire height should match actual wire thickness. Set to ~3.5 units on Defender. HauntFreaks confirmed wire height should match actual wire thickness.
Ball Rolling Sound with Amplified File¶
Defender implemented a new approach for ball rolling sounds using the most amplified sound file. Sounds great and the example table should be updated with this approach plus ramp rolling sounds.
Minimizing User Physics Options¶
Defender shipped with basically no user-adjustable physics options - rubberizer was hardcoded on. The physics were tuned to match real machine videos by adjusting table angle, playfield friction, and flipper strength within recommended ranges.
Physics values: Flipper strength 1600 (range 1400-1600), PF friction 0.2 (range 0.15-0.25), Slope angle 5.
Scripting¶
Credit Lamp Discovery via Visual B2S Tool¶
Lamp 7 is the credit lamp in Defender. The manual and schematics list it as "Not Used" but it actually functions as the credit lamp when the game runs.
Discovered using the "All ID in 1 Visual B2S" tool: https://vpuniverse.com/files/file/4829-all-id-in-1-visual-b2s/
FlexDMD Enhancement for Alphanumeric Displays¶
Scutters created a FlexDMD enhancement that replaces the standard alphanumeric display. For VR: when setting to FlexDMD, the backglass image changes so the alphanumeric area is removed and the grill image changes for better DMD display.
Enable by pressing F1 on table load and checking "external DMD."
Updated FlexDMD options include a scanner effect mimicking the Defender video game (showing lamp and drop target states as aliens), plus a new full DMD option.
3D & Art¶
Camera Culling Fix Near Apron¶
A ramp near the apron was used as a hack to fix camera culling (VPX stops rendering planes parallel to the camera). This ramp must be set to non-collidable or it interferes with the drain path.
Flupper Williams Bats for Easy DL Control¶
Recommended using Flupper's Williams bats so DL (diffuse level) values can be easily changed for GI state matching. They also look better than default flipper meshes.
Blender Import Scale Settings¶
Tomate80's blender import scale setting: 10 (done automatically in his workflow).
Color Grading Bug Fix in Lightmapper¶
Niwak found a major bug where color grading was wrong, making renders look "video game" instead of "real pinball." Fixed in latest lightmapper version - results described as "really really better."
Troubleshooting¶
Playfield Mesh Causing Black Screen in VPX 10.8¶
In v1.1, playfield_mesh caused a black playfield and missing reflections in VPX 10.8. Root cause: the playfield_mesh was placed in the ON_Prims collection (a design specific to Defender).
Fix: Deleted old playfield_mesh and renamed playfield_mesh_on to playfield_mesh. VPX 10.8 split Visible and Physics playfield mesh handling, which broke the old approach.
Reflections Missing After Update¶
Multiple VPW tables missing reflections in VPX 10.8: Iron Maiden, Judge Dredd, Lethal Weapon 3, NBA Fastbreak, Star Wars DE, Starship Troopers, Tales From The Crypt, Jokerz.
Root cause was related to playfield_mesh primitives interfering with the render probe. Deleting primitives starting with "playfield_mesh" restored reflections. Another fix: un-tick "Use Transparency" on the "playfield" material and comment out UpdateMaterial lines.
Staged Flipper Conflict with Solenoid Callback¶
Drop target solenoid 36 stopped firing because the staged flipper code was overwriting SolCallback(36). Williams ran out of solenoids and repurposed the secondary upper flipper solenoid for a drop target.
Fix: Comment out the conflicting staged flipper solenoid callback lines.
Segmentation Fault in Standalone VPX¶
Standalone crash caused by allBalls = gBOT in the cortracker code.
Fix: Change to allBalls = getballs
Tip: 95% of ball-to-flipper seg faults in standalone are caused by allBalls = gBOT.
VR Preview Window Blocking DMD Capture¶
FlexDMD not showing in VR was caused by the VR preview window overlapping the captured DMD.
Fix: Adjust preview window size in video settings via table .ini file. The preview window takes the size defined in video options even when disabled.
VBS Join() Crash on Standalone¶
Standalone VPX crashed when doing Join() where the first array element is empty (uninitialized).
Workaround: Manually concatenate instead of using Join.
Fix was implemented in VPX source: https://github.com/vpinball/vpinball/commit/5b459c5c0fa0b50b0b5f475781b05b0cbc849641
Anaglyph 3D Fix - Empty LUT Slot¶
Tables with an empty color grading LUT slot don't work with anaglyph 3D mode.
Fix: Add a 1-to-1 (identity) LUT file. Performance impact is minor and worth the cost.
Mixed Line Endings in Scripts¶
Script contained mixed line endings (CRLF and LF). This can cause strange behavior on non-Windows platforms. Likely caused by copy-pasting code from different sources.
Center Post Alignment vs Playfield Art¶
The center post on real Defender machines is not centered between the flippers or on the art - it's offset. The real machine's hand-drawn playfield had the same alignment issue.
Decision: Keep it centered on flippers for gameplay reasons (prevents insta-drains from left-middle top rollover).
Plunger Lane Groove Simulation¶
Ramps in the plunger lane simulate a plunger groove but were 10 units high at edges, causing ball stuck issues when the diverter opened.
Fix options: 1. Create a real groove in the playfield mesh (risky - ball may not settle well) 2. Shorten the ramps to just south of the diverter
Option 2 was used as a quick fix.
Resources¶
Niwak's Blender Lightmapper Toolkit¶
Defender was used as an early test case for Niwak's blender lightmapper toolkit.
Key concepts: - VLM renders the baseline (lights-off state) automatically - A 'World' lighting collection holds all 'always on' lights - Insert lightmapping needs only the OFF cup; the ON state light is mapped onto it - For insert animations, create a collection and provide the VPX light object ID for state syncing
Required a patched VPX for lightmap support (additive blending of primitives).
Operator's Manual¶
Operator's manual available at: https://www.ipdb.org/files/651/Williams_1982_Defender_Operators_Handbook.pdf
VPUniverse Release Page¶
Release page: https://vpuniverse.com/files/file/9456-defender-williams-1982-vpw/
Game Knowledge¶
Defender Gameplay Rules¶
Shoot the four upper lanes to activate multiplier and activate the reverse kicker at the left outlane (press left magnasave at the right moment to shoot ball back). Shoot the two targets above the left upper flipper, then press right magnasave to open the diverter at the right outlane. Costs one bomb per press but you have three and can earn more.
Right Flipper Bumper Lock Exploit¶
Right flipper can lock the ball off the bumper for huge scores. This is possible on the real machine too and was confirmed as accurate behavior.
Gate Exploit After Bomb Use¶
Using a bomb to open the outlane gate at the right moment can cause the gate to stay open permanently. Can be exploited by timing bomb use. Also after a slam-tilt and quick restart, a double ball launch can occur. These are ROM quirks, not table bugs.
Drop Target Popping Ball Off Table¶
Drop target script intentionally kicks the ball up when resetting, which can occasionally pop the ball off the playfield. Fix would require glass simulation over the playfield. Rare and considered acceptable behavior.
Version History¶
Key versions: - v014: Physics complete, ready for visual work - v015: Bord's rendered meshes added, GI beneath PF - v019: Dynamic shadows, drop target shadows, nearly complete - v022: Testing-ready, gatewire animated, instruction card zoom - RC1-RC3: Release candidates, wire height fix - v1.0: Initial release (Mar 2022) - v1.0.3: Slingshot corrections, 10.8 compatibility - v1.1: Staged flippers, solenoid conflict fix - v1.1.1: Playfield mesh fix for reflections - v1.1.3: FlexDMD enhancement by Scutters - v1.2: LUT, desktop POV, reflections fix - v1.3: Standalone fixes, fortified walls - v1.4: Anaglyph LUT fix, updated FlexDMD scanner (Jul 2025)