- Home /
Unity Understanding Network
Hi guys,im new to networking stuff here and i need some help.
I've been googling around the web for a few hours now on how to use the networking but none explains ip adresses,ports,port forwarding and stuff like that , they only explain the classes and functions on Unity networking not networking in general so i need some tutorials on networking in general.Im trying to make a local game with UNET so please explain to me the basics behind local multiplayer and general networking.
Please dont reply google it yourself because i already did and im asking it here because i can reply to questions that i dont understand and some of you might have better resources than me.
Thanks
Answer by JoshuaStrunk · Aug 12, 2015 at 05:48 PM
So what your really should be looking for is a basic overview of how the internet works. Now I say basic but this is a massively complicated topic and if you have little experience on the technical side of computing I recommend finding some one who is experienced with networking to set up your games networking or just forget about networking your game.
I would look up how to set up a basic web or game server on you local machine as these will get you familiar with all of these terms. I recommend Minecraft or Terraria because both are quite popular and you should be able to find plenty of resources targeting them. It only counts if you can get a friend to connect to it. If you are struggling to get those set up you are going to have a bad time with networking on your own.
As for your specific questions I will just give a brief answer for more detailed and informed information see the links below them.
Video on port numbers : Port Numbers
Video on NAT which covers ports, private area networks and more: Network Address Translation
IP Addresses
Why it matters in your game: This is how your players find the server running your game.
Every time you connect to a website you are using an IP Address and Port number. IP Addresses are exactly how they sound, Addresses. This is all abstracted away by your browser and these fancy servers called Name Servers(Think of these as massive address books). So really when you connect to www.unity3d.com your browser sends out a request to a Name Server to retrieve the actual IP Address if it does not already have the actual IP Address cached. Then your browser sends a request to Unity3D's IP address and waits for a response coming back from it.
Port Numbers
Why it matters in your game: This is how your players find the program on the server to talk to.
As IP addresses are to your home address, ports are to the people inside. Programs on servers have to be configured to listen for requests on specific port numbers. That way one physical server can have multiple server applications running and responding to requests
Port Forwarding
Why it matters in your game: If your are testing on at home you very likely need this so others can "see" your machine.
Now port forwarding requires a bit more knowledge of how IP addresses to understand why it is needed. Basically its a technique used to expose computers running in your private home network behind your firewalls, router, and ISP to the internet.
I am marking this community wiki because I could have grossly simplified something.
Your answer
Follow this Question
Related Questions
Network.connections.Length is always 0 1 Answer
UNET NetworkServer.Spawn intermittently not called on clients 1 Answer
Unity networking tutorial? 6 Answers
Local IP adress in UNet 4 Answers