From what I can tell this is a system specific bug and depends upon the frame rate.
I can’t really find what is causing it but it depends upon the frame rate.
Basically when testing the game on a dedicated server, the first character moves faster, its animations play faster everything happens faster in it. It doesn’t happen on my computer but happens on another remote computer where I am not able to test anything.
I added some debug messages to the game to see what was the issue and saw the character’s movement speed was dependent upon the the frame rate.
This bug happened after switching my project from 4.7.1 to 4.8
I am running this code as the debug message
if (GetCharacterMovement()->Velocity.Size() > 1.f)
{
if (Role == ROLE_SimulatedProxy)
{
FVector NewActorLocation = GetActorLocation();
float Speed = FVector::Dist(NewActorLocation, CurrentCharacterLocSim) / DeltaTime;
GEngine->AddOnScreenDebugMessage(-1, DeltaTime, FColor::, "Actual Speed = " + FString::SanitizeFloat(Speed)
+ " Intend speed = " + FString::SanitizeFloat(GetCharacterMovement()->Velocity.Size()));
CurrentCharacterLocSim = NewActorLocation;
GEngine->AddOnScreenDebugMessage(-1, DeltaTime, FColor::, "Character DeltaTime = " + FString::SanitizeFloat(DeltaTime));
GEngine->AddOnScreenDebugMessage(-1, DeltaTime, FColor::, "ExpectedFPS = " + FString::SanitizeFloat(1 / DeltaTime));
GEngine->AddOnScreenDebugMessage(-1, DeltaTime, FColor::, "World DeltaTime = " + FString::SanitizeFloat(GetWorld()->GetDeltaSeconds()));
GEngine->AddOnScreenDebugMessage(-1, DeltaTime, FColor::, "Global TimeDilation = " + FString::SanitizeFloat(UGameplayStatics::GetGlobalTimeDilation(this)));
GEngine->AddOnScreenDebugMessage(-1, DeltaTime, FColor::, "Actor TimeDilation = " + FString::SanitizeFloat(CustomTimeDilation));
}
else if (Role == ROLE_AutonomousProxy)
{
FVector NewActorLocation = GetActorLocation();
float Speed = FVector::Dist(NewActorLocation, CurrentCharacterLocAuto) / DeltaTime;
GEngine->AddOnScreenDebugMessage(-1, DeltaTime, FColor::Green, "Actual Speed = " + FString::SanitizeFloat(Speed)
+ " Intend speed = " + FString::SanitizeFloat(GetCharacterMovement()->Velocity.Size()));
CurrentCharacterLocAuto = NewActorLocation;
GEngine->AddOnScreenDebugMessage(-1, DeltaTime, FColor::Green, "Character DeltaTime = " + FString::SanitizeFloat(DeltaTime));
GEngine->AddOnScreenDebugMessage(-1, DeltaTime, FColor::Green, "ExpectedFPS = " + FString::SanitizeFloat(1 / DeltaTime));
GEngine->AddOnScreenDebugMessage(-1, DeltaTime, FColor::Green, "World DeltaTime = " + FString::SanitizeFloat(GetWorld()->GetDeltaSeconds()));
GEngine->AddOnScreenDebugMessage(-1, DeltaTime, FColor::Green, "Global TimeDilation = " + FString::SanitizeFloat(UGameplayStatics::GetGlobalTimeDilation(this)));
GEngine->AddOnScreenDebugMessage(-1, DeltaTime, FColor::Green, "Actor TimeDilation = " + FString::SanitizeFloat(CustomTimeDilation));
}
else if (Role == ROLE_Authority)
{
FVector NewActorLocation = GetActorLocation();
float Speed = FVector::Dist(NewActorLocation, CurrentCharacterLocAuth) / DeltaTime;
GEngine->AddOnScreenDebugMessage(-1, DeltaTime, FColor::Blue, "Actual Speed = " + FString::SanitizeFloat(Speed)
+ " Intend speed = " + FString::SanitizeFloat(GetCharacterMovement()->Velocity.Size()));
CurrentCharacterLocAuth = NewActorLocation;
GEngine->AddOnScreenDebugMessage(-1, DeltaTime, FColor::Blue, "Character DeltaTime = " + FString::SanitizeFloat(DeltaTime));
GEngine->AddOnScreenDebugMessage(-1, DeltaTime, FColor::Blue, "ExpectedFPS = " + FString::SanitizeFloat(1 / DeltaTime));
GEngine->AddOnScreenDebugMessage(-1, DeltaTime, FColor::Blue, "World DeltaTime = " + FString::SanitizeFloat(GetWorld()->GetDeltaSeconds()));
GEngine->AddOnScreenDebugMessage(-1, DeltaTime, FColor::Blue, "Global TimeDilation = " + FString::SanitizeFloat(UGameplayStatics::GetGlobalTimeDilation(this)));
GEngine->AddOnScreenDebugMessage(-1, DeltaTime, FColor::Blue, "Actor TimeDilation = " + FString::SanitizeFloat(CustomTimeDilation));
}
}
This is from My PC
Just 1 player on a dedicated server
2 Players on a dedicated server
And this is the debug messages I get from the remote PC
1 Player on dedicated server
2 Player on dedicated server
I am not able to pinpoint the bug sadly. But this bug only happens specifically on that computer and that project.