Difference between new ball and extraball

175 views
Skip to first unread message

leeoneil

unread,
Oct 24, 2025, 5:54:02 AMOct 24
to MPF Users
Hello everyone,
I'm still trying to figure what is happening with my super long wait between 2 balls.
Sometimes the wait betweend 2 balls can go to 1 minute or 2 !
I've checked loooooots of thing, I can't understand what's going on.
It's specific to very very good scores, if we play badly, there is no wait between 2 balls.

When we have an extraball, there is no wait at all (even with super high scores !).
So, what can I check ?
What's the difference between a ball and an extraball ?

I'm still in 0.57.3, can't go in 0.8.

Thank's for your help !

Alex L

unread,
Oct 25, 2025, 4:33:00 AMOct 25
to MPF Users
Interesting! Are there any events logging during this wait? If there is a big gap with no logging, what are the events right before and after the wait? Is this only with single player games? What happens with multiplayer?

I'm not great with .57, but I wonder if you have a bonus mode that is silently going through multiple delayed awards, but not showing anything, so it seems like nothing is really happening. This would be something I would expect to have grow alongside higher scores. But maybe bonus happens on extra balls as well. Hmm.

Another idea - extra balls start within the same player context as the previous ball (which earned it). Therefore there is (guaranteed) no player rotation, whereas ball 1-to-2 progression or a ball ending in a multiplayer game both do some extra handling of ending the current turn and starting a new turn, even if it is just a single-player game.
If you have a lot of player variables (or maybe more importantly, <x>_player event hooks listening for changes in player variables), maybe the value management is causing a lot of event processing, which delays the start process of the next ball.

You might dig around the default Game mode implementation to find more clues: https://github.com/missionpinball/mpf/blob/00460954febea09ae82d7b18412edd99fedf9260/mpf/modes/game/code/game.py#L95 . Notice that extra ball handling calls `_run_ball`, but normal turn progression also calls `_start_player_turn` and `_rotate_players`, which extra omits.

Anthony van Winkle

unread,
Oct 26, 2025, 6:05:20 PMOct 26
to MPF Users
By any chance are you using a segment display? What is your hardware like and can you share a link to your repository?

leeoneil

unread,
Oct 28, 2025, 1:35:42 PMOct 28
to MPF Users
Thank's.
I'm trying to understand how to share my code on github (creating a repository)

Actually everything is here : https://drive.google.com/drive/folders/11r_yReAPgv784EVpiqdJ36kgg8GsXdBx?usp=drive_link
But I don't know if someone can acess it.

Nothing change between 1 or multiple players (same problem).
I'm not using segment display, I'm with a WIN11 computer, pretty fast ( AMD Ryzen 7 5825U, 32 Go RAM DDR4).

leeoneil

unread,
Oct 29, 2025, 4:15:20 AMOct 29
to MPF Users
Ok not very easy...
I think all my code is here :

https://github.com/Leeoneil-Vely/Cthulhu_pinball

I absolutley don't understand....
In the log there is nothing during the wait.

leeoneil

unread,
Oct 29, 2025, 9:12:37 AMOct 29
to MPF Users
Sorry i'm talking to myself...

I made a verbose log and... I don't understand.

2025-10-29 14:00:25,913 : INFO : EventManager : Event: ======'player_turn_ended'====== Args={'player': <Player 1>, 'number': 1}
2025-10-29 14:00:52,857 : INFO : EventManager : Event: ======'game_will_end'====== Args={}
and
2025-10-29 14:00:25,814 : EventManager : Event: ======'slide_main_init_active'====== Args={}
2025-10-29 14:00:52,901 : EventManager : Event: ======'slides_play'====== Args={'settings': {'game_over_slide_3': {'target': None, 'background_color': [0.0, 0.0, 0.0, 1.0], 'priority': None, 'show': True, 'force': False, 'expire': None, 'slide': None, 'tokens': {}, 'action': 'play'}}, 'context': 'game_over', 'calling_context': "mode_game_over_started{current_player.game_over_number=='3'}", 'priority': 500, 'queue': '<QueuedEvent>'}
2025-10-29 14:00:52,901 : EventManager : Event: ======'sounds_play'====== Args={'settings': {'game_over_sfx_pool': {'action': 'play', 'priority': None, 'block': False, 'delay': None, 'track': None, 'volume': None, 'ducking': {}, 'pan': None, 'loops': None, 'start_at': None, 'fade_in': None, 'fade_out': None, 'about_to_finish_time': -1.0, 'max_queue_time': -1.0, 'events_when_played': ['use_sound_setting'], 'events_when_stopped': ['use_sound_setting'], 'events_when_looping': ['use_sound_setting'], 'events_when_about_to_finish': ['use_sound_setting'], 'mode_end_action': 'use_sound_setting', 'key': 'use_sound_setting'}}, 'context': 'game_over', 'calling_context': 'mode_game_over_started', 'priority': 500, 'queue': '<QueuedEvent>'}

This is an example of a long wait...
It was here on ball 3 before the end of the game, just after the bonus points.

And At some point during the game, the computer start to struggle with the shows.
Looks like a very new videogame on and old computer, the "framerate" for the show is very bad....

leeoneil

unread,
Oct 30, 2025, 6:29:26 AMOct 30
to MPF Users
I get rid of all the highscores... And the problem still here.
Can be between 2 balls or after the third ball (so just before a game over).
So I guess the modes are not concerned...

cobra18t

unread,
Oct 30, 2025, 7:54:45 PMOct 30
to MPF Users
Have you tried this memory leak search method?
https://missionpinball.org/latest/troubleshooting/debugging_memory_leaks/

That helped me find the source of my delay between game over and attract mode restarting. Basically I had thousands of event handlers that were not cleared until the end of the game because of how I was using segment displays. Maybe you have something that stacks up that is not cleared until a new ball (not extra ball).

leeoneil

unread,
Oct 31, 2025, 3:59:50 AMOct 31
to MPF Users
Hello !
I tried it but I'm too dumb to understand I think (the result...)

So I press "d" at the beginning of my game, and "d" at the end (after a long wait).
I have some informations on my log but don't know exactly what to check.

There is a line with 1500 handlers but....
None of them seems particular.

The MC is here : https://drive.google.com/file/d/1lf8T95fMk4qD7JYTChy7W9iWa7NcHMXA/view?usp=sharing
And the other log is here : https://drive.google.com/file/d/1ac83twxIgmT5gfWqYpGCdyfJIR2EzNfJ/view?usp=sharing

Is it easy to find some clues on these files ?



Thank's for your help !

Philip Dixon

unread,
Oct 31, 2025, 10:52:55 AMOct 31
to MPF Users
try changing max queue time from -1 (which is infinite)? In fact, try commenting out a line at a time and see if the delay goes away and if so, that line is your problem.
Message has been deleted

leeoneil

unread,
Oct 31, 2025, 1:34:02 PMOct 31
to MPF Users
Maybe   
He spotted that my base game mode had this :
#config_version=6
mode:
  start_events: ball_started, base_start
  priority: 100
  stop_events: base_stop

So probably, the base mode was not shutting down between 2 balls.
He told me to put this :

mode:
  start_events: ball_started, base_start
  priority: 200
  stop_events: game_ended, ball_ended, game_ending, ball_ending

And it's nigh and days !
The wait sometimes could go to 5 or 10 seconds, on big scores.
Need to do more testing, but looks like he found something big !

Thank's again to  !!!!!!

leeoneil

unread,
Nov 1, 2025, 7:57:14 AMNov 1
to MPF Users
Back to the beginning, the problem is still here.
It's crazy !
Yesterday, 15th plays, no problem.
This morning, one play, one good ball, lots of points.... Problem is back !
Aaaaaarrrghhhhhh !!!!!!

kaydeeH

unread,
Nov 6, 2025, 10:03:12 PMNov 6
to MPF Users
I wish I was chiming in with an answer for you Lee, but instead I'm piggybacking on... I've seen two mentions of segment display related memory leaks causing this... can someone elaborate on that? We've seen similar problems in the past on our Dukes of Hazzard game where once in a while the game goes on this long hiatus after a ball drain where nothing seems to be happening and everything kinda... slows down... Sometimes even the bonus countdown slows way down too. Particularly when a player has had a big game with lots of stuff happening over multiple balls. We've never been able to resolve it, but we DO use segment displays (on a OPP/CobraPin board based game, if that has anything to do with it), so if there's something we can or should be doing to mitigate or resolve the issue, I'd love to know what that looks like. Oh, and it's on 0.57.4.dev2, if that matters. Thanks in advance!

Alex L

unread,
Nov 7, 2025, 2:03:47 AMNov 7
to MPF Users
I don't have anything to add in the direction of a real solution, but I want to point out a mistake that I've seen several times around a few different MPF communities in the last weeks (and that I also had mistaken for a long time as I began! It's a very understandable mistake to make!):

Game Modes do not need an excess of stop_events. There is no point in defining stop events that are redundant or stop the mode after it's already been stopped once. With the example
`stop_events: game_ended, ball_ended, game_ending, ball_ending` three of these bindings will not ever matter because ball_ending will have already turned off the mode. But there's more:

Per the `mode:stop_on_ball_end` documentation :
"""
The default behavior for modes in MPF is that they're automatically stopped when the ball ends. Some modes (like the built-in game and credit modes) need to stay running even when the ball ends, so to support that you can add `stop_on_ball_end: false`.
"""

So really, you don't need any of those four stop_events, because it was always going to be stopped at ball end unless you specifically overrode this.

If you need your mode to stop earlier than default end of ball timing (or it's a mode you stop and start due to rules separate from just ball_end), then sure you still need some custom stop_events. But when you just want to make sure the mode stops between balls? That's free. (And if it's not, I'm here for the bug reports!)



(As to why adding new stop events made the slow process faster sometimes? I think that the changes maybe stopped the mode a little earlier than before, so the cleanup ended up starting sooner and just appeared to be faster, while not actually being addressed.)

leeoneil

unread,
Nov 7, 2025, 6:29:06 AMNov 7
to MPF Users
Thank's, it was a an idea with Zohan, who thinked the base mode needed to be shutted down (between 2 balls).
So we tried to add all this code to all the modes, to see if one one them was not running multiple times.
So it's totally new to my code (and does not affect my time between 2 balls).

Thank's for the clarification. 

leeoneil

unread,
Nov 12, 2025, 3:05:16 PMNov 12
to MPF Users
Still trying to find something.
I was testing today, but in production mode, so no verbose log.
The bug occured, so I made a "dump" during the freeze.

The log is showing strange entries :
2025-11-12 20:23:36,824 : mpfmc : <ClockEvent (0.2) callback=<bound method WindowSDL._check_keyboard_shown of <kivy.core.window.window_sdl2.WindowSDL object at 0x000002C351EE1010>>>
2025-11-12 20:23:36,824 : mpfmc : <ClockEvent (0.03333333333333333) callback=<bound method VideoGstplayer._update of <mpfmc.assets.video.VideoWrapper object at 0x000002C351F49850>>>
2025-11-12 20:23:36,824 : mpfmc : <ClockEvent (0.03333333333333333) callback=<bound method VideoGstplayer._update of <mpfmc.assets.video.VideoWrapper object at 0x000002C351F499D0>>>
2025-11-12 20:23:36,824 : mpfmc : <ClockEvent (0.03333333333333333) callback=<bound method VideoGstplayer._update of <mpfmc.assets.video.VideoWrapper object at 0x000002C351F49A90>>>
2025-11-12 20:23:36,824 : mpfmc : <ClockEvent (0.03333333333333333) callback=<bound method VideoGstplayer._update of <mpfmc.assets.video.VideoWrapper object at 0x000002C351F49B50>>>
......


and this kind of line is going on forever.
Can it be a clue ?

The full log is here :
https://github.com/Leeoneil-Vely/Cthulhu_pinball/tree/main/logs

Thank's is someone have some time to check it !
Reply all
Reply to author
Forward
0 new messages