For my game I am using unitys built in networking and was wondering if my game can be hosted to be a browser and client based game. Or does unitys networking only work for lan connections? Not sure what the limitations are and how limited it is to a decent amount of players connecting. I know for large amount of players a lot of people use photon server. So I guess my main question is now that I have my multiplayer setup would I just have to give another player my ip / port to be able to connect and play? Also could I just upload this to my website to be a browser based game and have people connect to that whenever they want?
Unity’s built in networking is suitable to both Internet and LAN usage (as long as its IP based, it should work). The networking code you create will work basically the same regardless of its destination build (iOS, Android, Linux, Windows, etc), the API exposed to you through Unity handles the magic behind the curtain. With Photon I would recommend you use their cloud system unless you’re willing to rent/lease a dedicated server from a hosting company to setup Photon on.
Yes you can just give out your IP/port to anyone who wants to connect to your system to play, however, the big catch to that is setting up access to your computer will be the challenge. Alot of ISP’s tend to filter or interrupt traffic that appears to be related to “server” type activity (for residential connections). Or you may have problems with a router blocking direct access to your computer, so you may have to look into port forwarding.
Setting up a browser based version of your Unity application, is fairly simple, but requires a certain bit of knowledge and a http/web server.
Thanks for the reply, helped me understand it a bit more. I totally forgot the name of it but someone mentioned some kind of program that’s almost like an instant messanger but for connecting to online games that you host yourself. So it avoids the tricky ISP filters that you were talking about and what not. Wish I could remember what it was.
You are talking about the master server. It uses NAT punch through (UDP whole punching) to avoid the problem but it doesn’t work 100% of the time.
About number of connections , it depends on the amount of CPU load in game on the server and the machine that is hosting the game.