- Home /
question before building my first online game
hi everyone, i am going to make a online game and search a lot of infomation,
while in my search, the issue on server confused me a lot.
i have find some tutorial like M2H networking tutorial, which should be a famous tutorial.
I find that the server it made is just using the unity, i think.
while i also find somthing that build the server with other software such as arcalet,photon or smartfoxserver,et.
hence i would like to know what will be the different and what should i use?
One more question is that it is strange to me that when i search "unity database",
there are no information that i expected to have
To my knowledge, database nust be used to store player information such as the items.
So if game need a database, is that i can just use mysql and using sql in the scripting?
Answer by Jojo Batista · Sep 26, 2013 at 01:42 PM
Hey there! Depending on what you want to do, each networking server/plugin/tool will be better.
A couple of things you must know :
Do you need Unity built in physics? There are some servers that basically run a unity instance and you use that with its physics and stuff, but I don't have any experience with that. If you don't need this, I suggest you use something like smart fox or photon SERVER. This will let you have an authoritative server (more secure), and save stuff in your server, but you will need to work with a server, wich can be complex. And this brings up number 2.
Database. If you use something like smartfox server, you can use whatever database you want to use. Since you write everything in java, from the unity clients, you will send events, and those events will be handled in the server, in your server code, you will choose what to save, and what to do with the different events you receive from the clients. If you use a server, runing a unity instance, I'm not sure what can you use, but I think you will be able to find some database, or maybe use player prefs??? I don't think using player prefs will be viable to be honest, but, who knows!
Is this game going to be simple? If you need to create a simple game, you can always use something like photon cloud, where there is no server in your game. Every client connects to a master server, and this one tells where to connect. After that, you give one of your user "privileges" to control and synce the game flow (the master client). So you will have to write the server code in the client as well. This have some security problems, but will get you going in no time, so it's really nice. The main problem with this, is that you won't be able to store anything in the server, since you don't have one! So you have to search for another ways of storing client information. This can be done too, and there are a couple of plugins that can do this for you.
So basically, you need to know what are you going to do, and choose accordingly, but everything is possible, there is no golden rule. If you ask me? I will prefer to use something like smart fox server, and learn step by step how to do a great server. Since in my humble opinion, this is the best way to go if you want to be able to tweak everything as you please, and take out the authoritative client as well(I don't like this). And, you will be able to manage databases wich then can be used for example in your webpages really easily.
Hope this helps! Cheers!
A few other points:
I use Photon Cloud and get weird connection drops (I'm not alone).
If you are using mobile devices on 3G forget Unity Networking - you can't get through.
Currently investigating TNET http://www.tasharen.com/?page_id=4518 which looks really nice to me, though the author is a bit busy building Unity's new GUI system...
Thank you for your clear explanation!
Finally i choose to use photon,i believe there is a long way to learn.
Your answer
Follow this Question
Related Questions
How to load online level 2 Answers
How many bandwith will take on 500 ccu? 0 Answers
How to implement online multiplayer in a simple 1v1 game? 2 Answers