Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by N13s · Jun 08, 2013 at 09:01 PM · androidmultiplayernetworkmasterservernat

Setting up a Unity Masterserver - how to do it correctly?

Hi everyone,

I have been struggling with creating a multiplayer game for a long time now. I didn't really know how to do it, and how all the network related stuff works, so I started to watch tutorials (like this one, that explained a lot: http://cgcookie.com/unity/2011/12/20/introduction-to-networking-in-unity/) and read documentations.

I am now able to set up a MasterServer (content downloaded from the unity website) on my laptop. So i have two consoles running: one MasterServer.exe and one Facilitator.exe. I can connect to the masterserver and register my game from any device within my home network, or outside. Also, when having two or more devices connected to each other via the masterserver WITHIN my home network, everything seems to be working fine - it's like having a decent multiplayer game.

But there comes the problem. When switching my android device(Yes, I made a build for android) to 3g instead of wifi (so that is is not a part of my home network anymore) it CAN connect to the masterserver (I have port forwarded everything correctly! :D , and you can see the masterserver.exe and facilitator.exe receiving and sending data ) but it cannot connect to my game running on my laptop. The error "Receiving NAT punchthrough attempt from target XXXXX failed" shows up.

So here are my questions:

-Is it true that the Master Server won't work if it is in a NAT network? (see: http://www.raknet.net/raknet/manual/natpunchthrough.html) So do I need to host it somewhere? or can disable NAT in some way to make the server work properly?

-Is using the masterserver actually a good idea? Isn't it too outdated or is it unstable or always having problems? anyone having experience with this?

-Is it a better option to hire a server - something like photon or smartfox?

This is what I'm trying to reach: Making a simple multiplayer scene where clients "all over the world" can connect to, whether they are in a home network, outside using mobile internet, or something else...

Any help is appreciated!

Thank you so much in advance!!

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image N13s · Jun 27, 2013 at 07:33 AM 0
Share

anyone? is the masterserver too old to use or something?

avatar image Graham-Dunnett ♦♦ · Jun 27, 2013 at 09:32 AM 0
Share

The master server is intended to sit on the internet somewhere that all machines can connect to. Unity networking is good for small numbers of players connecting to play a game together, so perhaps up to 16 players. One of the players will act as a server, and will talk with the masterserver to help other players find it.

avatar image N13s · Jul 05, 2013 at 07:37 AM 0
Share

thanks, i figured that already, but i doesn't seem to be working since no one one the internet is able to use it properly :(

avatar image Wurghi · Dec 03, 2015 at 07:23 PM 0
Share

so do i get this right that someone can not create a server when he's in a NAT-network(behind router) in a simple and fast way? What i would like to achieve is a game where you can simply host a game yourself and invite 2-3 friends via a link or ip or sth similar and they join your game. So i'd not need to have game-servers. Only maybe a master-server to share the ip to the clients. Is this even possible? I always thought you could just send your public ip to a friend and he could easily join, but it seems like it's not that easy online...

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Weirdo-Studios · Jun 28, 2013 at 05:23 PM

The thing I recommend and am currently using is Photon. Check it out on the asset store but in essence it is a server which works in the cloud and they host for you completely free (20 connections at once) and you can then pay for more licenses if you want it. These give you 200, 500 connections or unlimited something like that.

https://www.assetstore.unity3d.com/#/content/1786

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image N13s · Jul 05, 2013 at 07:36 AM 0
Share

I guess that's the only option! thank you for answering

avatar image
1

Answer by justust · Sep 23, 2013 at 10:13 AM

Perhaps a to late answer but the master server seems to work just fine for you, its just giving the address and port to the game server on your laptop with port and everything. Same as any other lobby would do.

But then you want to connect to that server and the problem occurs. That is you can not find the server running in you gameclient on your laptop. You would I presume have to port forward that port to your laptop in your router.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image aastha · Apr 22, 2015 at 09:24 AM 0
Share

@N13s Hi,

Could you please help me in setting up master server. I followed the following tutorial https://www.youtube.com/watch?v=ScijsRwrsho but still i am unable to connect to master server

Thanks in Advance

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

19 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Custom master server 0 Answers

How to solve networking issues? 0 Answers

How to control "portable hotspot" function on Android? 1 Answer

NAT Punchthrough failed 0 Answers

are you sure the server can be connected to? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges