Skip to content
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

Separate cmd args per debug instance #6232

Closed
aekobear opened this issue Feb 3, 2023 · 3 comments
Closed

Separate cmd args per debug instance #6232

aekobear opened this issue Feb 3, 2023 · 3 comments

Comments

@aekobear
Copy link

aekobear commented Feb 3, 2023

Describe the project you are working on

I'm working on a multiplayer game with a dedicated server + client model. The server and clients get run as separate executables

Describe the problem or limitation you are having in your project

Because Godot's Multiplayer API only allows an instance to be a server or a client, the way I test / debug my application locally is to select Debug > Run Multiple Instances

However all of these instances receive the exact same command line arguments, which forces me to create a special debugging scene with buttons for choosing server or client

Describe the feature / enhancement and how it helps to overcome the problem or limitation

The ability to set different command-line arguments for each of the (up to 4) debug instances will allow me to quickly test my client-server game in a way that closely mirrors the production version (server will be controlled via command line)

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

add 4 more fields to the Project settings for each of the debug instances:

image

All instances would receive the "Main Run Args" in addition to the args unique to the instance. So in the example above, Instance 1 would receive "foo server=true" whereas Instance 2 would only receive "foo"

If this enhancement will not be used often, can it be worked around with a few lines of script?

As far as I can tell this cannot be achieved without creating a custom scene requiring the user (me) to choose which instance should be a server and which should be a client

Is there a reason why this should be core and not an add-on in the asset library?

The ability to run multiple instances is already a core feature, but it is limited by the fact that all 4 instances are identical. There are situations (server-client, A B feature testing, game with pop-out UI, etc) where developers want the instances to behave differently, and command line arguments are a direct way to tell instances how to behave

@aekobear
Copy link
Author

aekobear commented Feb 3, 2023

I found an issue with similar discussion: #3357

But I decided to make this a new proposal because while a built-in variable for identifying the running instance would help solve the problem, it's still somewhat limiting and would lead to code that only works when run in editor. Being able to pass server=true to one of my instances lets me accurately test my code in a way that matches production use

@YuriSizov
Copy link
Contributor

This is a duplicate of #522. And there is a PR implementing that one, actually, godotengine/godot#57975 🙃

@YuriSizov YuriSizov closed this as not planned Won't fix, can't repro, duplicate, stale Feb 4, 2023
@aekobear
Copy link
Author

aekobear commented Feb 5, 2023

This is a duplicate of #522. And there is a PR implementing that one, actually, godotengine/godot#57975 upside_down_face

sorry I missed that in my search! but thanks for info and I'm glad to hear it's in the works 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants