Search Unity

Looking for a networking library!

Discussion in 'Multiplayer' started by dadude123, Jun 29, 2018.

  1. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    Hi there guys.
    I'm looking for a networking library that fulfills my requirements. I know there's the Lowlevel unity networking api, but since the news hit that they're working on something new (in c# even?) I definitely don't want to build anything on top of the the old stuff.

    Here's what I need:
    - Should not be abandoned by the developer
    - Low overhead to send messages (only byte[] required)
    - Automatic fragmentation of large messages and automatic re-assembly on the receiving side.
    - Channels and QoS modes like Lidgren or the unity lowlevel api have are nice to have but the only thing I really need at the moment is a ReliableOrdered mode (aka "stream mode").
    - No built in serializer, or a way to completely avoid it. I have my own serializer that I want to use for everything.
    - Should pool data-buffers for incoming data like every reasonable library. Should be generally light on the garbage collector.
    - Be connection based. There should be automatic ping, timeout and at least pseudo connection handling (even for UDP many libs to that since it's needed)

    Looking at
    https://github.com/nxrighthere/BenchmarkNet/wiki/Benchmark-Results
    there are quite a few libraries listed, but they all have some issues.

    ENet is seemingly abandoned
    UNet as well (and the lowlevel api is scheduled to be abandoned from what we know)
    Lidgren seems to be the most promising, but is abandoned. Maybe not a problem since it seems mature,
    MiniUDP sounds promising, but does not handle message fragmentation
    Hazel is pretty early in development (basically no pooling, huge byte array allocations everywhere)
    Photon is not an option (free/unlimited libraries only)
    Neutrino pretty much forces MessagePack as a serializer, which I don't want, is abandoned and does not fragementation.
    DarkRift is basically Hazel, and wants to handle too much for my needs. I need something more low-level.


    What other libraries are there?
    Should I go with lidgren?
    Valve Game Networking Sockets sounds like what I need, but it is not written in C# and there are no working bindings for it.
     
    Last edited: Jul 1, 2018
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    You reduced the available API's to 0 with your first criteria.
    There is no way to guarantee any API you choose will not be abandoned by the developer tomorrow. In fact the only thing you can be sure of is at some point the developer will abandon every API.
     
  3. RevenantX

    RevenantX

    Joined:
    Jul 17, 2012
    Posts:
    148
    What?) There is automatic fragmentation for reliable packets. And there is one copy only when you sending packet.
     
  4. cmckelvy

    cmckelvy

    Joined:
    Nov 7, 2016
    Posts:
    12
    I'm having good results with TNet which just got a new update this week. It does have its own serialization but I don't think its mandatory, but its serialization functions are awesome and you should check them out.
     
    Artaani likes this.
  5. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    Seems like you are right. I removed that part in my first post.
    I will have another look!
     
  6. AndLucLive

    AndLucLive

    Joined:
    Jul 13, 2018
    Posts:
    4
    Hi man.
    I'm developing a multiplayer network lib that supports all kind of games.
    It does some work for you like Nat Punch-through that you mentioned.
    I made it capable of working through TCP and UDP channels simultaneously so you can decide which messages should go through which channel.
    I'm still working on it but I have already a game, also in development, being made on top of this lib.
    It is working very well.

    If you want to give it a look here is the repo:
    https://github.com/andersonlucasg3/game-networking-lib-csharp

    There is no release yet, but it's coming soon (I think until August).
    So the updated code is in the develop branch.

    Hope it helps.