Is it worth to use cocos2dx for a server side?

I will get into the overwhelming side of server-client application for games, and I have a few questions.

I was thinking to make a server side application for: a game for:
CASE 1: a continuously connected server:

  • storing their savedata info (and transer this data: client->server & server->client).
  • Also to perform basic validations on server side for avoiding hacks

CASE 2: A server to control a multiplayer game (2 to 4 players)

  • real time action or racing game

Is it worth to use cocos2dx for the server side?
Does it give me an actual advantage or benefit over plain C++ and sockets?


Im not interested in any pre-made server 3rd party, (since they would ask for more money than I actually have [I got zero money :frowning: ] )

I don’t have any experience regarding your question, but I see no reason to use cocos2d-x on the server side since most of the framework consists of APIs used for rendering and controlling visual stuff…

1 Like

Here’s my personal thoughts:

If you are on a tight budget, clearly CASE 2 wouldn’t be sensible since running and scaling bandwidth would cost a bomb over time. If you not using any cloud hosted server services, you probably be required to maintain your own server hardware. Bear in mind, the difficulties of tuning and optimising regional load (you might need to deploy several servers across the globe to accommodate users from different region for performance reasons).

On the alternative, you wouldn’t need a real time server side game engine in CASE 1. Most of the functional requirements you mentioned does not need a game engine to execute. So nope, you barely need to run cocos2dx for the server side.

What if I have the budget?

Then that depends on what type of games are you building. Do you need to synchronies real time physics world across the clients? If you don’t, I don’t see why you need a server side game engine.

Even if you need to do so, there are a few lightweight physics engine out there to enable you to do physics calculation without the visual renderings. You can even use those physics engine on you server side that cocos2d-x have embedded (chipmunk, box2d).

If you just want the easy - brute force way out, just run similar setup (cocos2dx) on the server and client. They work. Just not as elegant or effective.

Hope it helps, any additional feedbacks are welcomed.

1 Like

Cocos2d-x is client-side game engine, offer graphics, physics, network etc. to your client side games. I don’t think it can fit the requirement of a game server.

I have some in-house game projects here. For cocos2d-x lua projects, we are using Skynet for the server, for cocos2d-x javascript projects, we are using Pomelo. Both of them are free and open source server-side framework. You can consider them.

2 Likes

Is the Pomelo server real time or turn based? I’m curious if a node.js server framework can support a real-time multiplayer game.

In pomelo’s docs, they’re OK for real-time MMORPG.
Though I only use it for turn-base games.

You can use cocos2d-x for MMO , in fact it is one of the best . BUT currently the client support only
WEBSOCKETS for real time , using libwebsockets lib ( oneof the best )
for server side you can chouse i have beginners tutorials for using libuv and netty both are
server frameworks for web-sockets .
C libuv


Java netty

1 Like