Jump to content
  • Advertisement
Sign in to follow this  
menyo

Free networking framework for C#?

This topic is 721 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,

 

I know Unity has it's own networking API but in the past I have run into major issues running this outside a local network where I got NAT Punchtrough errors, strangely these seem to be still present and I don't want to run into the same wall again. Recently I have been working a lot with Java/Libgdx and the Kryonet framework for networking, and this works great. Now I want to play around with Unity again and I was wondering if there is something like KryoNet for C#. I know there are some paid networking frameworks like Photon but I just want to play around and perhaps eventually setup my own server somewhere so I have full control over it.

 

I have been looking into C# socket programming and this works, but it's hard to make a robust client/server system without tons of knowledge. So is there a framework, perhaps similar to KryoNet for C#, that would work with Unity? Where I could just run the server without problems locally or from Raspberry Pi and connect anywhere with a service like noip.com or eventually from a paid service like VPS, AWS, Azure, etc. Or perhaps the HLAPI or the Transport layer do work now or there is some work around for that NAT Punchtrough error?

 

More specifically, I want to create a lobby and a matchmaking system where 2 or more users can play games with/against each other.

 

Thanks,

Share this post


Link to post
Share on other sites
Advertisement

I was actually using System.Net for writing my own Socket application and wasn't aware of WCF. I will be looking into it, all I currently need is functionality to send data between server and clients. I currently also have a working connection between a Unity client and a C# console server using Lidgren.Network.

 

edit:

Just looked at that link and that actually looks amazing. It looks to be well documented, I can't believe I missed that in all my searches.

Edited by menyo

Share this post


Link to post
Share on other sites
WCF is wholly unsuitable for the front-end networking of multiplayer games. It can work fine for back-end service-to-service communications.

Lidgren is a C# game networking library. I don't know how easy it would be to integrate with Unity, whether the assemblies would work as-is, and such, but it might be worth a shot.

Share this post


Link to post
Share on other sites

WCF is wholly unsuitable for the front-end networking of multiplayer games. It can work fine for back-end service-to-service communications.

Lidgren is a C# game networking library. I don't know how easy it would be to integrate with Unity, whether the assemblies would work as-is, and such, but it might be worth a shot.

 

It works good with unity. But I have to poll for new messages instead of catching it in a observer pattern. I currently got this polling working but I actually want to extend it with a observer pattern so I can override something like void OnGameWorldChanged(). But first I want to familiarize myself a bit more and have some sort of chat/lobby application with rooms.

Share this post


Link to post
Share on other sites

I have to poll for new messages instead of catching it in a observer pattern.


The good news is that it's easy to go from polling to observer -- all it takes is a hash table :-)
Glad to hear it's working alright for you; please let us know how it works out in the future.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!