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
    1950x1300.png
    (Demo) (Asset Store) (Docs) (Discord)

    “In the information age, the barriers just aren't there. The barriers are self imposed. If you want to set off and go develop some grand new thing, you don't need millions of dollars of capitalization. You need enough pizza and Diet Coke to stick in your refrigerator, a cheap PC to work on, and the dedication to go through with it. We slept on floors. We waded across rivers.” ― John D. Carmack, Masters of Doom

    Introduction
    DOTSNET brings easy to use, WoW/EvE scale AAA Networking to Unity.

    Embracing Unity's new Data Oriented Technology Stack, DOTSNET can handle both millions of entities & thousands of connections, with unmatched stability & ease of use.

    It's fun to work with, it's orders of magnitude faster than any other Unity networking solution, and comes with over 90% test coverage by default.

    MMOs with epic LotR scale battles. Infinite Sci-Fi space simulations. DOTSNET.

    2020-05-01 full project.png

    2020-05-01 PlayerMovementSystem.png
    2020-05-01 tests.png

    2020-05-07 - 90perc code coverage.png
     
    Last edited: Apr 27, 2021
    longsl, invictvs1, sirxeno and 16 others like this.
  2. TheMessyCoder

    TheMessyCoder

    Joined:
    Feb 13, 2017
    Posts:
    522
    Ive been waiting for the power of DOTS.
     
    Antypodish, Gekigengar and mischa2k like this.
  3. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    It will arrive in around 14 days :)
     
    Gekigengar, OldMage and Nyarlathothep like this.
  4. TheMessyCoder

    TheMessyCoder

    Joined:
    Feb 13, 2017
    Posts:
    522
    Nice, in time for another chat on my stream? :)
     
  5. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Hey, sorry didn't get to your DM yet.
    Will finish the work I have been putting off while releasing DOTSNET, then get back to you.
    I'll probably have time :)
     
    TheMessyCoder likes this.
  6. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    This looks fabulous performance...
     
  7. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Looks like excellent work!
     
    mischa2k likes this.
  8. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Documentation updated: added most of the API properties, functions & descriptions.
    Check it out while waiting to have an easier start.

    Around 12 days remaining until Asset Store team should review it.
    Working on V1.1 already :)
     
    hippocoder likes this.
  9. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    962
    Will this be free like Mirror?
     
  10. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Maybe some day.
     
  11. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    What is the cost, and are you provided full source?
     
  12. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    $100, but price could go in either direction later.
    Mirror being $0 made sense because it's a community fork. But after 3 years, nearing 4000 commits and >6 people working on it, not even 1 of us can work on it full time with the donations.

    Yes, full C# source. Note that it uses my Apathy low level transport, which was developed in native C. The native C project isn't included, but you can use other C# transports too and native C might no be needed much longer.
     
  13. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Here is the Code Coverage report.
    There are around 200 unit tests, covering 90% of the code.
    The higher the coverage, the lower the probability of bugs.

    As far as I know, Mirror already had the highest code coverage from all Unity networking solutions: 50%.
    I have never seen a game networking library with 90% code coverage before. That's basically unheard of.
    This is what I mean with AAA quality :)

    2020-05-07 - 90perc code coverage.png
     
  14. GCatz

    GCatz

    Joined:
    Jul 31, 2012
    Posts:
    282
    so.. what can i do with this ? c# bare bones can also hold 500k connections without fancy DOTS
    lets say it does state sync..

    what about snapshot interpolation?, lag compensation?, delta compression? (a must in this scales), events?,
    authoritative? (if so do you use HPC# physics or Havok or custom physics)
    entity freezing?, can set entity ownership ? does it have packet priority (for near and far entities)?
    editor codegen? (but guess i'm being spoiled with this one)

    btw hope i'm reading it wrong but
    head of line blocking will be insane with this amount of synced properties (in real world connection not local test)
    not even mentioning congestion control or exponential back-off problem

    or you just send low amount of packets and slow down the battle pace like WoW does
    (good luck with that for new games in 2020)

    it does look fast but has the same problems like the new disrupt network (which is also very fast)..
    I respect new network systems as I know how hard it is to make them and kudos for that
    but to be honest it feels more like a dots network prototype rather then a full networking stack
     
    madebynoxc, Deleted User and Vincenzo like this.
  15. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    For V1, you can sync ECS entities over the network and I think it's easy to use :)

    Sure, outside of Unity 500k connections are doable.
    Inside of Unity, it's a lot more difficult.

    The reason why you would want both server & client in the same Unity project is an order of magnitude improvement in productivity. Most multiplayer games don't fail because of performance - in fact, a lot of the popular games like DayZ have quite poor performance. Most games fail because multiplayer is hard. Having both server & client in Unity & sharingdata/code makes it a lot easier.

    If you decide to do that, then you have two options: Mono or ECS. For Mono, there are already a lot of networking libraries to choose from. For ECS, the only one I can use today is Unity's netcode - which seems to target ~80 CCU shooters.

    I am more interested in WoW/EvE type of large worlds, which is where DOTSNET comes in. Without any real optimizations, it can already handle a lot more networked entities than Mirror simply because it uses ECS.

    Will be very interesting to see what's possible with more optimizations over the next few years.
    Do you have Discord? Would be interesting to discuss the topics you mentioned :)
     
    Last edited: May 7, 2020
  16. UsmanMemon

    UsmanMemon

    Joined:
    Jan 24, 2020
    Posts:
    87
    Yup donation is never enough AGREED
     
    mischa2k likes this.
  17. pocketpair

    pocketpair

    Joined:
    Jul 7, 2015
    Posts:
    72
    @vis2k
    We have already developed networking system with DOTS netcode.
    Is there still some benefits compared to DOTSNET?
    It looks DOTSNET is totally different from netcode. We'd like to create Open world FPS/TPS.
     
  18. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    If you already use Unity's netcode and it works, then keep using it :)
     
    MylesLambert likes this.
  19. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Still pending review. Asset Store should get to it either today or next week hopefully.

    I already finished V1.1 while waiting. Changelog:
    upload_2020-5-15_14-40-23.png
    V1.1 will be submitted immediately after V1.0 release. To get started, it's probably better to wait for V1.1.

    Unity.Physics Demo: (looks more fun when playing)
    upload_2020-5-15_14-35-24.png

    Pong Demo:
    upload_2020-5-15_14-36-0.png

    Chat Demo:
    upload_2020-5-15_14-36-20.png
     
    OldMage likes this.
  20. Vanamerax

    Vanamerax

    Joined:
    Jan 12, 2012
    Posts:
    938
    This looks neat. Does it work with WebGL?
     
  21. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    It can use different low level (= packet sending) transports.
    The current one in V1.0 will run on Windows/Mac/Linux.
    For WebGL you'll need websockets. Will add one later :)
     
    OldMage likes this.
  22. TheMessyCoder

    TheMessyCoder

    Joined:
    Feb 13, 2017
    Posts:
    522
  23. SirTwistedStorm

    SirTwistedStorm

    Joined:
    Sep 20, 2015
    Posts:
    192
  24. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    DOTSNET should be reviewed by the Asset Store team any day now..

    Encryption needs to happen on transport layer, and you can use any transport of your choice again.
    I might add an encrypted transport later on. First goal is top optimize for max CCU :)
     
    OldMage and TheMessyCoder like this.
  25. Cuttlas-U

    Cuttlas-U

    Joined:
    Apr 11, 2017
    Posts:
    38
    Hey,
    Great stuff, Have a question ,
    My game right now is on the mono solution and i want it to stay that way ,
    But I also like DOTSNET and wants to have a server implemented with that ,

    so can I just use the DOTSNET and its ECS thing on the server while the main game is working with mono for sending and receiving data ?

    Thank u
     
  26. TheMessyCoder

    TheMessyCoder

    Joined:
    Feb 13, 2017
    Posts:
    522
    Thanks. Will look forward to that
     
  27. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    It's possible, sure.
    It's going to be a whole lot of work though.
    If you already use Mono, it's probably best to keep using it. ECS is still in preview.

    Imho finish your Mono game and use ECS for the next game 5 years from now :)
     
  28. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Check out Mirror :) This one here is for ECS, which is Unity's new data oriented technology.
     
    OldMage likes this.
  29. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Rejected after 21 days because documentation.txt links to a google doc.

    Good news is that I resubmitted V1.2 instead of V1.0, so as soon as Unity Asset Store accepts it, you'll already have the version that you should use anyway :)
     
    Last edited: May 23, 2020
  30. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Hai-Long, Lars-Steenhoff and Flem100 like this.
  31. Flem100

    Flem100

    Joined:
    Feb 20, 2018
    Posts:
    4
    Cool! I have just decided to use mirror after comparing with the other options. Then you release this same day :p. As a Unity noob creating his first Unity network project I should probably stay with Mirror for now right? I had a look at the uMMORPG since they use Mirror. Are they going to move to DOTSNET?
     
  32. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Yes, better to stay with Mirror.
    MonoBehaviour is still easier for beginners. DOTSNET uses ECS, which is still in preview and has some more advanced concepts.
     
  33. ViCoX

    ViCoX

    Joined:
    Nov 22, 2013
    Posts:
    37
    Hi,

    Looks promising. Regarding the transport - how complicated it is to change for example to LiteNetLib and reliable/unreliable UDP?

    I don't want to buy if it's not possible without rewriting half of the thing.

    Thanks,
    - J
     
  34. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Very easy. You just need to drop them in and fill out one wrapper for the server:
    upload_2020-5-27_9-53-37.png

    And one for the client:
    upload_2020-5-27_9-54-49.png

    And then drag them onto the NetworkServer/NetworkClient GameObject.

    LiteNetLib will probably be used by a lot of people, so I'll add that myself in one of the next updates.
     
  35. ViCoX

    ViCoX

    Joined:
    Nov 22, 2013
    Posts:
    37
    Ho! Nice!

    I will buy and test it out in the evening! : )

    Cheers,
    - J
     
    mischa2k likes this.
  36. ConAim

    ConAim

    Joined:
    Jan 17, 2017
    Posts:
    16
    On the server, do we have to launch a new instance of services for each mission/game/world. Or we can creating multiple worlds utilizing the DOT/ECS's Worlds?
     
    Last edited: May 27, 2020
  37. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Right now it has one ClientWorld and one ServerWorld.
    The goal is to have multiple ServerWorlds.

    I just need to look into it in one of the upcoming versions. I don't think we need many (if any) changes since they are memory separate anyway. Will just need to tell the server which scene to load for which world :)
     
  38. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Hai-Long and ConAim like this.
  39. dannyalgorithmic

    dannyalgorithmic

    Joined:
    Jul 22, 2018
    Posts:
    100
    Would there be any way to implement some form of Wifi Direct so that devices could connect and communicate without a router? Would be an instant purchase from me, as you'd be the only one implementing something I've been exhaustively searching for, for ages. Being able to connect locally without a router .... dude. Playing with the boys on the bus, without using data ... come on. lol

    Seriously, though.
     
  40. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Sounds like too much of an edge case for me to implement.
    But you can use any transport that you want, so feel free to add your own :)
     
    dannyalgorithmic likes this.
  41. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Just wanted to say I got a laugh seeing your quote of the asset store's official terms regarding refunds at the end of your asset description, while Unity has chosen to put "Refunds - We've got you covered" on every asset now, in seeming contradiction with their own terms of use.

    Glad you got this out this week.
     
    mischa2k likes this.
  42. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    upload_2020-6-1_18-35-15.png

    Automated serialization is a huge usability improvement. Here is what a message looked like before:
    upload_2020-6-1_18-36-29.png

    Now:
    upload_2020-6-1_18-37-0.png
     
  43. ScottMeyers

    ScottMeyers

    Joined:
    Aug 10, 2017
    Posts:
    5
    Is there something similar to [SyncVar] Attribute here?
     
  44. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    [SyncVar] only makes sense in MonoBehaviour world because we can get all NetworkBehaviour components and find all SyncVars in them. That's not possible in ECS world as far as I understand.

    For DOTSECS you create a BroadcastSystem for each component that you want to serialize. Check out the built in NetworkTransformServerSystem to see a good example. It will even run in a Job soon :)
     
    Last edited: Jun 2, 2020
  45. ScottMeyers

    ScottMeyers

    Joined:
    Aug 10, 2017
    Posts:
    5
    https://docs.unity3d.com/Packages/com.unity.netcode@0.1/manual/ghost-snapshots.html
    Maybe it helps~
     
  46. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
  47. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    toomasio, ConAim, mgear and 1 other person like this.
  48. JJ-Jabb

    JJ-Jabb

    Joined:
    Feb 6, 2015
    Posts:
    42
    @vis2k looking at the stats in the gifs you posted, it looks like you’re not batching the materials - not sure if that was intententional, but if not you’ll get even better frame rates if you enable batching. That said, asset looks awesome, I need to start saving up
     
    mischa2k likes this.
  49. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Thanks for the tip, that's awesome.
    They already used the same materials and meshes while still drawing 32k batches.
    With GPU Instancing enabled it's a lot faster:
    upload_2020-6-6_10-10-55.png

    Thanks man!
     
    ConAim likes this.
  50. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    V1.5 pending review. Major performance update.
    10k Entities are running at 40 FPS on my Laptop.
    Targeting 100k next.
     
    farshmak and LuisEGV like this.