+1 vote

hi.
i have a simple game with multiplayer ready codes. it is a fighting game with 2 players max. i succeeded to connect two pc to each other with hamachi and play the game (i did everything to do it via port forwarding, but i couldn't). now my Q is how should connect two phones to each other? is there a simple way like hamachi for mobile phones or is there a better way to do it? is there a way to connect them via P2P networking (people say it is bad for gaming because of latency)? what a bout website like this:
http://api.shephertz.com/
how can i use websites like this? (sorry about my simple questions, i dont know networking a all ;) )
thank you :)

in Engine by (75 points)

1 Answer

0 votes
  1. Master server + matchmaking.
  2. Client-side host.
  3. Peer 2 Peer.

First option is the best, not just because you can use different server locations (so people from USA won't have to connect to server in Europe), but it's overall more secure (server-side code) and easier to manage.
Second option is way harder to prevent cheating and manage but allows LAN connections.
Third option depends on your needs, not recommended for real-time fighting game so I'm not going to describe it further.

by (378 points)
edited by

hi Oen44, thank you for replying
is there any tutorial to implement option 1 for ex... i downloaded android sdk android package from appwarp website, but i dont know what should i do with it ;)

Master Servers are 98% of the time headless applications. Why? Performance mostly, console, commandline applications are just enough for that. They are not build using game engines. It's something that works better when created from scratch (or using library/framework (like Kryonet), which is recommended). For example you can create server using C#, have your game made in Java, C++ or Python (I would like to say GoDot too, but not sure if GD supports that kind of networking without source editing) and it's going to work together by sending and receiving packets.

Secondly, I'm not working with GoDot (lack of community and extensions), never used networking and all so I'm not able to provide examples. Only documentation based stuff and overall experience.

What you should do is study as much as possible about how networking in GD works, so follow this documentation about High level multiplayer. There are examples that will help you progress further. Have in mind that GoDot won't give you working examples, you will have to rip your skin off before you get to the point where it will work as expected.

really thanks for info oen44.
the last Q (sry)... can you show me a tutorial about using p2p networking for games especially on android (as you read before somehow i managed it on pc)? is it possible to do such a thing on android? i understand that it is not practical to use p2p networking because of latency, but i want to learn it. thank you very much :)

There is no tutorial for GoDot on that topic. Yes, it is possible. Google Play Service is capable of handling that, take a look there.

Take a look at this article. It's the closest thing to tutorial about networking and P2P model.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.