MPF 0.80 changes (GMC pre-release)
Last updated May 25, 2024
The upcoming release of MPF is 0.80, which includes support for the Godot Media Controller (GMC) and drops support for the 0.57 Kivy-based Media Controller (MC).
While there are not many functional changes in MPF between 0.57 and 0.80, there are some config file migrations necessary and this document will help you through that.
See also: Installing MPF 0.80 and the GMC
List of Required Changes
MPF and GMC version compatibility
MPF (as of 0.80.0.dev9
) contains code to check whether the installed GMC version is compatible. 0.80.0.dev9 is the first version to check this, and it requires GMC version 0.1.5 or greater.
Slides and Widgets
The GMC manages all slides and widgets, so the slides:
and widgets:
config sections are deprecated.
Sound Player
The GMC manages all sound assets, so the sound_system:
and sounds:
config sections are deprecated. You can still reference sounds by filename directly, but if you want to specify specific settings for a sound or sound pool, use the MPFSoundAsset
resource type in GMC.
Audio channel groups have been renamed from "tracks" to "buses", so in your sound_player:
config sections change track: music
to bus: music
.
Sound Pools
The GMC includes support for sound pools using the AudioStreamRandomizer
resource type. You can combine this sound pool with MPF-specific sound properties by creating an MPFSoundAsset
resource and using an AudioStreamRandomizer
as the stream.
Using MPF Sound Pools
If you have a large project with many sound_pools:
defined in MPF configs, it is possible to continue using them until you migrate them to GMC. This hack is not officially supported, and may have unintended side-effects, so use with caution.
To enable sound pools in config files, you will need to install the legacy MPF-MC in your virtual environment with pip install mpf-mc
. This will cause the MC to inject the sound pool configurations into MPF 0.80
Note: While MPF will manage the sound pools, it will not be able to map sound pool sound names to files configured in a sounds:
config section (which is no longer supported). Your sound pools *must use the name of the sound file as the sound name or GMC will not be able to find the correct file.
Changes to default modes
Many of the modes provided for optional use with MPF have been changed, and may require you to make changes to maintain compatibility.
Bonus Mode
The bonus config spec has changed to use the keyword entry
instead of event
when defining bonus entries, because Bonus events have changed to use a consolidated bonus_entry event instead of unique events for each bonus item (including subtotal, multiplier, and total).
In your bonus.yaml config section, change each entry from event: bonus_item_name
to entry: bonus_item_name
.
With this change, given a bonus entry named "completed_ramps" that was hit 3 times for a score of 3000:
MPF 0.57 Event:
completed_ramps{hits=3, score=3000}
MPF 0.80 Event:
bonus_entry{entry="completed_ramps", hits=3, score=3000}
Bonus default slide
A default Godot slide for the bonus mode has been provided. You may duplicate this slide to your own slides folder to use as a base for your own layout and customization.
Carousel Modes (updated in 0.80.0.dev10
)
Carousel events have changed to use a consolidated carousel_item_highlighted and carousel_item_selected event instead of unique events for each item.
Given a carousel mode "missionselect" and an item "garrus":
MPF 0.57 Event:
missionselect_garrus_highlighted{direction="forwards"}
MPF 0.80 Event:
carousel_item_highlighted{carousel="missionselect", item="garrus", direction="forwards"}
The new carousel_item_highlighted event is incorporated into GMC, but if you have other custom event handlers for carousel item selection those will need to be updated.
High Score Entry/Award Mode
The built-in high score mode has had some significant changes, including breaking changes to which events are automatically posted by the mode.
Default controls for high score name entry slide
The controls for scrolling through the text entry options and for submitting the selected item are now included by default with MPF.
If you have set the tags start
, left_flipper
, and right_flipper
on switch devices, those switches will automatically take control
of the high score interface. Left and right will change the selected item, and Start will select the item or submit the name when complete.
If you do not use these tags, or wish to use your own controls, see the event_player
entry in the MPF codebase high_score.yaml
config for information about the text_input{action:left|right|select}
events that GMC uses to control the Godot slide.
High score event changes (updated in 0.80.0.dev10
)
Like carousel, high score events have also changed to use static naming, with all dynamic information being consolidated in the event parameters.
The events high_score_award_display
, (award_name)_award_display
, and (category_name)_award_display
have been reduced to just high_score_award_display
. Award name is available as the parameter award
,
category name is the parameter category_name
, and the parameters player_num
, player_name
, and value
are also available.
High score default slides
Default Godot slides for the name prompt and award display have been provided -- if you duplicate them to your own slide folder with the original names, your duplicates will be used in place of the defaults.
Tilt mode slides
The 0.57 tilt mode contained slides for tilt_warning_1
, tilt_warning_2
, and tilt
.
0.80 only contains a single slide, named tilt
for all three cases.
If you wish to customize your tilt slides, see the slide_player
entry in the MPF codebase tilt.yaml
config for examples.
Something missing or wrong? You can fix it!
This website is edited by people like you! Is something wrong or missing? Is something out of date, or can you explain it better?
Please help us! You can fix it yourself and be an official "open source" contributor!
It's easy! See our Beginner's guide to editing the docs.
Page navigation via the keyboard: < >
You can navigate this site via the keyboard. There are two modes:
General navigation, when search is not focused:
- F , S , / : open search dialog
- P , , : go to previous page
- N , . : go to next page
While using the search function:
- Down , Up : select next / previous result
- Esc , Tab : close search
- Enter : go to highlighted page in the results