Hello again guys,
I’m sure you guys hear something like this all the time, but I’m having some trouble finding the answer on the forum by searching, so I figured I’d just ask so I can finally go to sleep. I want to develop a game where people would be able to log in, customize their characters, join a room, and initiate a game with whoever else is in that room (if anyone is familiar with Gunbound, something similar to that). I’m in my 4th year of a 4 year Computer Science degree, and I am currently learning about database design (which I imagine would tie into this somehow), but I’ve never done any server-side programming before. Do you guys have any suggestions (Tips, suggested reading, etc) to get me going in the right direction? I know this is a huge topic, but if you could, treat me like a complete novice when it comes to server/client programming in general.
Unity3d does not offer a ‘server-side’, it only offers a gameserver instance so players can connect to the same game.
There’s a few options, you can either use PHP as a proxy to connect to a database or look into the middleware solutions like Photon or SmartFox or others. Or you can create your own server program and connect to it using .net sockets.
I’ve come across a lot of people recommending SmartFox. I’ve looked it up, and it’s within my price range. However, I still find myself at a loss. I’m at the point where I could purchase SmartFox…but once I’ve bought it, I’ll just sit at my computer and wonder…“What now?”. Will I need my own server connected at all times or are there webhosting solutions that would work well with Unity? What would you guys recommend? And if I purchase SmartFox, and have the SmartFox server running…how do I get people to connect to said server? How do you manage login and account information.
I obviously don’t expect anyone to be able to answer all those questions at once…although that would be awesome lol. I’m really hoping for some direction more than anything
They all have there specific API’s to works with Unity3d. Basicly they all do sort of the same.
You import the dll into Unity and then you can use the classes provided by the dll.
There are numerous videos, tutorials and more for all the solutions on there own websites.
They also all provide a free/community/… license so you can test stuff or develop without buying from the start.
It depends on what programming language and what exactly our looking for to decide which one would be best for your game or application.
I’ve found a lot of resources with your help, so thank you for that. I’m still going over everything to try to get a better understanding of how this will work. I’m still a little confused as to how players would be able to connect to my server. All the tutorials I find use the 127.0.0.1 IP Address for testing purposes, which makes sense since the server is running on my own computer at that point. But how will other people be able to connect to my server? That’s one of the things that is confusing me the most, really.
EDIT: Just read up on VPS (Virtual Private Servers). Would you guys recommend that?
Depending on the game your creating there are also different solutions, if you only want small amounts of players in a game and the players host there own games you can look at the masterserver Unity provides.
Mostly the middleware ones like SmartFox,… will need to be on a server thats reachable from all clients. They probably also provide some sort of NAT capabilities but i’ve never used those.
Deciding what server you would need depends also alot on what your creating. You will need to look at bandwith, security, database access,… and lots more. If it’s for testing with small amounts of players during development a vps will do just fine.
If you are using middleware that is primarily client/server based ( Electroserver, Photon, Smartfox ) then you will need some sort of dedicated ‘server’. For the purposes of development this could just be a home server that is using your DSL / Cable. It is usually pretty simply to configure your firewall to forward the appropriate ports so external users can hit your server. Once you want to move your game to ‘production’ you would need to start thinking about hosting on dedicated or virtual servers.
Regarding authentication, generally the client is going to make a login or authentication request to the server and pass some sort of credentials. Your server will most likely talk to a database and compare the stored credentials with the ones presented by the client. I believe we have an authentication example that hits a database here.
If you are interested in SmartFox or Photon I have a tutorial series for both that does authentication with encryption for Photon here, and SmartFox here. They will help give you an idea for what is involved.
Thanks for all the help guys! Dragagon, I’m gonna go through your tutorials and see if I understand it. I’m running Mac OSX, so it might be a little different. Hopefully that’s not a problem though. I think my next challenge is going to be learning more about how databases can integrate with Unity to check login credentials and stuff like that…it’ll be a learning experience, that’s for sure lol.