-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Identify instance windows when using launching multiple instances #3357
Comments
This will be handy property to expose, currently all the instances are created and stacked on top of each other with the exact same name, there is no way to determine or label which is which session and I have to manually arrange the windows every time they are started |
The technical implementation of this feature likely involves adding a This argument could be made available in debug builds only as to not bloat release export templates. |
I worked out how to do this in gdscript with a network game I was working on. I found what it did and was not a good solution |
I would appreciate it if this would double as a way to identify the different sessions from script, e.g. |
@opatut @Calinou I recently had to make my own modification to the engine to account for something like this and found this proposal when searching for any existing requests. I would like to know how users here feel before attempting an upstream. I've basically created an instance identifier variable (for instance, So by opatut's recommendation, I could make an With that in mind, users could configure whatever behavior they need from this (including modifying window title states, or overlaying detailed information unique to each instance as an overlay in game) while also having other uses for it such as testing server client interactions. Basically, I have the code ready already to mostly upstream, but would like to clean it up if the main team is interested. Should I create a WIP merge request? |
exposing the session ID with something like Engine.get_session_index() would be ideal, no need for more |
Multiple instanses may connect to debug server in arbitrary order. I have another implementation for this proposal: Add misc capture group to RemoteDebugger and add misc:set-session-id to set the session id. |
I think adding a feature to seperate the two console instances as well would be helpful as its currently difficult to differentiate between the two while print debugging |
I was scrolling through the docs for a solution and I came across Is this what we are looking for? If not, can someone enlighten me on what it actually does and how is it different from what we are trying to achieve? Edit: After some tinkering, no, this wasn't a solution. There were moments where the same values were displayed in the label for both instances. If someone can enlighten me about this particular method, I will deeply appreciate it. |
Meanwhile, I found OS.get_process_id() which at least lets me distinguish between windows. As a quick and fallible workaround this missing info I'm just doing modulo 2 to choose player 0 or 1 which works most of the time. There's probably a way to leverage this more robustly. |
One way to handle this is the following (by storing an incremental value to a file):
It's not the brightest way, but it's used for debugging purposes anyway. |
@ctrlraul Sorry. How is it that you have an option "Customize Run Instances"? |
@JodliDev It's a new feature of the 4.3 : |
Oh. Well, I should have figured that out myself. Thank you very much! :) |
is it possible to set these new settings in 4.3 through gdscript? I'd like to add buttons to my editor which would change the settings in this customize run instances window |
Related to #522.
Describe the project you are working on
A networked game in pre-alpha 4.0
Describe the problem or limitation you are having in your project
When using the new feature to launch multiple instances (pic 1), it is very easy to lose track of which instance belongs to which debug session (pic 2).
Describe the feature / enhancement and how it helps to overcome the problem or limitation
In the instance window title bar, display the debug session number, something like,
Session - 2
. This will help prevent this situation altogether.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Read above
If this enhancement will not be used often, can it be worked around with a few lines of script?
Will be used all the time for games that are testing with multiple instances.
Is there a reason why this should be core and not an add-on in the asset library?
It's a core editor feature now.
The text was updated successfully, but these errors were encountered: