Search Unity

DarkRift Networking Beta Thread

Discussion in 'Multiplayer' started by Jamster, Mar 30, 2015.

  1. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    This is a public thread for the ongoing development of DarkRift Networking and its testing, if you dont know what DarkRift is then have a look here!

    I'm not actively seeking any more beta testers but if you're interested in testing the next release then send me a PM :) Next release should be in the coming month :)

    If you want to be part of the beta PM me your email! :D
     
    Last edited: Dec 20, 2015
  2. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    It's light, flexible, and fast - it's DarkRift, and it's getting even better!
     
    Last edited: Mar 31, 2015
    Neo-Gamefactory and Jamster like this.
  3. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    Thanks for your trust :)
     
    jpthek9 likes this.
  4. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Next beta is rolling out to those on my email list tonight! (Hopefully)

    Hopefully the next release will be out in around 1-2 weeks :)
     
    Neo-Gamefactory and jpthek9 like this.
  5. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    I'm assuming that no news is good news so I'm going to submit the latest release to the asset store on Saturday! If you've found anything then tell me quick :p
     
  6. GraphXCreations

    GraphXCreations

    Joined:
    Jul 6, 2014
    Posts:
    121
    jamie, just sent you pm requesting beta testing.

    cheers
     
  7. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    That's true! I went in thinking I'm gonna be a badarse bug exterminator but I couldn't find any (besides the ones in my code).

    Oh yeah, just something I stumbled upon: the old DarkRift client has some issues with communicating with the new DarkRift server; note that if you're getting some weird behaviors with the Beta server.
     
    Last edited: Apr 10, 2015
  8. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Yeah this update isn't backwards compatible with older clients unfortunately, I optimised and modified the Transmission.dll file a lot and cut around 5 bytes off the header per message so the older client still looks for them! I decided that I'm not aware of any published games that would be affected by the change in protocol and most in development games would just update their clients with the server.

    I doubt I'll make any other non backwards compatible changes to it, I can have up to 255 different protocols implemented and being mixed and matched in a single game!

    Submitting the package today and I'll create a release thread when it's out (~1-2 weeks).

    Jamie
     
    jpthek9 likes this.
  9. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Ok so there is now a plugin thread here for you to share your plugins! Get submitting ;)
     
  10. Veris

    Veris

    Joined:
    Mar 2, 2015
    Posts:
    3
    Any chance of a linux server?
     
  11. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    This might be a lot... but it'd be really nice to have DarkRift servers in Unity instances. Then Unity can build as a headless linux, Windows, and Mac server. There's also the additional benefit of allowing players to easily host servers.

    For me, the Windows server is perfect but I can see how cross-platform support can be really helpful.
     
  12. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    @Veris Someone got it working on OSX using mono via cd-ing into the directory and using:
    Code (CSharp):
    1. mono —gc=sgen DarkRift.exe
    I dont know what it does and I cant guarentee it'll work on linux but it's worth a try :)

    @jpthek9 I'm working on it ;)
     
  13. Sphelps

    Sphelps

    Joined:
    Jun 9, 2013
    Posts:
    243
    Extreme version price?
     
  14. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    It's pretty decent, especially compared to the prices of other networking solutions: $50.
     
  15. Sphelps

    Sphelps

    Joined:
    Jun 9, 2013
    Posts:
    243
    Is there a way to have a master server?
     
  16. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Actually, the server by default is a master server. If you want it to be more fancy and create rooms and whatnot, you can write it yourself! It'll look something like this:
    Code (CSharp):
    1. public class Core : Plugin {
    2. public static Core()
    3. {
    4. ConnectionService.OnPlayerConnect += HandleConnect;
    5. }
    6. void HandleConnect(ConnectionService connection)
    7. {
    8. Player player = new Player(connection);
    9. TryJoinRoom(player)
    10. }
    11. void TryJoinRoom (Player player)
    12. {
    13. //Check if there's an open room; if there is, add the player to the room. If not, create a new room and add the player to that room.
    14. }
    15. }
    16.  
    17. public class Room {
    18. List<Player> RoomedPlayers = new List<Player>();
    19. public Room(){
    20. //Initialize room
    21. }
    22. public void AddPlayer(Player player)
    23. {
    24. RoomedPlayers.Add(player);
    25. }
    26. }
    27.  
    28. public class Player{
    29. ConnectionService connection;
    30. public Player(ConnectionService con)
    31. {
    32. connection = con;
    33. }
    34. }
    P.S. I recommend using Visual Studio to write your server. That way, you can have your Unity game solution open in Monodevelop and code your server in another window - no annoying solution changing.
     
    Megaphone_ likes this.
  17. Sphelps

    Sphelps

    Joined:
    Jun 9, 2013
    Posts:
    243
    What I am trying to do is Have a master server then the players can create(thought client or dedicated) there own server and it will show up on the server list.
     
  18. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Unfortunately, DarkRift wasn't designed for that. Online player-hosting is still a big maybe. There's nothing wrong with having a redistributable local server though. Players can host their own games on their own network - just no over the internet.
     
  19. Sphelps

    Sphelps

    Joined:
    Jun 9, 2013
    Posts:
    243
    I'm out
     
  20. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Okay. No offense, but online player-hosted games are very difficult to make well. You don't have to use DarkRift, but you'll still have to shoot for a tangible goal that's not full of nasty bugs.
     
  21. Sphelps

    Sphelps

    Joined:
    Jun 9, 2013
    Posts:
    243
    Sorry I did not mean that in a negative sense, I just meant this product is not meant for me then :)
     
  22. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    @DestinyComp Sorry to hear that, each networking solution is good at certain things, DarkRift wasn't designed for that sort of use but with a bit of plugin work it's definately possible :)

    For others reference: DarkRift is free for 20 users, $50 for 200 users (across all servers) and $650 for unlimited users :)
     
  23. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Official Asset Store thread is now here :)
     
    jpthek9 likes this.
  24. TheBraxton

    TheBraxton

    Joined:
    Mar 6, 2014
    Posts:
    98
    Curious, I assume that DarkRift is meant for normal 8 to 64player multiplayer games like Battlefield, etc, correct? I assume permanence is not something that you designed around correct? I'm still researching a "launching" platform for starting my back-end for an MMO ;) !
     
  25. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    I think an MMO could work very well. I've been thinking of adapting DPhysics for DarkRift to allow for authoritative physics - but with floating point math for better speed.
     
  26. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    I don't know that DarkRift has been used in an MMO context yet but it could definitely manage it. I guess it all depends on how you implement any clustering etc and how much load each client will put on the server. What genre is your game? :)
     
  27. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Hmmm... That's promising... ;)
    Capture.PNG
    Unfortunately, the whole 'multithreaded server' idea is going to make my life significantly harder... :confused:
     
    jpthek9 likes this.
  28. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    YUIS! That looks awesome!

    I think that the server doesn't have to be multithreaded when it's Unity-embedded, since a bunch of other things like rendering and physics will take a much bigger toll on the CPU.
     
  29. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    I'm currently developing a MMO based on DarkRift, with no problems! I already tested it on a remote server with an authoritative server, position and rotation sync'ing, persistance management. I have to stress test it when I will complete the game structure, but I'm already developing a multiserver structure to divide server load (in case of bottlenecks on 200/300 concurrent users)!
    And the support is quick and smart, Jamie will respond you in some hours! :)

    Best regards,
    Emanuele - Crimson Games Development Department
     
    Last edited: May 1, 2015
    Jamster and jpthek9 like this.
  30. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    @jpthek9 I know it's probably not the worst thing to have to ditch, but it's going to be a darn sight harder to do remove from the source code :p I might try and implement a message pump or alternatively just leave it for you guys to do ;)

    @ManHunterITA Awesome :D I'm really interested to see how well DarkRift performs in an MMO context! How are you developing a multiserver system, are you simply sharding it or are you sharing the same world across all servers?

    Jamie
     
  31. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    I hope that it will performs very well! :D
    About multiserver: I'm trying to create a server structure that will be independant in a single instance, but it can receives states from other server instances. In example, I want to teleport a player in other map. This other map is hosted on other server. I can send Player instance from server 1 to server 2, send the new server IP (or port, if the new server is on the same machine) to client, connect to new server on client and continue my game.
    This is why I asked you for a P2P class (to share states between servers).

    Any news about my latest issue report?
     
    Last edited: May 2, 2015
  32. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    I sent you an email about it. I'm still not entirely sure how you've managed it :p
     
  33. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    Issue solved, thank you.

    I have another question: did you already managed some type of connection security between client and server?
    I will make an example to explain this concept:
    I create my server and my client with their own behaviour thanks to DarkRift.
    If I create another application (in .NET, for example) that send a socket to my DarkRift server, can I still communicate with my third application to my DarkRift server? Or DarkRift server provides any type of checks on incoming sockets and only accepts sockets sent by a DarkRift client?

    I am curious on this point, because I don't want that some users can communicate with server without a verified client connection (risk of bots, cheats, etc). So I need to manage it if DarkRift doesn't deals with this problem!

    Best regards,
    Emanuele - Crimson Games Development Department
     
    Last edited: May 8, 2015
  34. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Technically there's no stopping them being able to connect, I was thinking of adding a hashed key to the handshake that's required to gain access to the server. In the end if someone's going to communicate with the server they're likely to either download the free client and connect (which a key would stop) or they're going to decompile you assembly/listen to the network traffic and the key will probably be fairly obvious...

    It kinda seems like a token gesture considering how you could work it out in a matter of minutes. Never the less if it's a wanted feature it should be easy to do.
     
  35. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Quick progress update:
    DarkRift has had a few bolt-on upgrades allowing you to run a DarkRift server under Unity and therefore take advantage of Unity's pathfinding and physics. You essentially get the same API and the same system except:
    • You're not a plugin and therefore can't access things in the Plugin class.
    • Plugins aren't loaded. Really you should be doing all your logic in Unity in this setup but I may add support for adding plugins during runtime if it's needed.
    • You lose out on a lot of multithreading. Usually all events are fired and executed on the threadpool but as Unity doesn't like multiple threads they're now executed from Update, LateUpdate or FixedUpdate (your choice which) at a little cost of performance I guess.
    • settings.cnf is obsolete. Now specified in the inspector.
    • Errors go to Unity's console.
    • Plus some other things I can't remamber...
    This isn't final, the whole server has now migrated to a dll with just a console application 'front' so I should be able to create a GUI for the server too which will be nice. Chances are I'll also finalise some changes because, as I said, some bits aren't pretty... :)
     
    jpthek9 likes this.
  36. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    I see so many potential uses for this feature. DarkRift is the new Forge!
     
  37. breck79

    breck79

    Joined:
    Jan 7, 2013
    Posts:
    9
    Very nice Jamster!!
    When we can get the new DarkRift?
     
  38. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    New DarkRift will be out when I have less work, I have vast amounts of Documentation to update before I can release anything so I need to have a little less work on my plate first :) I suspect perhaps mid July as a rough estimate.
     
  39. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Just to get overall feedback, what would people change about DarkRift? By that I mean anything in DarkRift be it more plugins, a new API, new feature etc...

    Personally I think the distribution system needs an overhaul; currently the onDistribute event has a glitch (though that's already sorted in the next version) but I also think there could be a better implementation, perhaps allowing more freedom in terms of when data is decoded to aid performance (which could then be extended to onData/onDataDecoded because I wouldn't say they are optimal for performance either...).

    Anyway, I'd like to hear people's thoughts on what they would change. I think the next update will be fairly major so I'd like to make sure I address as much as possible.

    Jamie
     
  40. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    At least for my prototyping purposes, DarkRift works too well. There's actually not much to ask of DarkRift because of how flexible it is.
     
  41. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Quick Update:
    The next beta should be within 1/2 weeks, I'm currently working out the odd bug with the new Unity embedded mode plus I still need to write a fair amount of documentation (complicated by the fact I don't have MS word on my PC to write it in :/ ). I've also started my own little game in DarkRift which should help me better understand how to go about development and maybe it'll become an example project.

    If there is anyone who would like to be added to the beta list PM me! :D

    Jamie
     
  42. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    After a short fight with a virtual machine to test, DarkRift can now officially support Ubuntu!

    Other than that progress is slow on documentation, it's getting there but only slowly. The next beta should be out maybe next week but there's still no guarantee on that :/
     
    jpthek9 likes this.
  43. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    DarkRift Beta V1.3 has been released to those on the testing list!

    I'm looking for more people to help test so if you're interested please PM me!

    Jamie
     
  44. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    DarkRift Beta V1.4 has been released sent to the beta testers!

    I need more testers so please PM or email me if you're interested!

    Jamie