Search Unity

DOTSNET - High Performance Unity ECS Networking from the creator of Mirror!

Discussion in 'Assets and Asset Store' started by mischa2k, May 1, 2020.

  1. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
  2. BitPax

    BitPax

    Joined:
    Oct 4, 2019
    Posts:
    89
    Three questions!

    1. I just started my project and just finished writing my network authenticator code using Mirror. If I were to use DOTSNET would it be easy to refactor the network authenticator code?

    2. Does it work well on Unity 2019 LTS?

    3. Is it more stable than Mirror?
     
    Last edited: Nov 18, 2020
  3. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Hi,
    1. NetworkAuthenticator is almost the same

    2. 2020.1 is recommended, with exactly the right ECS packages

    3. Do you have stability issues with Mirror? DOTSNET itself has over 90% test coverage. While it does not have that many features yet, the ones that it has should be very stable due to 90% of them being tested constantly. DOTSNET uses Unity's DOTS/ECS tech though. This one is not very stable. I reported ~12 bugs to Unity, I don't think any were fixed yet. In fact they removed the ECS packages from the Editor a few months ago.

    Honestly if you don't absolutely need insane scale, then use Mirror & MonoBehaviour. MonoBehaviour is way more stable and 10x easier to work with.

    ECS is 1000x faster (not an overstatement), but also 10x harder to work with and not stable.
     
    BitPax and dannyalgorithmic like this.
  4. dannyalgorithmic

    dannyalgorithmic

    Joined:
    Jul 22, 2018
    Posts:
    100
    The nanosecond ECS has something like feature parity with the Monobehaviour world, imma pick this up. I love your work.
     
  5. BitPax

    BitPax

    Joined:
    Oct 4, 2019
    Posts:
    89
    Thanks for the honest and detailed reply! I bought DOTSNET to support your efforts during the sale. I guess I'll wait for Unity to make things more stable before using it for now. I only use LTS versions of Unity because I need a stable environment to work in to get everything to production.
     
  6. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    That's definitely the sane thing to do. Unity LTS + MonoBehaviour is your biggest chance to release a multiplayer game at the moment.

    DOTSNET isn't going away. As ECS evolves, so will DOTSNET. We have time.
     
    Mikael-H, dannyalgorithmic and BitPax like this.
  7. dannyalgorithmic

    dannyalgorithmic

    Joined:
    Jul 22, 2018
    Posts:
    100
    :-D
     
  8. Deleted User

    Deleted User

    Guest

    How to select one of the existing clients as the server role after the server is offline
     
  9. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    DOTSNET does not come with host migration, you would have to implement that yourself.

    Or just host on a dedicated server so you avoid that problem. Won't be able to connect to most clients' computers anyway :)
     
    dannyalgorithmic likes this.
  10. BitPax

    BitPax

    Joined:
    Oct 4, 2019
    Posts:
    89
    Regarding Mirror is it ok to write code in ECS format and would I get a boost? I understand DOTSNET is actually designed for this from the bottom up but would I get a boost in Mirror if I wrote my code in the ECS way?
     
    dannyalgorithmic likes this.
  11. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Mirror is 100% MonoBehaviour world. Not compatible with ECS.
     
    BitPax likes this.
  12. BitPax

    BitPax

    Joined:
    Oct 4, 2019
    Posts:
    89
    If I want to get a game to production using DOTSNET what's the exact version of Unity I should be using (or that you recommend?)
     
  13. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    2020.1.2 is current DOTSNET Unity version.
    I am trying 2020.1.16 this morning actually. Should be safe.
     
    BitPax likes this.
  14. BitPax

    BitPax

    Joined:
    Oct 4, 2019
    Posts:
    89
    Unity is so unstable. Like I've had things break even with the smallest version changes (and it was an LTS version) and had to revert back.

    Why not just support the latest LTS version so you can concentrate on long term development so you only have to periodically update to the next LTS version and so on?
     
    Last edited: Dec 7, 2020
  15. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    I would love to.
    All my other assets are always on LTS, which is way less stressful.
    ECS seems to early though. Unity doesn't updated the 2019.4 LTS Entity packages anymore as far as I know, so we need to be on bleeding edge probably until 2020 LTS :)
     
    BitPax likes this.
  16. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    V1.21 pending review. Maintenance release to prepare for further features.

    2020-12-09_15-29-48@2x.png
     
    toomasio, Lionious and BitPax like this.
  17. Rocky_Unity

    Rocky_Unity

    Joined:
    Oct 13, 2017
    Posts:
    96
    This might be a silly question vis2k... but how did you get so good at writing code? I dream of being as fluent as you are! I've been struggling the past few weekends to write a reliable system for applying unique Entity Id's to entities that pre-exist in a scene (Forge Networking Alloy)... and here you are pioneering this bad*** ECS networking code. It's an inspiration really
     
  18. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Thanks. Been writing code 80-100 hours / week for the last 15 years.
    Still somewhat new to networking and ECS, so while the existing DOTSNET features are solid, it's definitely not in its final form yet :)

    I do all of this for my MMO.
    If you have a dream game, just do whatever it takes.
    You get better at coding automatically, that's a side effect of pursuing your goal.
     
  19. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    V1.22 pending review:
    2020-12-12_00-14-42@2x.png
     
  20. WardGames_JohnShin

    WardGames_JohnShin

    Joined:
    Apr 23, 2019
    Posts:
    5
    Hi

    First, Thanks for this awesome asset.
    I bought this asset and reading the manual.
    I've developed my game using Monobehaviour environment and Photon Pun for multiplay.
    But I want to change some game systems to DOTS, and I want to change multiplay code from Photon Pun to others too.
    So I consider DOTSNET and Mirror for multiplay.
    I've some questions about DOTSNET.

    1. When I can use DOTSNET for the mobile platform?
    2. Is DOTSNET or Mirror suitable for session-based action games like Brawl Stars?

    I hope you reply to my question.
    Thanks.
     
    Last edited: Dec 17, 2020
  21. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    It runs where Unity runs. Just need to use the kcp transport instead of libuv transport.

    I recommend using Mirror & MonoBehaviour unless you have no other choice but to use ECS.
    ECS is hard to work with. Why bother going the hard way if you don't need insane scale for your game :)
     
  22. Doris232

    Doris232

    Joined:
    Dec 18, 2020
    Posts:
    2
    Whoever plays or has ever played EVE knows that you need to keep an eye on your spark to stay on top. Isk allows us to survive all wars, clashes and sometimes skirmishes. The more Isks, the greater the chances of survival, and we all agree that in normal and virtual life we only want ... survival. Isk gives us such an opportunity. Isk gives us hope to continue playing !! Thanks to Isk, we can sleep well because even when the attack comes from a non-Isk, it will allow us to stand on our feet later.
     

    Attached Files:

    Last edited: Feb 20, 2021
  23. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    One step after another :)
    The first goal was to simply sync ECS monsters & players over the network somehow.
    More advanced features will follow as time allows. Currently working on Bitpacking.
     
  24. WardGames_JohnShin

    WardGames_JohnShin

    Joined:
    Apr 23, 2019
    Posts:
    5
    Thanks for reply.
    I determined using Mirror for our multiplay game.

    I have one more question.
    I want to use a cloud server solution for service like Amazon GameLift.
    When I make our game server using Mirror, then it can be integrated with Amazon GameLift for cloud service?
     
  25. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    yes, you can host it anywhere. see mirror documentation :)
     
  26. WardGames_JohnShin

    WardGames_JohnShin

    Joined:
    Apr 23, 2019
    Posts:
    5
    I'll try it.
    Thanks, Really Thank you.
     
  27. BitPax

    BitPax

    Joined:
    Oct 4, 2019
    Posts:
    89
    If I'm using gameObjects with Unity DOTS for pathfinding. (Basically ECS mixed with MonoBehaviour.) Should I be using Mirror or DOTSNET for multiplayer?

    EDIT: Basically, if I'm running all my game logic code in DOTS, but everything else (visual stuff) is using standard Unity MonoBehaviours, which should I be using?
     
    Last edited: Dec 28, 2020
  28. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    ECS is capable of that hybrid approach.
    If it was me I'd do it 100% ecs or 100% monobehaviour.
    Seems less stressful :)
     
    dannyalgorithmic likes this.
  29. BitPax

    BitPax

    Joined:
    Oct 4, 2019
    Posts:
    89
    It's just UI requires a TON of work at this point in time when going down the ECS path because there's nothing there yet. Also it's still nice to take advantage of the Jobs System and Burst Compiler even if visual elements are traditional MonoBehaviours for a pretty big boost in performance.

    Sure, it won't be as fast as pure DOTS but it'll still be a lot faster than the traditional way.

    What do you recommend for multiplayer when visual stuff are MonoBehaviours but logic is ECS, Mirror or DOTSNET (or do I need a completely different solution)?
     
    Last edited: Dec 29, 2020
  30. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Depends on what you mean with 'visual stuff'.
    For UI it's fine to use MonoBehaviour. I do that for the DOTSNET examples too.
     
  31. BitPax

    BitPax

    Joined:
    Oct 4, 2019
    Posts:
    89
    Like the players moving in the game being Monobehaviours. Basically anything the user can see on the screen.
     
  32. caglarenes

    caglarenes

    Joined:
    Jul 9, 2015
    Posts:
    45
    Is it possible to create and use multiple game instances in DOTSNET like Mirror "Multiple Matches" example scene?
     
  33. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    In theory yes.
    ECS uses worlds, so you can have as many as you want.
    I never tried it yet and DOTSNET still uses Bootstrap.ServerWorld/ClientWorld.

    In other words, it's not built in yet but ECS itself makes it very easy.
     
  34. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Bitpacking coming to next version, based on the excellent article from Glenn Fiedler.

    Comparison: 2015 Macbook Pro sending 50k monsters to 1 player.
    Server & Client running in simultaneously in 2020.1 Unity Editor.
    => Before: 24 FPS, 10 MB/s bandwidth.
    => After: 63 FPS, 4.17 MB/s bandwidth.

    Bandwidth impact is huge.
    Transport load is heavily reduced, hence huge performance gain as well.
    2021-01-06_18-43-23 - 50k at 65 FPS with HEAVY NT Bitpacking and 4MB per second.png
     
  35. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    V1.23 pending review! Huge update!
    2021-01-06_19-48-44@2x.png

    Also added a Bitpacking chapter to the documentation:
    2021-01-06_20-09-10@2x.png
     
    Last edited: Jan 6, 2021
  36. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    V1.24 pending review! Please try the new kcp transport version in your project and let me know if it works for you!
    The goal is for kcp to become the new default next.
    2021-01-11_11-45-23@2x.png
     
    dannyalgorithmic likes this.
  37. Marco-Playable

    Marco-Playable

    Joined:
    Nov 12, 2020
    Posts:
    53
    Seeing two warnings with 2020.2.0a18.
    Do I need to downgrade Unity or wait for a newer DOTSNET release?

    Assets\Plugins\DOTSNET\Scripts\Authoring\NetworkEntityAuthoring.cs(135,45): warning CS0618: 'PrefabStage.prefabAssetPath' is obsolete: 'prefabAssetPath has been deprecated. Use assetPath instead.'

    Assets\Plugins\DOTSNET\Scripts\ECS\Worlds\Bootstrap.cs(40,13): warning CS0618: 'ScriptBehaviourUpdateOrder.UpdatePlayerLoop(World, PlayerLoopSystem?)' is obsolete: 'Use AddWorldToPlayerLoop() instead. (RemovedAfter 2020-10-31)'
     

    Attached Files:

  38. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Hi, please use exactly the Unity version & ECS package versions that I recommend for DOTSNET. See asset store page. 2020.2 especially is very unstable, both for DOTSNET and Mirror.
     
  39. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    V1.25 pending review:
    2021-01-21_10-35-46@2x.png
     
  40. PesadeloDoEspantalho

    PesadeloDoEspantalho

    Joined:
    May 26, 2017
    Posts:
    45
    "Requires ECS knowledge & exactly Unity 2020.1.16, Burst 1.4.3, Entities 0.16.0, Unity.Physics 0.5.1, HybridRenderer 0.10.0,!"

    That's don't work with DOTSNET 1.25

    "Assets\DOTSNET\Scripts\ECS\Worlds\ServerActiveSimulationSystemGroup.cs(33,52): error CS0103: The name 'm_systemsToUpdate' does not exist in the current context"

    "Assets\DOTSNET\Scripts\ECS\Worlds\ClientConnectedSimulationSystemGroup.cs(33,52): error CS0103: The name 'm_systemsToUpdate' does not exist in the current context"

    There is no need to change the versions* that install automatically with the package DOTSNET?

    *(Unity 2020.1.16, Burst 1.3.2, Entities 0.14.0, Unity.Physics 0.4.1, HybridRenderer 0.8.0)
     
    Last edited: Jan 23, 2021
  41. dannyalgorithmic

    dannyalgorithmic

    Joined:
    Jul 22, 2018
    Posts:
    100
    mischa2k likes this.
  42. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Please use exactly the Unity version + packages mentioned on the asset store page.
    Unity changed m_systemsToUpdate recently.
    This works 100%:
    2021-01-25_19-01-55@2x.png
     
    dannyalgorithmic likes this.
  43. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    V1.26 pending review!
     
    unity_4XmM7WgLIz0pXA likes this.
  44. SixDimensional

    SixDimensional

    Joined:
    Nov 6, 2015
    Posts:
    4
    Would it be worth developing my game fully as an ECS DOTS singleplayer game while learning ECS, then adding DOTSNET after while keeping in mind the server/client structure with the singleplayer game? How hard would it be to add DOTSNET to an existing ECS game with some Monobehaviors on the "client" side (for UI and things?)
     
  45. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    It would be hard.
    Multiplayer games should be developed with multiplayer in mind from day one. Anything else is crazy imho.
    I also recommend not using ECS unless you have no other choice (insane scale).
    MonoBehaviour is way easier to work with. And you could use Mirror for networking, which is free.
     
  46. gianni22

    gianni22

    Joined:
    Apr 26, 2015
    Posts:
    5
    I HAVE PROBLEM

    TcpStream 2549191923520 error de lectura: -4077: libuv2k.Native.OperationException: ECONNRESET (ECONNRESET): ECONNRESET: conexión restablecida por par
    UnityEngine.Debug: LogError (Objeto)
    libuv2k.TcpStream: OnReadCallback (Byte [], Int32) (en

    First connect server and after clien and crach

    Please help!
     
  47. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Please try the kcp transport that comes with DOTSNET :)
     
  48. nauroman

    nauroman

    Joined:
    Nov 1, 2014
    Posts:
    13
    Hello and thank you for your amazing asset.

    Is it possible to update it to Unity 2021.1 to let DOTSNET work with Hybrid Renderer 0.11 ?
     
  49. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Currently updating it to 2020.3 LTS.
    I recommend that version after the update.
    Anything non LTS is usually way too unstable, especially for a game server.
     
  50. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Quick update, pending review. More to come :)
    2021-03-29_18-48-20@2x.png