Impossible use UE4 for a coop or mp listen server game due the unfixed network errors since 4 years

I don’t know if it’s been posted here or elsewhere but listen server couldn’t rotate another player’s character mesh and I found out why. Linear fixes all my issues and just works so much better on both dedicated and listen server.

It turns out, Epic has decided you’re not allowed to use linear on listen server, even though this breaks heaps of stuff.

Here is my solution:


void UMyCharacterMovementComponent::OnRegister()
{
    Super::OnRegister();

    // UE4 forces this back to exponential which
    // BREAKS turn in place and any mesh rotation!
    const bool bIsReplay = (GetWorld() && GetWorld()->IsPlayingReplay());
    if (!bIsReplay && GetNetMode() == NM_ListenServer)
    {
        NetworkSmoothingMode = ENetworkSmoothingMode::Linear;
    }
}

Here is where the problem lies, at the last few lines in the UCharacterMovementComponent::OnRegister function

else if (NetMode == NM_ListenServer)
{
    // Linear smoothing works on listen servers
    // but makes a lot less sense under the typical high update rate.
    if (NetworkSmoothingMode == ENetworkSmoothingMode::Linear)
    {
        NetworkSmoothingMode = ENetworkSmoothingMode::Exponential;
    }
}

3 Likes