How do I make a server like clash of clans or king of thiefs have?
I was trying to find some useful information by searching it on google but without success.
Im begging for any usefull information or tutorials that u will give me.
Thanks
Yaniv .a.
How do I make a dedicated server for mobile game?
Actually, most "social" games do not need a real-time simulator. Instead, they send the parameters for the game to the player; the player then interacts with the "event" (invasion or whatever,) and then sends back the commands the player issued and the results to the server. The server re-plays the game given the player commands, and verifies the results, after which the world state is updated.
Thus, you really don't need anything more than a basic HTTP application server to implement this kind of gaming. The most important part is being able to write the game-logic in the same language on the client and on the server, so that commands/interaction done on the client ends up being the same on the server. The four most obvious technologies for this are:
* C/C++ -- you can write servers in C/C++, and you can write clients in C/C++, and that C/C++ code can be ported to all platforms. Definitely the "least strange" way of doing it, although of course you'll have all of the draw-backs of C/C++ development,too.
* Java -- you can write servers in Java easily; and you can still write clients in Java (such as Minecraft,) although the support on client devices is going away -- you may have to embed a Java interpreter in your binary for some platforms, and some platforms don't allow JIT compilation for user-supplied code, which would make it run slow. This is currently a possible path, but I wouldn't bet on it being free of heart-ache in the future.
* C#/Mono -- write server and client code in C# (or another .Net language) and deploy on top of Microsoft .Net for the Windows-based platforms, and on top of Mono for the others. Mono is not as high quality as .Net, and you have to test with both implementations to make sure what you develop will actually work. Ahead-of-time compilation (a la NGen) makes shipping binaries to restrictive environments easier (Unity does this for iOS, for example.)
* JavaScript -- write the game to run in a browser; run the same code on the server with a JavaScript application server like Node.js or a fork thereof (io.js)
If I want to install the game or download it from an app store, I'd probably personally go with C++; C# would be second place.
If I want to play in a browser, JavaScript would be the obvious choice. However, there are ways to compile C++ to JavaScript (such as emscripten) that could make C++ work there, too.
Thus, you really don't need anything more than a basic HTTP application server to implement this kind of gaming. The most important part is being able to write the game-logic in the same language on the client and on the server, so that commands/interaction done on the client ends up being the same on the server. The four most obvious technologies for this are:
* C/C++ -- you can write servers in C/C++, and you can write clients in C/C++, and that C/C++ code can be ported to all platforms. Definitely the "least strange" way of doing it, although of course you'll have all of the draw-backs of C/C++ development,too.
* Java -- you can write servers in Java easily; and you can still write clients in Java (such as Minecraft,) although the support on client devices is going away -- you may have to embed a Java interpreter in your binary for some platforms, and some platforms don't allow JIT compilation for user-supplied code, which would make it run slow. This is currently a possible path, but I wouldn't bet on it being free of heart-ache in the future.
* C#/Mono -- write server and client code in C# (or another .Net language) and deploy on top of Microsoft .Net for the Windows-based platforms, and on top of Mono for the others. Mono is not as high quality as .Net, and you have to test with both implementations to make sure what you develop will actually work. Ahead-of-time compilation (a la NGen) makes shipping binaries to restrictive environments easier (Unity does this for iOS, for example.)
* JavaScript -- write the game to run in a browser; run the same code on the server with a JavaScript application server like Node.js or a fork thereof (io.js)
If I want to install the game or download it from an app store, I'd probably personally go with C++; C# would be second place.
If I want to play in a browser, JavaScript would be the obvious choice. However, there are ways to compile C++ to JavaScript (such as emscripten) that could make C++ work there, too.
enum Bool { True, False, FileNotFound };
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement