Search Unity

UniKnowledge entry: Unity Networking the Zero to Hero guide

Discussion in 'Multiplayer' started by MikeHergaarden, Aug 23, 2009.

  1. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    I know that the timeframe between submission to the asset store and when it actually finishes review, shows up and is purchasable takes forever. Maybe you should sell it on your website in the meantime, Leepo :)
     
  2. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    I got my asset store problems fixed for 5 packages that we submitted. I now aim to get the networking project submitted as soon as possible, as I didn't submit this yet to see how the process worked for the others. Theres only one problem with "full projects", being that the build settings are not saved for asset store packages, but I'll add this to the instructions and make an editorscript for it.
    My target is to get it up and running this month, I'm sorry for the delay.
     
  3. sovietpenguin

    sovietpenguin

    Joined:
    Jan 9, 2011
    Posts:
    21
    i cannot see created games from another computer! HELP!!!!!!!!!!!
     
  4. sovietpenguin

    sovietpenguin

    Joined:
    Jan 9, 2011
    Posts:
    21
    i cannot connect as a client on a different computer. :(
     
  5. Word

    Word

    Joined:
    Jan 23, 2010
    Posts:
    225
    yeah i got the same error..it always says "failed to connect" (i tried to copy the relevant files from example 4 in my project)
     
  6. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    I'll dedicate a section to resolve connection issues as there's a lot of confusion regarding this subject.
     
  7. Word

    Word

    Joined:
    Jan 23, 2010
    Posts:
    225
    Last edited: Jan 18, 2011
  8. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    I'm almost there.

    The project is 3.0 ready.
    New content:
    - The project is still in JS, but every file is available in C# too.
    - Example 5: Automatic matchmaking in-game (no usage of GUI, see Crashdrive 3D)
    - My custom MultiplayerFunctions class is included. Contains several timesaving functions/tricks.
    - Better/New documentation on: Masterserver, NAT/Connection troubleshooting, performance/LAG, load data before connecting, tips.

    I hope to submit the asset store package later today.
    Missing any content? Suggestions are welcome. I'll also be updating the asset bundle when required.
     
    Last edited: Jan 24, 2011
  9. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    I think I just peed a little. How long does it usually take from asset store submission -> actually being available on the store? Could you possibly add an option to purchase it via paypal and download it elsewhere? I've been having trouble getting my asset store account activated and Unity support hasn't gotten back to me.
     
  10. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    A bit random, depending on their workload. But 1 to 4 days I guess.
    Sorry, no, as I want to keep my own administration clear. Maybe try registering under a new email address or send them a new email?
     
  11. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    The new 3.X compatible project has been submitted to the asset store and should be available soon. I was exploring the 50-100 Euro price range and have chosen for the lower end to make the project more accessible to everyone. I submitted it for 60$ and unless the Unity asset team advises a different price it should sell for 60$ / 45 Euros? (I'm not sure how the store converts to euros).

    The forum topic to discuss this new project is:
    http://forum.unity3d.com/threads/75385-Ultimate-Unity-Networking-project-Add-multiplayer-to-your-game-today!
     
  12. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    I think that sounds like a fair price. If you got half that for every person that read your uniknowledge one, you'd probably be a millionaire :)

    I hope for your sake that all those people buy this one, as you really deserve it. Unity networking would be nowhere near as accessible were it not for your community contributions and making it so easy to understand.
     
  13. appleunited

    appleunited

    Joined:
    Dec 25, 2010
    Posts:
    103
    Great guide. Thanks for sharing. :)
     
  14. HiPPiE1337

    HiPPiE1337

    Joined:
    Feb 13, 2011
    Posts:
    7
    Hello,
    I am making an fps, but this works with one server right?
    Cause i want in the main menu create server or an standaolne server so everybody can make their own server or join them via console or server list. For example: warsow
     
  15. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Unity allows for hosting a server, a game list, joining servers (via console or GUI). There is one masterserver, but players can host their own servers at will. There is no dedicated game server in the Unity network solution. Photon does allow for dedicated game server(s).
     
  16. Gamer_

    Gamer_

    Joined:
    Dec 4, 2009
    Posts:
    74
    Hi to all,
    I have a issue in networking and exciting to know how to achieve.I want to give user the option of selecting the character he wants to control. Say i am the user roaming around the multiplayer game world where other players also connected,i want to select one of the characters(AI characters not controlled by anyother player) and make it has mine and remove the exiting character controlled mine.

    I tried to change the "Network.mine = false" but its read only. Any way to accomplish this. Thanks in advance.


    regard's
    rajesh
     
  17. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Have the right player instantiate its own player to properly set the network owner. Either via network.instantiate, or better yet, by manually allocating the networkViewIDs. The ultimate networking project shows you all possible methods to do so.

    Edit:
    Since you want to allow any player to take control of existing characters you will have the server spawn them all. Your only option is to use RPCs to send messages and input accross and you should totally ignore the networkView owner. Instead set the owner manually via RPC.
     
  18. cepa

    cepa

    Joined:
    Sep 6, 2010
    Posts:
    6
    Where can I download this guide (the one which you posted on the front page), links on the front page are broken.
     
  19. Caps

    Caps

    Joined:
    Jul 23, 2010
    Posts:
    21
    Hi, I have also tried downloading the project from the link provided. It is broken :/
     
  20. GTaveira

    GTaveira

    Joined:
    May 20, 2009
    Posts:
    29
    Hi,

    I also tried to download the tutorials but the links posted on the first page are broken. Have they changed or moved? If not, could you check what's wrong?

    Thanks in advance!
     
  21. DJAZLAR

    DJAZLAR

    Joined:
    Feb 18, 2011
    Posts:
    37
    Hi,

    I am looking into the authoritative tutorial 3 and its ideal for my networking setup, however the direct ip thing i cannot get to work to connect to a friend. I only get local connections working great with that connection type.
    How easy is it to implement the example 3 lobby system to do the connections for the authoritative tutorial 3 I have tried to implement this and the cubes dont spawn after the load. the problem seems to be with Network.InitializeServer(32, connectPort);
    its called before the level loads so its kinda screwing things up for me.
     
  22. tecra134

    tecra134

    Joined:
    Mar 19, 2011
    Posts:
    94
  23. ben.06feb

    ben.06feb

    Joined:
    Dec 8, 2010
    Posts:
    9
    those r bad links i can't download the tutorial
     
  24. ben.06feb

    ben.06feb

    Joined:
    Dec 8, 2010
    Posts:
    9
    hai,
    can u send me M2H's network tutorial. The links given by him is broken
    my mail id : ben.06feb@gmail.com

    Thanks in advance
     
  25. Worldprofile

    Worldprofile

    Joined:
    Apr 22, 2011
    Posts:
    2
    When I click on the link theres an error... WHY!!!
     
  26. jstriedinger

    jstriedinger

    Joined:
    Apr 19, 2011
    Posts:
    58
    The links doesnt work ._. xD
     
    Last edited: Apr 29, 2011
  27. DonGato

    DonGato

    Joined:
    Dec 9, 2010
    Posts:
    45
    I too am looking for this. I previously downloaded it, and have the assets, but I guess I deleted the .pdf that explains it all...

    If anyone has it could they post here or PM me a link?
     
  28. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    The old version is no longer available.

    It was drastically expanded, refined and detailed and is now for sale on the asset store.
     
  29. Myister

    Myister

    Joined:
    May 1, 2011
    Posts:
    3
    I am sure people would still like to see the old tutorial...
     
  30. Quietus2

    Quietus2

    Joined:
    Mar 28, 2008
    Posts:
    2,058
    As the old version of the tutorial was an official Unity contest entry, it should still be available to people.
     
  31. Myister

    Myister

    Joined:
    May 1, 2011
    Posts:
    3
  32. DonGato

    DonGato

    Joined:
    Dec 9, 2010
    Posts:
    45
    Thank you very much...


    This time I won't delete it :p
     
  33. IndieDude360

    IndieDude360

    Joined:
    Oct 29, 2010
    Posts:
    105
     
  34. Kethis

    Kethis

    Joined:
    Sep 10, 2009
    Posts:
    28
    Thanks a ton for the link to the pdf!

    Does anyone have a copy of the project?
     
  35. DonGato

    DonGato

    Joined:
    Dec 9, 2010
    Posts:
    45
  36. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    The link to the PDF in the original post no longer works.

    Edit : Ok my bad : See links above :)
     
  37. Grady Lorenzo

    Grady Lorenzo

    Joined:
    Jan 18, 2010
    Posts:
    407
    you saved my hide there. I had the original tutorial on another old computer that I've since lost track of. I don't have the $85 to buy it...
     
  38. flamy

    flamy

    Joined:
    Feb 7, 2011
    Posts:
    194
    thanks for the link again :) donGato
     
  39. U7Games

    U7Games

    Joined:
    May 21, 2011
    Posts:
    943
    Hey DonGato, fantastic.. thanks, and Thanks M2H for this.. and thanks God who made you.. and so..... thanks me too because i like this things... and my mom, because she.. well.. thanks..
     
  40. Rush-Rage-Games

    Rush-Rage-Games

    Joined:
    Sep 9, 2010
    Posts:
    1,997
    Very cool, thanks for sharing!
     
  41. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,476
    In this example2, I did like this. Make standalone game. And then run the game in the unity editor after load the [Example2_menu] scene.

    and made server and started game. And then run the standalone, but the list of game is empty. I think it should listed in there cuz I already run server in the editor. I don't know why list does not appear.

    In example3's lobby testing, no problem. Client get list of current server well. Then why example2 can't do like this? I saw example2's scripts but I can't find the reason.

    Anyone know why and how fix? Thank you.
     
  42. cozza13

    cozza13

    Joined:
    Dec 13, 2010
    Posts:
    64
    Does anyone have a good reference for exactly how to setup the master server on your own server? having trouble finding any good references.
     
  43. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
  44. cozza13

    cozza13

    Joined:
    Dec 13, 2010
    Posts:
    64
    Thanks I got those, yet they are not to helpful explaining how to setup the actual server.
     
  45. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Mmm... As I would be dealing with a hosted server, I sent the links to my provider and said "Can you set this up for me if I'm buying additional hosting space?" and they said "Yes! Piece of cake!"...

    And I stopped my research.

    But, sympathetically and unhelpfully, I've not found a lot either.

    Have you tried #unity3d on irc?
     
  46. cozza13

    cozza13

    Joined:
    Dec 13, 2010
    Posts:
    64
    yeah I tried that. In most cases I just use the public server. But I want to set one up myself at the moment. I think I have it going but I am not connecting so some sort of manual that explains the setup would be helpful to make sure I have not missed anything. .e.g what ports need to be opened UDP and TCP getting the NAT running etc.
     
  47. dip

    dip

    Joined:
    Jan 8, 2010
    Posts:
    1
    the download link is broken
    anyone have other link?
     
  48. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    dip: Look above to the link provided by DonGato.
     
  49. Gabatto

    Gabatto

    Joined:
    Dec 23, 2011
    Posts:
    1
    Hello, i think the tutorial is great and i have two questions:

    In the exaple4(FPS game) there' a script GameSetup which takes care of spawning of players. The script calls function OnNetworkLoadLevel in the following loop:
    Code (csharp):
    1.  
    2. for (var go : GameObject in FindObjectsOfType(GameObject)){
    3.             go.SendMessage("OnNetworkLoadedLevel", SendMessageOptions.DontRequireReceiver);
    4.         }      
    5.  
    I want to know why this loop with FindObjectsOfType(GameObject) is neccessary(or logical)? Why can't it be replaced with just one call of OnNetworkLoadedLevel() function(the function which calls Network.Instantiate) like in the example2 for instance?

    And my second question :) -> In the same script(GameSetup) there is public var playerList = new ArrayList(); with comment that this is a server-only playlist. Is it really server-only? Because RPC function call TellOurName is sent to everyone and playerList gets new elements added on clients as well, if i understand it correctly?

    Thanks and Happy Holidays!
     
  50. Bladesfist

    Bladesfist

    Joined:
    Jan 3, 2012
    Posts:
    107
    Megaupload has been shut down, can anyone put up another mirror of the PDF?