Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  4. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Any one experienced enet with Unity3D

Discussion in 'Connected Games' started by benzsuankularb, Feb 4, 2018.

  1. benzsuankularb

    benzsuankularb

    Joined:
    Apr 10, 2013
    Posts:
    127
    I'm choosing between enet and LiteNet

    LiteNet is very active and supported for Unity.

    however enet gain a lot of performance, anyone here experienced these lib with Unity before.

    P.S. Is that general to have only 500 CCU per server machine?
    P.S.2 Will I going to gain more CCU by moving from reliable UDP to TCP?
     
    Last edited: Feb 4, 2018
  2. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,725
    ENet looks by far the best option, and most gentle on your servers. Not moved to ENet yet, but it's on my list of updates.

    I think 500 CCU per server is pushing the upper limit, once you figure in NPCs, MOBs and other things that the server is simulating and broadcasting changes from. Any more than that and you'd want to think about different servers controlling pieces of the map and passing players between them as needed.

    I'm going with 4km square maps, and a 500 CCU max, maybe less; see how it goes and adjust to realities.

    I would guess that moving from reliable UDP to TCP would reduce max CCU. Sequenced UDP is ideal for movement and other server broadcast packets that are not 100% important, with reliable UDP for the more important things like client to server packets.
     
    Last edited: Feb 4, 2018
  3. pachash

    pachash

    Joined:
    Apr 2, 2014
    Posts:
    48
    In the light of UNET deprecation I'd like to bump this topic :) I only need a reliable and fast transport layer and I thought LLAPI would fit my needs but it looks like it a) has its own performance issues b) is going to be deprecated some day.

    So the question is whether anyone had positive experience of using enet native library with Unity? Specifically in a Unity application built for a mobile device.

    After googling around I found C# bindings for enet: https://www.zer7.com/software/enetcs (or even better https://github.com/NateShoffner/ENetSharp)
    At the first glance it includes MacOS and Linux native libs. However no Android and iOS native libraries are mentioned there. Of course I can give it a try and build the required libraries but maybe someone already did that in the past :)
     
    Last edited: Aug 18, 2018
    benzsuankularb likes this.
  4. pachash

    pachash

    Joined:
    Apr 2, 2014
    Posts:
    48
    benzsuankularb likes this.
  5. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    327
    There's nothing special. You only need CMake with GNU Make or Visual Studio. You can just grab compiled libraries from the release section by the way.
     
    Last edited: Aug 20, 2018
    benzsuankularb, pachash and wobes like this.
  6. benzsuankularb

    benzsuankularb

    Joined:
    Apr 10, 2013
    Posts:
    127
    Way too awesome.
     
  7. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    327
    If you encountered some problems, please check this section. I answered many basic questions there, so this may help. By the way, API reference is ready for use.
     
    wobes likes this.
  8. Njb_

    Njb_

    Joined:
    Jun 3, 2015
    Posts:
    20
    Im interested bit it doesnt seem to support mobile platforms.
     
  9. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    327
    Here's an answer to a question regarding support for mobile platforms.
     
  10. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    327
    In the latest version, I've added support for a custom memory allocator. So, now you have full control over memory allocations, and you can use whatever you want instead of malloc. A simple example is here.
     
  11. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    327
    I've added support for iOS in the latest version. You can compile your project in XCode with the native library. The wrapper now works with IL2CPP (thanks to @JoshPeterson).