Search Unity

Third Party Photon Viking Demo

Discussion in 'Multiplayer' started by bertelmonster2k, Sep 1, 2011.

  1. bertelmonster2k

    bertelmonster2k

    Joined:
    Apr 3, 2009
    Posts:
    78
    Photon Viking Demo



    Get it - runs ins the cloud, no Server necessary
    Download from the Asset Store:
    http://u3d.as/content/exit-games/photon-viking-demo/2gg

    Overview
    In collaboration with Mike/M2H we've been developing a multiplayer version of the official Unity demo "3rd Person MMO Controller". This demo now shows the power of Unity AND Photon. The multiplayer is implemented using the new Photon Unity Networking plugin.

    Have fun and watch this short preview: http://www.youtube.com/watch?v=NfmsDzU4Q94.
    Making of: http://www.youtube.com/watch?v=f8S-xSsB9hg&feature=mfu_in_order&list=UL

    Related Asset Store Downloads
    Photon Unity Networking: http://u3d.as/content/exit-games/photon-unity-networking/2ey
    Photon Angry Bots Demo: http://u3d.as/content/exit-games/photon-angry-bots-demo/2i9

    Requirements
    Compatible with Unity Free.

    As server use either

    Feedback is welcome! Just reply here.
     
    Last edited: Oct 18, 2011
  2. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    :)
    What's the name of the music track?
     
    Last edited: Sep 2, 2011
  3. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    Asset store says I need Unity 3.4.1 to download the demo - but 3.4.1 is not yet publicly available.
     
  4. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    win7 х64
    4672: 03:56:33.649 - CService::OnException() - Exception: CManagedHost::photonRunning() - Failed in AppDomain: 3 - Cannot load Counter Name data because an invalid index '' was read from the registry.
     
  5. loki72

    loki72

    Joined:
    Aug 17, 2011
    Posts:
    13
    hmm. yes the asset stores says unity 3.4.1 required.. can't download.
     
  6. bertelmonster2k

    bertelmonster2k

    Joined:
    Apr 3, 2009
    Posts:
    78
    We re-uploaded with the 3.4 final :#.
     
  7. terrainoob

    terrainoob

    Joined:
    Sep 3, 2011
    Posts:
    1
    Still looks to be requiring 3.4.1 on the asset store. Is there a time lag for the update to take effect?
     
  8. AbgaryanFX

    AbgaryanFX

    Joined:
    Jan 9, 2010
    Posts:
    167
    +1
     
  9. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
  10. bertelmonster2k

    bertelmonster2k

    Joined:
    Apr 3, 2009
    Posts:
    78
    Until approval you can use this temporary download link:
    not necessary anymore - live in asset store
     
    Last edited: Sep 7, 2011
  11. GTaveira

    GTaveira

    Joined:
    May 20, 2009
    Posts:
    29
    I downloaded the link you posted but I got the following errors:

    Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs(19,31): error CS0433: The imported type `ExitGames.Client.Photon.PhotonPeer' is defined multiple times
    Assets\Plugins\PhotonUnity3D.dll (Location of the symbol related to previous error)
    Assets\Photon Unity Networking\Plugins\PhotonNetwork\library\Photon3Unity3D.dll (Location of the symbol related to previous error)

    Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs(19,43): error CS0433: The imported type `ExitGames.Client.Photon.IPhotonPeerListener' is defined multiple times
    Assets\Plugins\PhotonUnity3D.dll (Location of the symbol related to previous error)
    Assets\Photon Unity Networking\Plugins\PhotonNetwork\library\Photon3Unity3D.dll (Location of the symbol related to previous error)

    using Unity 3.4.0f5
     
  12. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Did you also import the Photon unity package?
    The viking demo already includes PUN, so downloading that will cause these errors.
     
  13. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    The updated package is live on the asset store, please download it from there :).
     
  14. oxl

    oxl

    Joined:
    Nov 21, 2008
    Posts:
    325
    Hm..not for me . Still showing the need for 3.4.1.

    --
    oxl
     
    Last edited: Oct 11, 2011
  15. Rush-Rage-Games

    Rush-Rage-Games

    Joined:
    Sep 9, 2010
    Posts:
    1,997
    Same...
     
  16. bertelmonster2k

    bertelmonster2k

    Joined:
    Apr 3, 2009
    Posts:
    78
    This is caching issue in your browser - press reload.
     
  17. oxl

    oxl

    Joined:
    Nov 21, 2008
    Posts:
    325
    I was talking about the asset store inside unity, but never mind, it's there now .

    --
    oxl
     
    Last edited: Oct 11, 2011
  18. GTaveira

    GTaveira

    Joined:
    May 20, 2009
    Posts:
    29
    Hi Leepo!

    I didn't import the PUN files but, for some reason, when I reimported everything and it just worked! Who knows...

    The only problem is that now I can't connect to the server! When I hit Play in the Editor, the server stops and Unity returns an connection error.

    Did anyone experience that as well or am I missing something? I'm using the server downloaded from the Photon site, since I'm on a 64-bit Windows and the server that comes with the Viking demo is x86.
     
  19. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    The websites server is not compatible with PUN. Please use the bundled XP version, this will work on almost any windows version. I think you will be able to get a 64bit build for your specific OS if you request it. For this first launch XP was chosen as target as that'll ensure it'll run on any server.
     
  20. ExitBG

    ExitBG

    Guest

    Joined:
    Oct 16, 2009
    Posts:
    52
    It seems there is IP 127.0.0.11 configured in MainMenuVik.cs. change this to 127.0.0.1.
     
  21. BBGameDev

    BBGameDev

    Joined:
    Nov 23, 2010
    Posts:
    14
    --------------------------
    OperationResponse 7: ReturnCode: 6 (Failed to get server instance.). Parameters: {}
    UnityEngine.Debug:LogError(Object)
    PhotonHandler:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:82)
    NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:669)
    NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:680)
    ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
    ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
    ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
    PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:48)
    --------------

    joinGame failed, client stays on masterserver: OperationResponse 7: ReturnCode: 6 (Failed to get server instance.). Parameters: {}.
    UnityEngine.Debug:LogError(Object)
    PhotonHandler:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:82)
    NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:669)
    NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:774)
    ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
    ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
    ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
    PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:48)
     
  22. ExitBG

    ExitBG

    Guest

    Joined:
    Oct 16, 2009
    Posts:
    52
    please check your game server log. looks like it couldn't connect to the master server.
     
  23. BBGameDev

    BBGameDev

    Joined:
    Nov 23, 2010
    Posts:
    14
    tanks ExitBG

    Only find in GSGame1.log and GSGame2.log

    2011-09-09 00:59:47,968 [10] ERROR Photon.LoadBalancing.GameServer.GameApplication [(null)] - Latency monitor connection failed with err 1225: Il sistema remoto ha rifiutato la connessione di rete.

    client UNITY on MAC

    server WIN XP 32
     
  24. GTaveira

    GTaveira

    Joined:
    May 20, 2009
    Posts:
    29
    Thanks Leepo and ExitBG! I'll try both suggestions!
     
  25. BBGameDev

    BBGameDev

    Joined:
    Nov 23, 2010
    Posts:
    14
    Client on MAC
    server WIN xp

    client side(Unity):"connection refused" onCreate Room

    Server side:
    2011-09-11 16:32:21,578 [1] WARN Photon.LoadBalancing.LoadShedding.WorkloadController [(null)] - Did not find counter Business Logic Queue
    2011-09-11 16:32:21,625 [1] WARN Photon.LoadBalancing.LoadShedding.WorkloadController [(null)] - Did not find counter ENet Queue
    2011-09-11 16:32:21,625 [1] WARN Photon.LoadBalancing.LoadShedding.WorkloadController [(null)] - Did not find counter bytes in/sec
    2011-09-11 16:32:21,640 [1] WARN Photon.LoadBalancing.LoadShedding.WorkloadController [(null)] - Did not find counter bytes out/sec
    2011-09-11 16:32:21,796 [1] INFO Photon.SocketServer.ApplicationBase [(null)] - Application start: AppId=Game1; AppPath=C:\Documents and Settings\Bruno\Desktop\Photon-Server\LoadBalancing\GameServer1
    2011-09-11 16:32:22,781 [11] ERROR Photon.LoadBalancing.GameServer.GameApplication [(null)] - Latency monitor connection failed with err 1225: Il sistema remoto ha rifiutato la connessione di rete.
    2011-09-11 16:32:22,796 [11] ERROR Photon.LoadBalancing.GameServer.GameApplication [(null)] - Master connection failed with err 1225: Il sistema remoto ha rifiutato la connessione di rete.
    2011-09-11 16:32:24,859 [11] ERROR Photon.LoadBalancing.GameServer.GameApplication [(null)] - Latency monitor connection failed with err 1225: Il sistema remoto ha rifiutato la connessione di rete.
    2011-09-11 16:32:26,140 [11] INFO Photon.LoadBalancing.LoadShedding.LatencyMonitor [(null)] - connection for latency monitoring established (id=7)
    2011-09-11 16:32:39,859 [11] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer [(null)] - connection to master at 127.0.0.1:4520 established (id=8)
    2011-09-11 16:32:39,890 [10] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer [(null)] - Successfully registered at master server
     
  26. ExitBG

    ExitBG

    Guest

    Joined:
    Oct 16, 2009
    Posts:
    52
    if you want to connect from a remote machine you have to modify the IP the game server reports to the master server. Please check chapter 2.1 in the included PDF.
     
  27. BBGameDev

    BBGameDev

    Joined:
    Nov 23, 2010
    Posts:
    14
    Many tanks ExitGB works fine...
    my fault not having read the document carefully
     
  28. jaybones_old

    jaybones_old

    Joined:
    Mar 31, 2010
    Posts:
    21
    Is there a way to keep an room active with no players in it?
    Say i want my world to stay up even if the last person disconnects

    then i can run the client again and join my room(world)

    jay
     
  29. ExitBG

    ExitBG

    Guest

    Joined:
    Oct 16, 2009
    Posts:
    52
    as long as anyone holds a RoomReference the room remains open.
    You could change the code to retrieve another RoomReference from the GameCache on game creation.
     
  30. DaneC020

    DaneC020

    Joined:
    Mar 19, 2010
    Posts:
    191
    Really cool guys, thanks for this!

    -Dane
     
  31. polytropoi

    polytropoi

    Joined:
    Aug 16, 2006
    Posts:
    681
    @Leepo, I look forward to Photon tutorials from you that are as good as your Unity networking set. But I hope you don't abandon your work with Unity's builtin networking! Photon is awesome, but there's something really cool about the co-op networking stuff you can do for free, that your tutorials helped me understand.
     
  32. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Read through the sources, it seems like this is just another "pass through client data to all other clients"-server, as the server is not authoritative?

    I've been looking into on how to create an authoritative server with photon that has control over player movement, but there seems to be no way to expose the vector/quaternion/matrix libraries of Unity to Photon. Does Photon have something built in that does this? (I've been looking through your documentation, but can't find any API docs anywhere).
     
  33. ExitBG

    ExitBG

    Guest

    Joined:
    Oct 16, 2009
    Posts:
    52
    correct, no authoritative servers - yet.
     
  34. evillemez

    evillemez

    Joined:
    Sep 21, 2011
    Posts:
    24
    Yet? Awwwww.... don't leave us hanging, what's coming? :)
     
  35. bertelmonster2k

    bertelmonster2k

    Joined:
    Apr 3, 2009
    Posts:
    78
  36. marf

    marf

    Joined:
    Jul 20, 2011
    Posts:
    124
    What I need to change in the CharacterPrefab to make the player in the first person mode?
     
  37. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    The Viking Demo is also updated to PUN 1.12. Some new features, lots of improvements.
    Let us know how it does.
     
  38. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
  39. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
  40. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    And another update: PUN 1.16. Click here for details.
    No questions or bugs? :)
    Edit: I found a bug myself. 1.16 won't compile in the initial release. Please make sure you got 1.16.2 or up. If it doesn't compile: Look for a update. I'm pushing it up while I post.
     
    Last edited: Aug 3, 2012
  41. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    I just uploaded v1.17 of PUN (free), the Viking Demo and Photon Angry Bots.
    There's a fix for an exception, so: Please update!
    Click here for details.
     
  42. CallToAdventure

    CallToAdventure

    Joined:
    Apr 5, 2009
    Posts:
    159
    Awesome work!

    One question - I can't seem to find it anywhere - does it work on iOS? I get this error:

    Error building Player: SystemException: System.Net.Sockets are supported only on Unity iPhone Advanced. Referenced from assembly 'Photon3Unity3D'.
     
  43. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
  44. Deleted

    Deleted

    Joined:
    Dec 8, 2012
    Posts:
    16
    Downloaded and imported it -> Set Photon ID -> Play -> Created lobby -> Error above.

    What's the problem? (Unity 4.0.0f7)
     
    Last edited: Dec 21, 2012
  45. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    I didn't check yet if changes in the animation system of U4 break something in that demo. The other demo with the worker is doing fine in U4.
    I will check early next year. Hopefully you can bear with us or find a workaround.
     
  46. Deleted

    Deleted

    Joined:
    Dec 8, 2012
    Posts:
    16
    I tried Viking Demo after trying Angry Bots (which sticks on loading 0%). Maybe I'm doing something wrong.

    P.S. To solve the issue above I just removed animations.
     
    Last edited: Dec 23, 2012
  47. Deleted

    Deleted

    Joined:
    Dec 8, 2012
    Posts:
    16
    So basically to create a multiplayer game for Android/iPhone you must pay at least 3000$ for Unity Pro and Android/iPhone Pro.. :(
     
    Last edited: Dec 23, 2012
  48. TB0Y298

    TB0Y298

    Joined:
    Dec 25, 2012
    Posts:
    59
    How do i change the CharPrefab with a FirstPersonController?
    I added the Photon and Network view to it (Prefab).
    Deleted then the prefab in the current scene, and tryed to play it.
    But i getting weird results now when somebody trys to join :(

    Can you help or teach me how?
     
  49. Victor-Cardona

    Victor-Cardona

    Joined:
    Apr 6, 2011
    Posts:
    14
    Hello i have unity 4.0.0f7, downloaded the latests Viking Demo 1.17 from asset store, start a new project and imported the package, i set the photon app ID, play and gives me this error:

    The animation state Fall could not be played because it couldn't be found!
    Please attach an animation clip with the name 'Fall' or call this function only for existing animations.
    UnityEngine.Animation:CrossFade(String)
    AnimationController:Update() (at Assets/DemoVikings/Demo/Assets/AnimationController.cs:220)

    NullReferenceException
    AnimationController.OnLand () (at Assets/DemoVikings/Demo/Assets/AnimationController.cs:129)
    AnimationController.FixedUpdate () (at Assets/DemoVikings/Demo/Assets/AnimationController.cs:166)

    The animation state Land could not be played because it couldn't be found!
    Please attach an animation clip with the name 'Land' or call this function only for existing animations.
    UnityEngine.Animation:CrossFade(String)
    AnimationController:Update() (at Assets/DemoVikings/Demo/Assets/AnimationController.cs:223)

    after that when i press space bar to jump

    NullReferenceException
    AnimationController.OnJump () (at Assets/DemoVikings/Demo/Assets/AnimationController.cs:119)
    ThirdPersonControllerNET.FixedUpdate () (at Assets/DemoVikings/Scripts/ThirdPersonControllerNET.cs:180)

    The animation state Jump could not be played because it couldn't be found!
    Please attach an animation clip with the name 'Jump' or call this function only for existing animations.
    UnityEngine.Animation:CrossFade(String)
    AnimationController:Update() (at Assets/DemoVikings/Demo/Assets/AnimationController.cs:217)
     
    Last edited: Dec 30, 2012
  50. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    TBOY298:
    The Marco Polo Tutorial text should help here. In it, we describe how to setup and use a prefab:
    http://doc.exitgames.com/photon-cloud/Marco_Polo_Tutorial/#cat-PUN Tutorials

    Yuu:
    This seems to be a problem with the char we use (it's a Unity 3 asset) and Unity 4. You need to setup/fix the animations of the viking in Unity 4 at the moment.

    I hope we can find a solution that's compatible with Unity 3 and 4. Else, we will have to upload two versions of the demo (as we don't want to end support for Unity 3 just yet).