Bay 12 Games Forum

Please login or register.

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

Author Topic: Hardware and Game Performance  (Read 9700 times)

CatKate

  • Bay Watcher
    • View Profile
Hardware and Game Performance
« on: November 30, 2015, 03:52:52 am »

Hey guys,

one question about hardware performance.

So far I played the game on my old notebook, about two or three years old and even then only a discounter piece and not top-of-the-notch. My 3x3 embark, surface and 1st caverns flooded with undead, ran only with 7 fps in the end. Understandable, I guess, with all these undead crawling around.

Now I have a new desktop pc, not top of the notch, but not bad either, I guess, with an SDD the game is running from, an Intel Quad Core i4460 with 3.2 Ghz, 8GB RAM and an AMD Radeon R9 380. Performance now: 10 fps.

This is not what I expected.

Now I'm wondering if this is really what is to be expected or if there is something wrong in my system (performance handicapped by ... well ... something, old driver I haven't identified yet, anything else I do not even guess ...).

Thanks for your input.

Cheers,
Cat
Logged

Shonai_Dweller

  • Bay Watcher
    • View Profile
Re: Hardware and Game Performance
« Reply #1 on: November 30, 2015, 04:02:40 am »

There'll be a detailed reply along in a bit no doubt, but basically:

1. DF is a single core programme. Your processor may have upgraded but DF won't utilise the extra cores which are the main bulk of the difference.

2. DF is a 32 bit programme. It'll only use up to 2GB (3 with some fiddling) of memory. You probably already had that in your laptop...

3. Graphics card upgrade has minimal effect on manipulating ascii characters around your screen.

4. Type of memory seems to have some impact according to some. 'Generic 2GB' 3 years ago probably isn't too different to 'generic 2GB' now.

5. Zombies are evil and conspire to throttle your hardware.
Logged

soulsource

  • Bay Watcher
    • View Profile
Re: Hardware and Game Performance
« Reply #2 on: November 30, 2015, 10:22:24 am »

First things first:
The main performance impact for dwarf fortress is CPU single thread performance. This means, that within the same CPU series, it's mainly a question of clock rate, what furthermore means that a Pentium clocked as fast as an i5 of the same generation will have nearly the same performance. Your desktop's processor is from the 2 years old Haswell series (what's actually pretty good), but it's one of the lower clockrate models on the market (3.2 GHz). From the same series there'd be much faster (regarding dwarf fortress) models available, for instance the Pentium G3470 (3.6 GHz), or even faster, the Core i3 4370 (3.8 GHz).

The other main bottleneck of Dwarf Fortress is memory speed. Haswell (officially) only supports memory speeds up to DDR3-1600. There are some mainboards that allow to overclock the memory controller and run memory at higher clock rates, but Intel doesn't guarantee that this works in a stable manner. Without buying new hardware, the only real suggestion I can give is to make sure your memory is actually running in dual channel mode. Memory timings (the latency numbers, that make memory prices go up) should have little, but measurable impact. Usually operating systems try to distribute data in such a way, that those latencies are mitigated, but that's of course not always possible.
(Side note: Intel Skylake supports much higher memory clock rates when using DDR4, but that'd require a new processor and mainboard...)

Another impact would theoretically be processor cache. But as dwarf fortress uses huge amounts of memory, one would need a gigantic cache (hundreds of MB, as available on some way to expensive server processors) to see any significant improvement.

Ah, and you might have noticed I didn't mention AMD. That's because Bulldozer (and derived) AMD processors have horribly low single thread performance. Maybe in 9 months or so AMD will be an option for dwarf fortress again, but until AMD Zen is released: No, just no.

Otherwise, what Shonai_Dweller said, with one exception: Dwarf Fortress can use 4 GB of RAM, but only when being run on 64bit Linux. Not that this would make any difference regarding performance...
Logged
Quote from: Porkins Windu
Really, DF and Metal are practically the same. Drunkenness, Death, Depression, Depravity, Despondence, Demons, Dementia, Darkness. And thats just the D's!

CatKate

  • Bay Watcher
    • View Profile
Re: Hardware and Game Performance
« Reply #3 on: November 30, 2015, 10:32:53 am »

Hey guys,

many thanks for your great answers!

Little bit disappointing, though, because the main reason for me to buy a new system was, in fact, Dwarf Fortress. Well, I guess I had this coming, buying a new system without asking around what would be good and what wouldn't. Ah, anyway, found other uses for the new system (called "mass effect", guess I will find even more after some looking), so nothing was in vain.

Seems like "new fortress time" for me I guess.

Thanks again!
Cheers,
Cat
Logged

Geltor

  • Bay Watcher
    • View Profile
Re: Hardware and Game Performance
« Reply #4 on: November 30, 2015, 01:19:58 pm »

ive been in the same spot as you, i kept gradually upgrading hardware in hopes that my performance would increase, so i can say with confidence what matters: the cpu's CALCULATIONS PER SECOND, NOT CLOCKRATE

that means, an older 3.6ghz would do a lot worse than a newer, more expensive, 2.9hgz (probably). when comparing cpus, always look for calculations per second, because thats truly what matters for dwarf fortress from my experience. note that the name calculations per second might be something else (like instructions per second, or IPS), and the benchmark tests for it is to compare cpus working time in different programs. i was surprised to find out that some cpus are faster at some programs, while slower at others than different cpus.

i also upgraded the rams speed from 1600mhz to 3200mhz, didnt seem to make any significant change in performance. same goes for "faster motherboards", which just offer a platform for all those things.

long story short... dwarf fortress is expensive :(
Logged

Dozebôm Lolumzalìs

  • Bay Watcher
  • what even is truth
    • View Profile
    • test
Re: Hardware and Game Performance
« Reply #5 on: November 30, 2015, 02:59:18 pm »

And if you don't upgrade, it's expensive on time.  :-\
Logged
Quote from: King James Programming
...Simplification leaves us with the black extra-cosmic gulfs it throws open before our frenzied eyes...
Quote from: Salvané Descocrates
The only difference between me and a fool is that I know that I know only that I think, therefore I am.
Sigtext!

Bouchart

  • Bay Watcher
  • [NO_WORK]
    • View Profile
Re: Hardware and Game Performance
« Reply #6 on: November 30, 2015, 03:00:45 pm »

Units having problems with pathing and flowing water can tank performance, regardless of computer specs.
Logged

King Mir

  • Bay Watcher
    • View Profile
Re: Hardware and Game Performance
« Reply #7 on: November 30, 2015, 07:37:28 pm »

The one thing you can do on your desktop is get faster/lower latency memory. It should make the biggest difference of any component for DF. I don't have numbers to back that up though.

Lightman

  • Bay Watcher
  • The groboclones are looking for you.
    • View Profile
Re: Hardware and Game Performance
« Reply #8 on: November 30, 2015, 09:58:48 pm »

As others have stated, memory speed and core speed (not core count nor clockrate) are probably the most important factors.

We need a demo fort to test across multiple systems and get a frame-rate sampling.  And probably a custom script/app to automate the data collection.

Logged

Geltor

  • Bay Watcher
    • View Profile
Re: Hardware and Game Performance
« Reply #9 on: December 06, 2015, 09:52:51 am »

frankly i never really understood why only the pathfinding couldnt be branched onto a different core. i understand converting the entire game to utilize multiple cores is difficult, but i am convinced so far that allowing the process of pathfinding to work on a different thread shouldnt be that of a problem.

my understanding of multiple threads is based of java's, im not sure if its the same everywhere else. but say every dwarf is simply "halted" from moving until he receives an all clear from the other thread that he has a finished path to move through? the only side effect would be that dwarves would pause a second or two before beginning to move to their destination, unless i am corrected.

doing so would pretty much solve all fortress mode lag since it revolves around pathing. as opposed to popular consensus, ive never had issues with fluid lag ever, though my computer runs well
Logged

dorf

  • Bay Watcher
    • View Profile
Re: Hardware and Game Performance
« Reply #10 on: December 07, 2015, 04:04:06 am »

Multithreading isn't easy guys...
Logged

Button

  • Bay Watcher
  • Plants Specialist
    • View Profile
Re: Hardware and Game Performance
« Reply #11 on: December 07, 2015, 04:26:47 pm »

frankly i never really understood why only the pathfinding couldnt be branched onto a different core. i understand converting the entire game to utilize multiple cores is difficult, but i am convinced so far that allowing the process of pathfinding to work on a different thread shouldnt be that of a problem.

my understanding of multiple threads is based of java's, im not sure if its the same everywhere else. but say every dwarf is simply "halted" from moving until he receives an all clear from the other thread that he has a finished path to move through? the only side effect would be that dwarves would pause a second or two before beginning to move to their destination, unless i am corrected.

You have to remember that Dwarf Fortress is essentially written in C. (Yes, I know it's actually C++, but it's still paradigmatically C and a lot of the base code was written in C proper.) That means manual thread management. In Java you can lock an object and all the threads that want to access it will just wait; in C, you've got to tell each thread that might try to use the thread-unsafe thing that it needs to check and see if it's allowed to do the thing.

That said, I wish Toady would go ahead and bite the bullet. The longer he puts it off, the harder it's going to be.
Logged
I used to work on Modest Mod and Plant Fixes.

Always assume I'm not seriously back

SmileyMan

  • Bay Watcher
    • View Profile
Re: Hardware and Game Performance
« Reply #12 on: December 07, 2015, 07:38:42 pm »

You have to remember that Dwarf Fortress is essentially written in C. (Yes, I know it's actually C++, but it's still paradigmatically C and a lot of the base code was written in C proper.) That means manual thread management. In Java you can lock an object and all the threads that want to access it will just wait; in C, you've got to tell each thread that might try to use the thread-unsafe thing that it needs to check and see if it's allowed to do the thing.

That said, I wish Toady would go ahead and bite the bullet. The longer he puts it off, the harder it's going to be.
boost::threads would do the job nicely with very little learning.

People should really understand the following though: multithreaded code is not that hard to design or write (although it's quite tricky to retrofit, even in a frame-based game). It is, however, a massive pain to debug compared to single-threaded code. Quite a lot of multithreaded programs spend a good portion of their development phase as single-threaded, especially while new features are being developed. Otherwise every problem takes at least twice as long.

Right now, my adventures are being cut short when I run into a tunnel full of horses. Unless I buy a 3600-core CPU to handle the lag, that's where the effort is rightly focused.

It says all about the alpha on the screen you ESCed past.
Logged
In a fat-fingered moment while setting up another military squad I accidentally created a captain of the guard rather than a militia captain.  His squad of near-legendary hammerdwarves equipped with high quality silver hammers then took it upon themselves to dispense justice to all the mandate breakers in the fortress.  It was quite messy.

BoogieMan

  • Bay Watcher
  • Hi
    • View Profile
Re: Hardware and Game Performance
« Reply #13 on: December 07, 2015, 10:57:19 pm »

I don't know what kind of performance boosts DF has gotten from optimization since the earlier days, and those that may exist are probably hindered by the game becoming more complex as it goes, so keep that in mind.

If memory serves, when I first played DF I had something like a 3Ghz single core Pentium CPU. Then a core2 duo 2.83Ghz. I saw some improvement from that change but not a lot, despite losing some Mhz, so that supports the CPU itself being faster internally in some fashion. I then later got a core i7 2.93. I saw something like a 3-5fps improvement. Overall not that much improvement between the statistically huge gap in the actual power differences between the three systems.

The biggest improvement by far is my current system, which is a Core i7 4790k 4Ghz that can turbo to 4.4Ghz for a single core. I saw something in the range of 20-24 FPS boosts in the same fort (during a big undead siege) from the i7@2.93 to the i7@4.

So unless you upgrade big, you probably won't notice much difference. I'm eager for the next update and it the bugfixes because in 42.02 I was still getting fresh embark FPS at year two, and that's without DFHack's improvements. So unless it was just some quick of the site, perhaps then new version runs better than even the .40 series did. At least in Fortress mode. In adventure mode some cities are so heavily populated that it takes 4 or 5 seconds to move one space.
« Last Edit: December 07, 2015, 11:00:03 pm by BoogieMan »
Logged
(╯°□°)╯︵ ┻━┻ BoogieMan, Forumscrub cancels tantrum: Seeking Dr. Pepper

Geltor

  • Bay Watcher
    • View Profile
Re: Hardware and Game Performance
« Reply #14 on: December 08, 2015, 03:18:36 am »

I don't know what kind of performance boosts DF has gotten from optimization since the earlier days, and those that may exist are probably hindered by the game becoming more complex as it goes, so keep that in mind.

If memory serves, when I first played DF I had something like a 3Ghz single core Pentium CPU. Then a core2 duo 2.83Ghz. I saw some improvement from that change but not a lot, despite losing some Mhz, so that supports the CPU itself being faster internally in some fashion. I then later got a core i7 2.93. I saw something like a 3-5fps improvement. Overall not that much improvement between the statistically huge gap in the actual power differences between the three systems.

The biggest improvement by far is my current system, which is a Core i7 4790k 4Ghz that can turbo to 4.4Ghz for a single core. I saw something in the range of 20-24 FPS boosts in the same fort (during a big undead siege) from the i7@2.93 to the i7@4.

So unless you upgrade big, you probably won't notice much difference. I'm eager for the next update and it the bugfixes because in 42.02 I was still getting fresh embark FPS at year two, and that's without DFHack's improvements. So unless it was just some quick of the site, perhaps then new version runs better than even the .40 series did. At least in Fortress mode. In adventure mode some cities are so heavily populated that it takes 4 or 5 seconds to move one space.
truthfully speaking, even with the very welcome increasing complexion of the game, the main hinderence to performance was and will remain pathfinding. as people said above, retrofitting the entire game to work with multithreading would be unfeasible and hard, but its not what, in my opinion, should be done. a slow worldgen doesnt bother me to the least.

if only the problematic area (pathfinding) would be adjusted to use different threads, then you have just made a one-time fix to performance that would not need any altering in the future (assuming you leave pathfinding code alone). it doesnt mean any future updates would have to take multithreading into consideration... people would multicored PHONES could then run a fully packed 200 dwarf fortress, sieged by hell, necromancers, goblins and elves under 100 fps!!!! (or so id like to think  :P)
Logged
Pages: [1] 2 3 ... 5