News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 20th Jul 2008, 11:25 PM   #1
XxDangerxX
Registered User
 
XxDangerxX's Avatar
 
Join Date: Jan. 20th, 2008
Location: NSW, Australia
Posts: 128
What's wrong with Deltatime online?

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:
Attached Files
File Type: zip JETBOOTSv12_Raw.zip (68.9 KB, 1 views)
__________________
"32-bit colour is the best thing since... 24-bit colour."








Last edited by XxDangerxX; 21st Jul 2008 at 09:38 AM.
XxDangerxX is offline   Reply With Quote
Old 22nd Jul 2008, 07:08 AM   #2
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,753
UT does not properly recognize modern CPUs' dynamic clock speed. Sometimes it'll run a lot faster than usual. That is not related to online/offline play.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Old 22nd Jul 2008, 08:46 PM   #3
XxDangerxX
Registered User
 
XxDangerxX's Avatar
 
Join Date: Jan. 20th, 2008
Location: NSW, Australia
Posts: 128
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).
__________________
"32-bit colour is the best thing since... 24-bit colour."








Last edited by XxDangerxX; 10th Aug 2008 at 09:18 PM.
XxDangerxX is offline   Reply With Quote
Old 28th Sep 2008, 08:57 AM   #4
Zur
surrealistic mad cow
 
Zur's Avatar
 
Join Date: Jul. 8th, 2002
Posts: 11,638
I think what Wormbo means is that the approach UT uses to quantify time doesn't work properly on more recent computers.
__________________

Zur is offline   Reply With Quote
Old 28th Sep 2008, 09:36 AM   #5
XxDangerxX
Registered User
 
XxDangerxX's Avatar
 
Join Date: Jan. 20th, 2008
Location: NSW, Australia
Posts: 128
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...?
__________________
"32-bit colour is the best thing since... 24-bit colour."







XxDangerxX is offline   Reply With Quote
Old 28th Sep 2008, 10:02 AM   #6
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,753
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.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Old 28th Sep 2008, 12:10 PM   #7
Zur
surrealistic mad cow
 
Zur's Avatar
 
Join Date: Jul. 8th, 2002
Posts: 11,638
Quote:
Originally Posted by XxDangerxX View Post
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.
__________________

Zur is offline   Reply With Quote
Old 28th Sep 2008, 07:31 PM   #8
XxDangerxX
Registered User
 
XxDangerxX's Avatar
 
Join Date: Jan. 20th, 2008
Location: NSW, Australia
Posts: 128
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.
__________________
"32-bit colour is the best thing since... 24-bit colour."







XxDangerxX is offline   Reply With Quote
Old 29th Sep 2008, 01:25 AM   #9
elmuerte
Master of Science
 
elmuerte's Avatar
 
Join Date: Jan. 25th, 2000
Location: the Netherlands
Posts: 1,936
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.
elmuerte is offline   Reply With Quote
Old 29th Sep 2008, 05:15 AM   #10
eblade
Registered User
 
Join Date: Jan. 29th, 2006
Posts: 113
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.
eblade is offline   Reply With Quote
Old 29th Sep 2008, 05:55 AM   #11
XxDangerxX
Registered User
 
XxDangerxX's Avatar
 
Join Date: Jan. 20th, 2008
Location: NSW, Australia
Posts: 128
Ahhh, OK so it's about the speed scaling!

Please please please tell me how I can change it!!
__________________
"32-bit colour is the best thing since... 24-bit colour."







XxDangerxX is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 08:31 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer