Jump to content
  • Advertisement
Sign in to follow this  

C# higher level network library

This topic is 1407 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 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

Share this post


Link to post
Share on other sites
Advertisement

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites
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.)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Edited by DvDmanDT

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!