LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Games
User Name
Password
Linux - Games This forum is for all discussion relating to gaming in Linux.

Notices

Reply
 
Search this Thread
Old 03-23-2009, 06:16 PM   #1
gamelord12
LQ Newbie
 
Registered: Feb 2008
Posts: 23

Rep: Reputation: 15
Unreal Tournament running too fast


I've got Unreal Tournament installed natively (not through WINE), and it runs, but it runs twice as fast as it should. I've seen games do this in Windows, where they're using both cores of my CPU instead of just one (I've got a Core 2 Duo, and dual cores weren't on PCs in 1999). In Windows, I would right-click on the process in the task manager, and I could set the processor affinity. I've tried various commands to launch the game using only one core, but none of them have worked yet. They execute without any errors in the terminal, but the game still suffers from running too fast. I've tried taskset, schedutils, and a few others even using sudo, following all the documentation for getting a process running on one core, but they don't seem to be working. How can I get this running on one core, guaranteed? I'm on Ubuntu 8.10 64-bit.
 
Old 03-24-2009, 01:57 AM   #2
rizzy
Member
 
Registered: Mar 2004
Distribution: Debian
Posts: 283

Rep: Reputation: 65
this happens cuz UT depends on CPU clock to time itself. Try adding vSync=True to ut.ini or force vSync through grafix drivers. Also worth checking that BIOS CPU speed controls are off - like Asus Cool n Quiet options.
On my laptop, the only thing i could do to run it normal speed was running laptop on batteries and loading CPU 100% before launching the game - pain , i know
 
Old 03-24-2009, 09:40 AM   #3
gamelord12
LQ Newbie
 
Registered: Feb 2008
Posts: 23

Original Poster
Rep: Reputation: 15
That's not really a solution, so much as a work around. Loading up the processor while on batteries isn't a good way to handle that at all. I just want the processor affinity to work.
 
Old 03-24-2009, 12:36 PM   #4
rizzy
Member
 
Registered: Mar 2004
Distribution: Debian
Posts: 283

Rep: Reputation: 65
The solution is to disable speed stepping of CPU, if BIOS doesnt allow it , i use work around.

If you find a better way, please, let me know
 
Old 04-18-2009, 09:54 AM   #5
rizzy
Member
 
Registered: Mar 2004
Distribution: Debian
Posts: 283

Rep: Reputation: 65
found a nice script that finally solves this problem for me

http://pastebin.com/f7353a45b

run the script in UnrealTournament dir
 
Old 04-19-2009, 10:12 AM   #6
gamelord12
LQ Newbie
 
Registered: Feb 2008
Posts: 23

Original Poster
Rep: Reputation: 15
I found that this problem also applies to Hitman (the conversations get interrupted because the timing is off). Can this script be easily modified to fix any binary giving me trouble?
 
Old 04-19-2009, 11:04 AM   #7
rizzy
Member
 
Registered: Mar 2004
Distribution: Debian
Posts: 283

Rep: Reputation: 65
i suppose it can be adapted, you only need this part of it and edit the bit where it refernces to ut-bin:

#!/bin/bash
# Flood the CPU for four seconds so that it is running at the currect speed
#
RandomFork () {
#
while [ "$SECONDS" -le "4" ]; do
#
let MYRND="$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM"
#
done
#
}
#
RandomFork &
#

#
# Let's boogie!
#
if [ -x "${UT_DATA_PATH}/ut-bin" ]
#
then
#
echo -n "Sleeping for 1 second... ";sleep 1s;echo "done - launching UT"
#
cd "${UT_DATA_PATH}/"
#
exec "./ut-bin" -log $*
#
fi
#
echo "Couldn't run Unreal Tournament (ut-bin). Is UT_DATA_PATH set?"
#
exit 1
 
Old 04-22-2009, 07:33 AM   #8
gamelord12
LQ Newbie
 
Registered: Feb 2008
Posts: 23

Original Poster
Rep: Reputation: 15
Now I feel like this script should be something that every noob should have access to (I haven't tried it yet, but I'm assuming it works for the time being) and perhaps someone, maybe myself, should write a GUI program to generate it based on what game or program you want to run at the correct speed.
 
Old 04-22-2009, 07:35 AM   #9
gamelord12
LQ Newbie
 
Registered: Feb 2008
Posts: 23

Original Poster
Rep: Reputation: 15
Speaking of being a noob, to run a script, you just do "sh <filename>", right? And when I save this script, is there a common file extension I should be using? Sorry, I've never done this before.
 
Old 04-22-2009, 11:35 AM   #10
rizzy
Member
 
Registered: Mar 2004
Distribution: Debian
Posts: 283

Rep: Reputation: 65
save as utcustom.sh
make executable chmod +x utcustom.sh
run it ./utcustom.sh

You can make it even neater - create another script in /usr/local/bin
name it ut without extentions
the script is something like this:
#!/bin/sh
cd /usr/local/games/unrealtournament
./utcustom.sh

also chmod new script chmod +x ut

Now you can just type ut anywhere in terminal to start ut. it's cool as well as usefull.
 
Old 04-22-2009, 05:43 PM   #11
gamelord12
LQ Newbie
 
Registered: Feb 2008
Posts: 23

Original Poster
Rep: Reputation: 15
I got these errors:

andrew@lappyc2d:~/ut$ sh unreal.sh
: not found5:
: not found7:
: not found10:
: not found14: {
unreal.sh: 100: Syntax error: end of file unexpected (expecting "then")
andrew@lappyc2d:~/ut$ ./unreal.sh
bash: ./unreal.sh: /bin/bash^M: bad interpreter: No such file or directory
 
Old 04-23-2009, 12:12 PM   #12
rizzy
Member
 
Registered: Mar 2004
Distribution: Debian
Posts: 283

Rep: Reputation: 65
Could it be that you use 64bit system? I've never used 64bit myself and don't know if the script requires adaptations for it.
Instructions here may be of more use to you:
http://fingel.com/ut/howtos/utonlinux.html
 
Old 04-28-2009, 10:37 PM   #13
CaptainInsane
Member
 
Registered: Nov 2003
Location: Peoria
Distribution: Fedora 8
Posts: 92

Rep: Reputation: 15
I would suspect it is related to the 64 bit kernel.

I have been running UT native in both client and server installs without any such issues. All on 32-bit kernels.
Using P4 HT cpu's (linux see's as 2 cpus) and on a supermicro server system with 2 physical cpus.

No issues with program running too fast.
 
Old 04-29-2009, 11:55 AM   #14
rizzy
Member
 
Registered: Mar 2004
Distribution: Debian
Posts: 283

Rep: Reputation: 65
No, running too fast isn't linked to 64 bit, but to newer computers, imo. P4 HT is still old architecture so UT would run fine on it. However UT on my AMD X2 overspeeds in linux and winXP, also my GF's Sony Vaio Pentium M overspeeds in winXP - it has laptop speedstepping for CPU which messes up UT.

Did anyone managed to run UT native in 64bit? I've not seen one account on it, UT is fussy enough to run nowdays on ANY modren system , nevermind 64 :|
 
  


Reply

Tags
processor, unreal


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble Running Unreal Tournament 2004 lovetto Linux - Software 1 09-05-2005 08:16 PM
Unreal Tournament.. Help PLEASE IrcSystmzz Linux - Games 2 05-04-2005 08:02 PM
Unreal Tournament running problems thefallen Linux - Software 5 09-04-2003 02:03 AM
Segfault running Unreal Tournament with NVIdia card Infinity Linux - Software 10 08-12-2002 10:00 PM
Unreal tournament Zellius Linux - General 1 01-20-2002 10:18 PM


All times are GMT -5. The time now is 11:00 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration