-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auditor: Missing switches, optional player vars #1757
Merged
avanwinkle
merged 33 commits into
missionpinball:dev
from
avanwinkle:auditor-missing-switches
Feb 22, 2024
Merged
Auditor: Missing switches, optional player vars #1757
avanwinkle
merged 33 commits into
missionpinball:dev
from
avanwinkle:auditor-missing-switches
Feb 22, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Quality Gate passedIssues Measures |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR provides some improvements and functionality to the MPF Auditor to assist users in debugging their games.
Missing Switches
This PR adds switch detection logic to the Auditor to track the number of games since each switch has been triggered, to help users identify if a switch may be disconnected or malfunctioning. The default setting is 10 games, but this can be customized via config file with the
missing_switch_min_games
option.Missing switches will be identified in the Audits Service Menu, including the count of games since the switch was detected. For advanced users who want to display a secret light, DMD pixel, or display widget to alert at-a-glance, the Auditor's
report_missing_switches()
method can be called.Switches tagged with the
no_audit
tag will not be tracked, to avoid false alerts from non-game switches (like service menu buttons).Saving Audits
This PR allows more flexibility with how frequently the Auditor writes audit data to disk, which can alleviate I/O pressure during gameplay by not writing a new file (from scratch!) every time a switch is hit. For backwards compatibility the autosave is defaulted to be on, but can be disabled with the config option
autosave: false
.AutoSaving Events Only
However custom events may want to be autosaved (while not autosaving player, switch, and shot audits), so there is an additional config option
autosave_events: true
which will autosave the audits whenever an audit event occurs.Disabling Shot Audits
Some users may not want to audit all of the shots in the game, so the config option
audit_shots: false
can be set to ignore shots and only log switches.Enable/Disable the Auditor
This PR also adds
enable_events
anddisable_events
to the Auditor config, so users can control when the auditor is active. The default values aregame_starting
andgame_ended
, for backwards compatibility with the previous hard-coded behavior.Don't Audit Coin Switches during Free Play
Similar to the existing
no_audit
switch tag to prevent auditing of non-game switches, a new tagno_audit_free
can be applied to switches that are for paid games only (e.g. coin slots). When tagged withno_audit_free
, these switches will not be tracked as "missing switches" while the game is in Free Play mode.Auditing Player Variables when Undefined
This PR introduces a change to how player variables are audited. For every audited player variable, the Auditor tracks the number of audits, the average audit value, and a number of the highest recorded values (configurable with
num_player_top_records
, default 10). However some player variables may only apply to players who reach a certain point of the game, and should not be audited for players who don't.BREAKING CHANGE
This PR changes the player variable audits so that player variables that are not defined for a player are not included in the audit. Without this change, every player would have a value of 0 for the variable and the average value would be dragged down. With this change, only players who have a value set for that player variable will be counted.
MITIGATION TO BREAKING CHANGE
For player variables that should be audited for every player, even if the value is zero, that player variable should be initialized in the game config like so:
Any value initialized in the
player_vars
config will be audited (because it is initialized in the player object), and any value set withvariable_player
will be audited (because it is added to the player object). Only values that are never set will be discarded during the audit top/total/average calculation.Other Stuff
Volume Buttons from 10% to 5%
This PR reduces the service button volume controls to move in 5% increments instead of 10% increments, for finer control.
Typo typo typo
This PR fixes a typo for the config value
events_when_reorder_balls
, which was mistyped asevents_when_reoder_balls
Event Handler Removal
This PR cleans up more event handlers created by the Auditor, to prevent memory leaks