-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
[2.1] Some improvements for debugger #10891
Conversation
Remove useless debugger property panel Rename Remote Inspector to Live Scene Tree
@Geequlim In your gif, the editor reacts to you clicking on the nodes instantly. However, in my projects (other than the main scene which is tiny, similar to your gif, 4 nodes total) I need to wait a couple of seconds (with CPU usage noticeably increasing) before I see the properties in the window. I suspect some serialization is done on demand instead of earlier? That would explain the CPU usage increase. My project is 3d and consists of quite a lot of nodes (one main scene, which has 10 or 15 children, most of which are scenes themselves, and sometimes contain several child scenes too). Also going back to the game results in CPU usage rampup and several seconds of waiting, during which Windows behaves as though the game was hung up. EDIT: Monitor says its circa 3000 nodes. |
DO NOT MERGE YET ! Two new problems found here: |
@Zireael07 Did you copmpiled with commit of this PR? |
Nope, I'm using 2.1.4. Why do you ask? Did you make some improvements on performance? Also I've removed a scene I don't really need (which was made of a ton of modular meshes) and now with ~2900 nodes the delay is nearly gone. So it's definitely related to number of nodes (not scripts, the scene I removed had no scripts, just a ton of meshes). Is the debugger fetching the data for everything or some such? I am scratching my head here wondering why the additional 200 mesh instances should affect debugger so much. |
@Zireael07 |
@Zireael07 I didn't try any thing with 3D with godot yet. Could you please send me an example project to reproduct that? |
Dropbox'd my whole project so that you can take a look: https://www.dropbox.com/s/8bn3lxhtm8latrx/FreeRoamRacer.zip?dl=0 This is a working copy of my project (what I have on github is missing some functionality), so I often plop stuff straight into the navigation.tscn for testing purposes. You'll notice there's quite a lot of free space around, so a more finished version of the game could easily have double the number of nodes. If you instance the bridge scene, you'll probably see much worse debugger performance (as I said, 200 mesh instances). EDIT: Also I can't seem to go back to game after looking in the debugger, it freezes. Sometimes it unfreezes after a lengthy delay, but more commonly it doesn't, making live edits pointless. |
PS. Anyway my comments aren't meant to hold up this PR, I just thought it'd be good to get the slowdown/inability to go back to game looked at. |
@Zireael07 |
I didn't say 'run the bridge scene', I said 'instance the bridge scene'. Try running the project, and then instancing (chain icon over scene tree panel) the bridge scene in navigation.tscn (i.e. the main scene of the project), and running again. |
Hmm, so basically what you suggest is using the regular property editor for everything? Does it still work for modifying the running game? I'm not against it, but we could probably move the Live Scene Tree to the regular scene tree and add some sort of "Live" option (that is on by default when you run the game) to switch between the controls so you can switch between them. Also it could be interesting to mark the inspector so it's clear that it's editing something remote. I have to add a small panel already to inspector to warn you when you are editing a resource from another scene (so you know you can't edit it), so we might reuse it for this.. Give me some time to make a proposal (or feel free to make one yourself too) |
@reduz Yes my suggestion is using the inspector to edit properties for both local instances and remote objects. And mege the live scene tree and the regular tree editor is also a good advice. I'm glad to see the proposal you are making. |
@Geequlim My idea for 3.1 (or 3.0 if you have time) could be something more akin to this: Which of course needs a nicer design.. but the idea is that the remote scene appears automatically in the inspector when debug begins (and you can switch between local and remote). I think a lot of people ignores it right now because it can be kind of a hassle. |
And the remote/local tabs or buttons of the scene tree disappear when not debugging. |
That is more similar with what Unity does. 😄 But I think it is the right way. |
I really like the idea!! It's exactly the same than reduz proposes except using toggle buttons for both ui elements |
@Zireael07 I can reproduct your problem. And it may be fixed by anothor PR in the future. |
@Geequlim: Good to know it's reproducible, I was starting to think I was doing something wrong in the project :) |
editor/script_editor_debugger.cpp
Outdated
if (inspect_scene_tree->is_visible()) | ||
_scene_tree_request(); | ||
|
||
bool need_query_instance = inspected_object_id != 0; |
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 guess you could simplify this a bit as:
bool need_query_instance =
inspected_object_id != 0
&& editor->get_property_editor()->is_visible()
&& editor->get_property_editor()->obj != NULL
&& editor->get_property_editor()->obj->is_type("ScriptEditorDebuggerInspectedObject")
&& (ObjectID)editor->get_property_editor()->obj->call("get_remote_object_id") != 0;
Or whatever format clang-format
will allow for line breaks, it's a bit touchy with those. Worst case, everything on one line is still more readable than 5 successive assignments IMO.
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.
Done with clang-format :)
…history Fix error inspector capitalization with regular objects after insepct remote objects
@Dillybob92 Do you mean the 3.0 version? |
@Dillybob92 I have pull the request #13181 for that just now :) |
Improve data serialization/desrialization with the debug remote and client.