High traffic Game Server (C# vs C++ with Boost)

Started by
17 comments, last by Smjert 15 years, 5 months ago
For about the last week ive been going on a 'language/library/engine/framework' tryout spree to try to find the best framework for my Game Server. Currently, Its has come down to C# or C++ (with Boost). ----------------------------------------------------------------------- Looking at the Pros and Cons of a C# Server. Pros: - Faster Development Time - Easier to implement 'modular' support (Class Libraries) - Huge Integrated Framework (.NET 3.0) - Easier for n00bies to jump on Cons: - Slower Performance - Windows Only (Virtualizing with Mono is not ideal) ----------------------------------------------------------------------- Looking at the Pros and Cons of a C++ (with Boost) Server. Pros: - Performance (if programmed correctly) - Will work on any x86/x64 platform. Cons: - Slower development time. - Harder for n00bies to jump on. (Unless they are very skilled in C++) - Although Boost has alot of framework pieces already done, it still is missing some things I need. ------------------------------------------------------------------------- Ive been finding it really hard to make my decision.
Advertisement
IMHO portability should be a major concern and I would thus vote for C++ and abstract the lower-level net code into some wrappers.
First, as someone who has done high-performance distributed computing with Mono, I'm somewhat surprised about that "virtualization not ideal with Mono" claim, especially since the needs of a video game are probably not as complex or heavy as those of distributing computing grids.

Second, a game server is something huge, which involves a lot of parts that have no reason to be written in the same language. Some parts, such as the low-level UDP socket manipulation, may indeed deserve to be done in C++, but there's no reason to do the high-level work in C++ (especially since you will probably want to gain a lot of performance through multithreading, which C# supports far better than C++).
Personally, my opinion for a smaller team size (i.e. < 10 developers) would be to go with whatever you'd be most productive in. For most people, that's going to be C# by a long margin...
"game server" can mean a server for a poker site, or a server for an in-browser 2D game, or a serer for an MMO game, or a server for an FPS, or one of a number of different kinds of servers.

First, asnwer the question: What is your game? What requirements does it have?
Once you know that, you can whittle down the list of available technologies.
enum Bool { True, False, FileNotFound };
Quote:Original post by lordcorm
- Windows Only (Virtualizing with Mono is not ideal)


Sorry, but what? Mono doesn't virtualize anything, .NET/CLR code is assembled on a specific bytecode format, Jitted/AOT'ed later by the mono runtime or the .NET runtime.
Quote:Original post by ToohrVyk
Some parts, such as the low-level UDP socket manipulation, may indeed deserve to be done in C++

Que? The speed of the network is so much slower than the code interacting with the network that at no point in time would the network code be a bottleneck compared to your ability to transmit data, especially if you use IOCP (which C# sockets are inherently built to do when you use the asynchronous method calls such as BeginSend/EndSend).
Quote:but there's no reason to do the high-level work in C++ (especially since you will probably want to gain a lot of performance through multithreading, which C# supports far better than C++).

So very true also there's the ease with which you can mix managed and unmanaged code, although there are plenty of performance penalties for doing such and so you should be extra sure to profile first before and after you attempt such intermixing...

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

Quote:Original post by hplus0603

First, asnwer the question: What is your game? What requirements does it have?
Once you know that, you can whittle down the list of available technologies.


Its actually an MMO Emulator, so i dont expect to have as much traffic as a live commercial server.

The most i expect on a server at the time is 2,000 (and thats not on one zone, but one cluster.)
How will you reach 2,000 players and have them all play your emulator all at the same time?

Anyway, there was an Ultima server emulator written in .NET a few years back, and I think it did 2,000 users in pure .NET.
enum Bool { True, False, FileNotFound };
Quote:Original post by hplus0603
How will you reach 2,000 players and have them all play your emulator all at the same time?


The game im emulating used to be huge, and there are several server communities waiting for a server to be done (there are actually several other teams working on the same game, but not doing too well of a job) that have around 5,000 members on their forums (but only around 500 - 1,500 are active atm).

But yea, ill look into those servers then and see what they did for load distro and session handling then, because im fairly new to C#, but a 2 year veteran of using C++. (which both of the languages are very similar so its not really a problem of learning syntax, just where everything is in the .NET framework, because i never used managed C++.)

Anyway, thanks for the help guys.

This topic is closed to new replies.

Advertisement