Search Unity

Bootcamp Multiplayer Demo

Discussion in 'Multiplayer' started by ExitBG, Feb 28, 2011.

  1. kodagames

    kodagames

    Joined:
    Jul 8, 2009
    Posts:
    548
    Hello ExitBG,

    Thanks for this demo Greatly Appreciated!!! I do have one question though:

    There are 2 links from your ftp
    1) bootcampMultiplayer.unitypackage size: 260 MB, Date Modified: 3/3/2011
    2) BootcampMultiplayer_v1.1.unitypackage size: 90 MB, Date Modified: 3/14/2011

    Which one is the correct one? 2) seems to be smaller in file size which is why Im thinking may be the wrong one but that one was also modified at a later date which makes me think its the correct one? So from your ftp which link should I choose.

    last note: I had issues with the asset store not downloading which is why I listened to you for the ftp link :)

    EDIT:
    The first one works fine :D
     
    Last edited: Mar 27, 2011
  2. ExitBG

    ExitBG

    Guest

    Joined:
    Oct 16, 2009
    Posts:
    52
    oh - I aborted the 1.1 upload since it's similar to the one in the asset store.
    wasn't aware that the partial file would stay :(
    the only difference 1.1 to 1.0: it includes the file needed to fix the physics issue (walk over water)
     
  3. skartboard

    skartboard

    Joined:
    Dec 8, 2009
    Posts:
    38
    Sorry i can't download this demo in Asset Store.

    It's always stop in 33%, and I waited about five or six hours.
     
  4. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    It seems that the asset-store download is still not working for some users. In that case, you can still download the demo also from this FTP:
    ftp://216.151.161.122/
     
  5. freaka61

    freaka61

    Joined:
    Jan 15, 2011
    Posts:
    27
    man, how i install this server? or how can i play this game in network? please! need help!
     
  6. ExitBG

    ExitBG

    Guest

    Joined:
    Oct 16, 2009
    Posts:
    52
    setup is described in readme.txt:
     
  7. skartboard

    skartboard

    Joined:
    Dec 8, 2009
    Posts:
    38
    to TobiasS, ExitBG

    Thanks a lot : )
     
  8. mercuryplutus

    mercuryplutus

    Joined:
    Jun 27, 2010
    Posts:
    158
    Can somebody please explain the code

    t.transform.position = Vector3.Lerp(t.transform.position, player.playerRemote.pos, Time.deltaTime * 7.0f);

    I understand that this smooths the other players movements but what is the reasoning behind:

    Time.deltaTime *7.0f?
     
  9. InvaderStudios

    InvaderStudios

    Joined:
    Sep 1, 2010
    Posts:
    230
    I installed Photon and I did everything correctly. When I build the game I can create a room but when I play, I can't move. Also nobody else can see my room I created.
     
  10. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    Is there any output in the console or player logs for any of the clients you used?
     
  11. eotiti

    eotiti

    Joined:
    Sep 18, 2010
    Posts:
    18
    -------------------------------------------------------------------------------------------------------------------------------------

    1) Photon Setup (requires windows xp or later)
    a) Extract ExitGames-Photon-BootcampServer.zip parallel parallel to \Assets folder
    b) Go to the extracted folder and start \bin\PhotonControl.exe
    c) Right-click the Photon tray icon and select "start as application"
    d) Allow \bin\PhotonSocketServer.exe through the windows firewall (see http://developer.exitgames.com/photonserver/firewallsettings for detailed instructions)
    OR
    follow instructions at http://developer.exitgames.com/quickstart/photoninfiveminutes
    2) Open Unity3d scene BootCampLiteLobby.unity with Unity 3.2
    3) If photon is started on another machine: Set new Photon IP and Port in \Assets\Photon\Game.cs line 33 (default is localhost)
    4) Build and run as standalone or as web player


    -----------------------------------------------------------------------------------------------------------------

    i'm working step 2 "2) Open Unity3d scene BootCampLiteLobby.unity with Unity 3.2" but error by console help me
     
  12. ExitBG

    ExitBG

    Guest

    Joined:
    Oct 16, 2009
    Posts:
    52
    never seen that... did you try with the newest unity version? (It should say "3.2 or newer")
    When and where did you download the package?
     
  13. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    This can happen if you extract the server part into Unity project ).
     
  14. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    I agree.

    Are there any plans to improve the example? ;)
     
  15. ExitBG

    ExitBG

    Guest

    Joined:
    Oct 16, 2009
    Posts:
    52
    There are. No release date set though.
     
  16. adamascj

    adamascj

    Joined:
    Apr 22, 2010
    Posts:
    55
    Only to say that all have worked OK in the first try.Congratulations!
    Like you can see here:
    http://www.dmu.com/bootcamp.jpg
    What I don't like on all the multiplayer demos and tutorials I have seen until now is: we have allways "clone's wars"! All the avatars are clones!
    I would like to know how to create a multiplayer app having not an unique avatar...
    Now I will try to understand how Photon works...
     
  17. Xentar

    Xentar

    Joined:
    Apr 8, 2011
    Posts:
    23
    Adamascj, is possible change opponents avatars, i did already.
    My problems is another, i already asked the developers and sent some PM's, but no one answer me yet.
    I can't see other players shooting me, i mean, the fire animation... Anyone have this problem too?
     
  18. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    Xentar, I couldn't find your "fire animation" question in our forum. Maybe it didn't make it for some reason??
    Please post it again.
     
  19. Xentar

    Xentar

    Joined:
    Apr 8, 2011
    Posts:
    23
    Did again, thanks TobiasS
    Is extrange, cause all is there, but don't work...
     
  20. ExitBG

    ExitBG

    Guest

    Joined:
    Oct 16, 2009
    Posts:
    52
    Thanks for reporting this Xentar. (http://forum.exitgames.com/viewtopic.php?f=6&t=547)
    Solution:


    1) edit Gun.js: add
    Code (csharp):
    1. public var Soldier: GameObject;
    2) edit Gun.js: replace
    Code (csharp):
    1. transform.root.SendMessage("Fire",h, SendMessageOptions.DontRequireReceiver);
    with
    Code (csharp):
    1.  
    2. Soldier.SendMessage("Fire",h, SendMessageOptions.DontRequireReceiver);
    3.  
    3) Assign the Soldier to each Gun in editor (drag and drop to Gun.Soldier): Soldier --> GunManager --> M4 + M203
     
  21. mpgn

    mpgn

    Joined:
    Nov 30, 2009
    Posts:
    70
    Anyone else having issues with this not accessing the internet? I cant post on the official forums as I can't remember my username.

    To go further, when I have the server up and running I cant see port 5055 on the server I have also tried swapping the ports out.
    Now when I take the server down I can see the port using port forwards tool. So this leads me to believe it is a problem with Photon itself. Can anyone elaborate?

    And just so you know, I do have firewall off, and the server in the DMZ.

    Server is Win2k3 not that it matters
     
    Last edited: May 13, 2011
  22. youfus

    youfus

    Joined:
    May 24, 2011
    Posts:
    2
    Internal compiler error. See the console log for more information. output was:
    Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.

    at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)

    at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0

    at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in <filename unknown>:0

    at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in <filename unknown>:0

    at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in <filename unknown>:0

    at Mono.CSharp.Driver.LoadReferences () [0x00000] in <filename unknown>:0

    at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0

    at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0




    I have the same problem as well as at eotiti. What to me to do?
     
  23. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    You should try to start from scratch once more, following the instructions.
    We couldn't reproduce this issue so far, so we don't know how to fix it yet.
     
  24. ExitBG

    ExitBG

    Guest

    Joined:
    Oct 16, 2009
    Posts:
    52
    I just submitted update 1.2 to the asset store. It's currently being reviewed by unity.
    The update contains the fire animation sync fix.
     
    Last edited: Sep 9, 2011
  25. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    How would you suggest adding raycast checking on server side?
    Running a special unity standalone build in batchmode for each room (which connects to Photon via localhost as some kind of a special 'client') on the same machine as Photon?
     
  26. ExitBG

    ExitBG

    Guest

    Joined:
    Oct 16, 2009
    Posts:
    52
    Yes, unless you simulate the client world on the server (integrate physics, etc) - that's a lot of work though.
    I wouldn't start them on the same machine since that limits the number of concurrent users you can handle per server.
    Also keep in mind that per default each unity process logs into the same file per default that each process uses only one core.
    So you should modify the affinity and the log output of each process.
     
  27. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    Yeah, I know about affinity and log output.
    I wish Unity and Photon would be more easy to handle when it comes to creating authoritative servers! ;) (the ones when you need collisions and geodata from the scene)
     
  28. youfus

    youfus

    Joined:
    May 24, 2011
    Posts:
    2
    what is it?

    After input of a name of the player the lobby doesn't join.
     
  29. ExitBG

    ExitBG

    Guest

    Joined:
    Oct 16, 2009
    Posts:
    52
    did you start the server?
    did you set the correct server IP?
    please post some logs, so we can see a bit more.
     
  30. Chub

    Chub

    Joined:
    Mar 14, 2010
    Posts:
    247
    I have got to say Photon is great for hosting MMO's but I would choose Unity's inbuilt networking for an FPS project as most first person shooters will host a game off a local machine. Because you wouldn't really want 100 people in a Team Deathmatch although it would be great for a sandbox shooter or something.
     
  31. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    Hosting a game on a local machine will lead to
    1) cheating
    2) need to host master server \ proxy
    3) more lags
     
  32. linuxva

    linuxva

    Joined:
    May 5, 2011
    Posts:
    5
    Assets/Scripts/GameManager.js(94,45): BCE0019: 'enabled' is not a member of 'UnityEngine.Component'.
    Assets/Scripts/GameManager.js(158,43): BCE0019: 'enabled' is not a member of 'UnityEngine.Component'.
    Assets/Scripts/GameManager.js(170,22): BCE0005: Unknown identifier: 'chatting'.
    Assets/Scripts/GameManager.js(232,44): BCE0019: 'enabled' is not a member of 'UnityEngine.Component'.


    ????????????:-|
     
  33. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    A bit more information? Unity 3.4?
    Did you try a re-import?
     
  34. linuxva

    linuxva

    Joined:
    May 5, 2011
    Posts:
    5
    Yeah Unity 3.4

    Assets/Scripts/misc/GameManager.js(94,45): BCE0019: 'enabled' is not a member of 'UnityEngine.Component'.
    Assets/Scripts/misc/GameManager.js(158,45): BCE0019: 'enabled' is not a member of 'UnityEngine.Component'.
    Assets/Scripts/misc/GameManager.js(232,45): BCE0019: 'enabled' is not a member of 'UnityEngine.Component'.

    Just these 3 lines ... I reimported everything
     
  35. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,534
    im getting the same issue with 3.4 here.
     
  36. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    ((ComponentName)component).enabled should help
     
  37. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    gnoblin: Your idea is good but for some reason, it doesn't work. It might be UnityScript is not supporting this sort of casting.


    I checked in Unity 3.4 with the latest Photon Bootcamp Demo and you definitely need to fix the demo's code. Giving variable scriptSoldierCamera a fixed type made it run again.

    There are 6 places where scriptSoldierCamera is used, always 2 consecutive lines.
    Add this code (bold part is new):

    var scriptSoldierCamera : MonoBehaviour = cam.transform.GetComponent("SoldierCamera");
    scriptSoldierCamera.enabled = !showMenu;


    The cause for this is likely:
    "Unity 3.4 ships with an improved javascript compiler that supports better type inference heuristics for commonly used Unity APIs such as GameObject.GetComponent and Object.Instantiate [...]"
    http://unity3d.com/unity/whats-new/unity-3.4

    As the package was moved across categories in the Asset Store, there might be more than one Bootcamp Multiplayer demo in your download folders. I think this got me an outdated file imported in one case. So: Maybe you check if this is the case for you and remove outdated .unitypackage files.

    Hope this helps.
     
    Last edited: Aug 16, 2011
  38. rmele09

    rmele09

    Joined:
    Nov 8, 2010
    Posts:
    716
    Does this include the code? Do you need to know how to program to use this guide?
     
  39. Akonkagva

    Akonkagva

    Joined:
    Aug 22, 2011
    Posts:
    1
    using unity ver 3.4
    I am getting these 2 errors after I have fixed the first 3 code errors:

    RenderTexture creation error: CreateRenderTarget failed [wrong texture format]
    rcolor || rdepth
     
  40. RoDester

    RoDester

    Joined:
    May 21, 2011
    Posts:
    64
    got the same problem as linuxva, and a decal and imageeffect scripts, im using unity 3.4 free version. hope they fix it soon.
     
  41. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    I just submitted a update. When v1.2.2. is available, it will include the fixes for "BCE0019: 'enabled' is not a member of 'UnityEngine.Component'". The fix itself is described in my previous post, too. 4 posts above this.

    Akonkagva:
    The error you describe doesn't look like anything we can fix. Maybe the demo requires graphic card features you system is not compatible with? Did you check the original BootCamp Demo, too?
     
  42. BFDesign

    BFDesign

    Joined:
    Mar 16, 2011
    Posts:
    214
    Hello, all.

    I'm trying to run BootCamp multiplayer and I get this error:

    Internal compiler error. See the console log for more information. output was:
    Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.

    at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)

    at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0

    at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in <filename unknown>:0

    at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in <filename unknown>:0

    at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in <filename unknown>:0

    at Mono.CSharp.Driver.LoadReferences () [0x00000] in <filename unknown>:0

    at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0

    at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0


    No clue what's going on with this. Any ideas?
     
  43. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    Hm, that doesn't tell me a lot. It looks more like some issue in Unity while compiling the demo. Which version of the Editor are you running on which OS?
    From the looks, I'd submit it as bug to Unity.
     
  44. evillemez

    evillemez

    Joined:
    Sep 21, 2011
    Posts:
    24
    @TobiasS

    I read mention of plans to document how to, or possibly even change the bootcamp demo, to use an authoritative approach. Are there still plans for this?

    Also, being that you guys just released the Photon Unity Network plugin, which makes Photon MUCH easier to comprehend (srsly, thanks), I'm a little apprehensive to get too deep into the bootcamp demo if I'm going to end up not implementing things the way they are presented in the demo. So... I guess I'm asking if there are potential plans to update the Bootcamp demo to use PUN, or maybe document the code where differences would occur?

    My biggest stumbling block right now is knowing that ultimately I want an authoritative, dedicated server, but not really finding concrete details on how to implement it correctly(ish). I did it fairly easily using built-in networking, and using physics-based controls... but, I realize that I'll probably have to ditch all the physics-based movement if I want something that scales, and can be done on a dedicated server without relying on a headless Unity instance.
     
  45. BFDesign

    BFDesign

    Joined:
    Mar 16, 2011
    Posts:
    214
    I'm getting the same "bug" as youfus. I have built according to all of the instructions including setting the Ip and allowing access through the firewalls. Photon is running. When I try to view the Photon logs, however i get an error message.

    "the system cannot find the file specified"

    Been working very hard on getting this going. Very new to all of this but I at least know how to follow instructions ( well, my fiance would completely disagree with that ) so if you could give me a few pointers or message me I would be VERY grateful.

    Thanks a ton,
    -Richard
     
  46. KEMBL

    KEMBL

    Joined:
    Apr 16, 2009
    Posts:
    181
    gnoblin> ((ComponentName)component).enabled should help
    TobiasS> Your idea is good but for some reason, it doesn't work.

    Right way is:
    Code (csharp):
    1.  
    2. Component tmp = target.GetComponent(ComponentName);
    3.  if ( tmp is MonoBehaviour ) // othervice you cannot use enabled (on Transform or RigidBody components for example)
    4.     ((MonoBehaviour)tmp).enabled = true;
    5.  
     
  47. Wikened

    Wikened

    Joined:
    Oct 31, 2011
    Posts:
    271
    How do I use my own server as the back-end? Or has anyone created a Back-end yet for this?
     
  48. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    Wikened: Photon is a software you run on your own machines as server for this version of the Bootcamp Demo.
    Or what do you mean by "Your own server as back-end"?

    Kembl: As far as I could see, this works. The GameManager.js is JS/UnityScript, not C#.
     
    Last edited: Jan 6, 2012
  49. marf

    marf

    Joined:
    Jul 20, 2011
    Posts:
    124
    FTP link doesn't work!
     
  50. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    The FTP link was a temporary solution. I think we updated the asset store afterwards.
    But: The store download is broken currently. I informed Unity about it and will update you when it's fixed again.

    By the way: The Photon Bootcamp Demo is still Photon v2. From my side, I'd update it to Photon v3.
    We won't mod this particular Demo to use PUN but it could even be made into using the cloud (optionally).
    How big is interest for either (or both)?