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

Multiplayer Bomber and Pong demo: More Info on how to get them to run #535

Open
golddotasksquestions opened this issue Oct 8, 2020 · 2 comments

Comments

@golddotasksquestions
Copy link

golddotasksquestions commented Oct 8, 2020

Which demo project is affected:
Multiplayer Bomber demo
Multiplayer Pong demo

OS/device including version:
Desktop/Android

Issue description:
The bomber and pong demo are the most recommended Godot multiplayer demos. As someone who want's to find out how Godot multiplayer works, I would naturally try those first. After all if I can't get a finished working demo to run on my devices, what is the point of learning the multiplayer API?

Setting up multiplayer to work over an Internet connection is tricky enough for beginners. After ages I finally got the pong demo to work with port forwarding (which does not need internet permissions), so it took me another eternity to get the bomber demo to run, because I did not expect having to enable internet permissions as it is mentioned nowhere. As someone who new to multiplayer and setting up ports, I thought it must be something I did wrong with the setting in my router. Tutorials I found online on how to set up port forwarding are severely out of date or pretty much useless because every router software apparently works completely differently and has very different naming schemes.

Over the past couple of months I gave up multiple times before and many hours of frustration could have been saved if there would be better instructions for how to get the demo to run. What I know now that finally enabled me to run the demo on my devices I had to piece together from multiple sources of Godot documentation, various Godot QAs, unofficial multiplayer Godot tutorials, Godot reddit threads, and quite a few Godot unrelated websites and Youtube videos. This also applies to the pong demo, though it was slightly easier there due to the lack of extra hurdle (enabling internet permissions).

Suggestions:

  • Summarize all necessary steps to run the demo at the point of interest (Github README, AssetStore description) or add a link from there to the documentation where all this information to run the demos can be accumulated. Currently, the highlevel multiplayer docs explain the highlevel API and workflow, which for me, is a step much further ahead if I can't even get the finished demos to run.
  • In the Readme and the Asset Store description, mention that there are 5 principle ways to get multiplayer to work (locally on the same desktop computer, locally LAN/WIFI without connecting to the internet, over the internet with router port forwarding, over the internet with NAT punch trough, over the internet with dedicated server)
  • Mention that these vary vastly in difficulty and list them in order of difficulty as I have done here.
  • Mention that without making any changes to the demos, you can run the pong and bomber demo out of the box using the using the first three principle ways.
  • Mention which IP address in each case is needed, how to obtain the IPs and how to differentiate that particular IP among those listed.

To get both demos to work over an internet connection and port forwarding:

  • To get the demos to run over the internet (which is what 99% of all beginners think of when they think of "multiplayer"), mention that the easiest way is port forwarding, recommend to try that first.
  • Explain how to access the router settings in the browser,
  • Show at least one or two screenshots of different port forwarding setting pages of one or two different routers
  • Mention that both pong and bomber demo need a TCP port, and that the pong demo needs port 8910 and bomber needs port 10567.
  • Show a screenshot of the pong and bomber clients when the players first run the game, the host and the joining client with example IPs and names filled in the fields. Explain, that the host has to type in his local IP and that the joining client has to enter the public IP4 address. Mention that the IP addresses in the screenshots are example addresses and your particular ones may very well be different, link to the above explanation on how to obtain/find and differentiate those addresses.
  • Mention that it is not necessary to add the port to the IP address (192.168.0.0:8910) when connecting. While this is something many third party tutorials talk about, it is not necessary because the clients have the ports hardcoded in GDScript. Mention that you can change them in their respective scripts (gamestate.gd for the bomber demo, lobby.gd for the pong demo), but keep in mind to then change the forwarded ports in the router as well.
  • Mention for the bomber demo to work on Android, you also have to enable internet permissions in the Android export settings.
Calinou added a commit to Calinou/godot-demo-projects that referenced this issue Nov 8, 2020
The instructions will only show when the player is hosting a server.
This also includes a button to get your public IP address.

This partially addresses godotengine#535.
Calinou added a commit to Calinou/godot-demo-projects that referenced this issue Nov 8, 2020
The instructions will only show when the player is hosting a server.
This also includes a button to get your public IP address.

This partially addresses godotengine#535.
aaronfranke pushed a commit to aaronfranke/godot-demo-projects that referenced this issue Nov 12, 2020
The instructions will only show when the player is hosting a server.
This also includes a button to get your public IP address.

This partially addresses godotengine#535.
Calinou added a commit to Calinou/godot-demo-projects that referenced this issue Nov 13, 2020
The instructions will only show when the player is hosting a server.
This also includes a button to get your public IP address.

This partially addresses godotengine#535.
@Calinou
Copy link
Member

Calinou commented Aug 29, 2021

Mention for the bomber demo to work on Android, you also have to enable internet permissions in the Android export settings.

I wonder if we should allow defining Android permissions in the project settings for this to work out of the box. We can't commit export_presets.cfg files, so the project settings would have to be used for this instead.

@golddotasksquestions
Copy link
Author

golddotasksquestions commented Aug 29, 2021

I wonder if we should allow defining Android permissions in the project settings for this to work out of the box.

Maybe the Android permissions would be better set in the project settings. I found the hard to find in the Export settings.
However I don't thing "Internet" should be enabled by default. Not all Android projects need Internet, the least permissions are enabled by default the better.

If however having these setting in the Project settings would also mean how the Multiplayer demos could have these already enabled, that would be a big plus. But I think in order for people to learn better from the demos and create their own projects, it should still be mentioned somewhere that these permissions need to be set.

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