Networking Issue "QueueIncomingReliableWarning"

Options
Alright, now this topic is not particular new but I still have to post a new thread for it right now as all the posts I've found about it (both here and answers from unity3d, and even some others I've found on google) are pretty much useless, or rather not the solution for my problem.

To my case: I am currently working on a project called "Chronicles of Misuterra" (we're planning on making it a bit more public soon) but that's not really important, so the thing is, when I first started using Unity I used the inbuilt networking and soon thereafter realized it was just too much of a pain to code and it just wasn't flexible enough on it's own, at some point I tried out smartfox and some other things which didn't quite work out how I wanted... and then I found PUN (i think from a Quill18 tutorial) it was great, it was similar to what I was used in the Unity Networking and yet it was much more powerful and the server plans ExitGames is offering look really great too and I plan on using it on the future (and upgrade my plan as much as I have to). BUT, there is one big problem, and I had it from very early on where I tested it's multiplayer capabilites with friends, I was simply idling ingame and waiting for my friends to download and launch the game.. so far so good, but for some reason if one player was connected for quite a while (and/or moving alot) all new players wouldn't get spawned and instead just receive a bunch of errors, the almighty "QueueIncomingReliableWarning"

here's the full error tho:
Received unknown status code: QueueIncomingReliableWarning
    UnityEngine.Debug:LogError(Object)
    PhotonHandler:DebugReturn(DebugLevel, String) (at Assets/_Plugins/PhotonNetwork/PhotonHandler.cs:170)
    NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/_Plugins/PhotonNetwork/NetworkingPeer.cs:802)
    NetworkingPeer:OnStatusChanged(StatusCode) (at Assets/_Plugins/PhotonNetwork/NetworkingPeer.cs:1330)
    ExitGames.Client.Photon.EnetPeer:QueueIncomingCommand(NCommand)
    ExitGames.Client.Photon.EnetPeer:ExecuteCommand(NCommand)
    ExitGames.Client.Photon.<>c__DisplayClass11:<ReceiveIncomingCommands>b__f()
    ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
    ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
    PhotonHandler:Update() (at Assets/_Plugins/PhotonNetwork/PhotonHandler.cs:76)

from what I've read in the forums, I've tried a couple of things as a solution:
I am calling the code below once per second
PhotonNetwork.networkingPeer.Service();
			PhotonNetwork.networkingPeer.DispatchIncomingCommands();
I changed ALL PhotonView scripts to "Unreliable" to reduce the amount of reliable messages being pushed.
and some other things I can't remember since I am trying to solve this problem for a long time now

yeah so now the problem is, how can I solve this? I'd be reaaaaaallly overly attached grateful to anyone who can help me with this! If any of you would like to see certain code segments or want to know more about how I manage things, just write it here and I'll give everything you need (I just didn't want to put all my code in here if it wouldn't be any helpful)

Thanks in advance,

cerbi :)

Comments

  • vadim
    Options
    One assumption is that when new players gets connected it receives too much events at once. Those events may be cached events accumulated during 1st player life. Most common cached events are fired on PhotonNetwork.Instantiate() and on rpc calls with PhotonTargets.AllBuffered option.
    So avoid buffered rpc's and too much instantiation.

    Calling PhotonNetwork.networkingPeer.Service() and PhotonNetwork.networkingPeer.DispatchIncomingCommands() manually does not make sense since plugin handles this automatically quite well (and much more frequently than once per sec.)

    Also non-cached sync events may get stuck during connection if level loading takes some time because of incoming commands not dispatched while loading. It depends on how much sync is doing and how longs time loading takes. But usually even QueueIncomingReliableWarning fired, you can ignore it in that case.
  • Cerbion
    Options
    Thanks for your answer :)

    First: I have only 1 RPC call with PhotonTargets.AllBuffered
    which is a function to update the players 3Dtexts (used to show name and level)

    Second: Where is the limit with tooo much Instantiation? I actually only instantiate Players and Mobs (which are at the current state of development not that many) And the problem was even when I was only instantiating the player and nothing else the error would occur and break the players spawning, so I'd say it has something to do with the movement, let me quickly give you what I have for that:
    	void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
    	{
    		if(stream.isWriting)	// SEND
    		{
    			stream.SendNext(velocity);
    			stream.SendNext(lastpos);
    			stream.SendNext(moving);
    			stream.SendNext(color);
    			stream.SendNext(style);
    			stream.SendNext(gender);
    		}
    		else	// RECEIVE
    		{
    			velocity = (Vector3)stream.ReceiveNext();
    			lastpos = (Vector3)stream.ReceiveNext();
    			moving = (string)stream.ReceiveNext();
    			color = (Vector3)stream.ReceiveNext();
    			style = (int)stream.ReceiveNext();
    			gender = (bool)stream.ReceiveNext();
    		}
    	}
    
    As you can see there's actually not much being sent, so the error is even less understandable (at least in my opinion)


    Third: Level loading shouldn't be a problem since the player is connected and spawned >after< "LoadLevel()" was called.


    Oh yeah and a quick note: I am still in the alpha phase of the game, so the content is not that much (yet)
  • Cerbion
    Options
    a little BUMP because this topic is still up to date and the error is driving me nuts :I
  • vadim
    Options
    First: I have only 1 RPC call with PhotonTargets.AllBuffered
    Then you sure that it's called only once? Or may be you have subsequent updates?
  • Cerbion
    Options
    Yeah I am actually pretty sure since I only call it on Start() and when it changes (on Levelup)

             void Start()
             {
             (... there's of course actually more code here, but that code is not important for the matter ..)
    		// SET PLAYER TEXT
    		photon_view = PhotonView.Get(this);
    		if(photon_view.isMine)
    		{
    			photon_view.RPC("SetCharTitle", PhotonTargets.AllBuffered, player_name, player_level); 
    		}
            }
    
    (the same happens in OnLevelUp() but last time I tested if the my problem was still there, I played with my "main" account and my main is fulllevel so the only RPC with AllBuffered I sent was once upon login/spawn)

    Let's just get one thing straight, the error basically means that the Queue of Reliable messages (which is RPC's with PhotonTargets.AllBuffered and PhotonNetwork.Instantiate plus all gameobjects with a Photonviewscript.mode set to "Reliable") is to big for the client to handle it..?
    In that case isn't there a method to tell the client (or even the server?) to flush all messages of the same type except for the latest one.


    On the other hand I fear it has something to do with my Movement transmission, in that case, I have to know if stream.SendNext and ReceiveNext is reliable or fine to use with Movement in an MMO styled game.

    -Cerbi
  • Tobias
    Options
    It's not an error. It's a warning.
    Unless you get a disconnect, all reliable messages will eventually arrive and be executed. If that doesn't work, you will run into a disconnect.
    If Start() is only executed once, depends on where you attached it. It can be instanced any number of times. Let's assume it runs only once.

    If his game is an mmo, a lot of game objects might be observed and that can also lead to the warning. If you observe a lot of game objects or ramped up the update-frequency, then both can lead to a lot of messages which might trigger the warning.

    Photon Cloud is not built for seamless-world MMO type of games. It's good for less many tracked and synced game objects. If you get over a (not well-defined) limit of objects, then the server needs additional ways to funnel the data that's sent to each client or else the bandwidth will be eaten up and things break. Those mechanisms are called "Interest Management" and how they have to work depends on a game's requirements.

    How many game objects use OnPhotonSerialize in your case?
  • Cerbion
    Options
    Yeah I've also heard that PhotonCloud is not best suited for MMO-like games but I figured I'd find a way to work around (maybe write some clever coding to put people from different areas in different rooms or whatnot)

    But about the game, the problem is precisely that there is currently -nothing- other than the Player (the rest is handled for each client locally, I've not synced everything up yet because of that problem)

    But I've just started a test, and logged in, I will not move and see if I can connect in like 10 minutes. If that works and I can connect, it means that it really is connected to the movement in some way.

    (And sorry for all this trouble, but I am really no pro when it comes to this networking stuff and my game's not yet thaaat big so ._. )


    EDIT: I have 2 other objects actually that use OnPhotonSerializeView() but there's nothing in it.
  • Cerbion
    Options
    I found that the EnemySpawner (although spawning/instantiating was deactivated) where I changed the photonview to "Unreliable" had no "OnPhotonSerializeView" in it's script and it was getting logged as error in the output.log
    I changed it and it seems to work now, I tested it for quite some time..

    Does that mean that as long as I use OnPhotonSerializeView with stream.Send/ReceiveNext it will (probably) be fine? Even with let's say 20 users connected and sending/receiving data that way?

    Thanks a lot though!