Skip to content

X-Men

Build guide-heavy development with 3D art, troubleshooting, and scripting for X-Men (Stern 2012).

Build Notes

GI Lighting Architecture (X-Men Stern)

X-Men GI architecture:

  • One main GI power string (unmodulated) from PinMAME
  • 3 GI relays: Normally ON, output to solenoids 54/55/56 (manual says 44/45/46). Outputs are inverted (normally On)
  • Bottom spotlights and backpanel lights: Wire directly to main GI power
  • Playfield LEDs: Behind their color relay (powered if GI on, modulated by inverse of relay)

Result: 4 GI lightmaps needed: base (backpanel/spots), white, red, blue

During villain modes, GI switches colors (e.g., Shadow King = blue only, Sentinels = red/blue for purple).

Contributor: niwak

Physical VUK Design (Replacing cvpmBallstack)

Best practice for VUKs (replacing old cvpmBallstack which destroys/creates balls):

  1. Cut hole in playfield and extrude receiver cup (separate mesh or part of playfield)
  2. Place switch at bottom triggering ROM switch
  3. On ROM solenoid, use KickBall code (from LOTR) to eject - better than VPX kickers
  4. Deactivate ROM switch on solenoid fire (not unhit, to handle 2-ball corner case)

Using walls/ramps for cup geometry. KickBall sub does same as VPX KickZ but without kicker object lock issues. No kicker objects means no ball destruction.

Contributors: niwak, apophis79

Cone-Shaped Scoop for Multi-Ball Handling

For scoops that need to handle multiple balls: make physical hole cone shape so one ball must sit almost directly on top of other. No room for balls to get moved to side and jam on edges.

Works reliably with 2 balls. Made as collidable primitive in Blender.

Contributor: sixtoe

Shooter Lane Wall Height Best Practice

Collidable primitive wall at shooter lane entry was only 15-20 units high (under ball's equator), causing balls going fast through Cyclops loop to roll up into shooter lane.

Fix: Set shooter lane platform at 25+ units high (about half ball height). This prevents balls from clearing wall at speed.

Contributor: sixtoe

VPX Table Image Setting for Lightmapper Tables

VPX table image must be set to VLM.NestMap2 (not blank/0) for correct playfield lighting on lightmapper tables. Setting it to 0 causes GI-off texture to display permanently, making playfield appear as if GI never dims.

This is base playfield texture that gets lit by lightmap system.

Contributors: sixtoe, flux5009

Slingshot Animation Variable Bug Fix

Lines 1008 and 1050 (sling prim enable):

Case 3:x1 = False:x1 = True:y = -10

Should be:

Case 3:x1 = False:x2 = True:y = -10

Second variable was being set to same as first, preventing proper sling animation state management.

Contributor: skillman604

Mods as Separate Bake Collections

To add optional mods (like Blackbird model, Sentinel figure): create 'Mods' collection set to 'Split' in VLM.Bake, move parts into it (use short names for name length limits). Set sync property to toggle visibility.

Simple for static toys. Gets harder with lights involved - need separate lighting scenarios. For replacement mods, both original and mod go in Mods collection; decide which gets 'hide' option.

Contributor: niwak

Stern X-Men Nightcrawler Target Solenoid Logic

Nightcrawler (pop-up) target latch and up solenoids were swapped in script, plus inverted logic. Targets have latching mechanism - latch solenoid holds them up, up solenoid pops them.

Getting these wrong causes targets to drop too soon. Nightcrawler fixes are sensitive and can affect mode completion (NC hits count from Xavier scoop or Iceman ramp too).

Contributor: apophis79

Staged Flipper Implementation (Modern VPinMAME)

Modern VPinMAME handles staged flippers automatically. Old StagedFlipperMod approach (with KeyUpperRight) is deprecated and broken.

Fix:

  1. Remove StagedFlipperMod code entirely
  2. Uncomment standard solenoid callback for upper flipper
  3. Remove custom keydown/keyup staged flipper handling (keep only button animations)
  4. Don't separate upper/lower flipper calls on non-staged tables

Standard solenoid definition is all that's needed. VPinMAME 3.7+ handles staging internally.

Contributors: robbykingpin, primetime5k

Inlane Ball Velocity Dampening

Add ball velocity dampening code to inlane switch hit subs to address "slippery" lane feel. Code slows down ball and removes spin when it passes through inlane switches. Apply to both left and right inlane hit subs.

Contributor: apophis79

VPX Day/Night Slider Integration

When migrating table brightness settings from DMD menus to F12 Tweak Menu: Day/Night is managed automatically by VPX, not stored in table's INI file.

If "Automatic Day/Night" is checked in VPX Video Options (global or table override), it overrides user input. Brightness and Day/Night cannot easily be synced between old DMD menus and F12.

Recommendation: Migrate fully to F12 Tweak Menu and use Day/Night instead of custom brightness.

Contributor: bhitney

VR Room as Table Option

VR rooms can be added as F12 Tweak Menu options. Implementation supports multiple room choices (e.g., Minimal, Mega Room 1, Mega Room 2). VR room objects are toggled via visibility.

Table option code:

val = Table.Option("VR Room", 1, 2, 1, 1, 0, Array("Minimal","Ultra"))

Collections of VR objects need to be properly defined for toggling.

Contributors: dardog81, bhitney

Scripting

gBOT vs GetBalls for CoR Tracker

Replace gBot with GetBalls in CoRTracker.Update to avoid Cor.BallVel subscript out of range errors. Error occurs when ball gets destroyed or created outside tracked gBOT array.

Using GetBalls catches all balls regardless of creation method.

Syntax:

dim str, b, AllBalls, highestID : allBalls = getballs

Contributors: niwak, apophis79, jsm174

Debug Command to Find Stuck Ball Positions

To find stuck ball positions on tables that don't destroy balls, paste this in debugger window:

dim b,i:b=getballs:for i = 0 to ubound(b): debug.print b(i).x & " " & b(i).y & " " & b(i).z: next

Open debugger after ball gets stuck, paste, and press enter to get X/Y/Z of all balls.

Contributor: apophis79

Quick Test for Blackbird Scoop with Multiple Balls

To quickly test blackbird scoop with 2 balls: lock one ball in Magneto, get second ball, put it in scoop, then run in debugger:

for each b in gBOT:if b.y < 1810 then:b.x=195:b.y=1040:end if:next

This rips balls from Magneto into scoop. Breaks game eventually but good for quick scoop testing.

Contributor: apophis79

KickZ Parameter Reference

Kicker.KickZ(angle, speed, inclination, heightz):

  • angle: Direction in X-Y plane relative to kicker's red arrow (always in degrees)
  • speed: Kick strength
  • inclination: Vertical angle (90 = straight up). Accepts both degrees and radians (VPX auto-detects)
  • heightz: Ball Z offset (avoid using)

KickZ is documented in CommandReference.txt in VPX directory and at docs.orbitalpin.com/kicker.

Contributors: apophis79, niwak

IceMan Ramp Hold Logic (Moving Ramp Safety)

IceManHold variable prevents ramp from moving while ball is on it (you can't move collidable primitive safely with ball on it).

Two critical hit subs must exist:

Sub IceRampEnd1_Hit:IceManHold = IceManHold - 1:End Sub
Sub IceRampEnd2_Hit:IceManHold = IceManHold - 1:End Sub

Without these, ramp gets stuck after its initial positioning because hold counter never decrements.

Contributors: niwak, sixtoe

Rotating Disc Visual Speed vs Physics Speed

To make turntable disc spin at different visual speed than physics speed (e.g., physics needs high speed to affect balls, but visual should be normal):

Disc_BM_Dark_Room.RotZ = (Disc_BM_Dark_Room.RotZ + (ttSpinner.Speed/4)) Mod 360

Set turntable speed to 100 (high for physics), divide by 4 for visual rotation. Turn off GrabCenter on magnet. The /4 ratio controls visual-to-physics speed difference.

Contributor: sixtoe

Iceman Ramp Working While Ball Rolls On It

To make Iceman ramp work with balls rolling on it: use platform wall with two long thin flippers on top that rotate to simulate ramp walls. Flippers sweep ball left/right as ramp moves.

Key requirements:

  • Update ramp position on 1ms timer
  • Continuously update ball velocity to point in ramp direction while on ramp
  • Ramp now rotates at correct speed matching real table

Contributor: apophis79

Dynamic Magnet Strength for Multiball Start

On real X-Men, Magneto chains balls in line via magnetic field then spins them. cvpmMagnet's origin X/Y coordinates and size are public properties and can be modified in script.

DonkeyKlonk confirms dynamic X/Y adjustment works (used in Secret Agent for magnet on turntable). To increase magnet power only during multiball start: listen for correct ROM sound command (like LOTR approach) and temporarily boost strength. Magnet size can be adjusted via solmod value.

Contributors: sixtoe, apophis79, manners7344, donkeyklonk

3D & Art

Playfield Insert Masks Workflow (Krita)

To create BW masks for inserts and wood in Krita: add transparency mask, use magic wand tool to select color patches, remove them from transparency mask, then finish details with brush tool (use X key to switch between white and black).

Playfield image stays untouched - separate BW masks toggle between materials in Blender via mix node.

Contributor: niwak

AI Upscaling for Cartoon Artwork

Cartoon-style playfield artwork (like X-Men's comic book art) upscales very well with AI upscaling tools. Flat colors and clean lines of cartoon/comic art produce much better results than photographic or realistic artwork.

Contributor: sixtoe

Playfield Translucency for Backlit Areas

For playfield areas that are backlit (lit from behind through plastic/mylar, not traditional inserts), approach is to use plastic decal material for playfield and test translucency result. Need to know shape of holes underneath.

Translucency trick works well for rendering these backlit areas realistically.

Contributors: niwak, sixtoe

Wood Mask Purpose and Creation

Wood mask is BW mask that toggles between real wood material and playfield image overlay. Black (or white) marks where wood is visible, including cutouts. All visible wood should be masked.

Mask doesn't need to be perfect - even imperfect masks work well enough since blending is subtle.

Contributor: niwak

Magneto Turntable Flasher Configuration

X-Men turntable (Magneto disc) has 4 flashers underneath in 2 groups of 2 (flashers 19 and 20). Disc has cutouts around circumference edges. Light shows through holes and around edges. Disc itself is opaque.

Effect can be done VPX-side or with primitive object with light below showing through.

Contributor: sixtoe

Blender Toolkit Bake Resolution and Multi-Res

Toolkit supports multi-resolution baking with automatic splitting of objects that don't fit in single texture. Render settings for X-Men final: ~4K render resolution (6K for some elements).

Process includes automatic nestmap splitting. Bake times: approximately 6 hours for full run. x86 VPX has memory constraints for textures; x64 has no limits.

Contributor: niwak

Auto-Plastic Generation from Images

Toolkit's auto-plastic feature generates realistic-looking plastic pieces from source images: place image on primitive, apply auto-plastic settings, and use Blender's knife tool for shaping.

Results are surprisingly good even from low-res source images. Works well for quick replacements - especially useful for clear plastics with printed artwork that interact with flashers and translucency.

Contributor: niwak

GI Baked to White for Tinting Flexibility

Bake each GI string to separate white lightmap, then tint in VPX.

Advantages:

  • Easy adjustment of GI colors
  • Support for color mods (like 7-color GI mod)
  • Default matches real table colors, then users can customize

Process: Blender exports white HDR, VPX colors and tonemaps it. Same technique used for LED/Incandescent switching in Iron Man.

Contributor: niwak

Ball Reflections on Magnets - Circular Roughness

Real pinball magnets have circular milling marks, not mirror polish. Add circular roughness to magnet materials in Blender to:

  1. Make magnets visible in-game (pure reflection makes them invisible)
  2. Prevent static reflections of nearby toys being obviously wrong when toy moves but baked reflection doesn't

Ball marks on disc magnet add further realism.

Contributor: niwak

Playfield Print Bump Mapping (Freezy's Tutorial)

Added playfield print bump mapping following Freezy's VPE tutorial. This gives printed areas (like insert letters) visible depth - raised/sunken edge effect visible on real playfields.

Fairly experimental but adds depth perception. Works in Blender's material system. Real X-Men insert letters have solid borders with transparent interiors over frosted plastic inserts.

Contributor: niwak

X-Men Insert Letter Construction

X-Men character name inserts are large circular inserts with clear top layer over frosted white plastic. Letters have solid dark borders with semi-transparent interiors. Yellow X portion is part of decal but semi-transparent. Light bleeds through all areas slightly.

For accurate rendering:

  • Use 2-layer setup (like 3D inserts)
  • Make letters fully transparent
  • Show insert plastic underneath
  • Add letter borders to playfield texture

Contributors: sixtoe, niwak

Best Practices

playfield_mesh vs playfield_physics Naming

playfield_mesh is special name in VPX - it's primitive used for playfield rendering (needed for special reflection render path). If collidable, it also does physics.

playfield_physics (or any other name) is just regular physics object with no hardcoded naming convention. playfield_mesh name is only special for rendering, not physics.

Set collidable=false on playfield_mesh if you have separate physics object.

Contributor: niwak

Ramp Physics - Don't Touch Ramp Entrances

Ramp Entrance Modifications

When adjusting ramp visuals in Blender, avoid modifying ramp entrance area where balls ramp up.

Changing this can completely alter game physics and takes ages to re-tune. Decreasing height portion is safer to modify. If ramp shapes must change, keep entrances and exits in same position.

Use blueprints to align plastics/ramps, then adjust plastics to fit rather than moving ramps.

Contributors: niwak, sixtoe

Pink-Through-Black Ramp Alignment Test

Quick way to check ramp-to-wall alignment in VPX editor:

  1. Remove all textures and materials from metal walls (turns them pink)
  2. Make ramps solid black
  3. If you can see pink through black ramps, alignment is wrong

Simple visual test without needing to run table.

Contributor: sixtoe

Troubleshooting

Playfield Mesh Alignment Causing Ball-Eating Scoop

Playfield physical mesh's 0,0 origin point was off-center (shifted left and down), causing blackbird scoop to eat every ball fed from right side of pop bumpers.

Fix: Realign mesh origin. Also added bevel to blackbird hole edges to allow wall-riding.

Mesh offset explained why balls were consistently funneling into scoop.

Contributor: sixtoe

Spotlight Shadow Depth Bias Fix

Shadow depth bias conflict: editor set spotlight shadows with priority, but script set RTX shadows with 1+ prefix on Z values, layering them on top.

Fix: Add +1 to spotlight shadow Z values in script as well.

TLDR: depth bias gave spots priority, script gave RTX priority = broken. Z positions are initialized in script and need separation between shadow layers.

Contributors: sixtoe, apophis79

Crossed Wall Edges Preventing Blender Export

Circular walls surrounding switch with overlapping/crossed edges won't export to Blender.

Fix: Uncross the edges.

Unknown if crossed edges cause VPX physics problems, but fixing them resolved export issue. Objects copied between VPX files can sometimes become corrupt - may need to recreate rather than copy.

Contributor: sixtoe

Wolverine Bash Toy Hit Registration Fix

Full-velocity hits on Wolverine bash toy sometimes don't register because ball collides with dumb blocking wall slightly behind switch-active wall. Thin margin between them causes physics engine glitches at high speed.

Fix: Increase margin between switch wall and blocking wall, or reshape blocking wall to curve away, giving more space for switch to activate first.

Contributor: apophis79

VPX Memory Leak and Texture Issues

VPX Memory Management

VPX leaks memory from table to table and play to play. Heavy tables like X-Men need VPX freshly started.

Symptoms: Images get downsized (blurry) or drop entirely (white areas). Check image manager for "downsized" markers.

Fix: Restart VPX completely. Also check Task Manager for residual VPX processes after closing - end-task those.

Running VPX as admin may improve performance. x64 VPX eliminates memory limits.

Contributors: niwak, sixtoe, leojreimroc

VPReg.stg Settings Storage for Table Options

Table option settings (from Flex/Magna menus) are saved in Visual Pinball\User\VPReg.stg. Can be inspected with 7-zip (right click > 7-zip > Open archive). File is read-only.

If running VPVR from subfolder, it creates its own User folder with separate settings. Settings from one VPX installation won't transfer to another in different directory.

Contributor: apophis79

EXR Texture File Size Bloat

Opening EXR texture in GIMP, modifying, and resaving can cause massive file size increase (8MB to 80MB). GIMP and Krita both have issues with EXR file handling.

For EXR texture edits: Preferred workflow is to use Krita or handle modifications through Blender pipeline rather than editing EXR files directly in image editors.

Contributor: sixtoe

x86 vs x64 Memory Issues on Toolkit Tables

x86 VPX Limitations

Toolkit tables (X-Men, Iron Man, TZ) are designed for x64 VPX.

x86 has 4GB address space limit which is too small for high-res lightmapped textures. 4GB patcher is useless (VPX exe is already marked).

x86 symptoms: E_OUTOFMEMORY errors, textures downscaled or dropped.

Solution: Use x64 VPX. PinMAME crashes can occur on both x86 and x64 - that's separate emulation issue.

Contributor: niwak

Hardware

Stern X-Men Apron Flashers

X-Men has 2 flasher bulbs in apron. Yellow triangle areas on apron are translucent lights (not decorative). If they're not listed in lamp or solenoid matrix, they're GI.

2 bottom spotlights are on white GI string (directly wired to main GI power, not through color relays).

Contributors: sixtoe, niwak

Game Knowledge

X-Men LE vs Pro Differences

Key differences:

  • LE: Spotlight in lower position (to let ramp pass)
  • Pro: Spotlight higher
  • Non-LE version: Uses Newton cradle instead of Wolverine figure
  • Wolverine LED assembly in LE manual was never actually used in production (dropped before final release)

Manuals are printed late in development and can contain errors. Nightcrawler lights inside figures = aftermarket mod (not factory).

Contributors: sixtoe, niwak