[Fixed] Empty while block stuck loading game

When you have an empty while repeat block on the events tab, once you run the game, it sticks on loading screen until 100%, my guess is that it enters a overflown loop because the fans on my pc start to run faster and faster.

I supossed there shouldn’t be a trouble if the block was empty.

Thanks for reporting.

While I’ll wait for someone more knowledgeable about the codebase before closing this, my understanding is that While events are special as you’re explicitly telling the engine “Until these conditions are no longer true, complete these actions infinite times.” Because you have no conditions in the while event, it’s trying to complete actions infinitely, even though there are no actions. While events happen infinitely within the same frame, so it’s never progressing past the first frame.

So at a high level, I believe this is expected behavior.

Not sure that is expected, the other type of events don’t block the game.
There is a way to ignore an empty event maybe it not done here.
I report the bug.

1 Like

I would expect this behaviour.
You have no condition.
So you repeat the action infinitely, even if it’s nothing.
A while loop always needs a condition to be completed.

E: since a while loop without condition will always result in a freeze, how about make it impossible to have it without condition? make it mandatory.
With a pop-up notification that informs the user that a condition to resolve the while loop is needed.

1 Like

I already talked to 4ian about empty events or events without actions, and the conclusion was that while most conditions shouldn’t modify the game state and just check stuff, some may be impacting the game and therefore should not be removed. In GDevelop, the absence of conditions equals to an always condition, so this event is literally while(true) {}. It is intended behavior, not a bug.

Good idea! I would also put a warning in the diagnostics report if/when we add it.

1 Like

I checked the notes of the 108 version and it says that this feature or bug was fixed.
:exploding_head::exploding_head::exploding_head::exploding_head::exploding_head: