Good language to develop a game server in?

前端 未结 15 1213
悲哀的现实
悲哀的现实 2021-02-01 08:50

I was just wondering what language would be a good choice for developing a game server to support a large (thousands) number of users? I dabbled in python, but realized that it

相关标签:
15条回答
  • 2021-02-01 09:00

    I hate to say it, and I know I'm risking a down mod here, but it doesn't sound like there's a language out there for you. All programming languages have their quirks and programmers simply have to adapt to them. It's completely possible to write a working server in Python without classes (eliminating the "self" variable class references) and likewise just as easy to write C++ with clean syntax.

    If you're looking to deploy cross-platform and want to develop cross-platform as well, your best bet would probably be Java. It shorter development cycles than compiled languages like C and C++, but is higher performance (arguable, but I've always been anti-Java =P) than interpreted languages like Python and Perl and you don't have to work with unofficial implementations like Mono that may from time to time not support all of a language's features.

    0 讨论(0)
  • 2021-02-01 09:04

    I know facebook uses a combination of Erlang and C++ for their chat engine.

    Whatever you decide, if you choose a combination of languages, check out facebook's thrift framework for cross language services deployment. They open sourced it about a year+ back:

    http://incubator.apache.org/thrift/

    0 讨论(0)
  • 2021-02-01 09:05

    Speaking of pure performance, if you can run Java 6 you get about 1:1 performance when compared to optimized C++ (special cases notwithstanding, sometimes Java is faster, sometimes C++), the only problem you will have is of course stuff like database libraries, interconnectivity, scalability and such. I believe there's a variety of good to great solutions available to each of these problems but you won't find one language which would solve everything for you so I have to give you the age old advice: Choose the language you like and use that one.

    Oh, you're still reading this? :) Well, here's some extra pointers.

    • EVE Online uses Python for its client and server side code and it's both bug-ridden and laggy as something I don't think I should write here so that'd be an example of how Python can be extended to (poorly) serve vast amounts of users.
    • While Java has some good to great solutions to various related problems, it's really not the best language out there for vast amount of users; it doesn't scale well to extremes without tuning. However there's multi-VM solutions to this which somewhat fix the issue, for example Terracotta is said to do the job well.
    • While C++ is rather cumbersome, it allows for such a low-level interaction with the system that you may actually find yourself doing things you thought you couldn't do. I'm thinking of something like dynamic per-core microclustering of runtime code blocks for "filling" every possible clock cycle of the processor as efficiently as possible for maximum performance and things like that.
    • Mono is far behind the .NET VM/equivalent on Windows platforms so you wouldn't be able to use the latest and fanciest features of C#. However Windows XP (x64) OEM licenses are so laughably cheap at the moment that with small investment you could get a bunch of those and you could then run your code on the platform it was meant to be. And don't fall into the Linux hype, Linux is your saviour only if you really know how to use it and especially XP is pretty damn fast and stable nowadays.
    0 讨论(0)
  • 2021-02-01 09:07

    Erlang is a language which is designed around concurrency and distribution over several servers, which is perfect for server software. Some links about Erlang and game-servers:

    http://www.devmaster.net/articles/mmo-scalable-server/

    http://www.erlang-consulting.com/euc2005/mmog/mmog_in_erlang.htm

    I'm thinking of writing a game-server in Erlang myself.

    0 讨论(0)
  • 2021-02-01 09:10

    C++ and Java are quite slow compared to C. The language should be a tool but not a crutch.

    0 讨论(0)
  • 2021-02-01 09:15

    There is a pretty cool framework in development that addresses all your needs:

    Project Darkstar from Sun. So I'd say Java seems to be a good language for game server development :-)

    0 讨论(0)
提交回复
热议问题