Good language to develop a game server in?

前端 未结 15 1214
悲哀的现实
悲哀的现实 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:25

    What are your objectives? Not the creation of the game itself, but why are you creating it?

    If you're doing it to learn a new language, then pick the one that seems the most interesting to you (i.e., the one you most want to learn).

    If it is for any other reason, then the best language will be the one that you already know best and enjoy using most. This will allow you to focus on working out the game logic and getting something up and running so that you can see progress and remain motivated to continue, rather than getting bogged down in details of the language you're using and losing interest.

    If your favorite language proves inadequate in some ways (too slow, not expressive enough, whatever), then you can rewrite the problem sections in a more suitable language when issues come up - and you won't know the best language to address the specific problems until you know what the problems end up being. Even if your chosen language proves entirely unsuitable for final production use and the whole thing has to be rewritten, it will give you a working prototype with tested game logic, which will make dealing with the new language far easier.

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

    You could as well use Java and compile the code using GCC to a native executable.

    That way you don't get the performance hit of the bytecode engine (Yes, I know - Java out of the box is as fast as C++. It must be just me who always measures a factor 5 performance difference). The drawback is that the GCC Java-frontend does not support all of the Java 1.6 language features.

    Another choice would be to use your language of choice, get the code working first and then move the performance critical stuff into native code. Nearly all languages support binding to compiled libraries.

    That does not solve your "python does not multithread well"-problem, but it gives you more choices.

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

    The obvious candidates are Java and Erlang:

    Pro Java:

    • ease of development
    • good development environments
    • stability, good stack traces
    • well-known (easy to find experienced programmers, lots of libraries, books, ...)
    • quite fast, mature VM

    Pro Erlang:

    • proven in systems that need >99.9% uptime
    • ability to have software updates without downtime
    • scalable (not only multi-core, but also multi-machine)

    Contra Erlang:

    • unfamiliar syntax and programming paradigm
    • not so well known; hard to get experienced programmers for
    • VM is not nearly as fast as java

    If your game server mainly works as a event dispatcher (with a bit of a database tucked on), Erlang's message-driven paradigm should be a good match.

    In this day and age, I would not consider using an unmanaged language (like C or C++); the marginal performance benefits simply aren't worth the hassle.

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