Bay 12 Games Forum

Please login or register.

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

Author Topic: REPORT FOR TOADY: CPU and Memory Hogging -- What is slow  (Read 3493 times)

nagromo

  • Bay Watcher
    • View Profile
Re: REPORT FOR TOADY: CPU and Memory Hogging -- What is slow
« Reply #15 on: November 06, 2007, 09:22:00 pm »

quote:
Originally posted by Frobozz:
<STRONG>
I haven't looked at Wine much I mostly just run it. But I'm going to assume that it isn't a direct one-to-one remapping of the calls. The only way that would be possible is if Linux had at least all the calls that Windows has. That isn't likely.
</STRONG>

It doesn't need to be; it's still O(1). For some particular Windows function, Wine may have to translate from a Win32 data structure to an X11 data structure and call 3 shorter Linux functions, but it's still just a remapping that will take an extra 300 clock cycles (made-up example number).

Wine should give a constant slowdown for each Windows function called. The game uses lots of CPU on game logic and very little on rendering and interfacing. All of Wine's slowdowns should happen in the interfacing and rendering part of the code, which is very little of the total CPU time.

Unless Toady uses Windows-specific functions all over the game logic and inner loops (pointless/overly complicated), Wine will have much less slow-down on DF than it does on most Windows programs.

quote:
<STRONG>
Of course specs aren't necessary because, as I said, I've already tested under XP and Linux. There is a visible speed decrease. Oh and I am running official NVidia drivers before anyone asks. Believe it or not, I get more FPS under Linux than Windows typically.</STRONG>

So if you typically get more FPS on Linux, this indicates that Wine doesn't have a significant performance cost for DF.

Logged

The13thRonin

  • Bay Watcher
  • Profession: Handsome Rogue
    • View Profile
Re: REPORT FOR TOADY: CPU and Memory Hogging -- What is slow
« Reply #16 on: November 06, 2007, 10:29:00 pm »

The game is 'playable' at the moment but weather, path finding, temperature and fluids are all real killers at the moment. I'm confident Toady will find new and innovative ways to optimize his code so that we get the most out of our current technology.
Logged
I'm Digging Deeper... AGAIN... You Should Too!

Dig Deeper DIAMOND - 750+ items of new content including; new plants, new creatures, new metals, new woods, new gems, new stones, new crafts and much, much more.

Frobozz

  • Bay Watcher
    • View Profile
Re: REPORT FOR TOADY: CPU and Memory Hogging -- What is slow
« Reply #17 on: November 06, 2007, 11:17:00 pm »

quote:
<STRONG>So if you typically get more FPS on Linux, this indicates that Wine doesn't have a significant performance cost for DF.</STRONG>

I worded that badly. I intended to indicate that I get more FPS under 3D applications and games.

 

quote:
<STRONG>I'm confident Toady will find new and innovative ways to optimize his code so that we get the most out of our current technology.</STRONG>

Toady is definitely a good programmer. But even if he finds innovative ways to optimize his code any performance increases achieved are likely to be offset quite a bit as he adds new features.

Multithreading is really one of the better ways to go. Not every has multiple cores right now - but what about when the game hits 1.0? A good nine months passed between updates and that was only a minor version increase. I suspect by the time the game is considered beta that the majority people will possess multiple core systems.

Of course another possibility occurred to me. If the parts involving the terrain, temp, and weather could be made to work through multiple threads then why not make a version that uses the GPU to do the calculations?

[ November 06, 2007: Message edited by: Frobozz ]

Logged

Zemat

  • Bay Watcher
  • Zemat, programmer, cancels coding: Too insane.
    • View Profile
Re: REPORT FOR TOADY: CPU and Memory Hogging -- What is slow
« Reply #18 on: November 06, 2007, 11:34:00 pm »

Seeing the huge boost in performance in some details that are common both in pre-Z-DF and post-Z-DF and then the later boost from 32a to 33a I guess Toady is really getting the hang on how to optimize the code. I hope there's still a lot of room for improvement in performance before requiring a full rewrite. Because I don't want Toady spend one or two years just rewriting the code instead of adding new features.

Also, something I learned from my stints as a software engineer (...shudders) is that sometimes rewrites come too early and improve nothing. And I say this as a compulsive software rewriter. Most of the time the greatest performance issues are just bug-related and can be fixed by just moving or erasing a line of code of two.

[ November 06, 2007: Message edited by: Zemat ]

Logged
You too can help bring to life the RogueLife Project!

Bien

  • Bay Watcher
    • View Profile
Re: REPORT FOR TOADY: CPU and Memory Hogging -- What is slow
« Reply #19 on: November 07, 2007, 04:01:00 am »

I got a P4 1.7 GHz CPU, 633 MB RAM, running with temperatures on and I'm still maxing my FPS cap of 100, lucky me, I guess.
Logged

The13thRonin

  • Bay Watcher
  • Profession: Handsome Rogue
    • View Profile
Re: REPORT FOR TOADY: CPU and Memory Hogging -- What is slow
« Reply #20 on: November 07, 2007, 06:32:00 am »

quote:
Originally posted by Bien:
<STRONG>I got a P4 1.7 GHz CPU, 633 MB RAM, running with temperatures on and I'm still maxing my FPS cap of 100, lucky me, I guess.</STRONG>

With a huge map including magma though? I doubt it.

NINJA EDIT - I believe that this lag sucks  :(. I foresee two outcomes. Toady will optimize the code OR we'll just have to wait until stronger/faster processors come out that are able to handle Dwarf Fortress in all its epic scale glory.

[ November 07, 2007: Message edited by: The13thRonin ]

Logged
I'm Digging Deeper... AGAIN... You Should Too!

Dig Deeper DIAMOND - 750+ items of new content including; new plants, new creatures, new metals, new woods, new gems, new stones, new crafts and much, much more.

Guilliman

  • Bay Watcher
    • View Profile
Re: REPORT FOR TOADY: CPU and Memory Hogging -- What is slow
« Reply #21 on: November 07, 2007, 08:07:00 am »

Detailed report of my findings and observations:
I run a AMD x2 5800 dualcore ofc
2gig of ddr2 ram, 800mhz


My findings:

FPS drop when
-creatures (inc dwarfs) run over each other but attempt to go diagonally.
-Huge differences in cliff heights (I noticed a small map with rather big cliff differences (4-5) has my maxed out fps of 250) while others have a higher cliff variation i run aground to 40fps. I'm thinking in the area of amount of different stone, the 250fps area had only 3 different stone layers and 3 sand ones.
-Water has no affect on fps, not for me at least, apart from flooding something with a 100x100x10 reservoirs, and even then, the fluid algorithm is very smooth.
-stairs/ramps cause a huge drop in fps, My guess is, dwarfs attempt to go diagonally up or down (i build multiple wide stairs/ramps)
-I still think there's a connection with lower fps when i look trough more starting zones (like toady mentioned he fixed it. I think a part is still there.)


So far thats on the top of my head what i came to find.


edit for spelling
edit 2 for this:

Perhaps toady can change the game so that it used the graphic card to do all the path finding algorithms. Or at least some of them, with an option to scale/put it on off in the ini.


[ November 07, 2007: Message edited by: Guilliman ]

[ November 07, 2007: Message edited by: Guilliman ]

Logged

schm0

  • Bay Watcher
    • View Profile
Re: REPORT FOR TOADY: CPU and Memory Hogging -- What is slow
« Reply #22 on: November 07, 2007, 09:33:00 am »

Well, I guess it's my turn:

My System Specs say:
AMD Athlon 64 Processor 3400+, 1.8 Ghz
896 MB (1 GB> ) RAM

(I downloaded a program and it analyzed my computer and said I had 2.4 GHz. Perhaps my processer is overclocked?)

My first map had a magma vent. As soon as I had about 40 dwarves, I was averaging about 35 FPS. On my latest map, I have a brook and no surface magma and I average 60-70 FPS but haven't had my first immigration.

On both maps, I am building underground sewers that will be used to drain some of the local lakes and hook into the brook for a permanent water source for farming. Draining the lakes does create lag, but as soon as the water sources are settled, they jump back up. This is to be expected. I think the magma vent causes more FPS lag because it is trying to calculate any possible shifts every so often for X amount of Z-axis layers. In the case of the former fortress, it went down 18 levels. That's a lot of fluid to calculate, but is only about 30 FPS less than without magma altogether. Perhaps a magma vent should need no calculations until tiles surrounding it are modified or accessing the fluid itself has begun?

I also think that graphic card and multithread support should be implemented as soon as possible to take the load off the CPU. I think a lot of us will find a huge increase in FPS once this is supported.

[ November 07, 2007: Message edited by: schm0 ]

Logged
schm0
-------------
Nuk: lol schm0, u r da funnay
Nuk: i lik u

hactar1

  • Bay Watcher
    • View Profile
Re: REPORT FOR TOADY: CPU and Memory Hogging -- What is slow
« Reply #23 on: November 07, 2007, 09:59:00 am »

I've played on 2 computers... an Athlon64 3500+ with 1G of ram, and a Core2 Duo Xeon at 2.66 GHz per core, 2 GB ram.  The Athlon doesn't handle large maps well, at least not always.  The Xeon handles most everything well enough.

The only thing I've noticed that slows me down consistently is defining a meeting area or sculpture garden.  It's not really a performance-specific issue though, but about half my dwarves and every single stray animal will instantly descend upon the new meeting area and turn it into a dwarven moshpit of laggy doom.  It was even worse in .32a when prone creatures caused lag.

Logged

Mover#005

  • Bay Watcher
    • View Profile
Re: REPORT FOR TOADY: CPU and Memory Hogging -- What is slow
« Reply #24 on: November 07, 2007, 12:09:00 pm »

2,4 GHz Core 2 Duo & 2 GB RAM & Linux WINE

No lag (as long as I don't do stupid things like pike a huge area in a lively region etc.)

Adventure Mode is nearly unplayable, through

quote:

...

The second way is probably by far the hardest optimization of all - multithread the engine. Processor technology at this point is heading rapidly towards multiple cores for processing data and, while currently there are still reasonable increases in speed for individual cores, that is bound to slow down a good deal at some point. Tom's Hardware recently previewed a new CPU from Intel called Penryn. On the last page of that article they express the opinion that a version of it could be made with eight cores.

[ November 06, 2007: Message edited by: Frobozz ][/QB]


Jesus... who even does NEED something like this?

[ November 07, 2007: Message edited by: Mover#005 ]

Logged

Mover#005

  • Bay Watcher
    • View Profile
Re: REPORT FOR TOADY: CPU and Memory Hogging -- What is slow
« Reply #25 on: November 07, 2007, 12:20:00 pm »

*please delete*

[ November 07, 2007: Message edited by: Mover#005 ]

Logged

Mover#005

  • Bay Watcher
    • View Profile
Re: REPORT FOR TOADY: CPU and Memory Hogging -- What is slow
« Reply #26 on: November 07, 2007, 12:21:00 pm »

As an afterthought, I think you can screw up your game big time performance-wise with strange Fortress-layouts. I myself have written a fair share of pathfinding-algorithmns and finite state machine AIs and some designs which I see here or in the maparchive give me toothaches just looking at them. Alllthough I can't say how toadys engine works, some Pointers maybe (and please take them with a grain of salt):

1. Use the new Z-Axis. don't build a large fortress on just one Level. It isn't good for your efficency of the fort and pathfinding has to find a way from one end to the other.

2. Avoid open Spaces in your designs. more open titles = more possible Pathnodes.

3. Avoid locked doors and other toggleable blockages. I have the feeling they piss the pathfinder off big time if not used correctly.

4. Use Traffic-zones. Your dwarfs may find the best and shortest path anyways but they algorithm will thank for your help with less intensive cpu-hogging if you point out the clearly best titles.

I'm sure someone with the right background can add a few tips.

[ November 07, 2007: Message edited by: Mover#005 ]

Logged

Trukkle

  • Bay Watcher
    • View Profile
Re: REPORT FOR TOADY: CPU and Memory Hogging -- What is slow
« Reply #27 on: November 07, 2007, 06:40:00 pm »

I'd love it if flows 'slept'. Having a whole load of 5s and 6s zooming around idefinatly after making a large pool can't be processor friendly. Perhaps making pools even out to the most common of the two numbers instead of jiggling them around in a constant effort to level the surface?

My computer's getting old, but if I could find the parts, I'd upgrade it to it's technical limit before buying a new one.

Athlon 2400+ (2GHz)
1.5 GB RAM
Windowed, no graphics, [G_FPS_CAP:10]

Dwarf mode, I chug when hauling a lot, even when there's a straight line from the thing to be hauled, to the space it's being hauled to and when I use pumps, even when off screen. Adventure mode is pretty impossible to play due to slowdown and crashes when trying to visit a fortress site, but I've yet to find a pattern to that.

Logged
He needs distractions to get through the working day.

Frobozz

  • Bay Watcher
    • View Profile
Re: REPORT FOR TOADY: CPU and Memory Hogging -- What is slow
« Reply #28 on: November 07, 2007, 07:01:00 pm »

quote:
Originally posted by Trukkle:
<STRONG>My computer's getting old, but if I could find the parts, I'd upgrade it to it's technical limit before buying a new one.</STRONG>

Who made your motherboard and what model is it? If you're using Socket A then you'll be hard pressed to find a faster processor - AthlonXPs used are mostly the same price as they were new and often more money than simply buying a new board and dual core processor.
Logged

Trukkle

  • Bay Watcher
    • View Profile
Re: REPORT FOR TOADY: CPU and Memory Hogging -- What is slow
« Reply #29 on: November 07, 2007, 08:04:00 pm »

quote:
Originally posted by Frobozz:
<STRONG>
Who made your motherboard and what model is it? If you're using Socket A then you'll be hard pressed to find a faster processor - AthlonXPs used are mostly the same price as they were new and often more money than simply buying a new board and dual core processor.</STRONG>

(ASROCK K7NF2-RAID, if you're interested)
I've just come back from researching just that, and yeah. Processors aren't available, or if they are they're still at their 2003 prices :/
Looks like I'll be saving up for a whole new PC. I can run Bioshock fine and not feel the need to upgrade, but Dorfs bring me to my knees, wallet-in-hand.
Damnit Toady >:(

Missed it in my spec post, so: Average FPS of 45 with around 40 beardy, foul smelling, blood/mud/water/vomit soaked, ale quaffing, Elf kicking Dwarves, 10 tame animals and no surviving wildlife.

Logged
He needs distractions to get through the working day.
Pages: 1 [2] 3