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

Better debugging for multiplayer games #6729

Closed
nikiats opened this issue Apr 20, 2023 · 2 comments
Closed

Better debugging for multiplayer games #6729

nikiats opened this issue Apr 20, 2023 · 2 comments

Comments

@nikiats
Copy link

nikiats commented Apr 20, 2023

Describe the project you are working on

I am working on a multiplayer 2D game using low level UDP with GDScript

Describe the problem or limitation you are having in your project

To test client and server interaction I need to export the project as an executable file and then I can launch it. It takes much more time to test when you need to build and then open .exe via file explorer.

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

Add one-click client and server launch button. Developer needs to be able to see if a game instance is a server or a client after it is built to setup game as it is supposed to be from code.

One click will launch both client and server, and the game instances will understand their roles using some global variables set different for each instance

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

Add global variables - IS_SERVER and IS_CLIENT (for example, better with OOP practices of course) and make possible to launch two game instances at one click with these variables different.

Developer code:
launch.tscn

func _ready():
  if IS_SERVER:
    # starting the server or opening server startup menu
  elif IS_CLIENT:
    # open client menu / join the server / anything else

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

You can use .bat script to run 2 instances of built exe file and maybe pass different cli args to them for them to know which one is server and which one is client

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

Because it is associated with development of almost all multiplayer games and its a useful testing instrument which can save a lot of time

@Calinou
Copy link
Member

Calinou commented Apr 20, 2023

This is already partially implemented in 4.x via the ability to launch multiple instances from the editor. However, there's no way to specify different CLI arguments for each instance yet: #522

@nikiats
Copy link
Author

nikiats commented Apr 21, 2023

I see it, sorry for bothering you. Would be cool if different launch args could be applied

@nikiats nikiats closed this as completed Apr 21, 2023
@Calinou Calinou closed this as not planned Won't fix, can't repro, duplicate, stale Apr 21, 2023
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