-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Improve bevy_ecs inspectability and add debugging methods.
#17331
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
Improve bevy_ecs inspectability and add debugging methods.
#17331
Conversation
Example still doesn't work, but it's a start.
| @@ -0,0 +1,115 @@ | |||
| //! In this example, we use a system to print diagnostic information about the world. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be good to elaborate more on this. For example, what diagnostic info do we get and why is this useful to see?
Carter0
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mostly get the functionality. I think the docs could use some work. But maybe that can be done in a different PR? Ill approve.
Co-authored-by: Carter Weinberg <weinbergcarter@gmail.com>
|
You might want to add some PR tags like ‘needs review’ and then request some people like Alice to see it if you can. That way other people can find it easier |
I don't think I have permission to do either of those, unless I am missing something. |
alice-i-cecile
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, there's three parts to this:
- The
Bundleshelper method. Great, love these. Please split them out into their own PR and we can merge them. - The example. This is... kind of meandering and poorly written, and has a hard time communicating how the user might use these APIs and others to investigate the state of the world. The name is not great, and it should not live in the bevy_ecs examples.
- The methods themselves. I think the
diagnoseterminology is really unclear, and the "turn something into a string for the users" is an anti-pattern. We should return useful structured objects, which the users can then turn into a string on their own.
I really want better tools for investigating the state of the world and schedules holistically, but this needs to be better executed.
|
Yeah the strings did feel a little weird to work with. I'll look into adding a more structured way to view the world state. |
Added `len`, `is_empty`, and `iter` methods to `Bundles`. Separated out from bevyengine#17331. --------- Co-authored-by: shuo <shuoli84@gmail.com>
My attempt at adopting #7758.
Solution
len,is_empty, anditermethods toBundle.World,Schedules,Dag, andComponentId.SchedulesandWorldalso include adiagnose_with_flattenedmethod that includes a flattened version of the dependancy graph. This was moved to a separate method as getting the flattened graph requires mutable access.Example output:
This is an example output for
World::diagnose_with_flattened: