Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Lag problem and workaround  (Read 2264 times)

arbitrary

  • Escaped Lunatic
    • View Profile
Lag problem and workaround
« on: February 28, 2008, 03:16:00 pm »

The following report might be useful for people experiencing bad "lag attacks" when playing DF on laptops.

Ever since starting to play DF, I had trouble with lag. Usually the game would run really smooth at first, for example at 75 FPS with 40 dwarves. But after playing for 5 minutes, the FPS would suddenly drop to 30, or even less, everything slowing down to a crawl. After pausing the game for a while, it would return to 75 FPS, only to slow down again a minute later. So frustrating!

My machine is an Acer Aspire 5650 laptop, core duo (T2400 @ 1.83GHz) with 2 GB RAM and NVidia GeForce Go 7600.

At first I blamed DF, and tried to fix it by using smaller areas, or limiting the population. That did increase the FPS a little bit, but I still had the problem with the sudden slowdown after a few minutes of play.

Next I tried fiddling with the graphics settings... vsync, FPS caps, and so on... but that didn't change anything at all.

Finally I got the idea to monitor my CPU speed and temperature. I used a tool called Notebook Hardware Control (NHC) for that. When the game was running, the CPU (well, one core of course) ran at full clock (1.83GHz) and at full load, and the CPU temperature climbed rapidly. Starting from 65C, it rose up to 100C in 5 minutes. At that point, the game suddenly slowed down from 75 FPS to 30 FPS, even though NHC still said the CPU was running at 1.83GHz. I suppose some internal mechanism of the CPU kicked in to prevent overheating. The temperature dropped to 92C, then rising again slowly. When it hit 100C again, the game slowed down even more, to 22 FPS. Pausing the game for a while let the CPU cool down, so it ran at 75 FPS again until getting too hot.

Now to the solution. Most laptops will dynamically switch the CPU speed depending on CPU load, at least while running on AC power. NHC and some other tools allow setting/limiting the CPU clock speed. So I locked the CPU clock at its lowest setting, 1 GHz. The game ran at only 42 FPS then, but the CPU temperature never climbed above 70C and there was no slowdown, the FPS remained constant. Not very fast, but playable. I found that I could allow a clock speed of up to 1.50 GHz, if I pause the game occasionally, resulting in a constant 60 FPS.

In short... if you have a laptop (or maybe PC) like mine, which apparently isn't designed to run at full load for more than 5 minutes, check if your CPU might be overheating. In that case, limiting the CPU to a lower speed could improve your playing experience, even if it decreases the FPS a bit. But I find that much more tolerable then the sudden lag attacks I got before.

Cheers!

Logged

herrbdog

  • Bay Watcher
    • View Profile
Re: Lag problem and workaround
« Reply #1 on: February 28, 2008, 06:37:00 pm »

100°C and your computer still works?! Mine shuts down at 70°C (granted it is a desktop system though.)
Logged

Keiseth

  • Bay Watcher
    • View Profile
Re: Lag problem and workaround
« Reply #2 on: February 28, 2008, 06:41:00 pm »

Your laptop was hot enough to boil water. That's ... insane. On the bright side, just throw a pot on top of it, pour in some water and Ramen and you can cook and play DF at the same time.
Logged

Logan

  • Bay Watcher
    • View Profile
Re: Lag problem and workaround
« Reply #3 on: February 28, 2008, 07:13:00 pm »

quote:
Originally posted by Keiseth:
<STRONG>Your laptop was hot enough to boil water.</STRONG>

I've heard stories of somebody who cooled his overclocked processor by putting it in his window with a box fan drawing the outside air into the room. The chips warmed the incoming Alaskan winter air to 25°C.

Logged

Romantic Warrior

  • Bay Watcher
    • View Profile
Re: Lag problem and workaround
« Reply #4 on: February 28, 2008, 09:13:00 pm »

You need to dunk that puppy in some bacon grease!
http://www.tomshardware.com/2006/01/09/strip_out_the_fans/
Logged
Dwarf Fortress and the Abstract Truth.

Glaughdram

  • Bay Watcher
    • View Profile
Re: Lag problem and workaround
« Reply #5 on: February 28, 2008, 09:29:00 pm »

Good post, great tip. This is something to watch for not just with laptops, but any computer having inadequate cooling or aggresive overclocking.
Logged

Salmeuk

  • Bay Watcher
    • View Profile
Re: Lag problem and workaround
« Reply #6 on: February 28, 2008, 10:43:00 pm »

This appears to be the behavior with my computer. I staart to play, wnd in a few minutes the game slows down from 80 fps to 20 fps. I shall investigate, with this in mind.
Logged

numerobis

  • Bay Watcher
    • View Profile
Re: Lag problem and workaround
« Reply #7 on: February 29, 2008, 02:15:00 pm »

While writing my doctoral dissertation, I had to run some experiments somewhat at the last minute (in the final document I reran them in better conditions).  To make sure the timings weren't too screwed up, I ran them at night, with my laptop propped up over the table on four spice jars, with a floor fan blowing at the setup.  Worked like a charm.

If you have an external keyboard you could do this when playing DF.

Logged

arbitrary

  • Escaped Lunatic
    • View Profile
Re: Lag problem and workaround
« Reply #8 on: March 01, 2008, 05:09:00 am »

Yeah, 100C seems very high, but it's actually the maximum temperature for the Core Duo. I found a list here: http://www.hardwaresecrets.com/article/143/5

I removed the dust from inside the laptop, which had accumulated there for almost 2 years now. That seems to have improved the problem a lot. Combined with propping the laptop up a bit from the desk (the fan is drawing air from below), I can now run at maximum load for a much longer time, so I don't need to limit CPU speed any more. Sweet.

Thanks for the comments and tips!

Logged