Download

Confusing Possession Issue

Hi, hopefully someone can help me with this:

I’m working on a multiplayer game that involves 4 players. Each hero can get into a vehicle and switch Possession from themselves to the vehicle. When the vehicle blows up, the possession goes back to the hero. Pretty straightforward I think.

There is a really strange issue though:
(NOTE: This only happens on a truly dedicated server with 4 separate machines hooked up over the LAN. It can’t be reproduced at all in HOURS of testing with ping turned up to 300 and packet loss enabled. Again, ONLY on a real dedicated server.)

When possession goes back to the original hero, the hero doesn’t switch over to AutonomousProxy. He stays as a SimulatedProxy.

It’s really bizarre. When I check each player controller on the server, each one of them (all 4 players) have a remote role of AutonomousProxy. When I have the PlayerController on the client return its possessed pawn, it is the name of the pawn that I should have AutonomousProxy control over. Yet, that same actor/pawn thinks it is a SimulatedProxy.

When I grab all of the Actors in the level of my hero type after the repossession, every single one of them shows up as SimulatedProxy, instead of one of them being AutonomousProxy.

Clearly Possess failed somewhere (maybe it failed to replicate?) but it’s really strange that it only happens maybe 60% repro and can’t be reproduced in the editor with 4 player windows and dedicated server checked.

I’m happy to answer any questions about my setup, but for starters, I have a hero class that possess a vehicle that was recently spawned. That possession is triggered from within the hero code. The vehicle holds on to the hero (which is now a simulated proxy) and drags him around setting variables to be used for anim state. Once the hero exits the vehicle or it blows up, the hero is ejected and the vehicle class calls possess on the hero, put itself into a 1 second delay “purgatory” and then is destroyed after that 1 second delay. Most of the time the possession works, but annoyingly it fails while we are playtesting and renders one of the heroes useless, requiring a complete wipe of the match and start over again.

Just so we get this particular question out of the way: I am definitely doing everything (possession) on the server. i.e. all possess calls are inside a check for ROLE_Authority.

Hopefully someone can help me. Really scratching my head on this one and we have a focus group coming next week. This bug is going to be problematic.

Thanks in advance.