Bay 12 Games Forum

Dwarf Fortress => DF Dwarf Mode Discussion => Topic started by: thebigJ_A on October 03, 2010, 09:28:53 pm

Title: make it run faster
Post by: thebigJ_A on October 03, 2010, 09:28:53 pm
Hey all.
From watching the tutorial vids, it seems like my game runs alot slower than it should. It takes hours and hours for a season to go by, and my dwarfs are walking at like half the speed I see in the vids. It took me two long nights play to go from spring to winter.

I tried setting the game's affinity so it only ran on one of my two cores (I have an AMD 64x2). That definitely helped (my lil guys are moving maybe 3/4ths as fast, maybe), but I'm wondering if you guys have any other suggestions to get my game to run faster.

I appreciate any and all ideas.
Title: Re: make it run faster
Post by: darkrider2 on October 03, 2010, 09:30:55 pm
If your playing the game right you should be happily enjoying the cripplingly low FPS.

I'm afraid we may have to work on your technique.
Title: Re: make it run faster
Post by: fivex on October 03, 2010, 09:31:40 pm
In the init file(data>init>init.txt) change FPS:NO to FPS:YES
Start up the game the load your fort.
While unpaused, what does the FPS counter say?
Title: Re: make it run faster
Post by: FleshForge on October 03, 2010, 09:43:00 pm
It's pretty normal for game speed to decline as you gradually build up your fort.

Forcing any app to run on a single core, for a multicore machine, is generally a pretty bad idea, but whatever makes you happy.
Title: Re: make it run faster
Post by: thebigJ_A on October 03, 2010, 10:08:05 pm
It seems to hover around 25 (20). And my fort isn't particularly large. Hell, I've only got 15 dwarves.

@FleshForge: I've been told that, since many games don't support multithreading, setting affinity is a good thing if the game isn't running well. It definitely helps, especially with older games. There's little to no risk, from all I've heard/looked up.
Title: Re: make it run faster
Post by: fivex on October 03, 2010, 10:09:29 pm
It seems to hover around 25 (20). And my fort isn't particularly large. Hell, I've only got 15 dwarves.
I...
what.
What is your system specs?
Title: Re: make it run faster
Post by: thebigJ_A on October 03, 2010, 10:26:55 pm
AMD Athlon 64x2 4400+ ~2.3 GHz
2 GB RAM
ATI Radeon 4600 series (4650 i think)

Any other info that'd be helpful?
Title: Re: make it run faster
Post by: Emily on October 03, 2010, 11:28:24 pm
What size embark?

And how deep does it go?  ...I've had maps that went down about 50 layers run twice as fast as the ones that went down 150, despite there being nothing in those bottom layers
Title: Re: make it run faster
Post by: thebigJ_A on October 03, 2010, 11:53:00 pm
Just  the default 3x3. My fort starts on the surface at 143, and the very bottom of the map is -20something. I haven't dug very deep, apart from a stairwell that goes down to level 73,but that's just 4 tiles of up/down squares.
Title: Re: make it run faster
Post by: thebigJ_A on October 03, 2010, 11:59:39 pm
I just tried something I read in the wiki, lowering the G FPS cap, but that had no effect at all.

This is really annoying. According to the wiki, my pc is far above minimum requirements, and I should be getting near the 100fps cap I have set.

I'm maxing around thirty. While the game is pefectly playable, it takes forever to accomplish anything.
Title: Re: make it run faster
Post by: Raging Mouse on October 04, 2010, 03:02:58 am
How much moving water do you have in your embark?
Title: Re: make it run faster
Post by: fivex on October 04, 2010, 03:04:25 am
The only thing I can think of that would lower your fps in this case is the magma flowing into the circus or a lot of flowing water
Title: Re: make it run faster
Post by: LoSboccacc on October 04, 2010, 03:13:48 am
Just  the default 3x3. My fort starts on the surface at 143, and the very bottom of the map is -20something. I haven't dug very deep, apart from a stairwell that goes down to level 73,but that's just 4 tiles of up/down squares.


this. stairs kills fps, for no particular reason. I used to dig a 3x3 staircase to hell a la Led Zeppelin, but that is very very bad on the pathfinder.

now I'm using something like this:


odd level

WWWWWW
W.....W
W.v^v.W
W.^W^.W
W.v^v.W
W.....W
WWWWWWW

even level:

WWWWWW
W.....W
W.^v^.W
W.vWv.W
W.^v^.W
W.....W
WWWWWWW




W wall
. space
v ramp down
^ramp up
Title: Re: make it run faster
Post by: Vehudur on October 04, 2010, 03:44:09 am
As said before, efficient stairs are critical.  In fact, do not use stairs, use ramps.  And if you must use a stair, do NOT use an up+down stair.

Mine look like....

Code: [Select]
Exits can, well, exit from any W tile on the edge.

W=wall
X=open space
^=up ramp
V=down ramp

Single "stairwell" even level
WWWWW
W   W
W^ VW
W   W
WWWWW
Single "stairwell" odd level
WWWWW
W   W
WV ^W
W   W
WWWWW


Large "stairwell" even level

The center has an access every 10th level and the outer areas are marked as low restricted,
so if a Dwarf can use the inner one he will.
WWWWWWWWWWWWWW
W            W
W            W
W   XXXXXX   W
W   X    X   W
W^^ W^XVWX VVW
W   X    X   W
W   XXXXXX   W
W            W
W            W
WWWWWWWWWWWWWW

Odd level

WWWWWWWWWWWWWW
W            W
W            W
W   XXXXXX   W
W   X    X   W
WVV WVX^WX ^^W
W   X    X   W
W   XXXXXX   W
W            W
W            W
WWWWWWWWWWWWWW

Title: Re: make it run faster
Post by: LoSboccacc on October 04, 2010, 03:51:05 am
yeah any design will apply, even rotating ones, it's just that I'm fixated with compactness and symmetry of the main up/down pathway. =P
Title: Re: make it run faster
Post by: beekay on October 04, 2010, 09:42:58 am
Uhh, no, stairs are significantly more fps-efficient than ramps, and faster for dwarves to boot.

If you're using a recent version, open up init.txt and change [PRINT_MODE:2D] to [PRINT_MODE:STANDARD]. This should give you a rather large fps boost. Other than that, try this thread (http://www.bay12forums.com/smf/index.php?topic=66871.15) for extra tips.
Title: Re: make it run faster
Post by: LoSboccacc on October 04, 2010, 10:43:14 am
high stack of adjacent up/down stair are a very repeatable fps killer

also you got it wrong, stairs take one step to change level and one to move in any other direction, while stairs you get in one step down and in an adjacent square
Title: Re: make it run faster
Post by: zilpin on October 04, 2010, 11:37:18 am
fixed:
Quote
...stairs take one step to change level and one to move in any other direction, while ramps you get in one step down and in an adjacent square

Though, from an FPS perspective, ramps require more computer thought per step, probably because they have to check for the correct adjacent wall.
If ramps were stored with directional data, then ramps would probably not have that FPS penalty.

Pathfinding is always the biggest FPS killer in DF.
Can't blame Almighty Toad, though.  Pathfinding programming is always difficult, and not fun to do.  For a lot of work, there is very little visible reward.  Even implementing known, well-documented algorithms is a pain ( A*, D*, etc).

Title: Re: make it run faster
Post by: LoSboccacc on October 04, 2010, 12:01:04 pm
yeah, path finding on a dynamic terrain does nasty things to your cpu cache

my fortress has a big warning signpost for migrants to see: "we kill cats on sight, please be advised"

burrows also help a bit. but I'm unsure if it's because of restricted pathing searching for local solutions or because dwarves are using more of local near resources instead of better far ones.
Title: Re: make it run faster
Post by: helf on October 04, 2010, 12:38:08 pm
You could do the typical init changes such as disabling temp and weather and what not. Should help some.
Title: Re: make it run faster
Post by: BurnedToast on October 04, 2010, 12:53:19 pm
In my experience using fancy 'ramp' stairway setups is much laggier then just slapping a generic up/down stairway column in the middle of the fort.

I've not done extensive testing, but my fancy stairway forts have always been much laggier then my lazy up/down column forts.
Title: Re: make it run faster
Post by: drvoke on October 04, 2010, 02:17:33 pm
In my experience using fancy 'ramp' stairway setups is much laggier then just slapping a generic up/down stairway column in the middle of the fort.

I've not done extensive testing, but my fancy stairway forts have always been much laggier then my lazy up/down column forts.

They also dig up more stone.  Stair columns are also much quicker to designate using just what's available in game.  Connecting floors via hallways (whether using stairs or ramps) has always been a defensive consideration for me, since the FPS benefit doesn't seem that great.

For the OP, it seems like the game should still be hitting 100 fps at this point.  If your stair column is currently only 4 levels tall, that's not going to be your problem.  Running water calculations can easily destroy FPS if you have an extensive amount of exposed, flowing liquid on your map.  Your FPS should only be dropping to that point once you have a magma or waterworks running, you've pierced every level of the caverns, and have 2000 stone lying around.

How many different embarks have you tried?  Do they all give the same speed results?  Are you running some pre-genned world to follow along with a tutorial, or generating your own world?  Also, what version?  25 FPS with 15 dwarves is pretty ridiculous.
Title: Re: make it run faster
Post by: janglur on October 04, 2010, 02:22:38 pm
It's pretty normal for game speed to decline as you gradually build up your fort.

Forcing any app to run on a single core, for a multicore machine, is generally a pretty bad idea, but whatever makes you happy.

Actually, since DF is single-threaded, it experiences a significant boost for being assigned to a single core.
For example, my fort runs at a steady 41 FPS on a highly dedicated core, but set to all three cores, it falls to 32 FPS.  A big difference.
Title: Re: make it run faster
Post by: FleshForge on October 04, 2010, 02:40:31 pm
I'll try this, but in my experience with a lot of other apps that are single threaded, forcing processor affinity has never done anything good and has sometimes been bad for overall machine utility, e.g. you try to start another app and for whatever reason it wants to get on the busy core, but can't, so it stalls.  Although my board/processor is a quad core, it's fairly old now (4 years I think?) as is my OS (Windows XP 64-bit), so that may have something to do with it.
Title: Re: make it run faster
Post by: Vehudur on October 04, 2010, 02:45:12 pm
No one has yet explained to me why I get 100fps until endgame when I drop to 50 - 70 and I have a single core computer (because my new one still isn't here), unless I'm dumb enough to embark by where 3 major rivers meet or something like I just did.  bad idea.  really bad idea.  Getting 60 fps in the second year here.  Although it's really cool, 2 go over waterfalls and everything.
Title: Re: make it run faster
Post by: FleshForge on October 04, 2010, 03:11:19 pm
Object count goes way up, tables of data in memory get larger, data becomes too large to keep in an optimal address space, job calculation becomes more complex, pathfinding becomes somewhat more complex, underground flora covers more tiles, etc etc etc.
Title: Re: make it run faster
Post by: janglur on October 04, 2010, 03:13:24 pm
I'll try this, but in my experience with a lot of other apps that are single threaded, forcing processor affinity has never done anything good and has sometimes been bad for overall machine utility, e.g. you try to start another app and for whatever reason it wants to get on the busy core, but can't, so it stalls.  Although my board/processor is a quad core, it's fairly old now (4 years I think?) as is my OS (Windows XP 64-bit), so that may have something to do with it.

You also have to force other processes off DF's core.  (Make sure that's not core0, tho).  Especially Explorer.exe

Use Process Explorer.  It can offload almost everything, including system and hardware.  I use it for major gains.
Title: Re: make it run faster
Post by: Emily on October 04, 2010, 05:47:34 pm
Just  the default 3x3. My fort starts on the surface at 143, and the very bottom of the map is -20something. I haven't dug very deep, apart from a stairwell that goes down to level 73,but that's just 4 tiles of up/down squares.

...the default is 4x4, I believe....

Anyway, that depth alone, without any actual breaching of caves and such has caused notable lag on my computer--which is not a very fast one, it should be noted--compared to a shallower site.  Also this is at very low populations so pathfinding shouldn't be an issue yet.
Title: Re: make it run faster
Post by: helf on October 04, 2010, 08:53:13 pm
No one has yet explained to me why I get 100fps until endgame when I drop to 50 - 70 and I have a single core computer (because my new one still isn't here), unless I'm dumb enough to embark by where 3 major rivers meet or something like I just did.  bad idea.  really bad idea.  Getting 60 fps in the second year here.  Although it's really cool, 2 go over waterfalls and everything.

What cpu and ram speed? You probably have really low memory latency and high bandwidth. It helps a lot.

Also, ProcessExplorer is nice though I use DTaskmanager. I like it a lot, its located here - http://dimio.altervista.org/eng/
Title: Re: make it run faster
Post by: thebigJ_A on October 04, 2010, 10:11:23 pm
Uhh, no, stairs are significantly more fps-efficient than ramps, and faster for dwarves to boot.

If you're using a recent version, open up init.txt and change [PRINT_MODE:2D] to [PRINT_MODE:STANDARD]. This should give you a rather large fps boost. Other than that, try this thread (http://www.bay12forums.com/smf/index.php?topic=66871.15) for extra tips.

I tried that, that's what bumped me up to 30. I did get a collapsed cavern message at the beginning of embarking, so idk if that has anything to do with it.

I decided to try another embark. This time I'm getting higher fps, around 50, but that's with my 7 dwarves (do woe use 'dwarfs' or 'dwarves' in this game?) and the wagon, before I've even dug anything, so I'm a bit concerned it'll drop to 30 once I start digging.
Title: Re: make it run faster
Post by: janglur on October 05, 2010, 12:23:42 am
Basically, it will.

If you have no running water on a 3x3 area and embark with less than 100 FPS, your computer just simply needs an upgrade.  Otherwise, learn to deal with the slowness, or consider using Nanofort or whatever it's called.  It's a mod that lets you use 1x1 embark areas, which are insanely fast even with many dwarves.

Also turn off temperature and weather.
Title: Re: make it run faster
Post by: LoSboccacc on October 05, 2010, 02:21:28 am
In my experience using fancy 'ramp' stairway setups is much laggier then just slapping a generic up/down stairway column in the middle of the fort.

I've not done extensive testing, but my fancy stairway forts have always been much laggier then my lazy up/down column forts.

with that you mean a single up/down column? because I was meaning a 3x3 or more up/down column
single 1x1 column is not so critical, but will slow down dwarves.
Title: Re: make it run faster
Post by: thebigJ_A on October 05, 2010, 02:34:07 am
Well, buyin a better comp just isn't an option for me. I could learn to live with the slowness, except that, according to the magmawiki, my pc should be getting 100fps at embark, or nearly so.

I used process explorer to set everything to core 0 and DF to core 1, and defragged my hard drive (even though it didn't really need it).

I started yet another embark, which is getting 60fps in the very beginning. It's an improvement, but still not where I'd like it to be. I've reached the limit of my limited computer expertise. If there's nothing else I can do, then so be it, but maybe somebody with better computer know-how has some advice? Something I could do with my graphics card or comp or something?

I'd really hate to turn off weather and temperature, and a 1x1 fort seems so... small.

Thanks for the help, everyone.
Title: Re: make it run faster
Post by: Duuvian on October 05, 2010, 02:49:36 am
Try changing the init settings to partial print mode. That always seems to help speed up my games.
Title: Re: make it run faster
Post by: thebigJ_A on October 05, 2010, 05:55:49 am
Try changing the init settings to partial print mode. That always seems to help speed up my games.

I tried turning that on before with the DF Init utility, but it makes the screen flicker terribly.
Title: Re: make it run faster
Post by: BurnedToast on October 05, 2010, 07:06:08 am
In my experience using fancy 'ramp' stairway setups is much laggier then just slapping a generic up/down stairway column in the middle of the fort.

I've not done extensive testing, but my fancy stairway forts have always been much laggier then my lazy up/down column forts.

with that you mean a single up/down column? because I was meaning a 3x3 or more up/down column
single 1x1 column is not so critical, but will slow down dwarves.

I usually do either 2x2 or 3x3, depending on what fits with the rest of the fort design. Even with 2x2 I never see them crawling over each other so it's just aesthetics if I decide to go with 3x3.
Title: Re: make it run faster
Post by: zilpin on October 05, 2010, 12:31:11 pm
I typically do a 5x5 column, then put storage around it for common items (booze, furniture, mechanisms, specialty food, booze).
Corridors go at angles away from it.

I used to do all kinds of ramp tricks in my central stair, to quicken diagonal vertical movement, but that hurt FPS.  I'd rather keep decent FPS than save my dorfs 10 steps.

My favorite trick had no stairs, but rather had criss-crossed diagonal ramps connecting diagonal corridors on every level, then putting floor hatches over the ramp so it could be walked across on the same level.  Was awesome for the dorfs, they could get from anywhere in the fort to anywhere else with nearly a direct straight line across z-levels, but the combination of ramps with floorhatches always opening and closing KILLED my fps.


I wish we could give a special "highway" designation, which was always assumed passable and blockages never caused re-pathing.  It would be a simple change in code, and could have enormous benefits when used correctly (and disastrous when incorrectly).
The high-traffic designation does do that, so re-pathing still occurs.

I would absolutely take on writing optimization for pathing, if Toady threw the pathfinding related source code at me.
Title: Re: make it run faster
Post by: veok on October 05, 2010, 03:41:10 pm
Just  the default 3x3. My fort starts on the surface at 143, and the very bottom of the map is -20something. I haven't dug very deep, apart from a stairwell that goes down to level 73,but that's just 4 tiles of up/down squares.


this. stairs kills fps, for no particular reason. I used to dig a 3x3 staircase to hell a la Led Zeppelin, but that is very very bad on the pathfinder.

now I'm using something like this:


odd level

WWWWWW
W.....W
W.v^v.W
W.^W^.W
W.v^v.W
W.....W
WWWWWWW

even level:

WWWWWW
W.....W
W.^v^.W
W.vWv.W
W.^v^.W
W.....W
WWWWWWW




W wall
. space
v ramp down
^ramp up

Based on my limited understanding of ramps, that seems impossible! Time for !!Science!!
Title: Re: make it run faster
Post by: FleshForge on October 06, 2010, 01:33:34 am
Setting DF's processor affinity to force it to run on only one core has no useful impact on my FPS.  I have a busy fort right now that was at 21ish FPS with default processor affinity, and after changing it in Task Manager to only allow one core, it remains at 21ish.  Maybe other hardware/OS performs differently, I don't know.  Setting it back after a while it remains at 21ish.
Title: Re: make it run faster
Post by: Xenos on October 06, 2010, 01:40:00 am
you want to kick everything else off the core DF is on, not just tell it to stay to one core.
Title: Re: make it run faster
Post by: FleshForge on October 06, 2010, 01:51:06 am
The other three cores are at 0-1%, so I don't think I'm going to bother with that.
Title: Re: make it run faster
Post by: LoSboccacc on October 06, 2010, 03:51:34 am
Based on my limited understanding of ramps, that seems impossible! Time for !!Science!!

yes, seemed strange at first even for me. I was prepared to dig a relief tunnel for stranded miners (many were lost while experimenting ramps) but all of them returned to the surface.
Title: Re: make it run faster
Post by: o_O[WTFace] on October 06, 2010, 06:43:36 am
Temperature and weather really don't make much difference gameplay wise, but can give a pretty solid FPS boost.  Just turn temp back on if a dragon shows up or someone decides to take a magma bath. 
Title: Re: make it run faster
Post by: thebigJ_A on October 07, 2010, 10:07:55 pm
Is there a way to set affinity semi-permanently? Switching the affinity for everything ever frickin time I want to play takes like ten minutes. It's a pain.
Title: Re: make it run faster
Post by: Eagle_eye on October 07, 2010, 10:17:17 pm
just a guess, but the properties tab might have something.
Title: Re: make it run faster
Post by: Xenos on October 07, 2010, 10:32:46 pm
I know in the init options (31.16,) you can set the priority DF will take, (I set mine to HIGH, the second highest) I noticed a few FPS gain)  has anyone else noticed this/done any testing?
Title: Re: make it run faster
Post by: thebigJ_A on October 07, 2010, 10:36:36 pm
Yeah, Idk if setting the priority has much effect, but I set it to "High" anyway. (Realtime doesn't seem to work properly.)

I'm looking for a way to set affinity like that. I don't see anything in 'properties', either in Process Explorer or Task Manager.
Title: Re: make it run faster
Post by: FleshForge on October 07, 2010, 10:42:26 pm
Modifying priority never does anything useful in any app I've ever used.  100% utilization is 100% utilization whatever the priority is.
Title: Re: make it run faster
Post by: Raufgar on October 08, 2010, 03:04:14 am

I tried that, that's what bumped me up to 30. I did get a collapsed cavern message at the beginning of embarking, so idk if that has anything to do with it.

Depends on what that cavern collapse did, I think any large water flow (such as water flowing into the magma sea), even in undiscovered caverns, can cause such a lag. (unconfirmed though, please correct if wrong)

Anyways, are you playing in a modded game? or using any specific tilesets?

If you're moving files, watching a movie, downloading something, this can affect your DF game, as more processes take up RAM and processor time.
Title: Re: make it run faster
Post by: thebigJ_A on October 08, 2010, 05:21:11 am
I'm just using the Lazy Newb pack, with the Phoebus' tileset.

The only other thing I have running is internet explorer. (And that is required, I'm constantly looking up things in the magmawiki.)
Title: Re: make it run faster
Post by: Eagle_eye on October 08, 2010, 06:46:22 am
what z level did it zoom to with the cavern collapse?
Title: Re: make it run faster
Post by: thebigJ_A on October 08, 2010, 07:48:57 am
Couldn't tell ya. I turned off the zooming and pausing on cavern collapse on a previous embark. There, I got the message every second (literally), and the framerate was in the single digits. I gave up on that and started a new fort. Which is going well,but slowly.
Title: Re: make it run faster
Post by: Kronusdark on October 08, 2010, 11:40:29 am
if you are using windows vista/7 try disabling aero (right click icon, properties, compatibility tab, check disable desktop composition) this fixes ALOT of fps issues in games for me.
Title: Re: make it run faster
Post by: zilpin on October 08, 2010, 02:54:04 pm


Agreed.  Aero is very resource expensive.  Disable it at work, disable it for games, disable it everywhere. 

Title: Re: make it run faster
Post by: thebigJ_A on October 08, 2010, 06:05:22 pm
Do I just turn it off on DF, or do I have to go r-clicking every icon I've got?
Title: Re: make it run faster
Post by: FleshForge on October 08, 2010, 07:00:07 pm
http://www.howtogeek.com/howto/windows-vista/disable-aero-on-windows-vista/

Aero is one of those classic REALLY SHITTY ideas that Microsoft comes up with and forces on the entire world.  I'm not typically a MS basher but wow, sometimes they do come up with some breathtakingly shitty mandatory features.
Title: Re: make it run faster
Post by: jei on October 08, 2010, 08:00:42 pm
As said before, efficient stairs are critical.  In fact, do not use stairs, use ramps.  And if you must use a stair, do NOT use an up+down stair.

Why are updown stairs so much worse than ramps or oneway stairs?
Title: Re: make it run faster
Post by: Leonidas on October 08, 2010, 08:13:20 pm
As said before, efficient stairs are critical.  In fact, do not use stairs, use ramps.  And if you must use a stair, do NOT use an up+down stair.
Why are updown stairs so much worse than ramps or oneway stairs?

This puzzles me, too.  It seems like any ramp setup would impose some serious efficiency penalties on the dwarves, just because you have to stick walls everywhere for your ramps to work.

In any case, shouldn't this whole ramps vs stairs thing be easy to test?  You could build a fort with parallel systems of stairs and ramps.  Put hatches on all of them.  Wait for your FPS to drop.  Save, make two version of the game.  In game A lock all the hatches on the stairs.  In game B lock all the hatches on the ramps.  Or if you think that hatches might bring problems of their own, build a floor over them or dig them out.

However you want to do it, disable the stairs on one game and the ramps in the other, and then compare the FPS.

Personally, I think it's all about the numbers of objects and the numbers of people wandering around.  I diligently atom-smash and melt everything in sight, but it's hard to know if it helps.
Title: Re: make it run faster
Post by: thebigJ_A on October 08, 2010, 08:39:45 pm
Nothing works. This sucks.  :-[
Title: Re: make it run faster
Post by: Moonshine Fox on October 09, 2010, 06:49:55 am
The "collapse on embark" is a major pointer that something is wrong at the embark spot. We discovered earlier a guy who had the same and it was later uncovered that his entire magma sea was being drained down into HFS by a hole in the semi-molten rock. You could have something similar, and the calculations for the drain in the magma sea is likely killing you.

It sounds like you could have a funky world_gen if you keep getting collapses on embark. Try to gen a new world and embark. Play a couple of minutes. FPS any better in that fort?
Title: Re: make it run faster
Post by: Blurk on October 09, 2010, 07:03:35 am
Usually when i get a collapse underground on embark it means there is an upright spoiler somewhere down there, but that shouldn't hurt FPS that much.
it might indeed be a cavern being drained into another.
you could try using reveal to see what it is?
Title: Re: make it run faster
Post by: Max White on October 09, 2010, 07:07:27 am
You know all those cats you butchered? Well they all turn into ghosts, doomed to wander the planes, and now that you have generated that plane, the path finding of those invisiable ghost cats is killing your fps. Its karma!
Title: Re: make it run faster
Post by: thebigJ_A on October 09, 2010, 07:49:47 am
Oh, ok. So where do I download the Excorcism utility?
Title: Re: make it run faster
Post by: rephikul on October 09, 2010, 08:36:34 am
Ya the list of deceased being on my unit list is getting ridiculous with about 900 animals butchered yearly.
Title: Re: make it run faster
Post by: thebigJ_A on October 09, 2010, 10:30:09 pm
So I finally broke down and turned off temperature. This got me up to ~85 at embark. That's acceptable, but it kills me to turn off a feature like that. >:(

Besides, it's only a fix during non-winter months (I absolutely must have ice in winter) and until I strike magma (what's the point of magma if there's no heat?).
Title: Re: make it run faster
Post by: helf on October 09, 2010, 11:10:57 pm
Use DTaskManager I linked to earlier and it lets you select anything you want. I usually click the first process, scroll to the bottom, hold shift, select the last item, then find the dwarf fortress process if ive already launched it, hold control, deselect it and then change the affinity of all the other processes all at once. Its pretty quick and easy.
Title: Re: make it run faster
Post by: Larry421 on October 09, 2010, 11:51:29 pm
Something is definitely wrong. I have an almost identical machine (Athlon X2, 2.1Ghz, 2G RAM) and I get 100fps at embark (3x3) easily.
Have you tried modifying your world_gen to only have 1 cavern layer? You get less flavour in underground critters but can end up with 20-40z instead of 150.
Also, please tell me you're not running Vista...
Title: Re: make it run faster
Post by: thebigJ_A on October 10, 2010, 12:25:10 am
I am, in fact, running Vista. Why would that have an impact? Should I try running in compatibility mode or something?

I know something is wrong with my comp, it has to be. Which is why I hate having to turn of parts of the game to get it to run satisfactorily. But what could it be?

One thing I'm noticing is that, while I have the game running, my CPU usage, according to process explorer, rarely goes above 50% even when I don't have its affinity set to one core. This might not mean anything, though. I don't know enough about PCs.
Title: Re: make it run faster
Post by: lolghurt on October 10, 2010, 01:13:01 am
Uhh, no, stairs are significantly more fps-efficient than ramps, and faster for dwarves to boot.

If you're using a recent version, open up init.txt and change [PRINT_MODE:2D] to [PRINT_MODE:STANDARD]. This should give you a rather large fps boost. Other than that, try this thread (http://www.bay12forums.com/smf/index.php?topic=66871.15) for extra tips.
However, on some computers, [PRINT_MODE:STANDARD] with a tileset will cause the game to not show the right half of the game.
Title: Re: make it run faster
Post by: Larry421 on October 10, 2010, 11:22:16 am
I am, in fact, running Vista. Why would that have an impact? Should I try running in compatibility mode or something?

I know something is wrong with my comp, it has to be. Which is why I hate having to turn of parts of the game to get it to run satisfactorily. But what could it be?

One thing I'm noticing is that, while I have the game running, my CPU usage, according to process explorer, rarely goes above 50% even when I don't have its affinity set to one core. This might not mean anything, though. I don't know enough about PCs.

Vista was not designed for machines as old as ours. It's a significant resource sink. People who actually use it may have advice on how to switch off some of the bloat. I'd wager that that's your problem, if you're getting dodgy fps on embark.

Tips with regard to DF though: reduce the number of caverns in world_gen, cut your population cap and baby cap, turn off temp and weather, and embark in a small area. Avoid flowing water. Destroy or trade clutter as your dwarves produce it.
Title: Re: make it run faster
Post by: jei on October 10, 2010, 02:38:14 pm
I would absolutely take on writing optimization for pathing, if Toady threw the pathfinding related source code at me.
D* is probably being used and it's highly unlikely you can optimize it further, besides implementing CPU and OS specific optimizations tricks.
DF already uses tricks to cut down on water flow work for example. http://en.wikipedia.org/wiki/D*

Adding multicore support would probably be the easiest and most beneficial way to get performance boost, besides doing other tricks and waste management within DF to eliminate unnecessary and useless path finding in the first place.

Unfortunately paranoia about source code leaks seems to prevent the DF team from getting any programming help. There's a ton of people who would help.
Title: Re: make it run faster
Post by: melomel on October 10, 2010, 08:01:09 pm
Posting mostly to follow, as I think this POS PC just doesn't have the juice for my map.  (4x4 embark, volcano, pretty tall, not much constructed/dug out, no river, 25 dwarves, 154 animals but most of them caged, a metric shit-ton of caged wildlife, XP Pro/Pentium4 2.5GHz/1 gig RAM.  FPS...  10 or so at best.  Was was playable until I tried to get the cotton candy, which required going down about 150 zs & cracking open the caverns.  [PRINT_MODE:STANDARD] does nothing for me.  Single core, it's not threading.  Not running anything else intensive--got the browser, music player, and Notepad.)

It was a really awesome embark, too...
Title: Re: make it run faster
Post by: thebigJ_A on October 10, 2010, 08:45:39 pm
Vista was not designed for machines as old as ours. It's a significant resource sink. People who actually use it may have advice on how to switch off some of the bloat. I'd wager that that's your problem, if you're getting dodgy fps on embark.

Tips with regard to DF though: reduce the number of caverns in world_gen, cut your population cap and baby cap, turn off temp and weather, and embark in a small area. Avoid flowing water. Destroy or trade clutter as your dwarves produce it.

That stinks, seeing as how this pc came with Vista. It was a gift, as I'm a poor college student. Which also prevents me from getting a new one. All I could afford was to stick in a middling GPU a year or two back. It still manages to run most of the types of games I play pretty well on medium to high settings.

As for vista. I took someone's advice and switched to vista basic view, thus apparently turning off Aero. I can't tell if that helped or not. So how about it, anyone know how I can "switch off some of the bloat"?

Title: Re: make it run faster
Post by: FleshForge on October 10, 2010, 09:47:41 pm
The thing is, modern video-heavy games are greatly dependent on the graphics card and much less on the processor, so you can have a rather nice gaming rig that will run this game poorly - because DF is 100% CPU.  I'm sure ancillary stuff like bus architecture and memory bandwidth and all that shit matters, but when the game gets busy it's because the processor is pegged 100%.  Not really any way around that except getting bigger iron.

err, note though that each map varies A LOT with respect to what's going on and you may have much better speed with one map over another; I just now had an embark with a lake dumping INTO a river (goofy as that sounds) and right on embark it was around 75 FPS, whereas I normally have a very comfortable 100 FPS with most maps.  Take a look at the map's total volume also, e.g. as melomel said if you have a map that is 160z tall (counting about 10z for sky) that's an immense amount of individual tiles.  You can force the volume of all maps to be smaller by tweaking world_gen.txt and setting limits on cavern depths.
Title: Re: make it run faster
Post by: Diacritic on October 10, 2010, 09:53:24 pm
1. Grab  Wubi (http://www.ubuntu.com/desktop/get-ubuntu/windows-installer)
2. Install for dual-boot capability
3. Boot to linux
4. Grab linux version
5. ???
6. FPS profit!
Title: Re: make it run faster
Post by: FleshForge on October 10, 2010, 09:56:02 pm
Do you have any comparisons with the same map in the same state?  Serious question, please don't interpret that the wrong way (I don't even know if save files are portable between OS).
Title: Re: make it run faster
Post by: thebigJ_A on October 10, 2010, 10:08:17 pm
While I appreciate the suggestion, installing a completely new OS, unrelated to anything I've ever used, and that I have no experience with, to possibly get DF to run better, isn't exactly the advice I was hoping for.

I was hoping for something like, "uninstall this" or, "turn off that" or "change this setting". Maybe "download this program".
Title: Re: make it run faster
Post by: FleshForge on October 10, 2010, 10:15:56 pm
The simple answer is, when you have no programs running, is your processor utilization at 0%?  If it's not, then maybe something can be done.  If it's at zero percent when nothing's going on, then imo no amount of tuning or disabling is going to help you.  I think disabling Aero has been the best suggestion in the thread by a long shot/
Title: Re: make it run faster
Post by: albatross on October 10, 2010, 11:33:19 pm
Say, do you have DF in windowed or fullscreen mode? See if switching to the other mode would make a difference. Also, how's your antivirus scanner? Do other intensive programs work as well as before?
Title: Re: make it run faster
Post by: Vehudur on October 11, 2010, 12:41:31 am
Say, do you have DF in windowed or fullscreen mode? See if switching to the other mode would make a difference. Also, how's your antivirus scanner? Do other intensive programs work as well as before?

I know that my AV (I run Kapersky) eats up a lot of CPU at times, so if I'm doing something memory intensive (megaprojects) I'll disconnect my computer from the internet (see: physically unplug the cord) and turn Kapersky off, and just go online with my other machine
Spoiler (click to show/hide)
- which may not be possible for everyone, but I know it works well for me.
Title: Re: make it run faster
Post by: melomel on October 11, 2010, 01:09:48 am
Uhm...  How are you on auto-updater settings?  Those can affect performance on older PCs.  There are probably half a dozen settings, if it's anything like the previous Windows.  I'd like to help, but I got nothin' on Vista or newer machines.

I know that my AV (I run Kapersky) eats up a lot of CPU at times, so if I'm doing something memory intensive (megaprojects) I'll disconnect my computer from the internet (see: physically unplug the cord) and turn Kapersky off, and just go online with my other machine

I've done that before, without the backup PC.  It can help quite a bit.
Title: Re: make it run faster
Post by: Vehudur on October 11, 2010, 01:26:10 am
Uhm...  How are you on auto-updater settings?  Those can affect performance on older PCs.  There are probably half a dozen settings, if it's anything like the previous Windows.  I'd like to help, but I got nothin' on Vista or newer machines.

I know that my AV (I run Kapersky) eats up a lot of CPU at times, so if I'm doing something memory intensive (megaprojects) I'll disconnect my computer from the internet (see: physically unplug the cord) and turn Kapersky off, and just go online with my other machine

I've done that before, without the backup PC.  It can help quite a bit.

It makes the difference between 20% cpu usage (sometimes) and 1% while idle.  That's a huge performance boost.
Title: Re: make it run faster
Post by: thebigJ_A on October 11, 2010, 02:01:31 am
Well, I've spent two hours turning off processes and services, as well as shutting off all Vista's display shinies.

I have AVG for my antivirus. Most of the time, it only seems to use 4 or 5% of the cpu.

I think what I did squeezed a few more fps out, not anything amazing though.  I guess my processor just isn't up to snuff (which is so weird, seeing as someone with the same one has no probs, and the wiki says mine should be ok, also). I'll have to live with no temp/weather, I guess.

Barring some unforeseen source of income, it's going to be a while before I can upgrade, too. Are we allowed to post "send me money" threads?  ;D
Title: Re: make it run faster
Post by: Aussiemon on October 11, 2010, 02:20:03 am
Just in case this hasn't been posted already:

If you're on a Windows machine,

Start>Run (Run is hidden by default on Windows 7 machines)>"msconfig"

Turn off everything you don't want/need in the services and startup tabs.

Try Auslogics Disk Defrag instead of the default windows one. Faster and better.
Auslogics also has a good program called BoostSpeed that has some helpful performance tweaks.

Start>Right-click My Computer/Computer and select Properties>Advanced or Advanced System Settings>Performance>Turn off whatever you can do without

Finally, Gamebooster could help somewhat.

Google should be able to save me the trouble of posting links, right?  :)


P.S. I find that the latest Avast is a lot less cpu-intense than a lot of other products, not to mention better all-around, but your mileage may vary on that
Title: Re: make it run faster
Post by: FleshForge on October 11, 2010, 02:23:42 am
While disk defrag is a very popular suggestion, it has pretty much nothing to do with how DF runs - you can look at the I/O count in task manager while it's running, basically DF never touches the disk except while loading/saving a game.  I guess if you don't have enough RAM to keep the process in memory then you could be swapping, but if that's going on then defragging your disk isn't going to help you too much.  Just FYI :)
Title: Re: make it run faster
Post by: S31-Syntax on October 11, 2010, 02:33:07 am
1. Grab  Wubi (http://www.ubuntu.com/desktop/get-ubuntu/windows-installer)
2. Install for dual-boot capability
3. Boot to linux
4. Grab linux version
5. ???
6. FPS profit!

Love it! Ubuntu 10.10 is pretty zippy so far... need to check it with DF... but i get about 100fps on a standard embark. 80-90 on a moderately developed fortress.
Title: Re: make it run faster
Post by: Vehudur on October 11, 2010, 02:39:36 am
For a while I was running a (self-made) liquid nitrogen cooling system and overclocking my CPU to nearly 5.7 Ghz (normally I run at 3.9 3.6 overclocked to 3.9 Ghz), but the pump died broke apart spectacularly* after a month (probably because the pump wasn't designed to run that cold) and I have not been able to find an adequate replacement yet.

Oh by the way, liquid N2 isn't that expensive.  Keeping it liquid, however, is a pain in the ass - oh, and it's dangerous.

*The metal shattered like glass, with no warning.  It was really creepy.
Title: Re: make it run faster
Post by: thebigJ_A on October 11, 2010, 03:05:56 am
For a while I was running a (self-made) liquid nitrogen cooling system and overclocking my CPU to nearly 5.7 Ghz (normally I run at 3.9 3.6 overclocked to 3.9 Ghz), but the pump died broke apart spectacularly* after a month (probably because the pump wasn't designed to run that cold) and I have not been able to find an adequate replacement yet.

Oh by the way, liquid N2 isn't that expensive.  Keeping it liquid, however, is a pain in the ass - oh, and it's dangerous.

*The metal shattered like glass, with no warning.  It was really creepy.

Um..........thanks? I guess?
Title: Re: make it run faster
Post by: Aussiemon on October 11, 2010, 04:44:32 am
While disk defrag is a very popular suggestion, it has pretty much nothing to do with how DF runs - you can look at the I/O count in task manager while it's running, basically DF never touches the disk except while loading/saving a game.  I guess if you don't have enough RAM to keep the process in memory then you could be swapping, but if that's going on then defragging your disk isn't going to help you too much.  Just FYI :)

I figured that a better defrag wouldn't do much, if anything at all. Those are just my general performance tips for speeding up computers that I work on.
Title: Re: make it run faster
Post by: FleshForge on October 11, 2010, 04:46:22 am
Yeah I'm not picking on you, and of course it's good maintenance anyway.
Title: Re: make it run faster
Post by: LealNightrunner on October 11, 2010, 05:24:05 am
My other machine would die if I tried to play DF on it, it's a number of years old and has a cpu that runs at some 2.1 mhz

2mhz? Did you put DF on a Tandy or something?
Title: Re: make it run faster
Post by: Diacritic on October 11, 2010, 07:05:24 am
While I appreciate the suggestion, installing a completely new OS, unrelated to anything I've ever used, and that I have no experience with, to possibly get DF to run better, isn't exactly the advice I was hoping for.

I was hoping for something like, "uninstall this" or, "turn off that" or "change this setting". Maybe "download this program".

Wubi really is super-simple to use, and I doubt that you're going to find any easy answers in Vista.  You could try right-clicking the desktop, going to Personalize, and turning off Aero for something less intensive, but that's mostly going to save you GPU time that DF isn't using.

You could also check the "Processes" tab in Task Manager and sort by CPU to see what's using up CPU time.  It could be that something like your antivirus program is going off all the time, and you could kill that (and disconnect from the internet if you do) while DFing.
Title: Re: make it run faster
Post by: Vehudur on October 11, 2010, 07:10:11 am
Um..........thanks? I guess?

Obviously, you missed the message so I'll make it blunt:   If you know how (or know someone who knows how), and can keep your computer cold, you can overclock it (make it run faster than intended, sort of) to get better performance.  Just be warned, if you do it wrong bad things will happen.
Title: Re: make it run faster
Post by: thebigJ_A on October 11, 2010, 07:29:54 am
Because your anecdote of an exploding cooling system really sounded like a recommendation.  ::)

Regardless, I don't really know anyone that I'd trust with something like that, nor do I have the money to pay a professional.
Title: Re: make it run faster
Post by: deoxys413 on October 11, 2010, 08:25:09 am
IF you're not opposed to a little modding, setting dwarves to [SPEED:0] will make up for the difference. (And in my case at least, my average FPS went from 20-30 to 25-35  ???)
Title: Re: make it run faster
Post by: Diacritic on October 11, 2010, 08:37:35 am
Pathfinding is easy when you can walk through walls.
Title: Re: make it run faster
Post by: Vehudur on October 11, 2010, 08:59:19 am
Pathfinding is easy when you can walk through walls.

Really, really easy.

Because your anecdote of an exploding cooling system really sounded like a recommendation.  ::)

Regardless, I don't really know anyone that I'd trust with something like that, nor do I have the money to pay a professional.

The part about it exploding was...  it wouldn't have exploded if I had built it properly.  Of course, it was the best worst thing that could have gone wrong.  Other than that, it was quite effective.

Also, yes, exploding cooling system (http://tvtropes.org/pmwiki/pmwiki.php/Main/MadeOfExplodium).  Probably because I built it for $50 (USD) out of old pipes and machine pieces.

Of course, I'm almost finished with a new one that is NOT made of explodium.

EDIT:  On one hand, it's very nice to be able to mess with a computer like that, but in case I haven't made it painfully obvious, it can go very very wrong.  Actually, it exploding was completely independent of the computer, but was my poor choice of materials for the cooling system.  What is more likely to happen is something goes wrong and you turn the insides of your computer to smoking, molten goo.
Title: Re: make it run faster
Post by: Mr. Argent on October 11, 2010, 09:52:31 am
With 57 Dorves, a aquifer and a several-level fortress my laptop (AMD Turion x64 Dual-Core, 4gb RAM) gets 44fps - I'm pretty sure my desktop would fare much better (Core 2 Quad Q6600, 4GB RAM -- Not quite a i7 w/ 8GB RAM, but it'll work), but i can't get up to it right now because i'm recovering from surgery.
Title: Re: make it run faster
Post by: albatross on October 11, 2010, 11:43:21 am
I remember seeing a command "Setup traffic areas" in DF. Would that help the FPS?
Title: Re: make it run faster
Post by: deoxys413 on October 11, 2010, 11:50:22 am
Pathfinding is easy when you can walk through walls.

Really, really easy.

Really? Either I'm doing it wrong or the results vary, because my dwarves just move at hyperspeed, they don't phase through walls.
Title: Re: make it run faster
Post by: gtmattz on October 11, 2010, 11:51:30 am
Pathfinding is easy when you can walk through walls.

Dwarves at speed:0 do not walk through walls, they still have to path and walk to/from places etc.  What I assume you are referring to is the warping or teleporting effect that you can get, especially if you have your fps_cap at 0 and your g_fps at a lower number.  This is due to the fact that the game is simply not given enough chances to render every step of the dwarves because they are moving so fast.
Title: Re: make it run faster
Post by: jei on October 11, 2010, 01:10:34 pm
Could it be that broken arrows and blood, not getting seasonally cleaned up is what is making such a big FPS difference in 40d and 2010 DF's performance?

Could the seasonal brokenarrow/blood cleanup be fixed, please?
Title: Re: make it run faster
Post by: Lordinquisitor on October 11, 2010, 01:11:59 pm
By the way, is it normal that only Print Mode 2d works? If i try something else, even standard, it simply crashes. Any ideas?
Title: Re: make it run faster
Post by: thebigJ_A on October 11, 2010, 10:17:00 pm
Speed 0 makes them move crazy fast? Wouldn't that make the game slower, because it would have less time to calculate a path?
Title: Re: make it run faster
Post by: kapusta on October 11, 2010, 10:35:46 pm
Nope, one game "frame" is completed when all calculation for it (pathfinding, temperature, etc) are done. Speed:0 does reduce your FPS, but your dwarves still appear to move faster because during each frame they move a lot further.
Title: Re: make it run faster
Post by: thebigJ_A on October 11, 2010, 11:59:04 pm
Won't that mess up things like, for instance, determining if an arrow/bolt hits?

I've decided I can live with the fps I get with temperature on but weather off. I figure temp is the more important, at least for my current fort, since I'm in a temperate region, so the ponds won't dry out, and there's a brook anyway.

I guess I should start saving for a new pc. This'll take a while...  :-\
Title: Re: make it run faster
Post by: kapusta on October 12, 2010, 04:26:26 am
Well, I don't know how it affects combat to be honest, but I have a suspicion that it would be easier to dodge with high speed and your dwarves would attack far more often. So in my fortresses SPEED:0 is used only for building and megaprojects.
Title: Re: make it run faster
Post by: deoxys413 on October 12, 2010, 08:18:55 am
In the midst of my [SPEED:0] building, my dwarves felt the need to clean the obscene amount of blood some human had left. I lost 7 dwarves to this because the goblins that caused were still there, but there was many a case of Urist McNeo since the entire squad opened fire on him with bows just as he pathed to the middle of them releasing 'danger was near' (Although the mayor somehow survived this >>;)

My military was never much more than a few bowdwarves and they stand in place when they shoot, so I can't vouch for dwarven combat.