-
-
Notifications
You must be signed in to change notification settings - Fork 843
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
Ability to debug the composition of an Entity #1052
Comments
@skypjack is there any update on the |
Not yet, sorry. I'm back from vacation but also need to keep up with all other things before starting something new and tricky with natvis. 🙂 |
I've spent some time on this during the last week and 🤷♂️ Unless you have some smart idea to do it, I think I'll close the issue since it's not implementable as I initially thought and I don't know how to solve it if they don't improve natvis itself a little. I'm sorry. |
@skypjack I do have an implementation for our internal purposes. It is not exactly fast (we can toggle it on/off at runtime) but it's not that slow either. It does the job and has been indispensable in debugging the entities. The gist of it is:
I'm sure there are points of contention in the above such that it's not suitable to add to |
In a project I work on, we used a slightly different approach (that could work in EnTT out of the box maybe). First of all, note that natvis has an annoying idiosyncrasy. Once this is done, in the project I work on there is an entity object that also contains a pointer to a registry. However, how would this work? The registry has pointers to sparse sets. Using a non-enum entity type would display the content of the derived class, however it would still not be accessible from natvis. I must say that I like it as a compromise and I find it easy to use at the end of the day. It gets the job done for sure. |
That sounds great!
I am not a natvis wizard and I'm not sure how to iterate over the storages and sprinkle in some logic in the natvis (what is this now, a natvis script?) file. If you have any resource I can check out for this, I would appreciate it.
How would the imgui gui debugger work without knowing the types at compile time? I assume some extra work would be required by the user
|
I think the best way to proceed is to implement what I've in mind for the handle class. It already owns a single entity and a reference to a registry after all. If it works and is a good compromise, we can then try to apply the same to the registry itself with the trick above.
Oh, yeah, it would use meta or the like for sure. Right. I do something similar in a project of mine already, with a small macro to export component types for the imgui windows. |
@skypjack that sounds good If this is to become a feature, I would request some modularity with the type information i.e. on the one hand one can use the macro you mentioned without any additional work. On the other hand, with minimal code, one should be able to leverage other reflection systems e.g. Unreal's type reflection, with the entt debugger. |
Ok, I added a view for the handle class to give you a grasp of what I mean and also have a starting point. |
Thanks @skypjack. I'll try it out asap. |
More details here: #60 (comment)
It would be great to be able to debug an
entity
and all of it'scomponents
inside the debugger. In Visual Studio, with natvis support, theentity
should be expandable in the watch window to show all the components that it has. Ideally, one would be able to expand the components as well to inspect their values.The text was updated successfully, but these errors were encountered: