Increasingly more Cocos Creator builders are beginning to create on-line video games.
Immediately, I’ll arrange which open-source server frameworks are appropriate to be used with Cocos Creator.
TSRPC
TSRPC is a full-stack RPC framework designed particularly for TypeScript, which has been verified by tens of tens of millions of customers and is appropriate for HTTP API, WebSocket real-time purposes, NodeJS microservices, and so on.
Utilizing TSRPC, you may simply construct a sport server with a robust load capability.
Colyseus
Colyseus is a multiplayer sport community service framework primarily based on NodeJS + TypeScript, which supplies many consumer SDKs and might simply work with Cocos Creator.
Furthermore, on the Cocos Retailer, there may be additionally a Colyseus SDK for everybody to combine with one click on.
As well as, the Colyseus official additionally supplies internet hosting providers, making it quite simple so that you can deploy, and also you don’t have to fret about CCU, DAU stress.
cherry
NetEase as soon as open-sourced a very good community framework primarily based on NodeJS, Pomelo
, which obtained greater than 10,000 stars on Github, however it has been discontinued.
Later, the Pinus (the open-source model of Pomelo) and Pitaya (the Golang model of Pomelo) appeared.
However Pinus is nearly discontinued, and the replace frequency of Pitaya will not be very excessive.
Lastly, I discovered this Golang framework primarily based on the Actor concurrency mannequin, Cherry, and it helps the Pomelo protocol.
Cherry-related positions have already appeared on recruitment web sites. it‘s price you to concentrate.
skynet
skynet is a light-weight actor mannequin distributed server framework constructed with c and Lua.
Utilizing skynet, you may simply construct an environment friendly and secure sport server.
I’ve participated in two initiatives (an FPS and an ARPG) which have used skynet, they usually proved that skynet could be very useful.
The draw back is that the ecosystem of the Lua language could be very weak, and plenty of issues must be constructed by your self.
Plus, improvement can solely be carried out on Linux. If you wish to develop on Home windows, you’ll want to use a digital machine software program.
If you’re accustomed to Lua or the consumer logic is written within the Lua language, skynet is an effective selection.
ioGame
It is a very sensible Java sport server answer, and the creator has written practically 300,000 phrases of directions.
However it might be low-key publicity, and the variety of stars will not be excessive. Pals who like Java can strive it.
A number of of my mates’ corporations use ioGame for his or her Java sport servers.
In conclusion
For the selection of server framework, I recommend selecting based on the next precedence:
- If there’s a conventional, secure, and passable answer, use it first.
- Prioritize these which are nonetheless being up to date and have many customers
- Prioritize distributed, scalable ones
- Prioritize compiled languages (neglect PHP/LUA/PYTHON)
- Prioritize the identical language for back and front ends
I hope the above content material might help the Cocos sport builders in want, and I additionally hope that the builders’ initiatives can go easily and be efficiently launched.
Good luck, see you!