Net roles are different between PIE listen server and PIE OpenLevel listen server

I’m noticing inconsistent behavior with respect to the net roles when running an editor created listen server versus an “OpenLevel” created listen server. In both instances I’m running with PIE…I haven’t checked what a packed game says yet. My setup, and resulting behavior is as follows…

When running PIE as a listen server and 2 players I get the following local/remote roles for each of the pawns at each location

Server side

PawnA (which is controlled locally)
LocalRole = ROLE_Authority
RemoteRole = ROLE_SimulatedProxy

PawnB
LocalRole = ROLE_Authority
RemoteRole = ROLE_AutonomousProxy

Client side

PawnA
LocalRole = ROLE_SimulatedProxy
RemoteRole = ROLE_Authority

PawnB (which is controlled locally)
LocalRole = ROLE_AutonomousProxy
RemoteRole = ROLE_Authority

All of that is exactly as I would expect.

Now, when I create a listen server by setting the options to “listen” when calling OpenLevel I end up with the following (keep in mind play is starting in PIE…I’m starting a PIE session then pressing a key to open a level as a listen server)

Server side

PawnA (which is controlled locally)
LocalRole = ROLE_Authority
RemoteRole = ROLE_AutonomousProxy (What!?)

PawnB
LocalRole = ROLE_Authority
RemoteRole = ROLE_AutonomousProxy

Client side

PawnA
LocalRole = ROLE_SimulatedProxy
RemoteRole = ROLE_Authority

PawnB (which is controlled locally)
LocalRole = ROLE_AutonomousProxy
RemoteRole = ROLE_Authority

Notice that PawnA (which is controlled on the server) has the remote role listed as autonomous proxy but the client side version of PawnA has the local role listed as simulated proxy (which is what is expected).

Apparently something similar has been mentioned before albeit the difference was between a PIE and packaged project.

The reason this is a problem for me is that I’ve created actor components which are using these roles to determine which branch of code to execute.

Is this known/expected behavior? Is there something I’m missing that would explain this?

Hi!

It’s been like that since forever, my advice would be to just not use GetRemoteRole() on the server (or avoid it altogether). You can get all the information about an actor you need more consistently by using combinations of functions like GetLocalRole(), IsLocallyControlled(), GetNetMode() etc.

If you really think about it though the behaviour is not completely nonsensical because in general a server pawn can be both an autonomous proxy as well as a simulated proxy. Sure, if it’s a locally controlled server pawn it has to be a simulated proxy always remotely, or if you just have a host and exactly one client the roles are very clear too - but these are special cases, in general you can’t say for sure. Considering this the remote role of a server pawn can be viewed as undefined meaning it will essentially just be random whether it’s ROLE_AutonomousProxy or ROLE_SimulatedProxy and can differ depending on the configuration, so don’t use it. It’s annoying, but it’s not necessarily a bug.

Thanks for the insight, especially the historical side. Sometimes it’s hard to tell if you’re mis-understanding a concept versus fighting an editor nuance. Either way, your suggestion is exactly what I ended up doing in the mean time…a combination of IsLocallyControlled and GetLocalRole did the trick.