2 Players local-MP crash

hello,

I’m having a crash every time I test my game in local multiplayer with 2 players (launching the game via play in editor with Number of Players: 2)
oddly enough, it doesn’t happen with 1, 3 or 4 players, but only 2.

I started having this 2 days ago at one point in the day while working on C++ stuff for my project. at first it didn’t happen but after working on it for a few hours I now get this crash. I don’t have any version control to know exactly what changed (nothing much, just working on replicating player pitch and yaw via C++, and rotating some bones of the character based on that).

I see no obvious culprit from my code (especially since 1, 3 and 4 players work)

perhaps it’s something on your end?

here’s the callstack: link text

thanks,

Chosker

Hey Chosker-

There are a few questions I have that will help with investigating the crash. Which version of the engine are you using? Also, are you using a build from GitHub source code or are you using the binary version of the engine from the Launcher? How are you setting up the spawning and possession of multiple players? What changes between spawning 2 players versus spawning 4?

In addition, if you could also post the log files from the crash that will help give an idea of where exactly the crash is occurring. The log files are inside the Saved->Logs folder path of the project folder.

Cheers

hello,

I’m using the 4.7 preview. this started happening in preview 3 and still happens in preview 4. I’m only using binary builds that I get from the launcher (never compile it myself)

I am not doing anything special for spawning and possession. I used the third person C++ template as a start for my project, and I didn’t override any spawn/possess functions. literally nothing is different between 2, 3 or 4 players, at the moment I’m only working on my camera setup and making sure the basics are replicated (camera yaw and pitch, which rotate some bones of the character)

I’ll post the logs when I get home

Chosker

sure, I’ll do when I get back home later today.

as I pointed out in the first post, to spawn multiple players I just use Play In Editor with number of players set to 2. my game is not packaged, nor am I actually running proper multiplayer. this is just the editor feature

When you have the chance let me know if the crash occurs for you in a new C++ project. Also, the project is created for a single player, what steps are you taking to spawn multiple players.

here’s the crash log:

link text

might be worth mentioning that I’m using visual studio and running the debugger (I can use breakpoints and all), but when it crashes it doesn’t crash into my code

and I just created a new c++ thirdperson project and it doesn’t crash when running PIE with 2 players

Had you been testing anything to do with replication prior to when this crash first started occurring? Also, does this crash occur right as you click PIE, at some point during PIE or when you are exiting PIE?

yes, I was definately working on replication. just replicating the yaw of the player’s camera through the Character via changing the Tick and GetBaseAimRotation functions (no, I didn’t forget to call Super::thefunction proprely)

I replicate my RotationYaw var like this:

DOREPLIFETIME_CONDITION(AEliumBaseCharacter, RotationYaw, COND_SkipOwner);

but for the record, I tried commenting out the content of all my functions except for calling the Super::thefunction. it made no difference.

then in my character’s anim blueprint I get the RotationYaw to rotate a few bones

the crash occurs right after I click PIE. for less than a second I can see the first player’s viewport window getting loaded (and displaying the game) but the second player’s viewport is completely black for a fraction of a second before it crashes.

Could you post the custom Tick and GetBaseAimRotation functions that you are using? Additionally, if you click the drop down arrow next to Play and check the “dedicated server” checkbox, what is the behavior for PIE when the number of players is set to 1 vs 2?

the functions as I have them at the moment:

void AEliumBaseCharacter::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);
}

FRotator AEliumBaseCharacter::GetBaseAimRotation() const
{
	return Super::GetBaseAimRotation();
}

void AEliumBaseCharacter::CalcCamera(float DeltaTime, FMinimalViewInfo& OutResult)
{
	Super::CalcCamera(DeltaTime, OutResult);
	return;
}

void AEliumBaseCharacter::GetLifetimeReplicatedProps(TArray< FLifetimeProperty > & OutLifetimeProps) const
{
	Super::GetLifetimeReplicatedProps(OutLifetimeProps);
}

that’s my whole character class at the moment except for the constructor (I have a backup where I still have more code). and even this crashes!

and the day this started happening I only touched my Character class and PlayerController class, and in the PlayerController class I only added code to a camera-related function that I already had, and that only gets activated upon keypress

also if I check the “dedicated server” checkbox it also crashes with 1 player, 2 players and 3 players. but it’s able to run 4 players just fine!

Hey Chosker-

I am still having difficulty reproducing the crash you described. I have submitted this crash to our internal tracking database (UE-8287) for further investigation by our engineers. I can update you with additional information here once there is better understanding of what exactly is happening.

Cheers

hello,

I had some more time today to reproduce and isolate the cause of the issue. it’s not related to my code.

I have a few box meshes as staticmeshactors in my scene and I set them to simulate physics and replicate their movement, and if I delete them the game doesn’t crash.

oddly enough if I delete some and leave a few of them it doesn’t crash. I don’t know the exact threshold though, I’ll leave that to you :slight_smile:

I was able to reproduce this in the thirdperson template as well (though the boxes are meshes from the starter content, so they’ll lack the actual visible mesh). just copy-paste the contents of this textfile into a level and play with 2 players. and crash. link text

cheers,

Chosker

Hey Chosker-

Thanks for the updated information and assets. I was able to track down what was happening and recreated UE-8287 as UE-8519 with details. It seems having 10+ instances of an actor set to replicate movement is what was causing the crash. Thanks for the help and good luck in your projects.