C# higher level network library

Started by
14 comments, last by DvDmanDT 9 years, 9 months ago

Hi everybody! smile.png

So, I'm making a multiplayer game and I'm looking for a library that's built for multiplayer games, that easily (or at least without making me write the entire netcode) allows me to make a client-server system that syncs the entities' data, such as position, rotation, scale and so on.

If possible I don't want to rely on cloud-based systems like Photon, APlay and stuff like that.

First of all, does it even exist a library like that? If not, what framework is the best to make one? Lidgren or RakNet (now open source)?

Thanks to everyone who will help me! happy.png

Advertisement

lidgren

lidgren

Well, maybe I explained myself badly: I'm looking for a library that makes me easier to sync my entities, and Lidgren is indeed powerful, but using it I would be forced to write the entire netcode, which I want to avoid for various reasons.

I don't think you'll find something higher level without using an entire engine. I'm not sure I can see how such a library would even work. How would it know what to synchronize and how would it actually perform the synchronization when it receives data?

Netcode is usually intricately tied to the game engine itself.
Thus, if you want the "sync" part, you will typically also want the "entities" part of a game engine.
Most game engines that do this are complete solutions (adding graphics, too) such as Unreal Engine 4, C4 Engine, Torque 3D, etc. (I'd recommend for UE4 or C4, against Torque.)
enum Bool { True, False, FileNotFound };

SmartFox sounds more like what you are looking for. It is a discreet instance running on your own server will handle connecting and sending data back and forth from the client to the server. But as was mentioned no matter what route you go you will have to write some code yourself.

Netcode is usually intricately tied to the game engine itself.
Thus, if you want the "sync" part, you will typically also want the "entities" part of a game engine.
Most game engines that do this are complete solutions (adding graphics, too) such as Unreal Engine 4, C4 Engine, Torque 3D, etc. (I'd recommend for UE4 or C4, against Torque.)

Thank you for your response.

Unfortunately, for the game I'm making, there are no engines that have the features that I'm looking for.

This engine is also entity-based, but the netcode is the only part that I can't do. I tried several times, without any success.

I was interested in Janus (http://equis.cs.queensu.ca/wiki/index.php/Janus), but unfortunately it uses a peer-to-peer architecture, while I need a client-server one.

What about it is it that you're having problems with? Sending/receiving data is really easy with Lidgren. Figuring out what data to send and how to actually read/write that data from/to your entities is something that no solution will free you from, except possibly using an existing engine..

How much stuff do you need to synchronize? tens, hundreds or thousands of entities? If it's ten or so, then you can probably get away with sending everything all the time. If it's on the scale of hundreds or even thousands, then you'll need to figure out what to send to which player at each given time.

What about it is it that you're having problems with? Sending/receiving data is really easy with Lidgren. Figuring out what data to send and how to actually read/write that data from/to your entities is something that no solution will free you from, except possibly using an existing engine..

How much stuff do you need to synchronize? tens, hundreds or thousands of entities? If it's ten or so, then you can probably get away with sending everything all the time. If it's on the scale of hundreds or even thousands, then you'll need to figure out what to send to which player at each given time.

In each map there will be about from 50 to 200 entities (the maximum supported entities is 65536, a ushort) for a max of 24 CCU, and for each entity I have to send 7 data parts: position, rotation, scale, velocity, color, texture index and render depth, plus the entity unique ID.

My problem is that I know how to send/receive packets with Lidgren, but I don't know how to store and read them in an efficient way to do lag compensation and input prediction.

In fact, I'm very noob at game networking. I read numerous times the Source Multiplayer Networking, but I still don't understand it completely.

What kind of game is it?

You'll have to structure your game so it can handle not being in sync. Each entity will probably need a local state, last known "real" state and extrapolated current real state. When the local and the real state differs, you begin moving towards the extrapolated real state. You may not need to care about how an entity wound up in a specific place, all you need to care about is finding a way to get to that position within the game rules.

[edit]

Disclaimer: I have never written a game using this kind of synchronization. I'm writing an RTS with input command synchronization which comes with a completely different set of challenges. The above is just from the top of my head.

This topic is closed to new replies.

Advertisement