Skip to content
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

Create bevy_debug crate #11309

Closed
pablo-lua opened this issue Jan 11, 2024 · 9 comments · Fixed by #11341
Closed

Create bevy_debug crate #11309

pablo-lua opened this issue Jan 11, 2024 · 9 comments · Fixed by #11341
Labels
A-Editor Graphical tools to make Bevy games C-Feature A new feature, making something new possible

Comments

@pablo-lua
Copy link
Contributor

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

With the start of the bevy_editor prototype, it has become an important discussion to address the issue of what is needed to move forward with this project.
Most people agree that to do this, we need several debugging tools so that the user can enjoy a complete editing system.
However, another issue in this regard deserves discussion: Should we create a crate just for these debug tools, so that they are all housed in a separate block?
The advantages of this type of approach are numerous: If someone does not need such tools, we can disable everything as easily as disable a feature, in addition, the nesting of these tools will help in understanding the code in the future
So, as advantages, this feature would provide:

  • Nesting of debug tools for easy deactivation/activation
  • Management of these tools by new contributors made easier
  • Making it easier to visualize what we still need for the new editor

What solution would you like?

The creation of the bevy_debug crate (or similar) for the purpose of storing those tools and the moving of all debugs tools already existent in the engine (this last part is not very necessary: We would probably have to define what is only a debug tool and what is not for this purpose)

What alternative(s) have you considered?

We can simply have a debug mod in all crates for the purpose of storing the debug tools of that said crate there
The problem with this approach would probably be debug tools that are of interest of multiple crates: Where to store this kind of tool?

Additional context

Useful discussion on this issue.

The proposal of the new editor prototyping.

@pablo-lua pablo-lua added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Jan 11, 2024
@alice-i-cecile alice-i-cecile added A-Editor Graphical tools to make Bevy games and removed S-Needs-Triage This issue needs to be labelled labels Jan 11, 2024
@alice-i-cecile alice-i-cecile changed the title Creation of bevy_debug proposal Create bevy_debug crate Jan 11, 2024
@alice-i-cecile
Copy link
Member

The other main advantages that I see are:

  1. It becomes very easy to disable these in production games: simply turn off a feature flag in your build.
  2. We can create abstractions (input mapping, dev console) that can be shared across debug tools.

@matiqo15
Copy link
Member

I believe we can use bevy_diagnostic for this.

@alice-i-cecile
Copy link
Member

IMO bevy_diagnostic is much better suited as a lightweight crate for computing diagnostics. Then, users who want to run Bevy headless (or with just bevy_app) can pull it in easily.

You do have a point though. If only we had crate docs explaining the purpose of the crate 😅

@matiqo15
Copy link
Member

Okay, I get the idea, if we create a bevy_debug crate, we should consider moving bevy_log into it. I'm not sure if this wouldn't create some issues, but having two crates named similarly isn't a good idea.

@alice-i-cecile
Copy link
Member

Yeah, bevy_log and bevy_diagnostics are confusingly similar already.

@mockersf
Copy link
Member

mockersf commented Jan 12, 2024

Okay, I get the idea, if we create a bevy_debug crate, we should consider moving bevy_log into it. I'm not sure if this wouldn't create some issues, but having two crates named similarly isn't a good idea.

then we should find another name for this bevy_debug. bevy_log is different than what is intended here and is a very good name for what it is

@alice-i-cecile
Copy link
Member

Ideas:
-bevy_debug_tools
-bevy_dev_tools

@pablo-lua
Copy link
Contributor Author

but having two crates named similarly isn't a good idea.

Is log that much of similar with debug? IMO they are not so confusing, one is logging information about something (telling us amount of know info), the other is for identifying the info that we need and don't yet know.

But bevy_dev_tools is a good name though

@alice-i-cecile
Copy link
Member

https://crates.io/crates/bevy_dev_tools

Crate reserved. @cart, let me know how and when you want me to transfer ownership over. My kingdom for namespaces.

github-merge-queue bot pushed a commit that referenced this issue Jan 14, 2024
# Objective

- Explain purpose of bevy_diagnostic, see:
#11309 (comment)

## Solution

- Add doc comment
github-merge-queue bot pushed a commit that referenced this issue Mar 6, 2024
# Objective

- Resolves #11309

## Solution

- Add `bevy_dev_tools` crate as a default feature.
- Add `DevToolsPlugin` and add it to an app if the `bevy_dev_tools`
feature is enabled.

`bevy_dev_tools` is reserved by @alice-i-cecile, should we wait until it
gets transferred to cart before merging?

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: BD103 <59022059+BD103@users.noreply.github.com>
spectria-limina pushed a commit to spectria-limina/bevy that referenced this issue Mar 9, 2024
# Objective

- Resolves bevyengine#11309

## Solution

- Add `bevy_dev_tools` crate as a default feature.
- Add `DevToolsPlugin` and add it to an app if the `bevy_dev_tools`
feature is enabled.

`bevy_dev_tools` is reserved by @alice-i-cecile, should we wait until it
gets transferred to cart before merging?

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: BD103 <59022059+BD103@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Editor Graphical tools to make Bevy games C-Feature A new feature, making something new possible
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants