Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Possible way to boost framerate in .31+  (Read 1302 times)

qoonpooka

  • Bay Watcher
    • View Profile
Possible way to boost framerate in .31+
« on: December 08, 2010, 01:29:20 pm »

Based on http://www.bay12forums.com/smf/index.php?topic=71634.0 That discussion, I decided that the massive slowdown (which makes .31 unplayable, period) is due to all of the new underground stuff.

tl;dr - I run 40d with a 6x6 embark (sometimes larger) and my FPS will peg at the 125 maximum I set until I hit around 70-75 dwarves.  I run .31 and it starts out at a measly 80 fps and by 14 dwarves is down into the 60s.

It seems reasonable that all those new critters, liquids, and fun stuff would chew up processor - though they really have no need to until the cavern is actually breached.

I therefore suggest:

Freezing caverns and fun stuff in suspended animation until the cavern is breached.  There are already triggers that trip when that happens, you can simply 'wake up' all the critters and plants and whatnot when that happens and not burn the cycles until they're needed yes?

Logged

thijser

  • Bay Watcher
  • You to cut down a tree in order to make an axe!
    • View Profile
Re: Possible way to boost framerate in .31+
« Reply #1 on: December 09, 2010, 01:02:26 am »

Isn't the main thing that causes the lag the fact that you are dealing with a 3d map instead of a 2d? Additionally tempreture, weather ext. needs a lot of calculations.
Logged
I'm not a native English speaker. Feel free to point out grammar/spelling mistakes. This way I can learn better English.

Capntastic

  • Bay Watcher
  • Greetings, mortals!
    • View Profile
    • A review and literature weblog I never update
Re: Possible way to boost framerate in .31+
« Reply #2 on: December 09, 2010, 01:14:16 am »

Freezing caverns and fun stuff in suspended animation until the cavern is breached.  There are already triggers that trip when that happens, you can simply 'wake up' all the critters and plants and whatnot when that happens and not burn the cycles until they're needed yes?

But then we won't get a chance for things-in-caverns to come up and meet us of their own volition.   Cutting part of the simulation out like that may yield FPS gains but isn't really worth it in some ways, to some people.
Logged

Fancy Admiral

  • Bay Watcher
    • View Profile
Re: Possible way to boost framerate in .31+
« Reply #3 on: December 09, 2010, 01:38:27 am »

Does anything come out of the cavern before you breach it, though?  I don't think so.  I don't know how much drag the caverns have, but I'd think freezing them until breached would certainly help.  After you've dug into them, sure, everything needs to be tracked and that'll slow you down.  That may unfortunately discourage some players from that part of the game, but that's their choice.

I'd move the mysterious underground cave-in on embark to a later point, too.  I have a map with near 100 (and counting!) underground cave-ins now.  If underground isn't ticking until I look at it, this might not happen.

Volcanoes would still be a direct run to the sea, so they may or may not have some serious implications to this idea, too.
Logged

Capntastic

  • Bay Watcher
  • Greetings, mortals!
    • View Profile
    • A review and literature weblog I never update
Re: Possible way to boost framerate in .31+
« Reply #4 on: December 09, 2010, 01:53:23 am »

Does anything come out of the cavern before you breach it, though?  I don't think so.

Not currently, but I tend to argue for the future goals of the game.
Logged

Fancy Admiral

  • Bay Watcher
    • View Profile
Re: Possible way to boost framerate in .31+
« Reply #5 on: December 09, 2010, 10:27:47 am »

Ah.  Are there future goals which allow the ground to be broken without your input?  That would be a very different game from what we have now.
Logged

qoonpooka

  • Bay Watcher
    • View Profile
Re: Possible way to boost framerate in .31+
« Reply #6 on: December 09, 2010, 02:51:57 pm »

Isn't the main thing that causes the lag the fact that you are dealing with a 3d map instead of a 2d? Additionally tempreture, weather ext. needs a lot of calculations.

.28.40d  was also a 3d world with temp and weather and doesn't have problems on my machine.   I suspect it's all the pathing of stuff below the ground that does the harm here.  If there's a solid wall above them and they can't come up to interact with me, I see no reason to be spending clock cycles on 100 inaccessible z-levels.
Logged

orbcontrolled

  • Bay Watcher
    • View Profile
Re: Possible way to boost framerate in .31+
« Reply #7 on: December 09, 2010, 05:17:06 pm »

Based on http://www.bay12forums.com/smf/index.php?topic=71634.0 That discussion, I decided that the massive slowdown (which makes .31 unplayable, period) is due to all of the new underground stuff.

I would be interested to know how you came to that conclusion, since there is a lot of disagreement in that thread, and the only mention of caverns in the entire thing is from you yourself concluding that the caverns are to blame. I'm not saying it's not true, I'm just wondering if there is any evidence for it.

Framerate discussions about DF usually seem to boil down to a lot of semi-educated guessing about which features need to be eliminated or made optional, and I'm not sure how productive it is to request things like that from the developer when we aren't even sure how much good it will do. Especially when we could instead be making requests like "find out what causes the most unnecessary slowdown and fix it!". Toady has mentioned "low-hanging fruit" optimizations before, so I'm sure he would be quite capable of responding to such a request without us guessing at the specifics, he just hasn't been convinced it's worth doing yet.

In the meantime, if you feel that the underground is the main source of performance loss, then I would personally try genning a new world with only 1 cavern layer, or playing around with the size and openness of caverns or something.

Also, pathing? Why does everybody immediately assume it's pathing? Barely anything paths underground. An occasional migration of animals paths to the center of the map, sits around for a few weeks, then paths out. That isn't all that much. I would wager that the trees and plants contribute more to lag than pathing.

(Although if anyone feels like gathering evidence, it occurs to me that you could use Runesmith to render all underground animals caged/chained/dead (and therefore immobile), and see what effect it had on FPS)
« Last Edit: December 09, 2010, 05:19:28 pm by orbcontrolled »
Logged

qoonpooka

  • Bay Watcher
    • View Profile
Re: Possible way to boost framerate in .31+
« Reply #8 on: December 09, 2010, 10:32:59 pm »

I would be interested to know how you came to that conclusion, since there is a lot of disagreement in that thread, and the only mention of caverns in the entire thing is from you yourself concluding that the caverns are to blame. I'm not saying it's not true, I'm just wondering if there is any evidence for it.

Actually if you look at the author of the post it's Lord Darkstar, not me.  He references unlinked "reporting on the forum" wherein the new underground awesomeness drags down framerates.  No one offered dispute on that point there, and all of the disagreement is about whether or not .31.18 is faster or slower than .40d. 

Framerate discussions about DF usually seem to boil down to a lot of semi-educated guessing about which features need to be eliminated or made optional, and I'm not sure how productive it is to request things like that from the developer when we aren't even sure how much good it will do. Especially when we could instead be making requests like "find out what causes the most unnecessary slowdown and fix it!". Toady has mentioned "low-hanging fruit" optimizations before, so I'm sure he would be quite capable of responding to such a request without us guessing at the specifics, he just hasn't been convinced it's worth doing yet.

I don't know what else I can say to convince him that it's worth it.  I enjoy the game enough to investigate possibilities.  It was my understanding that forums are places to air out ideas.

In the meantime, if you feel that the underground is the main source of performance loss, then I would personally try genning a new world with only 1 cavern layer, or playing around with the size and openness of caverns or something.

Sounds great.  How exactly do I do that?  The game's raws aren't the most intelligible things out there, and I'd just gotten the hang of how to kill off dwarven civilization in .40d when they all changed on me. :P

Also, pathing? Why does everybody immediately assume it's pathing? Barely anything paths underground. An occasional migration of animals paths to the center of the map, sits around for a few weeks, then paths out. That isn't all that much. I would wager that the trees and plants contribute more to lag than pathing.

Catsplosions and waterfalls are the easiest, player-reproducable, most reliable ways to kill FPS.  Pathing and liquid dynamics are the Usual Suspects when FPS is the apparent issue.  Confessedly it is a Proof By Example fallacy, but in the absence of other theories, it seems sufficient to begin inquiry.


(Although if anyone feels like gathering evidence, it occurs to me that you could use Runesmith to render all underground animals caged/chained/dead (and therefore immobile), and see what effect it had on FPS)

Another good idea that I, myself, lack the ability to execute.
Logged

ungulateman

  • Bay Watcher
  • [PREFSTRING: haunting moos]
    • View Profile
Re: Possible way to boost framerate in .31+
« Reply #9 on: December 09, 2010, 11:55:29 pm »

Embarking on shallower areas might help.

I can easily get under 100 z-levels with minimal changes to the world-gen.
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.

orbcontrolled

  • Bay Watcher
    • View Profile
Re: Possible way to boost framerate in .31+
« Reply #10 on: December 10, 2010, 02:01:34 pm »

Actually if you look at the author of the post it's Lord Darkstar, not me.  He references unlinked "reporting on the forum" wherein the new underground awesomeness drags down framerates.  No one offered dispute on that point there, and all of the disagreement is about whether or not .31.18 is faster or slower than .40d. 
Ah, found it. That actually sounds pretty promising, since the things he refers to are more or less glitches (the magma sea shouldn't drain, things shouldn't attempt to path to inaccessible locations), and bugfixes are much more likely than optimizations around here.

I don't know what else I can say to convince him that it's worth it.  I enjoy the game enough to investigate possibilities.  It was my understanding that forums are places to air out ideas.
Fair enough. Sorry if I came off as harsh.

Sounds great.  How exactly do I do that?  The game's raws aren't the most intelligible things out there, and I'd just gotten the hang of how to kill off dwarven civilization in .40d when they all changed on me. :P
There's an option on the main menu for "Design new world with parameters". It allows you to redesign worlds, and save and load the designs. There are a hell of a lot of choices under "Enter Advanced Parameters, and one of them is one for "Cavern layer number". You only need 1 for a viable world. You can also turn off [SPOILERS], the magma sea, reduce the amount of water, etc.

Catsplosions and waterfalls are the easiest, player-reproducable, most reliable ways to kill FPS.  Pathing and liquid dynamics are the Usual Suspects when FPS is the apparent issue.  Confessedly it is a Proof By Example fallacy, but in the absence of other theories, it seems sufficient to begin inquiry.
I'll give you liquids, that's for sure (interesting recent breakthrough in that field incidentally), but catsplosions have taken on such legendary status around the forums that I'm reluctant to believe anything they say. It has been a lot of versions since the days of boatmurdered, and sometimes I wonder if we aren't just repeating that folk wisdom out of habit.

Another good idea that I, myself, lack the ability to execute.
Runesmith is neat. There's nothing like using cheat-o-ma-jigs on an unfinished game awesome ways in which it breaks (DISCO ROCKS!!!)
um... ahem.
Not sure if Runesmith works with the latest version, but it's a third party program that modified DF's memory while it's running. You can use it to change the state of living creatures in various ways, and among the flags you can toggle are "caged", and "dead" (just verified that chained doesn't do anything). Lots of fun, just make sure to back up your fortress first (by making a copy of the save folder) in case you break reality :). (FYI: You can "dead" creatures to get them out of the way, and the un-"dead" them later when you want them back! So convenient...


In any case, I'm sorry you have to deal with this. FPS issues are just about the most difficult problem associated with this game, and there is no easy fix. The best I can do is point you to this for what I'm sure is the hundredth time, and wish you luck.
Logged

qoonpooka

  • Bay Watcher
    • View Profile
Re: Possible way to boost framerate in .31+
« Reply #11 on: December 20, 2010, 09:31:20 am »

I'll give you liquids, that's for sure (interesting recent breakthrough in that field incidentally), but catsplosions have taken on such legendary status around the forums that I'm reluctant to believe anything they say. It has been a lot of versions since the days of boatmurdered, and sometimes I wonder if we aren't just repeating that folk wisdom out of habit.

Some recent (accidental) testing with 40d has lent more strength to my belief that pathing and liquids are at fault here.  I dropped a 40d embark on a truly FUN site: Chasm running parallel to an underground river with five waterfalls.  A total of around 400 critters (wound up slaughtering my embark team at the wagon).

FPS was wobbling between 50ish and 75ish FPS - behavior was virtually identical to what a vanilla .31.18 build feels like.

I'm going to try remove caverns to see if this makes .31 faster for me, but playing .31 without caverns seems like missing out on most of the Fun.

If it does turn out to be the cavern traffic, I'm going to go back to my original suggestion: Have Fun hibernate until breached.  In 40d most of the critters would be dead before you got to the chasm or river anyway (which was the big challenge in breeding cave crocs, IMO, they kept going over waterfalls and dying).

I also noticed that .31 takes up eight times the memory space of 40d - which seems a bit much.  I hope you're right and that this stuff is bugfixable.  The alternative is multithreading which just ain't gonna happen.
Logged

blue sam3

  • Bay Watcher
    • View Profile
Re: Possible way to boost framerate in .31+
« Reply #12 on: December 20, 2010, 01:16:35 pm »

Just ran a test on this. I generated two identical worlds using the same seed, one with all underground features turned on, one with them all turned off. With caverns, I got 82 FPS. Without caverns, I sat on the FPS cap of 100. It looks like caverns do have an effect. However, it is possible that this is the old "extra Z levels = lower lag" thing. I'll try getting the number of z levels on each to the same then rerun the test in a bit.
Logged