Software for powering real pinball machines. 100% free. 100% open source.
25 May 2019 - mfuegemann
After some months the MPF-VPX bridge proof of concept has been brought to live for real. We were able to successfully link MPF and VPX so that the VPX table is emulating the hardware for a MPF machine. After the first successful switch hits and lamp states have been sent, the functionality of the bridge has been extended. At the moment, lights, switches and solenoids are handled to fully. Mechs and Magnets are still missing but will be worked on in the future.
The bridge will connect to the running MPF machine when you start your VPX table. As the VPX table is used only to emulate the hardware and should not contain any game logic.
At the moment the latest VPX platform is contained in MPF 0.53 dev (see: Installing dev version). This version is currently necessary for the bridge to work. However, this will very likely make it into the upcoming 0.53 stable release. You can also read our Documentation about the VPX platform.
Copy the file register_vpcom.py
to your local machine.
To register the bridge run a CMD shell as Administrator, then
python register_vpcom.py --register
(You can use --unregister
to uninstall the bridge)
In your config.yaml
configure virtual_pinball as your platform:
hardware:
platform: virtual_pinball
or if you already have physical hardware configured start MPF with the --vpx
commandline option (similar to -X
):
mpf both --vpx
In VPX you need to adjust your script to talk to MPF. You can also looks this up in the example project inside the bridge repository. The GameName set in VPX is not used to check or validate the MPF machine.
Set Controller = CreateObject("MPF.Controller")
MPFTimer
with an interval of 10 to 50ms. Keep this well below the minimal default_pulse_ms
set in MPF for solenoidsSub MPFTimer_Timer
to update all the lights and solenoidsSub CheckAutofireCoils
to disable/enable the bumperSub CheckAutofireCoils
Slingshot_Slingshot
and Bumper_Hit
eventsController.Switch(MPFSwitchNumber)=SwitchState
to the Switch_Hit/_Unhit
events. Use “” to include string type numbersController.PulseSW(MPFSwitchNumber)
to the Switch_Hit
event of targets, slingshots and bumpersInitLamps
Sub UpdateLamps
add a case for every MPF light and LED number, setting the state of the VPX lamp/LED. Use “” to include string type numbersInitLamps
Sub UpdateGI
add a case for every MPF gi string number, setting the state of the VPX GI collection. Use “” to include string type numbersInitLamps
Sub UpdateFlashers
add a case for every MPF flasher number, setting the state of the VPX flasher. Use “” to include string type numbersSub InitSolenoids
, to initialize them als False
Sub UpdateSolenoids
add a case for every MPF coil number, setting the state of the VPX solenoid. Use “” to include string type numbersSolenoids
and KeyUp/KeyDown
) as in the demo table. Flippers are handled as autofire coils and can be enabled/disabled using hrdware rules.To exit a game shut down the VPX table first
Any problems getting VPX and MPF to work? Let us know in the MPF-Users forum!