Search Unity

Assets DarkRift Networking 2: The next level of networking

Discussion in 'Works In Progress - Archive' started by Jamster, Jan 20, 2016.

  1. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    I haven't posted in a while so here's an update!

    It's mostly fine tuning now, I'm moving the tutorial into the reference docs (as a different section) so that everything is in one place and it might get shortened a little so that it's in more manageable and referable articles rather than a single, long tutorial! A few bugs have been squashed and extra little bits added to support things that I'd overlooked but it's looking absolutely amazing and there have already been plenty of comments on it being much more stable than DarkRift 1! Perfect! :D

    Jamie
     
  2. The_Milesy

    The_Milesy

    Joined:
    Feb 9, 2017
    Posts:
    9
    Great work dude! looking forward to it.
     
    Jamster likes this.
  3. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    I am really interested in this asset. Same to other guys I looked all over the assetstore, but didn't find an Asset which fits to my "instanced world" scenario.
    We are working on a (M)ORPG. Having big cities as playerhubs where lot of people can interact, chat, chill etc.
    By leaving the cities you can explore the world or dungeons alone or in groups (Parties / Raids). This means that by having 500 people in the playerhubs and everybody soloing a dungeon will have to create 500 Unity / Scene instances.
    How would your asset handle this since it's not pure Unity? Can we use your asset for exactly this scenario having big playerhubs with tons of players and offering the possibility to create unlimited instances by leaving a scene with different player sizes from lets say 1 to 50 (1 Solo Dungeon, 50 a Raid)?
    Think of Stormwind of WoW as a big Playerhub but if I leave it I can explore the world alone or with other gamers in a group.


    Really looking forward for the beta and more information.
    Cheers
    Ronny
     
    Last edited: May 27, 2017
  4. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Hi Ronny,

    I'm not sure I fully understand your instancing but you'd be hard pressed to find something DarkRift can't do! It sounds like you just want a main server for the player hubs and then dynamically allocated servers for each party/raid, DarkRift doesn't have the ability to start new servers yet but this would be easy to do using a service like AWS or Azure to spool the new instances. It's also good to remember that you can have more than one raid running in the same Unity instance by using layers or offsetting the dungeons in the world space and you'd get better performance and cost efficiency this way :)

    There will be some support for what you want coming in the future but not for a while!

    Jamie
     
    RonnyDance likes this.
  5. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    Thanks a lot Jamster for your fast response. You understood everythyng right regarding creating instaces for gamers if they leave playerhubs. For the beginning it would be fine just creating an instance on the same Linux / Windows machine where the playerhub is running you don't need to start a whole new server for that. Of course later on you can start instances on seperate servers like on azure etc so the Playerhub Server is not the same as the dungeon instances server to reduce lagpikes and downtimes.

    Gonna have an eye on your asset and upcoming features :)
    Cheers
    Ronny
     
    Last edited: May 29, 2017
    Lisk and Jamster like this.
  6. Samuel411

    Samuel411

    Joined:
    Dec 20, 2012
    Posts:
    646
    I'm looking forward to this :) Do you have any idea when the system will be available for download?
     
  7. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    It's currently in alpha testing :) I'll have more time to work on it in June so probably late June :)
     
  8. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    The second alpha stage has been released to testers!
     
  9. mitchmeyer1

    mitchmeyer1

    Joined:
    Sep 19, 2016
    Posts:
    32
    Will DarkRift2 Have WebGL Support?
     
  10. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Not on release but it will later on :)
     
  11. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    It might not look like much but previously this was being displayed by Unity's capitalisation algorithm as "I Pv4" as alpha testers will have seen. It's been a long while since I had to work on custom inspectors so this is a trip down memory lane for me!
    Capture.PNG
    As well as this I'm also adding a warning to the Invoke From Dispatcher option so that it can't be accidently unchecked and cause threading problems across your project!
     
  12. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    After a little more work the server editor is coming on nicely! It's actually quite fun relearning how to make editor windows, though I don't miss the hoops you have to jump through to make some of it work o_O
    Capture.PNG

    It still looks hideously complicated though!
     
  13. Maride

    Maride

    Joined:
    Jun 8, 2017
    Posts:
    9
    Hello, I want to work with your server, but I'm new and can't find enough information
    to contact you I have failed, you can help examples, lessons...?it is particularly interesting how to make a arena, sorry for my English
     
  14. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Hi,

    Currently DarkRift 1 is available from the asset store and has a tutorial and some examples already in it, DarkRift 2 will be release within the coming months in beta and will have even more examples for you!

    There are also some YouTube tutorials for DarkRift 1

    Jamie
     
  15. Jacky2611

    Jacky2611

    Joined:
    Mar 2, 2013
    Posts:
    12
    Any chance for a second wave of alpha invites? I plan to participate in the next LD (July, 28) jam with a couple friends and we have a couple (coop-ish) features we might experiment with should we have time left and a theme that allows us to integrate them. (bet its gonna be something like "alone")
    Would like to use either DarkRift 1 or 2, but I tend to become really unconfortable when I start using libraries that are no longer maintained.
     
  16. Maride

    Maride

    Joined:
    Jun 8, 2017
    Posts:
    9
    thanks for the reply Jamie, I found a video on youtube. the main problem for me is - different versions of servers, plugins and lessons. me as a newbie is difficult. lesson for version 1.0 and we have 1.1+. and plugins very little information. maybe because I bad know English. and I hope you make more open information about your server and in на different languages.
     
  17. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Hey, I don't have any plans for another alpha wave but a public beta should be out by then which it would be great to see you use! DarkRift 1 and 2 share very similar concepts in operation so converting projects isn't too difficult and is mainly just mapping your project to different names. I understand not wanting to start with DarkRift 1 now!

    I would love to have the docs and tutorials in different languages but unfortunately I only know 1! The lessons/tutorials should all be compatible with the current servers, I aim keep backward compatibility as best I can.

    Jamie
     
  18. Jacky2611

    Jacky2611

    Joined:
    Mar 2, 2013
    Posts:
    12
    Public Beta? Nice! Do you plan to start it before July? Cause I have an IT entrance exam, for which I have to learn boring technical vocabulary in German (why can't they just use English? Ugh.), and also need some time to get the hang of unity again after spending the last few months using Java.

    BTW, I could probably translate some of the more important docs into German. Can't guarantee that I will be able to update them though.
     
  19. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    If possible yes, but it is variable depending on how much time I have!
     
  20. Deleted User

    Deleted User

    Guest

    Hey I was wondering if this networking system would allow me to create my server inside of unity or is it compleatly separate from that? Thanks
     
  21. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Yep, that's possible with DarkRift and it will give you access to Unity's physics/navmesh etc. just be aware you can't distribute the server, only the client :)
     
    mitchmeyer1 likes this.
  22. Deleted User

    Deleted User

    Guest

    I can't distribute the server? Does that mean you guys host it for me? I guess I don't fully understand what you mean.
     
  23. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Not at the moment no. You would usually rent a cloud server from Amazon/Microsoft etc. and host the server there :)
     
  24. Deleted User

    Deleted User

    Guest

    Oh yeah, alright. That's what I actually wanted. I thought you meant by you can't distribute the server that you couldn't self host, and that is a requirement for me, so this seems like a perfect solution. I've heard talks of public beta being around the end of this month, could you provide an update to that? Also with this be a free product like DarkRift1?
     
  25. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    It will have a free version yes :) I'll be releasing a beta soon, probably early July but still not sure, if I have to do an extra alpha increment then it'll be delayed :)
     
  26. Jacky2611

    Jacky2611

    Joined:
    Mar 2, 2013
    Posts:
    12
    Wait, so we can't package the server up with the game to let our clients host their own server? Kinda need that if I want to allow local coop.
    Could you maybe create a separate version that is limited to four or six clients for something like this? I can understand that you wouldn't want your server code to spread to everyone who has a game client but it's just not feasible for me as an indie dev to host a server for everyone who wants to play.
     
  27. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    I have no plans to at the moment, it's a possibility with DarkRift 2 in the future but DarkRift isn't well suited to it without things like NAT punchthrough anyway - it's designed to be run in the cloud not from a client's computer... :)
     
    NaviTest likes this.
  28. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Currently I'm reassessing the socket layer for DarkRift, I realised that it's lost the simple and flexible ethos that makes DarkRift so good and so I'm looking at ways I can simplify it with a minimal cut to functionality.

    Essentially, by having RUDP, it adds a huge amount of code, bugs and complexity but provides a minimal advantage over other solutions. The current idea is to move away from Hazel and use a dual connection through TCP and UDP, that way you still have unreliable messages through UDP and reliable/fragmented messages through TCP but there is significantly less code that can go wrong and significantly less to maintain.

    Theoretically I think this should make the unreliable data transmission faster as there's no conflict with the reliable/fragmented messages but will slow down the reliable/fragmented messages slightly as it uses TCP and so there is added congestion control (which isn't necessarily a bad thing to be honest).

    I'm developing this in parallel with the Hazel based DarkRift and we'll see how well it works in the next alpha stage, I can always revert back :) Also, Hazel will still be developed alongside DarkRift, it just might not be used in it!

    Jamie
     
    NaviTest likes this.
  29. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Done some first tests of the new socket layer with Unity today, seems to be working just as well! Capture.PNG
    (For the record I have tested it with some more stressful demos as well!)
     
  30. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Finally added the Upgrading section to the documentation to give people moving from DarkRift 1 a bit more help and advice on what bits have changed and how they should go about upgrading code that uses those bits. It's one of the longest pages on the documentation but definitely worth the read before you start!

    I want to add a brief article about the room system and then we should be good for another (and possibly last!) alpha release :)
     
    Lisk likes this.
  31. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Alpha 3 is out! :D
     
  32. Deleted User

    Deleted User

    Guest

    When can people who are not signed up for the alpha get their hands on this ;(
     
  33. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    I'm hoping to get it out for July 1st but realistically it'll probably be a little later :)
     
  34. Deleted User

    Deleted User

    Guest

    July 4th it is ;p

    Just want to confirm, this networking system would be able to send RPCs along with UDP data, correct?

    Also, when you do release the beta, is that including some starter docs like starting a server and stuff or would that come later?
     
  35. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    DarkRift is based around Message Passing rather than Remote Method Invocation, so.. yes, but in a slightly different way to you're used to!

    I've already written a lot of documentation including tutorials and much more :)
     
    Lisk likes this.
  36. Deleted User

    Deleted User

    Guest

    Awesome!

    One last thing I want to make sure, with the old system I was using, Forge Networking, I was able to create the server inside of Unity. I have trouble understand the entire plugin concept and stuff like that, but I was wondering if creating the server in Unity is possible? Or would we have to design it to be abstract from Unity?
     
  37. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Yes you can :) Essentially you can use DarkRift as a program that hosts plugins or as a library that can be hosted by something like Unity :) So you don't have to use plugins when in Unity.
     
  38. Deleted User

    Deleted User

    Guest

    Really excited to mess around with this system as soon as I can.

    Any update on the wishful July 1st release?
     
    Jamster likes this.
  39. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Unlikely!

    Early July though :)
     
  40. MassDivide

    MassDivide

    Joined:
    Apr 16, 2013
    Posts:
    4
    I need this asap. xD
     
    Jamster likes this.
  41. R3D0

    R3D0

    Joined:
    Sep 24, 2014
    Posts:
    6
    It's early July, is the beta out yet???

    I'll be patient :p Looking forward to trying to break it! (that's what betas are for, right?)
     
    Jamster likes this.
  42. Lisk

    Lisk

    Joined:
    Oct 23, 2013
    Posts:
    99
    If anyone finds it useful, I was able to upgrade my Packet Stresstest app for DarkRift 1 --> DarkRift 2.



    It's a simple project that shows a way to create a standalone DarkRift server and send messages to a connected client.

    Below are both the DarkRift 1 and DarkRift 2 versions. (too large to attach to Unity forums):
    EDIT: Link removed. Just realized DarkRift 2 should probably not be shared. PM me if interested (and show proof you have access to DarkRift 2).

    If you're experienced with DarkRift 1 and want to upgrade to DarkRift 2, you may find it useful!

    If any part of it is confusing, feel free to message me on the DarkRift Networking Discord.
     
    Last edited: Jul 4, 2017
    Jamster likes this.
  43. Maride

    Maride

    Joined:
    Jun 8, 2017
    Posts:
    9
    looking forward to it DarkRift 2=) and I hope you'll consider the translation of documents and many many examples=)
    for myself not profitable to buy the translation,вам перевод окупился бы(paid off) don't know how to translate, you are profitable
     
  44. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    I would certainly like to get the docs translated but it's tricky when they change frequently and particularly as it's expensive to do!
     
  45. Lisk

    Lisk

    Joined:
    Oct 23, 2013
    Posts:
    99
    DarkRift 2 question: I noticed the new DarkRiftReader and DarkRiftWriter are no longer based on the BinaryReader/Writer - is there a way to convert from a DarkRiftWriter to a BinaryReader? I have some unit tests that did that just to verify that things were put on the stream correctly.

    (I write stuff to the writer, then convert the writer to a reader, then read values off of it and verify that they match expected values).
     
  46. Lisk

    Lisk

    Joined:
    Oct 23, 2013
    Posts:
    99
    Another question: I noticed the Command API now requires all arguments to be named since they are passed via a NameValueCollection - is it possible to support the old behavior with unnamed arguments?

    I have a lot of text commands, like "validate 25" to run unit test number 25, and it's sort of annoying to have to type things like "validate -x=25" now.
     
  47. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    No direct conversion at the moment since they were designed to not need that dependency anymore (and hence not implement IDisposable), unfortunately that's also meant the insides are hidden and no longer stream based (it's actually a resizable array now). Theroetically you could put it into a Message object and then call GetReader to convert it but it could be nice to have a direct GetReader method on the writer!

    Yes! Perhaps not the most obvious but if you use the Flags property then they will be in there, in order (with the flags), I'll try and break that out specifically though!
     
  48. Lisk

    Lisk

    Joined:
    Oct 23, 2013
    Posts:
    99
    Thanks - I'll try that suggestion.

    Flags works perfectly! I just didn't think of using it for some reason (since Arguments was my first guess and seemed correct).
     
    Jamster likes this.
  49. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    I've rearranged some of the methods and made them a bit more obvious what they do! Good feedback :p
     
    Lisk likes this.
  50. Lisk

    Lisk

    Joined:
    Oct 23, 2013
    Posts:
    99
    I have a feature request: would it be possible to change the DarkRift 2 namespaces to begin with DarkRift2 rather than DarkRift?

    This would allow for side-by-side installation with DarkRift, in case we want to switch back and forth.
    1) This is useful to me because DarkRift 1 is currently more stable than DarkRift 2, and I'd like the option to switch back for production builds, while I develop with DarkRift 2.
    2) This would also allow others to do the same, then we can easily run comparisons between the two frameworks to help debug.

    Also, I think it makes more sense to be consistent with DarkRift 2 branding by having it named DarkRift2 in the namespace.