Network server client

Hello

I’m new to network programming(and mostly unity to, but done a lot of .net c# programming) and have done a small program that use, client server RPC programming. Now i need to know a little more about how to make a game where i don’t use a dedicated server(meaning a player will host the game other players will then join him). My biggest problem atm is that, i cant rely on my users to have a router with Upnp + they dont know how to port forward either.

I’ve have been searching for hours and hours on Google but have yet to find a tutorial or something similar that will help me.

On my search i found a method called NAT traversal, and have been told it can help me sort my problems with port forward and so on. But i don’t really know how to implement this method in my project.

If anyone out there can help me, to move forward with learning more about network programming, ill be more the happy to try it out.

Unity uses RakNet for networking. This network engine provides a Nat-punch-through technique which allows two or more clients to direct-connect to each other by using a master-server which acts as initial connector between clients. Officially it’s called “UDP hole punching”.

While it works with a lot of Nat-routers, it’s not possible with all types. It’s not a bug, it’s more because there are many different NAT-routers out there and there’s no reliable standard. Mainly because the NAPT-technique is already a “misuse” of the port number in the UDP / TCP protocol. Actually the routers that are capable of NAT punch through are “less safe” :wink:

So there is no reliable way to get around the NAT problem, but the NAT punch through should work in most cases. If not there’s not much you can do beside checking for Upnp and asking the user to manually forward. On the other hand all games have those problems. Most eleminate those problems by providing dedicated servers, but as small company that’s not always an option.

D:/Program%20Files/Unity/Editor/Data/Documentation/Documentation/Manual/index.html view it

I can’t find thread so posting random question.
I am based out of Chicago and have finished prototype with contract
programmers. Looking for Chicago based programmer
for potential partnership.

Jesse
jesseflangille@gmail.com