Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Dwarf Fortress performance!  (Read 2486 times)

BoogieMan

  • Bay Watcher
  • Hi
    • View Profile
Dwarf Fortress performance!
« on: July 10, 2013, 01:16:50 pm »

I've loved Dwarf Fortress long enough to have played it on more or less 3 different machines over the years. Starting with a Pentium single core that I believe had a 3.2 Ghz CPU and 2GB of RAM, to a Dual Core 2.93Ghz with 4GB, to my current Core i7 with 2.80GHz x4 w/hyperthreading, 8GB, and solid state OS and gaming drives. It's *vastly* more powerful than my previous systems. I've only noted extremely minimal improvements in game performance despite several versions being released and computer hardware making gargantuan leaps. Since the game *seems* to make either no or limited use of multiple cores, it seems like that it's performance has hit a cap that will never be improved hardware wise, because singular powerful cores have gone the way of the dinosaur in favor of multi-core machines. Maybe decades from now when we have shiny quantum computers it won't be an issue, but that's of no consequence right now. I hear that designing code for multi threading, especially on something originally designed without that in mind, is very difficult. So until the game itself is better able to utilize current and future computer design, it's up to finding more efficient ways to build your fort, limiting population and pets, certain embark elements, and some scripts that the great DFHack team is designing. And a random thought, I wonder if it would be technically possible to design multiple instances of single core program to communicate with each other and utilize more resources without being able to multithread? /headache

On that note, beyond the obvious such as what I said above and limiting embark sizes and the like, has anyone found or heard of a way that might be of some benefit? Not being an expert on such things, one would have thought the game would have run best on a machine like my old 3.2Ghz because the single core seemed to be more powerful, and better/more RAM and Video cards don't seem to mean that much to the game. However I am quite sure it runs best on my current machine and looking at the performance monitor I have seen it running on multiple cores. If that's a result of Windows knowing how to shuffle the load around despite the program not being designed for it, or the game actually having limited threading support I am not sure. Even when the game gets bogged down so much as to be unplayable, it's still barely utilizing the power of my processors despite it seeming to at times use more than one of them. At most I think it's used just over 20%. So I assume there is perhaps some kind of computational overhead or a bottleneck in the coding that means it doesn't matter how much extra power you have available.

Does anyone here have access to older server style rigs that had the large single cores that they have tested the game on? Did you notice anything different from your modern system? I've also heard of some motherboards and CPUs having the ability to power down extra cores and overclock a single core. I think my current system has that enabled, but it doeskin' seem to kick in for DF. And the other games I play are newer and either don't need more power or can utilize the extra cores. Most older single core games probably aren't complex enough to use more than a single core of modern systems now anyway, so I haven't been able to reliably test it.

Maybe something like this already exists, and if it does please direct me to it, but if not I wonder if anyone else would find it interesting... That would be having someone who can design perhaps two purely vanilla large old forts, one designed as efficiently as possible, and the other just kind of being made up as it went without extra concern for pathing efficiency. Probably duplicating the initial embark save so they'd have the same general environmental impact. And then uploading it somewhere that everyone can access it. This would be for the purpose of removing variables for more reliable testing for different machine configurations, drawing modes, performance enhancing scripts and the like. People could report performance and their systems and look for what seems to work best with no externally imposed variables. For example I know there is a thread where people voted on which printing mode performed the best for them, but being that each fort was different it doesn't really establish anything concrete.

Overall I'm curious about what thoughts or insights my fellow players have. Even if it's something as simple as proper ways to paint traffic designations, hallway width or something else seemingly mundane. What part of the fort is responsible for most of the calculations and should the most care be used when designing? Is it the meeting rooms where tons of pets and Dwarves are gathering and interacting, affecting each other's pathing, temperature and the like? Paths to major stockpiles? To the food/alcohol? I've heard about blocking off depleted/obsolete mining areas, but while I always do, I don't notice any real improvement. So what do you all think?
« Last Edit: July 10, 2013, 01:21:58 pm by BoogieMan »
Logged
(╯°□°)╯︵ ┻━┻ BoogieMan, Forumscrub cancels tantrum: Seeking Dr. Pepper

ORCACommander

  • Bay Watcher
  • [ETHIC:TORTURE_ELVES: PERSONAL_MATTER]
    • View Profile
Re: Dwarf Fortress performance!
« Reply #1 on: July 10, 2013, 04:14:00 pm »

Quote
And a random thought, I wonder if it would be technically possible to design multiple instances of single core program to communicate with each other and utilize more resources without being able to multithread? /headache
that is a more advanced form of multi threading, look up network render farms. and toady does not really know how to code for multi core and is very unsure how to split apart the different tasks in order to multithread.

DF is limited in that it will only use 2 cores, 1 core for everything except the graphics engine. that one it shunt onto another core and windows will try and move as many processes as it can over to other cores to reduce the load on the primary core df happens to be on.

the core power down part, windows can tell itself not to use certain cores if configure it to do so. and nothing running under windows will access these. windows is programmed to reduce core clock and voltage if running on a battery source.

pathing is the biggest single calculation running in the game. temperature jitter can be pretty bad in item heavy forts. however if it is not moving it is not pathing.

DF performance is based primarily in 4 variables, Processor Speed, Processor Cache size, RAM speed and Timings, Processor Cache speed. right now it appears that how fast the cpu can interactive with the ram is the biggest factor in performance followed by cache size.

on a side note, in the consumer market they can not clock beyond 3.6 ghrz is because at the point water cooling becomes necessary or the proc companies would have to manufacturer higher quality heatsinks and thermal intermediary medium. and when you hit 5GHrz you get quantum interference and require liquid N2
Logged

Snaake

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress performance!
« Reply #2 on: July 12, 2013, 12:00:03 am »

Your CPU progression is interesting. I went from singlecore (2GHz?) to a similar singlecore laptop to my current quadcore 3.2 GHz.

There's some fixes for eg. temperature jitter available as binary patches, or you can just get the latest PE LNP which has them included, like me. The pathing does cost a lot, and you seem to have read up on it some... IIRC the SCIENCE thread that looked into it hollowed out huge cubes of empty space for flyers to path around in, amd blocking those off did have    a significant effect. So the worst design for pathing would probably be just huge open dug-out areas without walls. I doubt it's worth compacting much from the "standard" scale of 3-wide hallways and 11x11 rooms.
Logged

fricy

  • Bay Watcher
  • [DFHACK:ZEALOT]
    • View Profile
Re: Dwarf Fortress performance!
« Reply #3 on: July 13, 2013, 07:49:42 am »

Try out accelerated modest mod or Masterwork, both of these mods reduce the number of item types in the game resulting in better performance. I've been playing with MW for a couple of months now, then started building a test fort in vanilla, and forgot to set a  population cap, so I ended up with 140+ dwarves instead of the 40 I wanted... :) Long story short: with lot's of dwarves I get about the same fps with temperature turned off in vanilla, as in MW with temperature on. Also: A lot more clutter, god all those x(socks)x!!!