PlayerController resetting on Multicast, all UE version

Hi,

this issue happens at least with 4.6, 4.7 AND 4.8 Preview!
Does NOT happen with dedicated server, but only with Listen server!

Given that in your Playercontroller you do a RPC call to run on server (reliable), i.e. through a left mouse click. Inside server call you now do a Multicast to all clients (reliable too).
This works correct when executed on a client (i can see server call being executed, and multicast being executed normal too). Though, when done on Listen Server (which is a client too), i suddenly reinstantiates Owning PlayerController of Client1, which resets camera etc!

I have attached a sample project. When you start with # of clients > 1 and NOT with dedicated server, in window of listen server do a left mouseclick. You will now see a message printed on screen that is printed from construction script of controller.

Cheers,

Hi ,

Just wanted to let you know that I see same behavior in project you uploaded, and I’m speaking with Network Team about it now. I’ll let you know what we find out. Thanks for your patience!

Hi ,

any news?
Thanks,

Hi ,

Not much news right now, sorry, but it does appear to be a bug. We’re trying to narrow it down, and once I have it written up I’ll post here to let you know.

I can tell you that warning that shows up in 4.7 doesn’t appear in our main internal build, but we’re still getting one that says, “LogNetPlayerMovement:Warning: CreateSavedMove: Hit limit of 96 saved moves (timing out or very bad ping?)” every second or so. It also appears that construction script is being called on a new controller (though I don’t see any change in World Outliner), and I don’t see any reason for it to be doing so.

Hi,

Thanks for test project, and for your patience as we looked into it. There is indeed a bug here; a new PlayerController appears to be created, and that shouldn’t happen. problem is occurring because we don’t do a relevancy check for reliable RPCs; Server is sending a reference to its PlayerController to Client, who then spawns it even though it isn’t owner. I’ve entered a bug report for issue (UE-16529), and I’ll post here when I see any update on it.

In meantime, cause is multicast RPC in your PlayerController. Since remote PlayerControllers are normally not relevant for clients, only owning client (if any) and server would execute RPC. This then causes Server to send its self reference to Client, which can’t do anything with it (so it creates a new PlayerController, which is bug I reported above). Instead, you probably want to do this in Pawn or GameMode, or something else that isn’t individually owned (not replicated).

Hope that helps!

Hi ,
yeah, somehow i completely forgot that Controller is not replicated everywhere. Thanks for heads up!
Cheers,

Hey all,

I am in same case. current controller is being wrecked and a new ghost controller appears.

Any update on that issue ?

solution is to use Run on Owning Client and not multicast. Multicasts do not make sense with PlayerControllers. If you need to multicast something, do it on something that exists for everyone, i.e. Pawns/Characters/PlayerStates/etc

I had a similar issue where I was trying to multicast from playercontroller and other clients were getting unpredictable results, like world getting unloaded, and client freezes.

solution for me was to move multicast call to my Character BP.

Another poster said:
“This is infact correct and only solution. Clients only are aware of their own PlayerController and don’t have PlayerController objects for other players. Running a Multicast on a PlayerController causes bad things to happen because you’re telling all clients to run a function on something that technically doesn’t exist. Only Server is aware of all PlayerControllers.”

Any idea why bug was closed as cannot reproduce? I’m able to reproduce it in 4.13 at least (I know it’s a little old). I’ve been wondering if there could be a compile time check in generated code to make sure that components within player controllers avoid having functions marked up with net multicast.