godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.17k stars 98 forks source link

Add a Start Paused button to the editor run bar #11060

Open geekley opened 3 weeks ago

geekley commented 3 weeks ago

Describe the project you are working on

A 2D game using physics interpolation and tween animation.

Describe the problem or limitation you are having in your project

There seems to be an issue happening for a single frame, but I can't visually confirm. At least not without trying to code a specific way to debug this somehow.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Unity has a "Step" button after the "Play" and "Pause" buttons: Play, pause and step buttons in Unity Unity toolbar

It's really helpful. It allows advancing a single frame, similar to pressing . on YouTube or E on VLC.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Please add a step button to Godot, like how it works in Unity. You can add it under Debugger > Stack Trace if you think it's more appropriate.

Also, please make the pause button always clickable like in Unity:

If this enhancement will not be used often, can it be worked around with a few lines of script?

An editor plugin might be able to implement this? But I have no idea if it would be easy/feasible to make it integrate properly with the other debugging tools.

Is there a reason why this should be core and not an add-on in the asset library?

Related

AThousandShips commented 3 weeks ago

The ability to step frames was added in:

Calinou commented 3 weeks ago

Note that if you force the project to start paused immediately and it's not visible due to being behind another window, it might not display anything once you alt-tab back to it (until you resume project execution).

This is because pausing with the editor run bar actually performs a debugger break, not just an in-game pause (which keeps the rest of the engine ticking, and is therefore able to keep rendering new frames).

geekley commented 3 weeks ago

@Calinou Would this also happen if it runs just 1 frame then pause?

Calinou commented 3 weeks ago

@Calinou Would this also happen if it runs just 1 frame then pause?

That might work better, but I think the core issue will still occur. To be fair, it already happens if you debug break and alt-tab the window until it gets hidden behind another window. I'm just pointing this out as this can affect the feature's usability.

geekley commented 3 weeks ago

To be fair, it already happens if you debug break and alt-tab the window until it gets hidden behind another window.

Well, I asked because I had tried that and it didn't happen to me at least. Tried pausing and break-point on Kubuntu X11, seems normal. Is it OS-specific or GL-specific or something?

I think I know what you're talking about, because I've seen this kind of issue happen on Dolphin emulator when paused, as well as other Linux apps. The other window images are "pasted" into the area of the paused window.

Calinou commented 3 weeks ago

Is it OS-specific or GL-specific or something?

This is likely OS-specific to a degree, but it occurs with any rendering method/driver IIRC.

because I've seen this kind of issue happen on Dolphin emulator when paused

Indeed, it's quite common for emulators to be affected by this.