How to create real-time multiplayer game using Cocos Creator

How to create real-time multiplayer game using Cocos Creator
0
#1

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.

Thanks

1 Like

#2

I’d use WebRTC https://caniuse.com/#search=WebRTC and have https://socket.io as a backend.

0 Likes

#3

Hi phero_constructs,

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

Hopefully I can get some result.

0 Likes

#4

Also check https://gafferongames.com/categories/game-networking/ if you’re new to realtime networking. It’s not really the easiest thing to do.

0 Likes

#5

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.

0 Likes

#6

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 socket.io 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.

0 Likes

#7

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

0 Likes

#8

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

1 Like

#9

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

0 Likes