bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
36.24k stars 3.58k forks source link

Step-through debugging via a specialized app runner #4245

Closed alice-i-cecile closed 1 month ago

alice-i-cecile commented 2 years ago

What problem does this solve or what need does it fill?

When debugging, it's common to want to advance logic one frame (or even system) at a time.

It's not clear to end users how exactly this should be done, and each user ends up re-inventing the wheel.

What solution would you like?

The most straightforward way to solve this problem is to provide a specialized debug_runner that users can set, along with an associated DebugRunnerPlugin.

Eventually, this should provide the following functionality:

These should all be event-triggered, with default customizable hotkeys (stored in a resource).

What alternative(s) have you considered?

Write more unit tests!

Additional context

This functionality is obviously very useful for the eventual editor, but should be entirely doable today.

We may want to clean up and refactor the winit_runner code to make it more reusable before or during this PR process, as it's currently very monolithic and previous attempts I've seen to modify it have just copy-pasted and tweaked the code.

nicopap commented 1 year ago

This should be fixed when/if #8453 gets merged..

mgi388 commented 1 month ago

@alice-i-cecile https://github.com/bevyengine/bevy/pull/8453 was merged, does this mean the issue can be closed or is nicopap's comment suggesting that this issue is now unblocked now that it's merged? The linked PR has what looks to me like a good setup for enabling system stepping, but I can't tell from reading the OP if there's still a bigger goal that's missing.

alice-i-cecile commented 1 month ago

Yep this is effectively done. There's work to be done still in terms of UX, but that will be clearer in follow-up issues.