Skip to content

Medieval Madness (Williams 1997)

Active toolkit conversion build (2021-2025) led by apophis79 with sixtoe, tomate80, niwak, iaakki, flupper1, tyson171, and majordrain. Notable for AI-generated 3D toy models (castle via Hunyuan), HandleMech fix for drawbridge/stepper motors, PWM incandescent bulb fade physics analysis by niwak, and PAPA video overlay flipper calibration. One of the first VPW tables to use AI-generated 3D models.

Build Story

Medieval Madness showcases the evolution of VPW's toolchain -- from traditional modeling to AI-generated castle and dragon toys via Hunyuan, from pre-toolkit GI techniques to full VLM toolkit conversion, and from basic incandescent simulation to niwak's physics-based PWM bulb fade model. The build also produced the definitive documentation on HandleMech issues with stepper motor mechanisms and the importance of preserving seemingly unused constants in system VBS files.

Table-Specific Details

Mechanisms & Hardware

Drawbridge HandleMech fix: Drawbridge solenoids stopped triggering during gameplay (but worked in self-test mode). Root cause: PinMAME mech handling interferes with table-side mechanism scripting (GitHub issue #226). Fix: set HandleMech=0 in the table script. Applies to any table using stepper motor mechanisms.

Drawbridge initialization timing: The drawbridge limit switch initialization must occur in Table1_init AFTER the PinMAME timer is started. Initializing too early (before PinMAME is ready) causes the drawbridge to not respond during gameplay, though it works in self-test mode.

Troll mechanism: The troll head (which vibrates on hit) must be a separate primitive from the troll lift (which stays still during vibration). If combined, the entire mechanism vibrates unnaturally. The head vibration simulates the real table's spring-mounted troll heads.

cSingleLFlip/cSingleRFlip constants: These constants must not be removed from table scripts even if they appear unused. Removing them broke troll solenoid functionality because they are referenced by the system VBS files for flipper and solenoid management.

Portcullis opto switch sw37: The portcullis pushes into the opto beam when hit while locked, triggering the switch. The switch pulse must be preserved in the DoorPortculis_Hit sub or gate hits do not register to the ROM.

Damsel tower lamp L15: Lit through a hole drilled in the back wood panel of the table. Factory original, not a modification -- confirmed by tyson171's WPC specialist.

Moat flasher green color: Achieved by placing a warm white light underneath green-tinted plastic. The light itself is not colored; the plastic acts as a color filter, matching how real machines produce colored flasher effects.

Art & Visuals

AI-generated castle model (Hunyuan): Generated using the Hunyuan 3D app with multiple iterations combining AI output with manual refinement: generate base model from reference photos, adjust proportions manually, apply displacement and normal maps for worn stone appearance. Significant cleanup required but saved substantial modeling time.

AI-generated dragon model: Generated from eBay listing photos of the real toy. Body and wings processed separately through the AI pipeline then combined. Multiple reference angles from product listings improved output quality.

Pop bumper GI splitting for purple lightmaps: MM's purple pop bumper caps required splitting bumper lights into separate collections. Top bumper on upper GI, bottom two on middle GI (separate GI groups on the real machine). Render white lightmaps in Blender, tint to purple in VPX.

GI string assignments: "There are never any GI diagrams, it's infuriating." tyson171 provided flasher, GI, and individual lamp test videos from his original MM to resolve string assignments.

Physics & Gameplay

Flipper angle calibration from PAPA overlay: apophis79 overlaid the PAPA tutorial video with the VPX table. Initial angles were too extreme (too flat). Correction: raised both up and down positions approximately 4-5 degrees. The flatter angle generated too much velocity on outside shots while making center shots harder. Real table owner majordrain confirmed: post passing is easy but ball control is challenging, backhand ramp shots are low percentage, and moat feed to left flipper rarely catches cleanly with flipper held up.

PWM bulb fade physics: Insert lights appeared too binary (sharp on/off). niwak debugged by graphing the actual PinMAME brightness curve. Finding: flashing pulses keep the bulb at fairly low temperature (never reaching full power), and the cooling rate for under-powered bulbs may be too fast. Workaround: select Linear fader in VPX for smoothing, though this makes lights slightly dimmer.

Low-poly collidable castle: The visual castle model is too complex for physics. Separate "huge low poly collidable castle prim" handles all ball physics while the detailed visual model is non-collidable.

Merlin scoop ball sticking: Two balls getting stuck in the Merlin scoop during multiball is realistic behavior on real MM tables. sixtoe: "the Merlin scoop acts like that irl so I went out of my way to replicate it."

Known Issues

Primitive naming with special characters: Names like Wire_Guide_2"1/2___Thick_1/8" break VPX's auto-generated VBS array declarations. Use only alphanumeric characters and underscores.

Color ROM performance degradation: Progressive frame rate degradation traced to PAL-type colorization ROM. Suspected memory leak -- gets worse over time. Not fixable by table developers. Removing the color ROM eliminates the stuttering.

Nestmap bloat: Large black areas in nestmaps from under-playfield blocker wall meshes consuming nestmap space. Fix: delete mesh from VLM results and replace with simple VPX walls using black material.

Techniques Developed Here

See Also