project-navigation
Personal tools

Author Topic: Attn Windows players with lag/slow performance w/2.4 dev builds  (Read 8712 times)

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Attn Windows players with lag/slow performance w/2.4 dev builds
« on: October 02, 2010, 08:37:24 pm »
I've noticed over time as the game developed that the Linux version, once compiled, runs rather smooth compared to the Windows build of the 2.4 dev branch, which runs at a godawful crawl on Windows 7 machines with multiple cores, and I've found a fix to this issue.

I found this works well and makes a *profound* performance difference on my new 64-bit Windows 7 i7 (eight cores) machine.  Before this method I had to turn all graphics options down to lowest settings, and still the battlescape was painfully slow to the point of making it un-playable.  After doing this method I'm about to describe, I can now turn everything all the way up and get smooth framerates.

This involves editing the config.cfg file inside the APPDATA folder with a text editor.

- First, you need to know exactly how many cores your machine has.

- Change the "set sys_affinity" value to exactly one greater than the total number of cores in your computer.

- If you don't plan on running other apps while playing, you can also change the "set sys_priority" to "1" instead of zero.

- In my case I also found it helped to increase the "set cl_maxfps" value to a multiple of my screen refresh rate, which in my case is ~60 (I live in North America, EU players might have a different default screen refresh rate, I really don't know for sure - I know that TV sets are different but don't know if the same is for computers over there).  In my case I put it up to "120" and got very nice results.

That's really it, just those steps made a huge difference.  I noticed that the default sys_affinity when I set up the game was "3" which would have meant both cores on a dual-core machine, but since I have eight cores the game - according to the console log - was confused and used just one core, the third one.  Now it uses all 8 of them.

P.S. - I've installed NSIS installer system again and I hope to have a new, complete 2.4 dev test build for win32 uploaded soon, in the usual thread - for those who want to try this out.

Offline mikeg

  • Rookie
  • ***
  • Posts: 24
    • View Profile
Re: Attn Windows players with lag/slow performance w/2.4 dev builds
« Reply #1 on: October 12, 2010, 09:00:39 pm »
Another remark: After study the source code, you can set the sys_priority to any other value than 0 or 1 to get real-time priority. But this can cause side effects such as problems with mouse, etc. Use it with caution.

Your description about sys_affinity seems to be incorrect, IMHO (take a look to source in win_shared.c:void Sys_SetAffinityAndPriority (void))

Regards

Mike

Offline ManicMiner

  • Squad Leader
  • ****
  • Posts: 113
    • View Profile
Re: Attn Windows players with lag/slow performance w/2.4 dev builds
« Reply #2 on: October 12, 2010, 09:34:42 pm »
Well, I've had a play with the newer 2.4 builds and I don't see the problem you're getting.

That said, by far the most playable and stable build I've got is the very last one from SVN, built using Muton's script tool, and optimized for dual core with the cache sizes set as per my work laptop.

Consistent 47FPS with everything enabled except GLS, and that's not bad considering the laptop's a couple of years old.

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: Attn Windows players with lag/slow performance w/2.4 dev builds
« Reply #3 on: October 12, 2010, 10:25:12 pm »
Well, I've had a play with the newer 2.4 builds and I don't see the problem you're getting.

That said, by far the most playable and stable build I've got is the very last one from SVN, built using Muton's script tool, and optimized for dual core with the cache sizes set as per my work laptop.

Consistent 47FPS with everything enabled except GLS, and that's not bad considering the laptop's a couple of years old.

You're probably not having this issue because, from what it sounds like, you only have two cores.  The issue is that the recent versions of the game (the last SVN one is rather old now) gets confused running on systems with more than two cores, so on a quad- or eight core machine (mine has eight), the game only uses one core and runs slow, but with just one or two cores, there's no problem.

I haven't actually looked at the code, but I'm guessing it is outdated, written to accommodate either one or two-core systems.

That being said, should I:

A - Sticky this for Windows users, until the code is updated?

or

B - Move this topic and treat is as a (logic?) bug?  (Until the code is patched)

Edit:  FYI to anyone who wants to update the code:  Machines with even more cores are coming out, I have a friend waiting to make a purchase on a 12-core system.  Therefore, to avoid having to patch things again in the future, I'd suggest supporting future machines with a lot more than eight cores.  Don't get me wrong, I'm not expecting support for enough cores to fill up a 64-bit integer value with any machines coming out in the next few years (methinks that would be overkill), but something adequate to work with machines that are in use by the time this project is complete (as in having the plot finished) would make sense.
« Last Edit: October 12, 2010, 10:31:51 pm by Destructavator »

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Attn Windows players with lag/slow performance w/2.4 dev builds
« Reply #4 on: October 12, 2010, 10:39:16 pm »
latest git master should fix the issues - if it works for you, let me know and i will merge it back into 2.3.1

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: Attn Windows players with lag/slow performance w/2.4 dev builds
« Reply #5 on: October 12, 2010, 10:50:33 pm »
latest git master should fix the issues - if it works for you, let me know and i will merge it back into 2.3.1

OK, thanks.  The eight-core machine is actually the one I've had a nightmare getting Git to work on, but I'll keep trying with Git and once/if I get a new, updated copy of the master together, I'll let you know how it goes with this issue.

Offline mor2

  • Squad Leader
  • ****
  • Posts: 145
    • View Profile
Re: Attn Windows players with lag/slow performance w/2.4 dev builds
« Reply #6 on: October 13, 2010, 07:48:44 pm »
I found this works well and makes a *profound* performance difference on my new 64-bit Windows 7 i7 (eight cores) machine. 

...

- Change the "set sys_affinity" value to exactly one greater than the total number of cores in your computer.

i dont know how this game works but i had similar problem with HOI on my PC at home, it was a simple case of no support for multiprocessing thus more cores = worse performance, since usually each core has lower clock speed.

so you may want to try a different solution for your problem, instead of editing the game files, simply go to task manager, right click your game process and set its priority higher and then change its affinity to anything but the first core which ~will give the game a core of its own (more or less)

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: Attn Windows players with lag/slow performance w/2.4 dev builds
« Reply #7 on: October 19, 2010, 03:27:58 am »
latest git master should fix the issues - if it works for you, let me know and i will merge it back into 2.3.1

After getting a fresh copy of the master together earlier today, I can see that, yes, this is now solved, the game detects and uses all cores properly now.

Note to others who had this issue:  If you update to a revision past the point when Mattn put the fix for this in the code, you may want to delete the 2.4 folder from your APPDATA path, so that the game starts fresh with a new configuration to work with.

Offline LuckyLindy

  • Rookie
  • ***
  • Posts: 40
    • View Profile
Re: Attn Windows players with lag/slow performance w/2.4 dev builds
« Reply #8 on: November 17, 2010, 10:01:09 pm »
Is this a problem with just Windows 7?  I am having problems with the newest development build and the stable build.  I am not having any problems with others memory intensive games.  Right now, with the frame rate at about 2 per sec, it is unplayable.  I tasked out, set the prority to high and set to both cores.  Another problem is that I bought a kind'of cheaper gateway, intel chipset, dual core 3.0 ghz, off the shelve model.  I have update all of my drivers, however it is still unplayable.


Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: Attn Windows players with lag/slow performance w/2.4 dev builds
« Reply #9 on: November 17, 2010, 10:11:47 pm »
Is this a problem with just Windows 7?  I am having problems with the newest development build and the stable build.  I am not having any problems with others memory intensive games.  Right now, with the frame rate at about 2 per sec, it is unplayable.  I tasked out, set the prority to high and set to both cores.  Another problem is that I bought a kind'of cheaper gateway, intel chipset, dual core 3.0 ghz, off the shelve model.  I have update all of my drivers, however it is still unplayable.



Could you please post the full system specs and exact version of Windows you're using?  (And your video card?)

I used to work as a professional tech, and I've seen some of the older systems with only two cores (or less) really struggle with newer software, although it varies (My old laptop with just two cores runs Win 7 fine, although my dual-core older desktop really lags with it.)  I can also tell you from my experience that if you haven't updated the system and drivers, that can make a *big* difference in performance, especially if you've got a lot of updating to do that hasn't been done yet.

Offline LuckyLindy

  • Rookie
  • ***
  • Posts: 40
    • View Profile
Re: Attn Windows players with lag/slow performance w/2.4 dev builds
« Reply #10 on: November 18, 2010, 01:58:57 pm »
Gateway SX 2801 Slimline, Pentium Dual-Core E5700 @ 3.0 (3.2) gHz, 6 GB memory.  On board G45 Intel express chipset, however next week it will change to Radeon 5570 1 GB DDR2 SDRAM (dual screen support).

I am not a techy, I am an environmental geologist and I run memory intensive modeling software; ArcGIS, ModFLOW, and AutoCAD (I use slimline computers for deskspace).  These are running fine.  Windows 7 is updated and running fine and I ran Would in Conflict on medium graphics setting fine last night, however high detail settings caused it to lag.  My laptop is windows vista and the game (ufo:ai) runs fine, but I have cooling problems and don't like to run games on it and use it for fieldwork and presentations.  I was going to test company of heroes later, but it may be tomorrow (field work today).

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: Attn Windows players with lag/slow performance w/2.4 dev builds
« Reply #11 on: November 18, 2010, 05:51:45 pm »
Gateway SX 2801 Slimline, Pentium Dual-Core E5700 @ 3.0 (3.2) gHz, 6 GB memory.  On board G45 Intel express chipset, however next week it will change to Radeon 5570 1 GB DDR2 SDRAM (dual screen support).

I am not a techy, I am an environmental geologist and I run memory intensive modeling software; ArcGIS, ModFLOW, and AutoCAD (I use slimline computers for deskspace).  These are running fine.  Windows 7 is updated and running fine and I ran Would in Conflict on medium graphics setting fine last night, however high detail settings caused it to lag.  My laptop is windows vista and the game (ufo:ai) runs fine, but I have cooling problems and don't like to run games on it and use it for fieldwork and presentations.  I was going to test company of heroes later, but it may be tomorrow (field work today).

After looking up your on-board video specs, it looks like that might be the culprit - From the information I've found your on-board video hardware really isn't meant for 3D gaming.  You certainly have enough standard memory/RAM for UFO:AI, and your processors should be fast enough, but the whole thing will only run a program as fast as the slowest component that that program needs.  It's not just about memory, and different programs use different resources.

I also noticed your on-board video is partially lacking in OpenGL support, which is what UFO:AI uses to render video.

Bottom line, I think once you get your new video card you should see a dramatic change in video performance and FPS.

Offline Muton

  • Sergeant
  • *****
  • Posts: 496
    • View Profile
Re: Attn Windows players with lag/slow performance w/2.4 dev builds
« Reply #12 on: November 18, 2010, 08:05:38 pm »
Disable gls sharders
options/video/extended

Offline LuckyLindy

  • Rookie
  • ***
  • Posts: 40
    • View Profile
Re: Attn Windows players with lag/slow performance w/2.4 dev builds
« Reply #13 on: November 18, 2010, 10:42:14 pm »
I appreciate it...I took it back (actually before I read the above when it miserably failed Company of Heroes and ArcGIS was giving onboard graphics a fit) to best buy since I could not install my graphics card from its little cousin that I used prior without PSU issues.  Mine is a clear case of assuming it was the same basically made and "ass out of me."  I am replacing it with a HP quad core AMD Athlon II tower build with Radeon HD4350 and replacing the PSU with a 500w unit and upgrading to 8 gb memory.  Later I should be able to upgrade to higher grade components.  (HP P6654Y AMD 2.8 Quad Core, 4 gb (upgrading to 8 gb), 500w PSU upgrade.)  Can't complain, they threw in the 4 gb "no charge" (yeah right). Thanks guys!

Offline LuckyLindy

  • Rookie
  • ***
  • Posts: 40
    • View Profile
Re: Attn Windows players with lag/slow performance w/2.4 dev builds
« Reply #14 on: November 20, 2010, 12:05:35 am »
The HP makes a 1000% difference!  Game works perfectly.  To bad I lost all of my progress; oh well, I will just start over.