- Home /
Smartphone multiplayer - NAT problem?
I have read several articles and heard that there is a problem if I want to use Unity built-in networking for smartphone multiplayer.
Some say it is possible, some say it is not.
The only thing I want is to make 1 vs 1 multiplayer using iOS and Android and I want to avoid using middleware such as Photon, since this game must not be limited (unlimited online players).
So should I use Unity built-in networking or is there any other way?
Hi, I have the same question myself. I was wondering if you found the solution to your problem? If so, what did you choose? I want to make a board game just like you described, so i'm facing the same doubts. Can you help?
I found out that it is not possible to use built-in Unity networking for this purpose. It works only via Wifi. I had to use Photon Cloud which uses server as a mediator and therefore resolves NAT problem.
This question is way to unspecific. It highly depends on your requirements. Are both players on the same local network? Or should they be able to connect via the internet when they use NAT wifi as well? In the first case a simple UDP broadcast should help to announce that a player is ready for connection. In all other cases where people might be behind NAT routers and / or on different networks you almost always need a server that helps you with matching player, trying NAT punchthrough and / or serve as relay between the players.
You can also look into UPnP to dynamically open ports in the router (if it has UPnP enabled). However that doesn't solve the problem of actually finding each other, it's just another way to break out of the NAT router.
So this question is way to unspecific to be answered.
@zanareno:
If you actually want a specific answer you might want to ask a seperate question with more details about your requirements. For example if you only want to connect to persons you know or if you want all players be able to find each other...
Hi Bunny, Thanks for your reply. I'll rephrase. I'm doing a board game and i want to add multiplayer features to it, like a lobby. One hosts and other joins. I Don't want auto matchmaking because i want the possibility to play with a friend. So it's a 1v1 game to play on iphone and android. I want to avoid uLink, SmartFox, Photon or any other that requires a licence. Since the game only requires that both clients talk to each other and knows their position in the board, what would be your recommendation? Oh and the gold is to be played online worldwide.
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
Get the WiFi IP address of the device 1 Answer
Cross platform multiplayer 3 Answers
Get the device IP address from Unity 3 Answers
1vs1 create/join or automatic player matchup on iOS - do I need SmartFox? 0 Answers