Character's tick is faster during multiplayer

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.

Looks like server has time “Server”, but client has time “Server + Client”, but summary they have time of one instance of the game. Try to build game and connect two instances (or just launch without connecting) and watch what will happen. If time will flow normally, then it is really a bug.
By the way it is not good if your game depends on framerate. Machines can be very different, someone has 10 fps, other one has 30 fps, second machine has huge handicap.

The game works fine on PC.

It depends on FPS or not I cannot tell… But on the client, even the gravity works faster(with dedicated server).

The game will not work without a dedicated server. I had coded the game in that manner. So I got no other idea on how to tested.

One thing I also forgot to mention. Even the physics runs faster.

Hi envenger,

I concur with HungryDoodles that the game’s logic shouldn’t depend on framerate but I don’t think that alone is causing the issue here. Some changes have been made to how dedicated servers work in 4.8 and you may want to check out this page and be sure that the dedicated server itself isn’t having issues:

Hope this helps!

This error was occurring when testing in editor. The strange thing is this is not happening in my PC.

The game might not be ready to get packaged. Still, i will test it soon and report here.

Hi envenger, have you had a chance to test out what you wanted to try yet? If you still require assistance, please let me know.

Hi… didn’t have chance to test it out. I want to tested it on another PC first.

This doesn’t happen on my PC so its hard for me to check what is happening. Updated the project to 4.8.2 recently still the same error.

I will post updates on it soon…

Hi envenger,

Please take your time testing for this issue. If you do come across anything, leave a comment here. In the meantime, I’ll be setting this issue to resolved for tracking purposes. We can continue this any time you’re ready.