• Advertisement
Sign in to follow this  

Network APIs/Engines with .NET?

This topic is 4681 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there, I was wondering if there are any networking APIs/engines that can be used (or even designed specifically for) .NET languages. My primary language is VB.NET but I can use C# if needed. I am creating an RPG that needs a server capable of handling around 200 simultaneous users. I am well aware that coding a server in .NET is not the most optimized way to go about it but it is the choice I have made. I am quite certain that a well coded server in .NET can handle 200 simultaneous users on top of the line hardware no problem. Numerous reverse engineered MMORPG servers are coded in .NET as well. Sorry about the previous paragraph, just trying to squash some anticipated flames. I have been working on my RPG for over 5 months and have been starting recently to research how to integrate multiplayer aspects. So if anyone knows of any network API/engines (like raknet) that are well suited to .NET, I would like to hear about it - thanks.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by biosphere
Hi there, I was wondering if there are any networking APIs/engines that can be used (or even designed specifically for) .NET languages.

Honestly I would use the .NET framework for this.. literally. All you need to do is use System.Net and System.Net.Sockets and come up with a serialization strategy and you can have a working implementation in no time.

Quote:

I am well aware that coding a server in .NET is not the most optimized way to go about it but it is the choice I have made.

Actually you are wrong. Right now one of our prototype servers can handle over 2000 concurrent players and is actually running faster than the C++ version due to some design and refactoring. You should note that when talking about pure application performance C# and C++ pump out pretty much equal performance and especially in the problem space of servers.

Quote:
I am quite certain that a well coded server in .NET can handle 200 simultaneous users on top of the line hardware no problem.

Connections / simulataneous users are completely according to your problem space. You could spin off thousands of users per actual server obviously completely dependant on how much information you are sending across the wire.

Quote:

Numerous reverse engineered MMORPG servers are coded in .NET as well.

RunUO has actually been load tested holding 3200 active players (on a single quad-Xeon server) whereas EA's C++ server code can't handle that many concurrents :) RunUO is a very nicely designed/refactored server though.


Quote:

So if anyone knows of any network API/engines (like raknet) that are well suited to .NET, I would like to hear about it - thanks.

I am not sure why you would look for an external dependancy before looking at the .NET framework itself? I mean .NET sockets are fairly straight forward and easy and you should have a working basic client/server by the end of the night, and from there you can start refactoring and bringing in serialization, etc.

Share this post


Link to post
Share on other sites
Thanks for the reply. Glad to see that .NET is a very viable platform for servers. I was expecting people to just tell me to use C++ hence my comments.

I was looking for a premade library for me to use mostly to save me time - I am not good with lower level socket programming as I simply do not know much about it at this time (from a programming perspective). A library of some kind would presumably have its bugs and instabilities worked out for the most part and would be easier to use than straight sockets (or at least not as low level). It looks like I will have to research the regular sockets and use that. It will take some time to research and program but I guess making my own is the only viable option.

Do you by any chance know of any design documents/diagrams of MMO server structure? I am going to have a world server(to handle player movement and interaction), a chat server, and possibly an NPC server. By server I mean application, they all might be able to be run on the same machine if the specs are high enough and its coded as well as I want it to be. Anyways, I will begin my research and planning tonight - I don't expect to write any code for a week or two at least.

Share this post


Link to post
Share on other sites
It is completely dependant on the game and structure as there are many ways to build depending on your problem space. There is no library that is just a pre-built MMO server or the like built using the .NET framework, this is something that you would have to roll yourself.

The .NET framework sockets are nowhere near low level programming imo. I mean you could have a library up in a day as I said as it is very easy. You can then go through and refactor things such as serialization, using the Ex methods for building/pooling, etc. The hard part is going to be structuring the server to provide asynchronous processing and have it designed properly and interop with your other services properly.

I prefer TCP myself which is what the majority of MMO games are built using. Some use a hybrid approach of TCP and than UDP for movement only as it really doesn't matter if you lose those packets. Although if you have a game that is point and click movement I would stay strictly with TCP.. which for example is used by World of Warcraft(tcp), Camelot (hybrid), Everquest (hybrid), Ultima Online (tcp). Really the only UDP based MMO games that I know of are City of Heros and Asherons Call, although obviously there may be others I don't know the details on every single one.

Now this is where it comes down to you asking for a library. If you are using a TCP approach you have zero need for a library as I have said. Although if for some reason you want to use a UDP approach you would want a reliability/ordering system in which you would want a library for but I have not seen one in .NET yet.

Share this post


Link to post
Share on other sites
I've built a library (http://www.lidgren.net/programming/network/) but i'm completely reubuilding it (again!) You might get some ideas from it at least...

Share this post


Link to post
Share on other sites
Thanks for the replies. fengus, I will check out your code when I have some free time( next week), thanks for sharing it. Saruman, I have decided on tcp as my protocol because I dont want to deal with the inherent issues of UDP and being connectionless. My RPG is 3D but the view is isometric/top down so I can really localize the data that needs to be sent to each client to keep bandwidth usage down.

I have a lot to think about while I write a basic client/server using the .net sockets with regards to how I am going to structure my server. I need to refactor my RPG as part of this process. I also need to look into database backends.

I am thinking mySQL(I don't know a huge deal about databases at this time) for my server as well as some XML stuff for basic server settings/configs and such. I am planning on the main server to handle player movement and all game interactions, with a chat server and NPC server. I think that will be what I end up with as the core applications - I might make some kind of dedicated DB server to deal with mysql to save my main server app some time but I'm not sure how useful this will be since my main server will need to grab info as fast as possible from a database(i.e. on the same machine). I will also look at some of the open source MMO emulator projects for ideas and how they set things up.

I realize I am not the most knowledgable or qualified in these areas but I have faith that with some research and proper planning I can make something that is good enough for my purposes. I am most definitely not trying to make the next WoW or EQ2.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement