godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Allow launching multiple game instances #560

Closed Jummit closed 4 years ago

Jummit commented 4 years ago

Describe the project you are working on:

Any multiplayer project.

Describe the problem or limitation you are having in your project:

To debug the project I need at least two instances running, which I do by running the game from the project manager. This is a little inconvenient.

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

You should be able to shift-click on the play buttons to launch an instance of the game, even if another instance is still being debugged. Maybe this instance could then be debugged.

The stop button should only close the debugged instance, but all instances when pressing shift.

There should also be a config option to configure how many instance shift pressing the run button will launch, and maybe even instance-specific arguments so client and server can be launched automaticlly. (https://github.com/godotengine/godot/issues/7008#issuecomment-385536739)

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:

The game needs to be launched similarly to the run option in the project manager.

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

I don't know how other people working with multiplayer debug their games, but I most of them would use this approach. It can be done in one line with OS.execute().

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

There needs to be a way to debug networked games in engine.

This is basiclly godotengine/godot#7008.

Calinou commented 4 years ago

Is this implemented by https://github.com/godotengine/godot/pull/36244's Debug > Debug 2 instances option?

Jummit commented 4 years ago

Most of the time this will be enough, but I often want to test a scenario with two player and one server.

Calinou commented 4 years ago

@Faless Is there anything that would prevent debugging 3 or 4 instances at once? If not, we could expose this in the Debug menu.

Faless commented 4 years ago

@Calinou no, that's probably just a matter of adding the option, I'll add it for 3 and 4 I guess, more that that seems pointless, and the editor has a hard limit of 4 connected sessions (for usability and security, but maybe we can make it configurable if there really is a use case).