Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

DarkRift - Fast and Flexible Cross Platform Networking

Discussion in 'Assets and Asset Store' started by Jamster, Apr 20, 2015.

  1. chrisx84

    chrisx84

    Joined:
    Nov 9, 2011
    Posts:
    84
    i think so. im using SceneManager.MoveObjectToScene to move the player and clones but i guess i just need to move the player and destroy the clone.

    object data = new object();
    data.sid = playerID;
    data.map = newMap;
    DarkRiftAPI.SendMessageToOthers(Controller, MapSwitch, data);

    Does that seem right(ish)?
     
  2. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,049
    Something along those lines looks good!
     
  3. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    643
    Hi Jamie, I'm back with another issue/question. I'm trying to implement functions for when player's log out (deleting their GameObject and saving their information...stuff like that). I have the following method firing from ConnectionService.onPlayerDisconnect.
    Code (CSharp):
    1. private void OnPlayerDisconnect(ConnectionService con)
    2.     {
    3.         Destroy(Players[con.id].gameObject);
    4.         Players.Remove(con.id);
    5.  
    6.         if(Minions.ContainsKey(con.id))
    7.         {
    8.             Destroy(Minions[con.id].gameObject);
    9.             Minions.Remove(con.id);
    10.         }
    11.              
    12.         foreach(ConnectionService cs in DarkRiftServer.GetAllConnections())
    13.             cs.SendReply(TagIndex.Controller, TagIndex.ControllerSubjects.PlayerDisconnect, con.id);
    14.     }
    The problem that I'm having is that as soon as this code fires, the entire server freezes (I'm running an embedded server in a game build instance). Any ideas what's going on?
     
  4. chrisx84

    chrisx84

    Joined:
    Nov 9, 2011
    Posts:
    84
    That code for Unity or for the server side?
    If its Unity then PlayerDisconnected is just a ushort. Here is what i have attached to all player clones
    Code (CSharp):
    1.  
    2. void PlayerDisconnected(ushort ID) {
    3.         if (ID == networkID) {
    4.             Destroy (gameObject);
    5.         }
    6. }
    7.  
    Of course you can change Destroy to Minions.Remove(ID);
     
  5. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    643
    No this is server code. It's executed by the server. What you have is from the example scenes. That doesn't apply to this case.
     
  6. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,049
    Hmmm, well it shouldn't freeze... could be down to a deadlock somewhere, I'll check it out!
     
  7. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,049
    I've posted an update to the store resolving some bugs fixed over the past few months including the issues people have been having with large messages (hopefully!).
     
  8. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    643
    Alright. Well if you want to try and replicate the issue I'm having, just so you know Players and Minions are Dictionaries. They have a key of ushorts (Players ushorts are their DarkRiftAPI.id and Minions are ushorts that I assign to them upon spawning). Players have a value of a Player script and Minions have a value of a Minion script. They're added to the Dictionary when the server (and clients) spawn the object.

    Okay. Whatever was in that update, fixed the problem.
     
    Last edited: Jan 16, 2017
    Jamster likes this.
  9. chrisx84

    chrisx84

    Joined:
    Nov 9, 2011
    Posts:
    84
    just putting this out there for anyone else trying to run the server in mono on linux.
    Every time i try to query my MySQL database with the MySQL plugin i get
    Code (csharp):
    1. System.MissingMethodException: Method 'Array.Empty' not found.
    After googling the issue it appears its a issue with the latest mono development for linux systems.
    I am curious though if anyone knows a work around for this issue.
     
  10. saybor

    saybor

    Joined:
    Jan 29, 2015
    Posts:
    5
    1. What means this errors?
    [Error] You specified an Encoding Version of 99but that doesn't exit!
    [Error] You specified an Encoding Version of 56but that doesn't exit!
    [Error] You specified an Encoding Version of 101but that doesn't exit!
    2. Does bug with big messages solve or not? Because now cannot use build-in serializer, just making my own serialize/packing and splitting message to a lot of small packets?
    3. As i understand there is no any security protocol in server, right?

    P.S. 1 and 2 is really annoying, impossible to even test normally.
     
  11. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,049
    Hey @saybor,

    Those errors mean that the messages being decoded start with invalid version number (which should only be 0 or 1), usually this means somewhere DarkRift has become unsynchronised with the incoming data which I suspect is because you're sending a large message.

    That should be fixed in the version I pushed to the asset store the other day, it'll take about a week to get approved and get to you however :(

    How do you mean you cant use the inbuilt serializer? Are we talking automatic or manual serialization? Do you get errors or is it related to the first error?

    Are you referring to encryption or to more general security measures here? There's no encryption because for anything security related (login etc.) you should probably be using HTTPS, there are security measures designed to stop malicious messages being sent to the server.

    Jamie
     
  12. saybor

    saybor

    Joined:
    Jan 29, 2015
    Posts:
    5
    I mean, that if message object is too big (like player information class, for example) then server often stuck and not answering, so need to disconnect and connect again. As i remember someone before was having same issue.
    So instead of using object, i write class-to-string serializer and then send this string by small 128/256 bytes parts, if getting stuck - then disconnect, reconnect and keep receiving parts from last.
    Problem is not serializer, problem was server stop answering when trying to send big message.
    Well, i didn't try last build, so maybe issues 1 and 2 are fixed.
    As i understand it was same problem:
    1. Server stop answering if trying to send big message to client.
    2. If client sending big message to server - then we receive error about version.

    Security, i mean:
    1. encryption, for example. Because now looks like i just easy change any packet that going from client to server (on client side). And server will not notice anything.
    2. any defense from spamming message from same/many clients? It's like typical way to crash server ro make him stuck.
    3. on web site was mentioned that this engine fit for MMO. Does it mean that it can be scaled on several servers?

    P.S. Sorry for mistakes and typos, not very comfy to type from mobile.
     
  13. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,049
    Ok, I think your first issue is fixed in the next release then, it should be with you in a week or so depending on how quickly Unity approve it :)

    There's no encryption because it adds a huge latency on packets, you would see significant lag on fast paced games if you were encrypting every message. Theoretically, yes, you can change the message and neither the client or server may ever know and that's why anything that requires security (login, IAP) should be going through your HTTPS server and not DarkRift. DarkRift is there to provide quick routing of messages for things like movement where if someone changed the data it wouldn't be all that damaging. You can also eliminate a lot of problems like this through good server-side validation (e.g. has the player moved too fast) bear in mind.

    There's not much protection against that form of attack at the moment though that is being improved for DarkRift 2.

    Yes, DarkRift is good for MMOs, generally you will want to build your backend in a zonal type way for DarkRift (you can do it other ways but DarkRift is a lot more suited to zones) and then pass players between servers as they move between 'zones'.

    Jamie
     
  14. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    643
    Hey Jamie...
    Looks like I'm having that issue where the server build (embedded) is freezing again. I have a server instance running and then an instance of the game running and I'm testing it with another team member. He's located in Spain and I'm in the U.S. My computer is running the server via port forwarding and DDnS. Once both of us are logged into the game, about 10-30 seconds after running around the server freezes. Any thoughts on what's going on? If it's just me running around it's fine, but after he logs in it freezes.
     
  15. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,049
    Hmmm, does it freeze if only he is logged in? Is it to do with the disconnection issue you were having do you think? How much data are you sending per second? Are you on the latest server? Any errors?

    Sorry for the large amount of questions!
     
  16. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    643
    No worries! lol I was expecting you to have to ask ME some questions in order to narrow down possible sources of the problem.

    1. It only freezes when he's logged in at the same time as I am. I haven't yet tried it with anyone else logged in with me.
    2. It is NOT related to the disconnect issue I had before.
    3. I'm not sure how much data. Is there any easy way for me to debug this? Also, do you need to know how much data is going both ways on the server (incoming and outbound).
    4. Not sure what you mean by latest server. I downloaded the update that you mentioned on January 16th.
    5. No errors.
     
  17. chrisx84

    chrisx84

    Joined:
    Nov 9, 2011
    Posts:
    84
    sounds like the same issue im having with 2 local players (me and me). Server is 1.4.3 but i see a update on assets just now.
    The issue im having is when Player 2 log in, the gameobject for both 1 and 2 dont show up for each other, player 1 freezes as well as the server. Thought at first was my code but after seeing all these new posts is starting to make me rethink that it could be darkrift itself.
    Ill try this new update now and let you all know.

    UPDATE: I still got the issue with 1.4.4. Player 1 connects, server is fine. Player 2 connects, no gameObject for player 1 or 2 on each other's screen and when both logs out theres no Disconnect (ip : port) message and the stop command says Shutting Down but i have to manually shut down the server.
     
    Last edited: Jan 23, 2017
  18. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,049
    Thanks, the update got pushed to the asset store on the 20th so I suspect you're not on the latest. It could very well be related to one of the issues fixed.
     
  19. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    643
    Hey Jamie!

    Good news! After updating to the latest version of DRN (DarkRift Networking ) and running another test there seem to be no issues. However, we've only tested it with the two of us being logged in simultaneously (never more than 2 CCUs at one time yet). In any case, you asked before about how many messages were being sent a second. I'd still like to be able to monitor this. Is there any "easy" way to debug how many messages are coming into and going out from the server at a time?
     
  20. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,049
    Good!

    Not easily actually, I'll try and add it to DarkRift 2 :)
     
  21. Vedrit

    Vedrit

    Joined:
    Feb 8, 2013
    Posts:
    508
    I'm trying to make sense of the embedded server demo, and I don't really understand the processing queue, and the script doesn't have much information. Could you explain how items are entered into the queue and what happens during processing?
     
  22. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,049
    Sure :) In a normal, standalone server DarkRift can invoke events from any thread but Unity can only handle calls from it's main thread so before DarkRift invokes an event in the embedded server it checks if an IManualDataProcessor is present. Since we're in Unity it will be and so DarkRift passes the processor a bit of code that invokes the event when it's run. The processor put it in the queue and when Unity calls Update (or whatever it's set to) the queue is emptied and each bit of code stored is run, thus invoking the events from the main thread.

    Additionally DarkRift can leave a wait handle with the code so that when it's run DarkRift is informed and can continue execution from where it left off.
     
  23. Vedrit

    Vedrit

    Joined:
    Feb 8, 2013
    Posts:
    508
    So is it just a generic queue to process all network events?
     
  24. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,049
    Essentially yes but the key thing to get across is that it's merging jobs from a number of threads to just the single main thread :)
     
  25. DuvE

    DuvE

    Joined:
    May 22, 2016
    Posts:
    128
    I have a question, when you accessing server:

    Code (CSharp):
    1.  /// <summary>Sends data, tag and subject to the server.</summary>
    2.     /// <param name="tag">The tag.</param>
    3.     /// <param name="subject">The subject.</param>
    4.     /// <param name="data">The data.</param>
    5.     public static void SendMessageToServer(byte tag, ushort subject, object data)
    6.     {
    7.       DarkRiftAPI.connection.SendMessageToServer(tag, subject, data);
    8.     }
    Ushort subject is used, so it means there is a limit of 65,535 online users or not?
     
  26. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,049
    Per server yes, but not because of that. The subject can be used to represent anything you like, it doesn't have to be a player's ID :)
     
  27. chrisx84

    chrisx84

    Joined:
    Nov 9, 2011
    Posts:
    84
    Example:
    DarkRiftAPI.SendMessageToServer(MyTags.PlayerData, MyTags.PlayerInfo.PlayerSteamName, PlayerSteamName);
     
    Jamster likes this.
  28. devK2

    devK2

    Joined:
    Jan 29, 2017
    Posts:
    1
    HI i like your asset very much simple and powerful.
    i have question on compression say if i want to send transform values in network we dont have to send ex : 2.845995566
    we can compress it to 2.84 and send the value so to do this how can we able to send a transform qeuaternion using compression. thanks
     
    Last edited: Jan 29, 2017
  29. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,049
    I'm not sure about Quaternion maths but an example for Euler angles could be to reduce it to 2 bytes (as opposed to a 4 byte float)
    Code (csharp):
    1. ushort compressed = vector.x/360*65535;
    You might be able to make the maths a bit better (could be a loss of precision in the calculation) but I'm too asleep to work it out!
     
  30. Vickylance

    Vickylance

    Joined:
    Mar 28, 2014
    Posts:
    17
    @Jamster Is it possible to get a beta access to dark rift 2 if so how can get it?
     
  31. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,049
    There's no beta out yet but it will be public when it's ready :) You can follow development here :)
     
  32. Kerozard

    Kerozard

    Joined:
    Nov 26, 2012
    Posts:
    10
    Is there a way to configure the server through command line parameters and maybe even add custom parameters that we can read from inside a plugin? I am trying to use DarkRift Extreme as custom game servers for the popular Playfab BaaS and they do fire up game servers on demand by starting them with fixed command line parameters.

    Their required parameters are listed are listed in their custom server guide: https://api.playfab.com/docs/custom-game-servers

    If this is not possible, I might have to look for a different solution than DarkRift and that would be a shame.
     
  33. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,049
    Not currently, I've moved it to a higher priority in my DarkRift 2 todo list so it might be available on release, if not it will be available soon after.
     
  34. NickDevelopment

    NickDevelopment

    Joined:
    Apr 16, 2014
    Posts:
    3
    Hey Jamster,

    I've been taking a look at DarkRift and it looks very interesting! I was just wondering if you had advice on how to have a single player mode for a game that is built with DarkRift for multiplayer.
     
  35. Vedrit

    Vedrit

    Joined:
    Feb 8, 2013
    Posts:
    508
    I'm taking another whack at DarkRift and so far so good, except for one thing. I've got my embedded server up, but I can't seem to send messages to clients from it.
    For example, when I try and send a message from the server to a new client who just connected, the debugs on the server fire just fine, but nothing happens client-side.
    Server:
    Code (csharp):
    1. void onNewPlayer(ConnectionService con)
    2. {
    3.     Debug.Log("New player with id: " + con.id + " has connected.");
    4.     con.SendReply(TagIndex.Controller, TagIndex.ControllerSubjects.JoinMessage, "hello");
    5. }
    Client:
    Code (csharp):
    1. void handleData(ushort senderID, byte tag, ushort subject, object data)
    2. {
    3.     Debug.Log("Message received from: " + senderID + " with data: " + data);
    4. }
    Are ConnectionService messages not seen by DarkRiftAPI?
     
  36. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,049
    I suppose it depends on what your game is but I'd probably just have a Boolean indicating if it's offline and then check that before constructing and sending updates :)

    It should be seen, are you sure there's a DarkRiftReceiver script somewhere in your scene?
     
  37. Vedrit

    Vedrit

    Joined:
    Feb 8, 2013
    Posts:
    508
    Ah, that's what I was forgetting.
     
  38. VXPuddiM

    VXPuddiM

    Joined:
    Jan 23, 2017
    Posts:
    10
    Hi, i'm new to DarkRift and i have a problem. My game is working fine, but when i open 2 clients, close one of them, and open a new one, the one that wasn't closed gives an error. error.png
    My game is kind of a rewrite of the Player Demo.

    Scripts:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. using DarkRift;
    6.  
    7. public class NetworkM : MonoBehaviour {
    8.  
    9.     public string IP = "127.0.0.1";
    10.     public GameObject Yplayer; // You (Camera)
    11.     public GameObject Oplayer; // Other Players (No Camera)
    12.     private Transform player;
    13.  
    14.     // Use this for initialization
    15.     void Start () {
    16.         DarkRiftAPI.Connect (IP);
    17.         DarkRiftAPI.onDataDetailed += ReceiveData;
    18.  
    19.         if (DarkRiftAPI.isConnected) {
    20.             DarkRiftAPI.SendMessageToOthers (TagIndex.Controller, TagIndex.ControllerSubjects.JoinMessage, "a");
    21.             DarkRiftAPI.SendMessageToAll (TagIndex.Controller, TagIndex.ControllerSubjects.SpawnPlayer, new Vector3 (0f, 2f, 0f));
    22.         } else {
    23.             Debug.LogError("Not connected.");
    24.         }
    25.     }
    26.  
    27.     void OnApplicationQuit() {
    28.         DarkRiftAPI.Disconnect ();
    29.     }
    30.  
    31.     void ReceiveData (ushort senderID, byte tag, ushort subject, object data) {
    32.  
    33.         if (tag == TagIndex.Controller) {
    34.  
    35.             if (subject == TagIndex.ControllerSubjects.JoinMessage) {
    36.                 DarkRiftAPI.SendMessageToID (senderID, TagIndex.Controller, TagIndex.ControllerSubjects.SpawnPlayer, player.position);
    37.             }
    38.  
    39.             if (subject == TagIndex.ControllerSubjects.SpawnPlayer) {
    40.                 if (senderID == DarkRiftAPI.id) {
    41.                     GameObject clone = (GameObject)Instantiate (Yplayer, (Vector3)data, Quaternion.identity);
    42.                     clone.GetComponent<NetworkP>().networkID = senderID;
    43.                     clone.GetComponent<PlayerController>().Controllable = true;
    44.                     player = clone.transform;
    45.                 } else {
    46.                     GameObject clone = (GameObject)Instantiate (Oplayer, (Vector3)data, Quaternion.identity);
    47.                     clone.GetComponent<NetworkP>().networkID = senderID;
    48.                 }
    49.             }
    50.         }
    51.     }
    52. }
    53.  

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. using DarkRift;
    6.  
    7. public class NetworkP : MonoBehaviour {
    8.     public ushort networkID;
    9.  
    10.     Vector3 lastPos;
    11.     Quaternion lastRot;
    12.     // Use this for initialization
    13.     void Start () {
    14.         DarkRiftAPI.onDataDetailed += ReceiveData;
    15.         DarkRiftAPI.onPlayerDisconnected += PlayerDisconnected;
    16.     }
    17.  
    18.     void Update () {
    19.         if (DarkRiftAPI.isConnected && networkID == DarkRiftAPI.id) {
    20.             if (transform.position != lastPos) {
    21.                 DarkRiftAPI.SendMessageToOthers (TagIndex.PlayerUpdate, TagIndex.PlayerUpdateSubjects.Position, transform.position);
    22.             }
    23.             if (transform.rotation != lastRot) {
    24.                 DarkRiftAPI.SendMessageToOthers (TagIndex.PlayerUpdate, TagIndex.PlayerUpdateSubjects.Rotation, transform.rotation);
    25.             }
    26.  
    27.             lastPos = transform.position;
    28.             lastRot = transform.rotation;
    29.  
    30.             if (transform.position.y < -20) {
    31.                 DarkRiftAPI.Disconnect ();
    32.             }
    33.         }
    34.     }
    35.  
    36.     // Update is called once per frame
    37.     void ReceiveData (ushort senderID, byte tag, ushort subject, object data) {
    38.         if (senderID == networkID) {
    39.             if (tag == TagIndex.PlayerUpdate) {
    40.                 if (subject == TagIndex.PlayerUpdateSubjects.Position) {
    41.                     transform.position = (Vector3)data;
    42.                 }
    43.                 if (subject == TagIndex.PlayerUpdateSubjects.Rotation) {
    44.                     transform.rotation = (Quaternion)data;
    45.                 }
    46.             }
    47.         }
    48.     }
    49.  
    50.     void PlayerDisconnected(ushort ID) {
    51.         if (ID == networkID) {
    52.             Destroy (gameObject);
    53.         }
    54.     }
    55. }
    56.  

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class PlayerController : MonoBehaviour {
    6.  
    7.     public bool Controllable;
    8.     private float h;
    9.     private float v;
    10.     // Use this for initialization
    11.     void Start () {
    12.      
    13.     }
    14.  
    15.     // Update is called once per frame
    16.     void FixedUpdate () {
    17.         if (Controllable) {
    18.             h = Input.GetAxisRaw ("Horizontal");
    19.             v = Input.GetAxisRaw ("Vertical");
    20.  
    21.             float run = 0f;
    22.             if (Input.GetKey (KeyCode.LeftShift) && v == 1) {
    23.                 run = 2;
    24.             }
    25.  
    26.             h = h * Time.deltaTime;
    27.             h = h * 120;
    28.             v = v * 3 + run;
    29.             v = v * Time.deltaTime;
    30.  
    31.             transform.position += transform.forward * v;
    32.             transform.Rotate (new Vector3 (0, h, 0));
    33.  
    34.             if (transform.position.y < -20) {
    35.                 Destroy (gameObject);
    36.             }
    37.         }
    38.     }
    39.  
    40.     void OnCollisionStay (Collision col) {
    41.         if (Controllable) {
    42.             if (Input.GetKey (KeyCode.Space)) {
    43.                 GetComponent<Rigidbody> ().velocity = new Vector3 (GetComponent<Rigidbody> ().velocity.x, 10, GetComponent<Rigidbody> ().velocity.z);
    44.             }
    45.         }
    46.     }
    47. }
    48.  
     
  39. Vedrit

    Vedrit

    Joined:
    Feb 8, 2013
    Posts:
    508
    I'm trying to get custom structs to transmit between client and server, and it seems that if the struct contains another struct (Vector3, Vector3Carrier, etc) then it cannot be cast when received. Am I doing something wrong, is this expected, or is there something else?

    Edit: Nope, my bad. It looks like I wasn't set up the sub-structs properly.
     
    Last edited: Feb 6, 2017
    Jamster likes this.
  40. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,049
    I don't have time to give it a proper look at the moment I'm afraid but can you tell me what line the error is raised on?
     
  41. VXPuddiM

    VXPuddiM

    Joined:
    Jan 23, 2017
    Posts:
    10
    Network Player, line 52
    Code (CSharp):
    1.     void PlayerDisconnected(ushort ID) {
    2.         if (ID == networkID) {
    3.             Destroy (gameObject); //This One
    4.         }
    5.     }
    6. }
    7.  
     
  42. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,049
    Hmmm, interesting since you're definitely destroying the gameObject not the script... Maybe try adding a breakpoint to the if statement to check everything is present just before it hits the Destroy call?
     
  43. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,049
    Just found a load of reviews on the Asset Store I'd not seen before, thank you everyone! 5 stars! :D
     
  44. VXPuddiM

    VXPuddiM

    Joined:
    Jan 23, 2017
    Posts:
    10
    Oops, sorry for late reply.
    I don't actually know how to use breakpoints, but i will try to learn how to use them later. Also, it seems like the error also occurs on DarkRift's player demo. error2.png
     
  45. Rakinare

    Rakinare

    Joined:
    Feb 1, 2017
    Posts:
    17
    Hey, I am currently building a game in Unity using DarkRift.
    On PC it is running perfectly fine, if I want to export it as SDK for Android tho, it starts up the game just fine, but it doesn't connect to the server.
    Is DarkRift not compatible with Android or is there something I gotta do different to run it as an app?
     
  46. Rakinare

    Rakinare

    Joined:
    Feb 1, 2017
    Posts:
    17

    Are you maybe destroying the gameobject that your network manager is connected to?
     
    Last edited: Feb 11, 2017
  47. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,049
    Perhaps try reimporting DarkRift, maybe something has been changed by accident. I'll try to make time to check my end for you.

    I can't remember of the top of my head if Android Pro is needed because I've lost track of what each Unity cersion can and can't do now! It certainly used to be the case but I was under the impression that this got changed a while ago?
     
  48. Rakinare

    Rakinare

    Joined:
    Feb 1, 2017
    Posts:
    17
    I don't know anything about how stuff works on mobile, I thought it was kinda easy with Unity to make a game cross platform :p
    And I personally am really satisfied with DarkRift so far (considering to buy it) so I wanna keep using it. Right now we are just a little frustrated that it doesn't work with WebGL yet cause WebGL doesn't support the unity networking stuff and now the problem with mobile that we can't really seem to figure out.

    Can you elaborate on the Android Pro part a little please? Google doesn't really give me much information after a quick search.
     
  49. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,049
    Hmmm, it looks like Android Pro got superseded without me realising, possible when Unity introduced their Plus version. Does anyone else know? :)

    The WebGL is a bit annoying and there will be support for it in DarkRift 2 at some point.
     
  50. Nexam

    Nexam

    Joined:
    May 14, 2016
    Posts:
    26
    Hi !

    @Jamster your library is very appealing and beautifully simple, really like what i've seen from it so far. And you are building a fresh new version of it with RUDP and everything ? You made my day :)

    Got some questions however. I'm leading a 1v1 competitive moba game project called Beyond the void (http://www.beyond-the-void.net). I'm currently using Lidgren, but i need to change this... quick :p
    Lidgren was fine for me when i was prototyping, but now we got a beta for backer coming, then a open beta in april, and Lidgren is just too much work to do on the top to get it work, and i suspect some of our problems are coming from unsolved bug within the library. Darkrift seems to be the easier way to go where i need.

    My main concern is about scalability. I've actually designed our servers architecture (with lidgren) like this:
    One "master server" to handle: Login connection, chat/friend list & matchmaking (got a custom one with elo rating system)
    One or Many "Game server" to handle X 1v1 game each.

    Everything is hosted on AWS right now...

    Can i replicate this architecture with Darkrift? Maybe there is a feature to do this i didn't see? I've seen you planned it on Darkrift 2, maybe i can just go with one big single server with Darkrift to make my life easier then switch to a Darkrift 2 before june and enjoy your load balancing feature ?

    Finally, if you have a beta stage for Darkrift 2, i'll be really exited to use it for Beyond the void beta and see how it work well for us :)
     
unityunity