-
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
MultiballLock blocking_facility #1596
MultiballLock blocking_facility #1596
Conversation
Mac tests passed, Linux tests failed.
|
mpf/platforms/fast/fast.py
Outdated
@@ -793,6 +793,10 @@ def get_coil_config_section(cls): | |||
"""Return coil config section.""" | |||
return "fast_coils" | |||
|
|||
def validate_coil_section(self, driver, config): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That does nothing on purpose? There should be a default implementation which actually validates this. Not sure if this is correct. I can check later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I see that now. I'm thinking that these changes may be my own workarounds for overlay platforms that you have since more-correctly fixed. I'll withdraw them from this PR and re-evaluate, thanks!
Are those two connected somehow? Maybe two PR would would be better. Do you have a test case for the multiball code? How should this be used? Would it make sense to enable/disable the mb? I guess an example which can be turned into a test would clarify. Is there any client for your new BCP code? Mpf service or the monitor? Guess we should add a simple test to prevent regressions as well. |
They are not connected, let me separate them out and write some tests! |
0e85579
to
634bdd6
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Separated and updated with tests! The MB use case is a bit quirky, but it goes like this. If a machine has multiple ball devices that all contribute to a lock, enabling the lock will allow any ball device to capture balls for it. In the case where the player must lock a ball in a specific ball device first before locking in another ball device, the lock needs to be enabled but balls entering the second device should be blocked from triggering the lock. Tested this locally and it works exactly as expected. The lock is enabled and a ball entering the first device is locked but entering the second device is unexpected and kicked out. The blocking_facility is conditional on the first device having no balls, so after it is full the second device successfully captures and locks. |
Guess this could also be solved with multiple mode with different priorities right? But that is nothing wrong with having multiple ways. |
Yeah, I tried with multiple modes or multiple locks, but it got messy when I tried to have the separate lock devices aggregate to the same multiball. Not a lot of games have separate locks and not a lot of rulesets require locking in a specific order, but.... at least it's an option? |
The change is simple enough so I don't see why we should not merge it |
Also, generally, I like the idea. Guess we can leverage this in a few more places. |
This PR has a couple of updates for miscellaneous MPF behaviors.
Multiball Blocking Facility
After many hours struggling to conditionally prevent a multiball from capturing a ball in a lock (with no other devices available to take the
unclaimed_ball
), I stumbled across theblocking_facility
code. It's totally undocumented but I was able to step through and figure out how to get it working, and it does exactly what I need!This PR adds
blocking_facility
as a valid config option onmultiball_locks:
devices, so that they can catch blocking events and avoid locking balls when desired.TO DO: I'll get a better understanding of it and write some documentation for blocking facility