Advertisement

Using RakNet with C#

Started by June 08, 2015 08:44 AM
1 comment, last by Postie 9 years, 5 months ago
Hi guys,
I'm building a Open World Survival RPG in C# and I'm looking for advice on network libraries. I started out by rolling my own socket connections, but got a short way into it and thought "there must be existing libraries out there" and starting looking around. I came across RakNet relatively quickly and people say good things about it, so I decided to give it a try.
I grabbed the source and I've spent 4 hours trying to get the examples compiling. I followed the c# tutorial and ran into issues, such as the build failing due to missing folders. So I fixed that by creating the folders. Then there were files missing from the project. I found them and added them to the project. None of the generated files have any standard "using" clauses, so I add the required "using" clauses to the generated code. Now I'm stuck with build errors such as "Cannot implicitly convert type 'RakNet.Row' to 'RakNet.TableRow'" or "Cannot apply indexing with [] to an expression of type 'RakNet.SWIGTYPE_p_DataStructures__ListT_DataStructures__Table__Cell_p_t'"... the list goes on...
It seems like parts of the RakNet source are out of date or the c# source generated by swig is messed up somehow. Or perhaps the swig tutorial I followed isn't up to date?
This brings me to my questions:
1) Does anyone know what I'm doing wrong with RakNet, and is it salvageable?
2) Can anyone suggest a different networking library for use with C# for simple multiplayer (8 simultaneous players) which may be easier to get up and running?
3) Should I just go back to rolling my own?
[size="2"]Currently working on an open world survival RPG - For info check out my Development blog:[size="2"] ByteWrangler
I could be wrong, but my understanding is that lidgren is the game networking library of choice when it comes to developing in C# and .Net.

The old repository is here, which you'll want for the getting started guides and tutorials:
https://code.google.com/p/lidgren-network-gen3/

The new repository is here, which you'll want for an up-to-date codebase:
https://github.com/lidgren/lidgren-network-gen3

It doesn't seem to have a NuGet package, as best I can tell.
Advertisement

I saw lidgren mentioned in a few of the articles I found, but was swayed towards RakNet. Time for me to check it out..

[size="2"]Currently working on an open world survival RPG - For info check out my Development blog:[size="2"] ByteWrangler

This topic is closed to new replies.

Advertisement