-
-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
Debugger Plugins in Godot #39440
Debugger Plugins in Godot #39440
Conversation
f455f05
to
2f2a89c
Compare
Sorry if that sounds confused, because I am: from my last looks at this system, the only thing that nitpicks me is that's called "profilers", while I had associated that word with "measuring execution time" so far, which is a significant part of development. |
offtop: side project is <3, @Zylann |
Yes "profiler" seems like a broader term because "network profiler" and "visual profiler" exists in godot. "Capture" is not about measuring general states of the game (atleast not the |
5b09d9e
to
72ff603
Compare
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.
The functionalities are overall good. There are 2 things that I don't really like about the implemention right now:
- First, there is no need for all those changes to
Profiler
andCapture
. Wrapping around them is less code and I think it's clearer (see Faless@c17bcbc which you should be able to apply on top of your branch ). - Second, for which I don't have a clear solution, it that there is now clean way of
get_profiler_scene_debugger
without instancing an EditorPlugin. Maybe the root node should be a new class (EditorDebuggerModule
?) which then expose that method? Should we have an exposed singleton instead? I'm still unsure about that.
About the naming issues raised by @Zylann should we call them DebuggerModule
instead of Profiler
. Does it make more sense?
7cf26a0
to
59c22b3
Compare
@Faless I added the
|
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.
See comments below, overall looking much better! Great job.
@Faless What are your thoughts about renaming Should I rename register/unregister functions to add/remove to make them similar to other in-built functions? Planned Functions/Signals for
Are there any other functions/signals that would be useful? User can |
Not sure, does this have the same behaviour as other add/remove? Register is used in other places (like ScriptEditor), but no sure. I don't have a strong opinion on this.
Check out the signals in
That's probably not needed.
No.
Maybe we can add some logic to the destructor, or the |
fc4d940
to
232b1a2
Compare
@Faless The implementation is complete. Things added/changed:
|
This looks great. |
232b1a2
to
6fae028
Compare
6fae028
to
58a324c
Compare
@Faless I added the documentation for all the new classes/functions implemented in this PR (not limited to EditorDebuggerPlugin.xml but EditorPlugin.xml and EngineDebugger.xml too as they contain new functions, I will revert it if required). And I removed those virtual functions. |
Changes: * EngineDebugger is exposed to gdscript. Game side of communication can be implemented through it. * EditorDebuggerPlugin is added which handles the editor side of communication.
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.
Almost there 👍 , please see my comments about documentation and the mutex.
5a50caa
to
ea2eaf8
Compare
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.
Great job 🏅
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.
Looks great, excellent work!
Thanks! |
Purpose
Godot's debugger uses
Profiler
andCapture
to communicate with the running game. This PR exposes them to gdscript as debugger plugins.How to use
To make a debugger plugin, we need 3 scripts and a scene (optional ).
First script is the plugin script that is used to register the debugger plugin script and autoload script.
Second script is the debugger plugin script. It is an extension of
EditorDebuggerPlugin
class. It can register/unregister message captures and send messages to the game using member functions. The script will run inside the editor.Third script is an autoload script . It use
EngineDebugger
functions to register/unregister profilers and captures. It can also useEngineDebugger.send_message
to send messages to the Editor. The script will run inside the game.Capture system
Capture system is used to relay the messages to the correct recipient (Callables in this case). A message like
my_profiler:my_message
will be passed to the capture registered with namemy_profiler
and the message would bemy_message
. The debugger uses some captures likeperformance
,scene
,memory
,visual
,servers
,network
etc internally, so don't use them.Sending message
Message should be in the format
[capture name]:[message]
. Use the argument array to send additional data with messages.Demo
This is the demo used for testing.
The right panel displays the mouse position relative to the running game. The left text field and button can be used to execute
Expression
inside the game. (It's a profiler but the usage is not limited to profiling)Action