What about using the Go language to develop a large MMORPG game server? (Very stable, catch all exceptions, great for starting from scratch, but big companies already have a ready-made C + + framework, so they won't be used)

Source: Internet
Author: User
Tags golang ide

What about using the Go language to develop a large MMORPG game server?
What are the pros and cons of a C socket server? What's the feasibility?


From 2013 onwards, by friends recommended to start using Golang to write game landing server, with C + + to do third-party platform verification. To write the Standalone Tool Guide Table tool Github-davyxu/tabtoy: cross-platform high-performance convenient spreadsheet exporter. and network library Github-davyxu/cellnet: simple, convenient, efficient go language game server on the ground floor. Finally using these tools and libraries to write the entire game server framework, I feel very good

The details look like the next few points:

Language, library
Golang language features and C are like, simple, a piece of A4 paper can write all the features. If you think about it, C + + comes to the comprehension stage and uses only a few simple features, and the rest is a bunch of tricks to solve various memory problems. and Golang A simple beginning, why waste life to study that a lot of artifice it?

There are only 2 pits in Golang: 1. interface{} and nil are used together, 2. For loops, introducing loop variables into closures (Golang, Lua, C # closure variable capture differences) does not affect the normal use of the compound language concept, just look at the official back how effective to avoid

Forget to inherit the set of things with Golang, with the combination + interface

Using Golang server How to ensure the game server to solve the consistency problem? Stop the world is positive, but Golang can serialize player data from the language layer and then save it in the background

Channel is Goroutine, although it is golang language characteristic. But in the writing of the server, in fact, only the underlying use more.

Golang's third-party library is a lot of good.

Do not say the template, C # is not good use, the official in the tangle also do not add, in use, no template is indeed a bit inconvenient. Using interface{}/reflection for generics is a bit of a face for Golang, a strong-type language.


Operating period
Golang and C + + performance, this is the advantage of C + +, Golang because there is no virtual machine, only a thin layer of scheduling layer. So the performance is very high, with a little performance sacrifice for development efficiency, the duly

After the 1.6 version of GC optimization has been good, if you are not high-performance, high-concurrency Web applications, not to find a bunch of optimization techniques. Only use Golang to write the game server, that point GC loss can be negligible

Like other modern languages, crash capture is a standard feature, and I run on the Golang server line, basically without crashing.

Hot UPDATE: Official already has plugin system submission, cross-platform. It is estimated that you will soon be able to leave manual cgo to do so hot update

Development, commissioning, deployment, optimization
Liteide is my preferred Golang ide, although there are children's shoes said B-grid is not high. But this estimate really can not find the shortcomings said, don't tell me visual Studio, that is the cosmic ...

Once heard that someone is not optimistic about Golang, I asked why: said the new language, not good recruit, behind the call heard he is a planning ... All right
The truth is this: Golang for a little bit of programming based on the new person, 1 weeks or so can start to contribute to the code. Old driver 2-3 days.

Development efficiency is still good, the general big game function, 2*2 people a week four and a half to complete. This change in the C + + ERA, probably also one or two can not be finished. Docking Server SDK, about 1 days, 10 more.

Golang Self-performance tuning tool, from memory, CPU, blocking points and other aspects of the direct plot to analyze, very intuitive, can refer to my blog a few years ago analysis: Using Golang for performance analysis (Profiling)

Golang Support cross-compilation, cross-platform deployment, what is the concept? Linux, huh? Do not ask you what version, directly on the Windows compiled output an elf, flung to the server to run. No more than 1 minutes of time.

Now North Canton Deep Rong many new projects have chosen Golang, is to see Golang development efficiency and recruit above
For Golang Development There is a tangle to see my blog: Server development language comparison

Make an advertisement, a variety of development notes, reference the soul of the battle-C + + Blog

Open Source Server network library, https://github.com/davyxu/cellnet Welcome star

Github-davyxu/tabtoy for multiple commercial projects: high-performance, easy-to-use spreadsheet exporter across platforms Xu Bo
Links: https://www.zhihu.com/question/21098952/answer/47703631
Source: Know
Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.

Large MMORPG game server, it is estimated that it is difficult to see Golang's "Success story". The obstacle is not the GC, but the fact that large-scale MMORPG can only be moved by big companies. And large companies are generally already have Daniel, has accumulated a N-year service-side C + + framework.

If there are really new entrants, you need to develop a service-side framework from scratch, which is almost the best choice for go.

For the page tour/hand tour, go can be said to be a broad world, promising. A team that uses C + + to copy a game in half a year and occasionally goes down and adds 3 months to a stable group VS a team that uses go three months to copy a game and never downtime.

Should cross the river
Links: https://www.zhihu.com/question/21098952/answer/21075482
Source: Know
Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.

What about using the Go language to develop a large MMORPG game server? (Very stable, catch all exceptions, great for starting from scratch, but big companies already have a ready-made C + + framework, so they won't be used)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.