1
\$\begingroup\$

I am wondering if the performance of unmanaged languages like C++, Rust etc. is relevant when developing a game server or is it more about the network. For game clients, it makes sense and is probably preferred.

Do you think using C# or some language like even Python would be comparable to writing game server in C++ or some other natively-compiled language?

\$\endgroup\$
6
  • 2
    \$\begingroup\$ Networking apart, it's likely that a server written in C will perform better than a server written in C#. Like always with performance, you need to weight your options and in the end it always depends of the game itself. Most of the times servers are running on powerful machines and I would say that the most important factor for servers is bandwith optimisations. \$\endgroup\$
    – nathan
    Commented Oct 8, 2018 at 9:52
  • 2
    \$\begingroup\$ You can't generalize this. It depends on your game and how much computation you do on the server-side. Also, the skill of the programmers is far more important than the language implementation. Well-written C# code can be orders of magnitude faster than badly written C code. \$\endgroup\$
    – Philipp
    Commented Oct 8, 2018 at 10:09
  • \$\begingroup\$ I think you mean code interacting with the network will perform better, I don't think it will affect the network speed. But C# is JIT'ted, also you don't need to care about the memory. I don't think it matters much, game servers are usually not compute-intensive, unlike clients. They're just meant to receive and broadcast packets and maybe persist the data somewhere. I think you can easily create scalable game server with C# working for 100.000-1 000 000 players and more. \$\endgroup\$
    – Konrad
    Commented Oct 8, 2018 at 10:12
  • \$\begingroup\$ "I don't think it matters much, game servers are usually not compute-intensive, unlike clients. They're just meant to receive and broadcast packets and maybe persist the data somewhere." Have fun with all the cheaters. No, really, the gameserver computes all the things in its world. When the client simulates physics for its own character and its surroundings, the gameserver physically simulates possibly hundreds of thousands of entities, evalutes AI, receives and transmits thousands of packets and validates them, each tick. \$\endgroup\$
    – tkausl
    Commented Oct 8, 2018 at 13:19
  • 3
    \$\begingroup\$ Chandler Carruth had a good point in one of his CppCon talks, saying "C++ does not give you performance. C++ gives you control over performance." Whether that kind of control is necessary for the specific kind of bottleneck you're experiencing/anticipating isn't something we can answer without seeing this bottleneck demonstrated. It might be something you can cut down to size with a better choice of architecture, algorithm, or data structure — transformations you can make in practically any language. \$\endgroup\$
    – DMGregory
    Commented Oct 8, 2018 at 15:09

0

Browse other questions tagged .