How to create real-time multiplayer game using Cocos Creator

How to create real-time multiplayer game using Cocos Creator

Hi all,

I have recently got into development of game and had developed a simple game using Cocos Creator so to learn about how it worked.

Now I wanted to try make the game into multiplayer but I have no experience in this and I can’t find any tutorial in regards to multiplayer with Cocos Creator.

Forgot to mention, I am trying to make the game on multiple platform (IOS, Android and Web), which is the reason why I used Cocos Creator.

Any advice will be appreciated.


1 Like

I’d use WebRTC and have as a backend.

Hi phero_constructs,

Thanks for the advice, I will start reading from there first.

Hopefully I can get some result.

Also check if you’re new to realtime networking. It’s not really the easiest thing to do.

Yes, I am aware of the difficulties, but I am willing to give it a try in order to gain some experience.

Thanks for the extra tips.

Hi everyone,

I am replying to this thread as I am having difficulties in trying to create a game server using cocos creator.

I am aware of and WebRTC as mentioned by phero_constructs, however I am not convinced if this worked in multi-platform environment.

In fact, I have tried to do a simple data sending which worked in browser but not on android device.

I am very new to networking development and in needs of correct research materials to get me started.

My objective now is to create the game server that are cross-platform, or rather a server-client network model which operating in multiple environment at the very least.

I wanted to create my own network engine rather on depending on other’s build, performance issue can be fine-tuned in the future as this is for learning purpose.

I have been researching on many documents for several weeks but unable to get the grasp or even to start on it.

Thanks in advance.

i also have the same question. I wonder if can work on native platform as android or ios?

refence the network part of the examples project,it can work on native and web.

1 Like

In this example i just see the code at client side. There is no code at sever side. I tried to write code at server side with node js in newest version. So client code at example can connect successfully but can not send message or emit event to server