project-navigation
Personal tools

Author Topic: Ufo.exe process priority  (Read 3341 times)

Offline Markus Ramikin

  • Cannon Fodder
  • **
  • Posts: 5
    • View Profile
Ufo.exe process priority
« on: November 10, 2009, 01:05:14 am »
Is there any reason why it needs to run itself as high priority by default? For some reason that eats 99% of my CPU and makes alt-tabbing out of it and accomplishing while tabbed out anything a huge pain in the behind. No other game I've played in years ever pulled that on me before, they all start as normal priority processes.

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: Ufo.exe process priority
« Reply #1 on: November 10, 2009, 01:08:09 am »
I vaguely recall some discussion about this with the game a long time ago, but first:  What version of the game are you playing?

Offline Markus Ramikin

  • Cannon Fodder
  • **
  • Posts: 5
    • View Profile
Re: Ufo.exe process priority
« Reply #2 on: November 10, 2009, 01:23:51 am »
The newest stable one, I presume, downloaded like yesterday... lemme take a look. 2.2.1 it seems like.

What's more, even if I set the shortcut to run via cmd /c start and make it run in /normal or /low priority, the game STILL overrides that and insists on running as /high. This goes beyond the merely disturbing into the 'wrong' territory.

I don't want to sound ungrateful or anything, I appreciate this game and I know it's free and all. But still. Unless this is needed for some obscure reason I cannot imagine, this is a Bad Idea.

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: Ufo.exe process priority
« Reply #3 on: November 10, 2009, 02:37:13 am »
OK, first, the last stable release 2.2.1 is over a year old as the upcoming 2.3 is taking a lot longer than expected, although 2.3 has so many new features and changes its almost a whole different game.  I'll try to help you out here with 2.2.1 although it has been a long time and I'm mainly doing this from memory.   :P

Second, I remember in the SVN logs that at some point during the development of 2.3 (after 2.2.1 came out), the code was updated to make the game run at normal priority by default - I think - Its really been a while so I could be remembering wrong.

Third, to change how the game runs at the command line you don't use a slash followed by "low" or "normal" or anything, to tell the game to set itself at the priority you want you add (this is from memory, I hope I'm close enough) "+set" followed by the name of the cvar you want to change and then the value.

Fourth, ...well - I have more I could say, but please excuse me for a few min while I go to my other computer with UFO: AI set up on it and try a few things, then I'll come back here to the forum, hopefully with more information.

Be right back...

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: Ufo.exe process priority
« Reply #4 on: November 10, 2009, 02:42:19 am »
...OK.  Try this:

Code: [Select]
ufo -set sys_priority 0
Hopefully that should work for 2.2.1.

0 == normal
1 == high
2 == realtime

We also have test builds of 2.3 if you want to try them, although they have bugs and are not finished.

Edit: If you plan on running other apps at the same time, you can also play with "sys_affinity" on a multi-core machine and make the game use only one specific core instead of all available ones.
« Last Edit: November 10, 2009, 02:45:13 am by Destructavator »

Offline Markus Ramikin

  • Cannon Fodder
  • **
  • Posts: 5
    • View Profile
Re: Ufo.exe process priority
« Reply #5 on: November 10, 2009, 05:09:50 am »
OK, first, the last stable release 2.2.1 is over a year old as the upcoming 2.3 is taking a lot longer than expected, although 2.3 has so many new features and changes its almost a whole different game.
Ooh, ouch. Does it finally have Psionics? *drool*

Quote
Third, to change how the game runs at the command line you don't use a slash followed by "low" or "normal" or anything
Oh, I was talking about putting this sort of syntax in a shortcut:
Code: [Select]
C:\WINDOWS\system32\cmd.exe /c start "UFO" /low "C:\Program Files\UFOAI-2.2.1\ufo.exe"Is that wrong? In my experience doing it this way works on most everything (like every other game I currently have, for instance), except some Microsoft programs which, as is typical, think they know better. Well, and your game. ;)

...OK.  Try this:

Code: [Select]
ufo -set sys_priority 0
Hopefully that should work for 2.2.1.

That worked! Thank you. I mean it kind of worked, it's weird. It made the game hog much less CPU and allow alt-tabbing with ease - however, it still shows up as High in the task manager's process listing. Confusing! :)

Quote
Edit: If you plan on running other apps at the same time, you can also play with "sys_affinity" on a multi-core machine and make the game use only one specific core instead of all available ones.

Single-core here!

_________

Thanks again for your reply and for taking the time to check this out. I appreciate helping me out; but I am also glad to hear you say this:

Quote
Second, I remember in the SVN logs that at some point during the development of 2.3 (after 2.2.1 came out), the code was updated to make the game run at normal priority by default - I think - Its really been a while so I could be remembering wrong.

I certainly hope this is true and I encourage you guys to make it so if it's not. I posted about this in the first place only in small part due to wanting a solution for myself right now - but in a large part as feedback for the future. I strongly believe that non-critical programs should not behave this way.

I might end up trying out 2.3 - if I can figure out how the hell to download it, the link on the page isn't doing much for me...
« Last Edit: November 10, 2009, 05:13:33 am by Markus Ramikin »

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: Ufo.exe process priority
« Reply #6 on: November 10, 2009, 05:20:51 am »
Quote
I might end up trying out 2.3 - if I can figure out how the hell to download it, the link on the page isn't doing much for me...

Which page is that?

Did you try:

http://ufoai.ninex.info/forum/index.php?topic=2830.msg31984#msg31984

...Which links to:

http://www.destructavator.com/92dl/ufoai_2_3dev_r26960.exe

...?

Offline Markus Ramikin

  • Cannon Fodder
  • **
  • Posts: 5
    • View Profile
Re: Ufo.exe process priority
« Reply #7 on: November 10, 2009, 05:26:57 am »
Oh, I was looking at http://ufoai.sourceforge.net/?page=Download . Still new here and haven't gotten my bearings yet.

Thanks again. :)