UE1 - UT What's wrong with Deltatime online?

  • 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.

XxDangerxX

New Member
Jan 20, 2008
128
0
0
NSW, Australia
www.myspace.com
To clarify, I am referring to function Tick()'s float variable, (usually) known as Deltatime.

When I define function Tick, it is called offline with a correct deltatime, properly showing the time between the last tick and the current tick. When I run it online, however, the deltatime that is defined when Tick() is called is many times what it should be. I'm finding that 3-5 seconds worth of operation is executed in just 1 second. This is hazardous to my Inventory's charge, which depletes itself based on the deltatime, at a rate much faster than the proper rate demonstrated in a standalone game.

I could use function Timer(), but it is already in use as inherited (and slightly modified) code from the Inventory's superclass, UT_JumpBoots.

What's wrong, and how can I fix it?

To aid your investigations, here is the source code for my JetBoots.

Any and all help is greatly appreciated. :)

EDIT:
The Deltatime problem might be related to a problem with Timer that I have found. I call SetTimer(0.05,true) and Timer() gets called every second, by the looks of it.

It's not something wrong with my machine, for the record, because the class 'flakslug' calls Timer() every 0.04 seconds successfully. I don't know why it works for the flakslug but not for the JetBoots. it's very frustrating. What variables do I need to change??

Anyway, I found this Timer problem because I:
figured out what the UT_JumpBoots' original timer did -> concluded I didn't need it -> moved appropriate code from Tick() into Timer()

So here's an updated version of the mod with the attempted Timer fix:
 

Attachments

  • JETBOOTSv12_Raw.zip
    68.9 KB · Views: 14
Last edited:

XxDangerxX

New Member
Jan 20, 2008
128
0
0
NSW, Australia
www.myspace.com
So what you're saying is that it's just a coincidence that Deltatime is consistently perfect offline and incorrect online?

I don't think my CPU's clock speed is dynamic. The core I have assigned to UT runs at full speed, at least while UT is running. I have set UT process priority to Realtime.

As for the Timer, turns out I overlooked UT_JumpBoots calling SetTimer(1.0,true) in PickupFunction(). I just redefined the function and deleted the SetTimer() call and it worked!

My jetboots are making major headway now. They're almost ready to be released at Beta! I just have to make some final touches...

EDIT:

OK, I haven't tested it yet, but I think I know what the problem is. when I click "Dedicated" and the button calls the console command "relaunch etc", it doesn't include the "-CPUSPEED=2500" switch that I put in the command line. Maybe it'll work when I use the dedicated server shortcut I have. Of course I have no intention to test it. I'll just trust it works until I find it doesn't (which is pretty likely in the case that I begin a new coding endeavour).
 
Last edited:

Zur

surrealistic mad cow
Jul 8, 2002
11,708
8
38
48
I think what Wormbo means is that the approach UT uses to quantify time doesn't work properly on more recent computers.
 

XxDangerxX

New Member
Jan 20, 2008
128
0
0
NSW, Australia
www.myspace.com
Is there a way to make Windows or, possibly, my CPU support UT in that respect? As in make UT run correctly while using all 4 cores of my AMD Phenom 9850?

My friend (XxDeadlyxX / deado - as you may know him) has an Intel quad and he has no troubles. Surely there's a way...?
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
UT (and UT2003, btw.) simply don't work if they run on more than one core. There's no problem with hyper-threading on a single core, but if the UT process switches between different cores, time calculations will break.
 

Zur

surrealistic mad cow
Jul 8, 2002
11,708
8
38
48
Is there a way to make Windows or, possibly, my CPU support UT in that respect? As in make UT run correctly while using all 4 cores of my AMD Phenom 9850?

My friend (XxDeadlyxX / deado - as you may know him) has an Intel quad and he has no troubles. Surely there's a way...?

It's a problem with many games from circa 98-99. I read somewhere that the way the new cpus work kind of bork the timing. That's why you'll get some people detected as speedhacking when they've done nothing.

I guess one solution would be to set core affinity or use the executable that Baiter posted on UnrealAdmin. You can also set the priority level of the program to high or real-time to increase the load.
 

XxDangerxX

New Member
Jan 20, 2008
128
0
0
NSW, Australia
www.myspace.com
I know. I've done all that. I've got imagecfg to configure the affinity (which has come in very handy :-)) and everything, but nothing of what either of you said explains why my friend has had no trouble running UT with his Intel quad core.
 

elmuerte

Master of Science
Jan 25, 2000
1,936
0
36
42
the Netherlands
elmuerte.com
it's not a quad core issue, it's an issue with all scaleable CPUs, which is pretty much every CPU since 2004. For example AMD64 has the same issues. You can test it by loading a level, look at the ground and run around. You should notice speedsup and slowdowns in the walking. The problem is much less noticeable when you disable the CPU scaling features.
 

eblade

New Member
Jan 29, 2006
113
0
0
Hm. I guess this explains why an item i made for land of the dead (engine 2226, same as ut03) that is dependent upon deltatime to calculate it's remaining power lasts approximately 10 times longer online than it does standalone. interesting.