Search Unity

Merry Fragmas 3.0 stopped working

Discussion in 'Multiplayer' started by aphixe, Dec 28, 2016.

  1. aphixe

    aphixe

    Joined:
    Sep 5, 2012
    Posts:
    11
    I followed the latest merry fragmas tutorial as close as possible, and about 70/80% of the way I go to run a build and I can't spawn on client, I look at log and find tons of these errors.

    Spawn scene object not found for 1
    UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()

    and once in a while one of these.
    Did not find target for sync message for 3
    UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()

    I don't get why this is happening, as i even went as far as re pasting in the code. and lastly I thought maybe it had to deal with particles, so i removed them all. I could post the dropbox of this project zipped up, but I don't know if unity forums would want me to do so. a similar error happened to me when I followed another mp tutorial a while back. I am using latest public release. 5.5.0f3. I'd like to know why I keep having these issues. Thanks.
     
  2. richardboegli

    richardboegli

    Joined:
    Dec 28, 2016
    Posts:
    13
    Yep, had this same issue and found the solution.

    I think there is actually a bug in Unity.

    But there is a work around :)

    Remove and re-add the network identity component on the player prefab. Make sure to hit apply :D

    Don't be like Mike, Apply your Changes! ;P


    https://twitter.com/richard_boegli/status/814323034668400640
    YouTube Sound bite: 47m42s
    Cannot use a embedded link as position gets wiped :(

    I found the solution in another thread and applied it to this tutorial.

     
    Last edited: Dec 29, 2016
  3. richardboegli

    richardboegli

    Joined:
    Dec 28, 2016
    Posts:
    13
  4. BerniceChua

    BerniceChua

    Joined:
    Nov 30, 2016
    Posts:
    32
    I have the same error message, but my progress was towards the end of the 2nd video. So it was only until after I did the IK for the hands in the 2nd video (https://unity3d.com/learn/tutorials...-30-ui-graphics-and-animations?playlist=29690), then I started getting these errors. But prior to that step, everything worked properly the same way as the tutorial.

    "
    host id out of bound id {0} max id should be greater 0 and less than {0}
    0x0000000141509B9B (Unity) StackWalker::GetCurrentCallstack
    0x000000014150B84E (Unity) StackWalker::ShowCallstack
    0x00000001414DA963 (Unity) GetStacktrace
    0x00000001411DCBFA (Unity) DebugStringToFile
    0x00000001411DD06C (Unity) DebugStringToFile
    0x0000000140CC8ED3 (Unity) UNET::NetLibraryManager::CheckHost
    0x0000000140CD013A (Unity) UNET::NetLibraryManager::popDataFromHost
    0x00000001416BDB3E (Unity) NetworkTransport_CUSTOM_ReceiveFromHost
    0x0000000027F21807 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.Networking.NetworkTransport:ReceiveFromHost (int,int&,int&,byte[],int,int&,byte&)
    0x0000000027F1B330 (Mono JIT Code) [NetworkClient.cs:698] UnityEngine.Networking.NetworkClient:Update ()
    0x0000000027F1AD0D (Mono JIT Code) [NetworkClient.cs:950] UnityEngine.Networking.NetworkClient:UpdateClients ()
    0x0000000027F1A984 (Mono JIT Code) [NetworkIdentity.cs:1073] UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate ()
    0x000000000D090A8E (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
    0x00007FFFCE9154A3 (mono) [mini.c:4937] mono_jit_runtime_invoke​
    "
    I get them when I click on the Network Manager in the Hierarchy. The errors keep on repeating forever even if I don't hit the play button in the editor.

    Other symptoms:

    If I use the standalone instance as the host and the editor as the LAN client:
    - In the Hierarchy, neither of the players network objects appear.
    - In the Scene view, none of the networked players appear (only the one inside the Construct scene appears).
    - In the Game view of the editor (which is the LAN client), none of the players appear (only the one inside the Construct scene appears).


    If I use the editor as the host and the standalone instance as the LAN client:
    - In the Hierarchy, ALL the players appear.
    - In the Scene view, ALL the players appear.
    - In the Game view of the editor (which is the LAN host), ALL of the players appear.
    - (please see the screenshot in the attachment) The FirstPersonController script and the FirstPersonCharacter of the remote/not local player are not active, even if the PlayerBehaviorInNetworking script (in the turorial, this script is called "Player") has them toggled to be active.

    For both versions:
    - The local player can move, can shoot things, and the kill count increases if the raycasts hit the "remote" player.
    - There is this harsh sound like a TV with static. This sound stops when the local player's "feet" leave the ground (like when the player is jumping).
    - The remote player is floating in the air, but the idle animation plays. When the "remote" player is shot, it does not play the "death" animation, and just disappears (previously, the death animation was able to play).
    - The editor's console has this error message (occurred once):
    "
    IndexOutOfRangeException: NetworkReader:ReadByte out of range:NetBuf sz:34 pos:34
    UnityEngine.Networking.NetBuffer.ReadByte () (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkBuffer.cs:36)​
    ".
    - The editor's console has these warnings (multiple of them):
    "
    Did not find target for sync message for 2
    0x0000000141509B9B (Unity) StackWalker::GetCurrentCallstack​
    "
    &
    "
    Did not find target for sync message for 3
    0x0000000141509B9B (Unity) StackWalker::GetCurrentCallstack
    0x000000014150B84E (Unity) StackWalker::ShowCallstack
    0x00000001414DA963 (Unity) GetStacktrace
    0x00000001411DCBFA (Unity) DebugStringToFile
    0x00000001411DD06C (Unity) DebugStringToFile
    0x0000000141166C78 (Unity) DebugLogHandler_CUSTOM_Internal_Log
    0x00000000322F82FB (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,string,UnityEngine.Object)
    0x00000000322F81E4 (Mono JIT Code) [DebugLogHandler.cs:10] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    0x00000000322F7B75 (Mono JIT Code) [Logger.cs:42] UnityEngine.Logger:Log (UnityEngine.LogType,object)
    0x00000000322F73B6 (Mono JIT Code) [DebugBindings.gen.cs:157] UnityEngine.Debug:LogWarning (object)
    0x00000000322F6E81 (Mono JIT Code) [ClientScene.cs:717] UnityEngine.Networking.ClientScene:OnUpdateVarsMessage (UnityEngine.Networking.NetworkMessage)
    0x0000000023918A2A (Mono JIT Code) [NetworkConnection.cs:468] UnityEngine.Networking.NetworkConnection:HandleReader (UnityEngine.Networking.NetworkReader,int,int)
    0x0000000023917EFB (Mono JIT Code) [NetworkConnection.cs:424] UnityEngine.Networking.NetworkConnection:HandleBytes (byte[],int,int)
    0x0000000023917D9F (Mono JIT Code) [NetworkConnection.cs:576] UnityEngine.Networking.NetworkConnection:TransportRecieve (byte[],int,int)
    0x0000000023908D83 (Mono JIT Code) [NetworkClient.cs:735] UnityEngine.Networking.NetworkClient:Update ()
    0x0000000023907FBD (Mono JIT Code) [NetworkClient.cs:950] UnityEngine.Networking.NetworkClient:UpdateClients ()
    0x0000000023907C34 (Mono JIT Code) [NetworkIdentity.cs:1073] UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate ()
    0x000000000AFC0A8E (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
    0x00007FFFCE9154A3 (mono) [mini.c:4937] mono_jit_runtime_invoke
    0x00007FFFCE8683F1 (mono) [object.c:2623] mono_runtime_invoke
    0x00000001411F985F (Unity) scripting_method_invoke
    0x0000000140E2E1A5 (Unity) ScriptingInvocation::Invoke
    0x0000000140CC5E5F (Unity) UNET::ScriptingUpdater::playerLoopUpdate
    0x0000000140BC01AD (Unity) PlayerLoop
    0x000000014147B5C2 (Unity) Application::UpdateScene
    0x000000014147CB8F (Unity) Application::UpdateSceneIfNeeded
    0x0000000141485454 (Unity) Application::TickTimer
    0x00000001415477AE (Unity) FindMonoBinaryToUse
    0x0000000141548DD1 (Unity) WinMain
    0x0000000141863E94 (Unity) strnlen
    0x00007FFFFBBC8364 (KERNEL32) BaseThreadInitThunk
    0x00007FFFFBEC70D1 (ntdll) RtlUserThreadStart​
    "
    - Whichever is the LAN client, the first person camera is not turned on & the player who is the LAN client cannot move, and floats in the air in the screen of whoever is the host.

    This error message comes out sometimes, but not all the time:
    "<RI.Hid> Failed to create device file: 2 The system cannot find the file specified."

    Despite the timing and circumstances of when I started getting the error messages, the error messages seem to lean more towards a networking issue, but I'm not sure. I tried looking online but those solutions seem either unrelated to my issue, or they are just questions in the Unity forums with no answers (such as this one).

    It appears that NetworkReader:ReadByte is an array, and something is trying to access the outside of that array. Is there a way to go into the code to see what's trying to do that? Is this even a good idea??

    On Unity 5.5.0f3, running Windows10, if that helps.

    Before that, everything worked the same as the videos. So it was only until after I did the IK for the hands in the 2nd video, then I started getting these errors.

    Things that I've tried to troubleshoot:
    - I went through all the code again and through all the videos again to make sure that everything is the same and that I didn't miss anything, including the placement of scripts & GameObjects in PlayerBehaviorInNetworking script (in the turorial, this script is called "Player").

    - https://forum.unity3d.com/threads/understanding-networkreader-readbyte-out-of-range-errors.361115/
    The person said that they just rebuilt everything, which I did. I tried refreshing everything in the editor, applied the changes to the prefabs, and saved everything. Then rebuilt the standalone.

    - http://answers.unity3d.com/questions/1170290/unet-indexoutofrangeexception-networkreaderreadbyt.html
    I didn't see anything on the script that was serialized or deserialized.

    - http://answers.unity3d.com/questions/1104570/unet-transport-layer-host-id-is-out-of-bound-0.html
    This looks different than what we are going through.

    - https://forum.unity3d.com/threads/i...kreader-readbyte-out-of-range-problem.368631/
    This one says that it's caused by:
    1. you are attempting to connect a client built from older or newer versions of the scripts to a server
    2. you have a mismatch in the number of bytes written and read in an OnSerialze and/or OnDeserialize method
    I tried refreshing everything in the editor, applied the changes to the prefabs, and saved everything. Then rebuilt the standalone. Is there a cache or something that's keeping the older version of the scripts? If that's the case, how do we refresh that so it has the latest version?

    - https://forum.unity3d.com/threads/host-id-out-of-bound-id-error-on-tank-demo.333596/
    - http://answers.unity3d.com/questions/1104570/unet-transport-layer-host-id-is-out-of-bound-0.html
    Are these the same as our problem??!??

    Any help is totally welcome. Thanks in advance!! ^__^
     

    Attached Files:

    richardboegli likes this.
  5. richardboegli

    richardboegli

    Joined:
    Dec 28, 2016
    Posts:
    13
    I would suggest either reposting this into my new thread, as Mike Geig is watching it or tweet him your post above to get his attention. Besides that I cannot offer any suggestions at this time as I'm not up to that part yet ;) Also, are you using the Space soldier asset or Stealth?
     
  6. BerniceChua

    BerniceChua

    Joined:
    Nov 30, 2016
    Posts:
    32
    Hi @richardboegli, thanks for creating the other thread. Sorry for replying to this thread. When I did a search for "
    IndexOutOfRangeException: NetworkReader:ReadByte out of range:NetBuf sz:34 pos:34
    UnityEngine.Networking.NetBuffer.ReadByte () (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkBuffer.cs:36)" and for "host id out of bound id {0} max id should be greater 0 and less than {0}" this thread showed up, and not yours.

    (Also, I spent a long time gathering all the data, and didn't refresh this page on time to see your replies lol!)

    Anyway, I had reposted my question from here into your thread, so everything's all in one place.