Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: Lag control  (Read 1879 times)

G-Flex

  • Bay Watcher
    • View Profile
Re: Lag control
« Reply #15 on: September 15, 2010, 05:31:38 pm »

I wasn't referring to how much memory the program uses. I was more getting at how the program iterates over things or handles the data; odds are he could decrease the computational complexity of some of the code dramatically. I mean, if fairly simple optimizations can turn an O(n2) task into an O(n) or O(logn) task, that obviously means a lot, and such improvements probably aren't even that far-fetched here.


Quote
Nope, C++.
Yes, apologies, I was speaking more generally, C/C++ family.  But keep in mind that DF was originally written in C with C++ classes later being added.  The legacy is still there, particularly in data structures and likely in coding style being used.

Coding style is an important point to bring up. A lot of his experience seems to be with relatively-unstructured things (he started out with BASIC, for that matter). If you've ever looked at the code for LCS, a lot of it is kind of bonkers by reasonable/modern standards (lots of switch-statement nightmares and that sort of thing). I think that's basically Toady's one most prominent flaw (everybody's got them) as a developer: He doesn't really have a ton of experience or formal education in developing and programming large projects where scalability and "best practices" matter. It's my half-educated opinion that if Toady had more formal education/experience in this sort of thing (and were working in a slightly more sane language when it comes to dealing with high-level/OO stuff, but that's a whole other debate/toipc) then development would be faster, he'd be able to better predict the results of his changes, and things would be better for everyone.
Logged
There are 2 types of people in the world: Those who understand hexadecimal, and those who don't.
Visit the #Bay12Games IRC channel on NewNet
== Human Renovation: My Deus Ex mod/fan patch (v1.30, updated 5/31/2012) ==

jei

  • Bay Watcher
    • View Profile
Re: Lag control
« Reply #16 on: September 15, 2010, 07:18:54 pm »

Have you tried to go into the init files both the normal and the d_init?

I have done absolutely everything, except blood cleanup since I don't know of tool to do it in Linux.

I suspect FPS loss is due to blood since windows players don't seem to suffer as heavy and steady FPS performance degradation as I do, no matter the fortress.
The only correlation thusfar has been time and time = blood spreading in DF, which means FPS loss.
Logged
Engraved on the monitor is an exceptionally designed image of FPS in Dwarf Fortress and it's multicore support by Toady. Toady is raising the multicore. The artwork relates to the masterful multicore support by Toady for the Dwarf Fortress in midwinter of 2010. Toady is surrounded by dwarves. The dwarves are rejoicing.

nuker w

  • Bay Watcher
    • View Profile
Re: Lag control
« Reply #17 on: September 15, 2010, 08:06:25 pm »

Maybe you just need a new computer to play it at the speed you want? I need one to, to be honest. "Lag control" can only be taken so far.
Logged

jei

  • Bay Watcher
    • View Profile
Re: Lag control
« Reply #18 on: September 16, 2010, 04:29:56 am »

Maybe you just need a new computer to play it at the speed you want? I need one to, to be honest. "Lag control" can only be taken so far.

Others seem to be fine playing with similar computers and get tons better FPS. Indeed, my FPS are also fine to begin with, but start to slowly degrade and by year 5 they're always down to 2. Blood spatter seems to be the only common factor that seems to bring this ail to all my different fortresses and a few years after proper bloodspilling has started everything grinds to a total halt. There is nothing more to do, I've already switched OS'es and computers and fortresses, even all the optimization settings. Still, the same problem persists. Blood is now the only reason that I can think of, unless it's somehow due to all the stone I've dug, but others don't seem to have that much of a problem with just stone.
Logged
Engraved on the monitor is an exceptionally designed image of FPS in Dwarf Fortress and it's multicore support by Toady. Toady is raising the multicore. The artwork relates to the masterful multicore support by Toady for the Dwarf Fortress in midwinter of 2010. Toady is surrounded by dwarves. The dwarves are rejoicing.

ungulateman

  • Bay Watcher
  • [PREFSTRING: haunting moos]
    • View Profile
Re: Lag control
« Reply #19 on: September 16, 2010, 06:37:11 am »

Digging out lots of stone does cause FPS problems. Atomsmash your spare stone for extra FPS.

Blood's also a pain. If you can get DFHack, it has a script for cleaning up blood, at any rate. You can also turn invaders off, but that spoils the fun.

You can also generate fewer caverns, and embark on flattish sites. I have a 5-year old laptop which can run about 70-80 FPS on a flat, shallow site lacking running water with 50-60 dwarves.

EDIT: Nearly forgot - spiral ramp staircases. Not normal ones, but a big circular corkscrew going through your fort. Your FPS will love you.
Logged
That's the great thing about this forum. We can derail any discussion into any other topic.
It's not an embark so much as seven dwarves having a simultaneous strange mood and going off to build an artifact fortress that menaces with spikes of awesome and hanging rings of death.

Joakim

  • Bay Watcher
    • View Profile
Re: Lag control
« Reply #20 on: September 16, 2010, 08:14:40 am »

Sure, multithreading would be a performance improvement. But if you're playing at 1 fps then 2 cores would give you (at most) 2 fps. Not really the holy grail if it's running that slow.
Logged

beorn080

  • Bay Watcher
    • View Profile
Re: Lag control
« Reply #21 on: September 16, 2010, 10:50:25 pm »

NOTE: I got 150, as stated before, on a laptop with 1.86 GHz, 1526 RAM and is a Vista. So its not impossible. Just don't ever expect to get a King before going mad.

I would like to see you play and take on HFS and win with that FPS number too. I got as far as getting a king on a similar computer setup (not FPS), but hitting 0-1 FPS no matter what I do kinda eats my will to continue.

For HFS, set the
Spoiler (click to show/hide)
in the world generation to zero. That will eliminate lag when you breach.

Also, use a small map. A 17x257 map runs faster and saves quicker then a 257x257 map, and it pretty much has the same stuff on it. Likewise, a 17x17 map will be fastest across the board.

Butcher all cats. If the have been adopted, kill them. If needed, kill the owner.

Use smaller embark areas. A 6x6 area has something on a thousand times the space of the full 2d map from way back when. Go 3x3. There is almost nothing that can't be built in that size map.

Smooth your stone and set up dedicated cleaners. There is speculation that dwarves clean up near meeting halls, so use them to hit dirty spots. Set up a bath for your dwarves between the dining room and the meeting hall, or other path every dwarf walks. A 2 deep chunk of water will clean your dwarves nicely.

Set you cap to 100 and the child cap to zero.

Invest in more ram. DF can eat up a ton of ram space.

Turn off cave ins.

Logged
Ustxu Iceraped the Frigid Crystal of Slaughter was a glacier titan. It was the only one of its kind. A gigantic feathered carp composed of crystal glass. It has five mouths full of treacherous teeth, enormous clear wings, and ferocious blue eyes. Beware its icy breath! Ustxu was associated with oceans, glaciers, boats, and murder.

nuker w

  • Bay Watcher
    • View Profile
Re: Lag control
« Reply #22 on: September 17, 2010, 01:33:11 am »

NOTE: I got 150, as stated before, on a laptop with 1.86 GHz, 1526 RAM and is a Vista. So its not impossible. Just don't ever expect to get a King before going mad.

I would like to see you play and take on HFS and win with that FPS number too. I got as far as getting a king on a similar computer setup (not FPS), but hitting 0-1 FPS no matter what I do kinda eats my will to continue.

For HFS, set the
Spoiler (click to show/hide)
in the world generation to zero. That will eliminate lag when you breach.

Also, use a small map. A 17x257 map runs faster and saves quicker then a 257x257 map, and it pretty much has the same stuff on it. Likewise, a 17x17 map will be fastest across the board.

Butcher all cats. If the have been adopted, kill them. If needed, kill the owner.

Use smaller embark areas. A 6x6 area has something on a thousand times the space of the full 2d map from way back when. Go 3x3. There is almost nothing that can't be built in that size map.

Smooth your stone and set up dedicated cleaners. There is speculation that dwarves clean up near meeting halls, so use them to hit dirty spots. Set up a bath for your dwarves between the dining room and the meeting hall, or other path every dwarf walks. A 2 deep chunk of water will clean your dwarves nicely.

Set you cap to 100 and the child cap to zero.

Invest in more ram. DF can eat up a ton of ram space.

Turn off cave ins.
Digging out lots of stone does cause FPS problems. Atomsmash your spare stone for extra FPS.

Blood's also a pain. If you can get DFHack, it has a script for cleaning up blood, at any rate. You can also turn invaders off, but that spoils the fun.

You can also generate fewer caverns, and embark on flattish sites. I have a 5-year old laptop which can run about 70-80 FPS on a flat, shallow site lacking running water with 50-60 dwarves.

EDIT: Nearly forgot - spiral ramp staircases. Not normal ones, but a big circular corkscrew going through your fort. Your FPS will love you.

Thank you two very much. I will be testing all of the above.
Logged
Pages: 1 [2]