I'm really curious about how to set up a game so like Hayday or Clash Of Clans, especially with regards towards the server-client architecture. How does one set up such an artitecture? What are the techinical details?
Thanks a lot!
I'm really curious about how to set up a game so like Hayday or Clash Of Clans, especially with regards towards the server-client architecture. How does one set up such an artitecture? What are the techinical details?
Thanks a lot!
The question is too broad, but i will start anyway,and if you are looking for specific tutorials, you need google, i know about architecture, and what all factors you might need to consider while writing down the tiptops of your game base interaction.
The main question is whether your game is going to be in real time, turn based, or long-delay based (e.g., email chess). Another question is whether or not you are going to be freezing the state for subsequent reloads.
I would highly recommend figuring out in advance whether or not all players in the same game are going to be hosted on the same server (e.g., 1000 of 5 player matches compared to 5 matches of 1000 players each). If possible, go with the first and stick everyone who is in the same game under the same server. You will have a hard enough time synchronizing multiple clients to one server, rather than having multiple servers against which players are synchronized. Otherwise, the definition of consistency is problematic.
If possible, have each client communicate with the server and then the server distributing updates to the clients. This way you have one "official state", and can do a variety of conflict resolutions, phantoms, etc. Peer to peer gives better performance in faster games (e.g., FPSs) but introduces tons of problems.
Now for implementation of this architecture, i suggest you use linux network programming, cause windows is too vague, and errors might bundle up in future:
Create 2 instances of server as back design, you can have more , but main design should consist of one master server, and other slave sever, or master server can fork new servers with { fork();
if(pid!=0){//child server interaction};
else(//optional block for authentication of players, you need extra child server for each user)
//parent process}
~Client specifics:
~server specifics