UE2 - UT2kX Is accurate timing possible?

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

JohnK

New Member
Oct 29, 2004
28
0
0
I'm finding the timing functions in ut2004 are consistently inaccurate... Roughly there's a 10:9 ratio between unreal deltatime and time measured by external hardware. Thus if the unreal log says 100s elapsed, i would measure about 90s on a stopwatch.

Is there any way to access real timing in unreal script? If the headers were released I would have a go at building a native function, but obv that's not an option.
 

War_Master

Member
May 27, 2005
702
0
16
the GameSpeed mutator changes the TimeDilation of the game and multiplies it with its default 1.1 times the GameSpeed value. I think you would get a more accurate Real-Time-Seconds in the game if you set it to like 90% or 91% GameSpeed.

Also, I dont know if UT2k4 has the ClassicMode which is Real-Time-Seconds in UT99, just to let you know.

found in the GameSpeed mutator:
Code:
class MutGameSpeed extends Mutator;

var globalconfig float NewGameSpeed;

function PostBeginPlay()
{
	Super.PostBeginPlay();
	Level.Game.bAllowMPGameSpeed = true;
	Level.Game.SetGameSpeed(NewGameSpeed);
}

found in the GameInfo class which is the parent class of gametypes:
Code:
class GameInfo extends Info
	HideDropDown
	CacheExempt
    native;

function SetGameSpeed( Float T )
{
    local float OldSpeed;

	if ( !AllowGameSpeedChange() )
	{
		[COLOR="SeaGreen"]Level.TimeDilation = 1.1;[/COLOR]
		GameSpeed = 1.0;
		Default.GameSpeed = GameSpeed;
	}
	else
	{
		OldSpeed = GameSpeed;
		GameSpeed = FMax(T, 0.1);
		[COLOR="SeaGreen"]Level.TimeDilation = 1.1 * GameSpeed;[/COLOR]
		if ( GameSpeed != OldSpeed )
		{
			Default.GameSpeed = GameSpeed;
			class'GameInfo'.static.StaticSaveConfig();
		}
	}
    SetTimer(Level.TimeDilation, true);
}
 
Last edited:

JohnK

New Member
Oct 29, 2004
28
0
0
Brilliant, thanks.

Can't I just set TimeDilation =1 in my gameinfo sub class?
 

Shadow_knight

Carpe diem!
Jan 29, 2008
51
0
6
Prague
Guys, you don't know it, but you've solved my problem as well... And I was still wondering - why am I always de-synchronized between Java and Unreal... :)