Search Unity

  1. Engage, network and learn at Unite Austin 2017, Oct 3 - 5. Get your ticket today!
    Dismiss Notice
  2. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  3. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  4. Unity 2017.1 is now released.
    Dismiss Notice
  5. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  6. Unity 2017.2 beta is now available for download.
    Dismiss Notice

Assets DarkRift Networking 2: The next level of networking

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

  1. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    811
    Possibly, I agree with the consistency aspect...
     
    Lisk likes this.
  2. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    811
    DarkRift 2 Beta has been submitted to the asset store!
    Hooray!
     
    RaomAroundAround likes this.
  3. jjobby

    jjobby

    Joined:
    Nov 28, 2009
    Posts:
    88
    Hi, Jamster. I only used to run Unity instance as my server. I've read that DarkRift can also run inside Unity. But it will have better performance if it runs as standalone. So, if I want to use physics in my game. Is it only possible to run DarkRift inside Unity? Is there any way to run DarkRift as standalone and can still enable physics in my game?

    My past game are just normal multiplayer and they are not real time so Unity instance is good enough. I'm currently developing MMO game for my client. I've read many people in this forum said that running Unity instance as server is not good for MMO. I don't know the truth behind such statement. But it makes you wary if many people said the same thing. I would like to ask your suggestion. Do you think that DarkRift inside Unity is capable of running big MMORPG like Tree of Savior?
     
    Last edited: Jul 17, 2017
    Lisk likes this.
  4. antifuzz

    antifuzz

    Joined:
    Feb 22, 2013
    Posts:
    51
    Hi @Jamster Is it possible to get an advance copy of the DarkRift 2 beta? I'm trialling DarkRift for use on a potential project and if v2 is nearly out it makes sense to focus on that if I can..?
     
  5. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    811
    Firstly, I'm going to pull DarkRift from the store again temporarily since I packaged a few things wrong and a couple of testers found a load of new, major bugs. An early release of the free version is currently available on the discord (pinned to one of the channels) so if you want to join the open beta please go there!

    I'll hopefully put future builds up here as well but for now there a (buggy) build available there!

    @jjobby Running things in Unity allows you to use things like physics really easily but there are performance limitations and it gets much trickier with large worlds etc. so it can make it very awkward for servers, particularly MMOs. On the other hand, a standalone server doesn't have world size limits (not that you'd want to have your whole world in one server anyway!) and would be better for performance but doesn't have built in physics etc.. So it's swings and roundabouts really but you can do either in DarkRift.
     
    Lisk likes this.
  6. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    811
    I've just realised I've been posting weekly updates on the Discord but not on here! I'll try and start posting more on here in future so that more people see it!

    Recently I've been working on a new release for DarkRift 2; I've rewritten the log system to allow you to write custom log writers as plugins and import them into DarkRift, this means you can get DarkRift to write out to databases etc. as well if you need and it should offer more flexibility than the previous system.

    On top of that I've been doing a similar thing for DarkRift's persistence layer. Previously, I was using SQLite but for some reason it would only work if DarkRift was forced to use 32 bit mode hence not allowing it to run as well on 64 bit servers (which is most!). I've now also made this a plugin-based system so that you can configure exactly where DarkRift should store it's persistent data and this should make it significantly easier to add server-server communication/proxies later. I've included a basic XML based storage plugin that should work out the box but it's possible to make DarkRift store in databases, another format, etc.

    Of course there was also a DarkRift 1 release that fixes a bug with lagging players and numerous bugfixes on DarkRift 2 :)

    Jamie
     
    Lisk likes this.
  7. Cushmily

    Cushmily

    Joined:
    Mar 25, 2015
    Posts:
    3
    Thanks man, I LOVE DarkRift Networking very much! Great to hear DarkRift 2 is under development.
     
    Jamster likes this.
  8. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    811
    DarkRift2 Beta r2 and r2p1 released!
    DarkRift 2 Beta r2
    • Lots of example code etc. now on GitHub
    • SQLite dependency has been removed and replaced with DataHandler plugins
    • LogWriters are now plugins
    • Lots of bug fixes
    • File path for FileLogWriter now more customisable
    • Configuration for log writers improved
    • (See updates channel for more details)
    DarkRift 2 Beta r2p1
    • Fixed Unity Server and updated editor to latest DarkRift
    • ServerSpawnData now takes lists rather than arrays - Fixed XmlDataHandler bug
    Don't forget this is still beta and there'll be plenty of issues! Please keep reporting things on the issue tracker :)
     

    Attached Files:

    Cushmily likes this.
  9. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    811
    (Apologies for cross-posting this late!)

    2 releases have been made this week for DarkRift 2! The majority of my time, thus, has been spent trying to package and test those releases beforehand so not a huge amount of functionality has been added. I have however bene able to address some bugs and documentation issues since the release and have added a Disconnected event to the client side (an oversight when writing it!). I've also taken some time to move a lot of my private repos to GitHub for things like the Agar tutorial completed code and the block demo plugin code. The link is available in the #links channel and it would be awesome if people wanted to help out with maintaining them!
     
  10. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    811
    This week I've had a lot of time on my hands so a lot's been done! I started looking into the UDP issues but found a number of other bugs in the process so I've had to fix those first; I've added a Disconnected event in the client (not sure why it wasn't there) and fixed bugs where UnityClient was passing events the wrong object as a sender.

    I've also added performance enhancements to the internal plugins by unsubscribing them from events when they're not in use and I've redesigned the sniffer interface to be more clear and include new options:
    Code (csharp):
    1. sniffer add -t=100 -s=89
    2. sniffer remove -a
    3. sniffer clear
    4. sniffer list
    Lastly, a lot of people (mainly those using PlayFab) wanted to be able to pass command line arguments to set parameters in the server so now you can pass the server variables to use when loading the configuration file. For example, to create a server on port 80 you could start it using
    Code (csharp):
    1. DarkRift.Server.Console.exe -differentPort=80
    and define your configuration file to use that variable:
    Code (csharp):
    1. <server ... port="$(differentPort)" ... />
    On top of that you can now pass in the name of the configuration file you want to load:
    Code (csharp):
    1. DarkRift.Server.Console.exe MyConfig.xml -differentPort=80
     
  11. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    811
    Hey all!

    This week I've mainly been on holiday so not much has been done! However, this evening I was able to write some build scripts to make my life easier when building the packages.

    I've previously been copying the files across by hand (hence the mess ups on some builds!) but for DarkRift 2 I've added an editor script so I can simply hit a menu item and it'll import the correct build into the project. It's fairly crude at the moment but it's a definite improvement over spending half an hour per package each time as I was for DarkRift 1!

    I also had the opportunity to rewrite a post build script that organised the DarkRift files into the Lib folder as you see it. Instead of being a quick CMD command that frequently broke it now uses MSBuild to do it in a bit more of a stable way (I also really wanted to learn MSBuild!)

    Jamie
     
  12. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    811
    DarkRift 2 Beta r3
    Bugs:
    • Added disconnection event to UnityClient
    • Disconnection events on client now invoked when the client causes the disconnection
    • UnityClient now pases itself as event sender rather than the backing DarkRiftClient
    Improvements:
    • Internal plugins now unsubscribe from events when not in use
    • Redesigned interface for the sniffer plugin
    • Added command line arguments and configuration variables in the XML configuration
    • Added more information to disconnection events
     

    Attached Files:

    Kalle801 and AdmiralThrawn like this.
  13. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    811
    Not much has been done the past week but I did get a chance to do some optimisation and greatly simplified one of the layers in DarkRift's internal protocol stack, this should mean one less object allocated for each message received and so shows a bit of a performance increase just using the demos!

    Hopefully next week more will get done!
     
    Cushmily and AdmiralThrawn like this.