Warning

This is the documentation the latest work-in-progress version of MPF!

This is the documentation for MPF 0.56, which is the “dev” (next) release of MPF that is a work-in-progress. This is probably ok, and means you’ll be on the latest, cutting-edge version of MPF.

However, if you want a more stable version, select the v:stable version from the lower-left corner of this page, which is the most recent version that is not getting new updates.

If you are new to MPF, we have recently rewritten the installation process which only applies to this “latest” 0.56, so you probably want to stay here because the prior installation process doesn’t work on the latest OS and Python versions.

How to design a game in MPF using Modes

This section assumes that you already configured all your hardware devices (especially all your ball device). If you did not configure your hardware please do that first. You can go through the tutorial or have a look a the mechs section.

Video about how to structure your modes:

Video about state machines (often used to implement logic in your mode):

Video about events in MPF:

This section is about laying out your modes and actually designing your game logic. It is structured into the following subsections:

Mode Selection and Game Startup

Questions answered in this section:

  • How to select modes/players during start?
  • How to implement a (timed) skill shot?
  • How does a player qualify for a mode?
  • How to start the mode?
  • Can multiple modes run at once?

Game Mode

Questions answered in this section:

  • How to track progress inside a mode?
  • How does it end?
  • Will it always succeed?
  • Can it timeout?
  • Can it restart if it failed?
  • Where will it continue on restart?
  • How to implement roll over lanes in a mode?
  • How to implement a mystery award mode?
  • How to implement a stand-up target bank mode?

Wizard Modes

Questions answered in this section:

  • How to track achievements towards one or multiple wizard modes?
  • How to start a wizard mode?
  • What to do after wizard mode?

Ball End Modes

Questions answered in this section:

  • How to start a mode after the ball for a player drained?
  • How to implement a bonus mode?

Game End Modes

Questions answered in this section:

  • How to start a mode after the last player drain his ball?
  • How to implement a highscore mode?
  • How to implement a match mode?

Other modes

Questions answered in this section:

  • Which modes run outside of a game?
  • How to control attract?
  • How do credits work?
  • How does tilt work?
  • What is the service mode?

Layering Modes Example

Examples given in this section:

  • How to define mode categories and helper modes
  • How to move in and out of game and wizard modes
  • How to track and persist progress outside of modes