Search Unity

Implementing Raknet

Discussion in 'Multiplayer' started by amherst, Jun 3, 2010.

  1. amherst

    amherst

    Joined:
    Dec 9, 2008
    Posts:
    30
    I am working on a multiplayer networked game with a dedicated authoritative server, clients connecting from a web player, and am experiencing server issues and wondering if Raknet would be a better choice for my game. However, I'm not finding an easy introduction to Raknet. Can anybody answer a few questions?

    1. Does Raknet come with Unity 2.6? Or do I need to download it separately?

    2. How integrated into Unity 2.6 is Raknet? Is it a transparent implementation? Or do I need rethink my coding?

    3. Is there any documentation or a tutorial written that gets you started with using Raknet on your server?

    Thanks!
     
  2. Chesh

    Chesh

    Joined:
    May 26, 2010
    Posts:
    3
  3. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    2/3. Unity's NetworkViews are RakNet driven actually.
    You have no access to anything related to raknet for manual usage, you can decide to use NetworkViews or implement an own solution.
    Thats why you don't find any information on it on the RakNet page.
     
  4. Ethan

    Ethan

    Joined:
    Jan 2, 2008
    Posts:
    501
    And you are not able to put your own raknet plugin (unity pro) on a webplayer game.
    So you have to use libs which can be used without plugins like photon or smartfox server (please correct me if one of these is plugin based) OR you have to use unity's builtin raknet solution.

    If you want to use unities builtin networking raknet stuff, then wait for unity 3.0, because in 2.6 it's too buggy.

    Cheers
    Ethan
     
  5. Quietus2

    Quietus2

    Joined:
    Mar 28, 2008
    Posts:
    2,058
    You might want to look into lidgren as a solution. It's C# so it will work in webplayers.
     
  6. amherst

    amherst

    Joined:
    Dec 9, 2008
    Posts:
    30
    Thanks everyone for the replies. A couple more questions for those who have already figured this stuff out, if you don't mind. And, yes, I have Unity Pro.

    So, is RakNet primarily designed for master server implementation? Does it not make sense to implement RakNet if I'm not implementing a master server design? The game I'm working on that I'm referring to does not have nor need a master server. It's just experiencing a lot of lag in object creation and I'm wondering if Raknet will speed things up. However I will be needing to implement a master server on another project I'm working on that is still relatively early in development.

    When I read that RakNet won't work in webplayers, does that mean that I cannot have a client running as a webplayer? Or only the server? Why I would run a server as a webplayer I don't know, but I just want to be clear.

    Dreamora, when you say Unity's network views are RakNet driven, what do you specifically mean? That I'm already using RakNet and it's just transparent to me? Or that with my existing network views will integrate with the proper RakNet libraries?

    Ethan (and/or others), you say I should wait for Unity 3.0. Is RakNet going to be transparently built in to the 3.0 release?

    Thank you all so much!
     
  7. Ethan

    Ethan

    Joined:
    Jan 2, 2008
    Posts:
    501
    You cant use RakNet in webplayer builds because these cant load plugins like DLLs.

    RakNet is a whole networking library not a masterserver. You can do a masterserver with RakNet, but you don't have to.

    Unity uses RakNet internally, but you don't get direct access to it, it's kinda wrapped with unity's logic.

    There will be a newer version of RakNet and Mono in Unity 3.0, the unity networking stuff stays the same.

    Cheers
    Ethan