Bay 12 Games Forum

Please login or register.

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

Author Topic: Best way for cleaning up a Fortress for further playing later on.  (Read 3151 times)

Geltor

  • Bay Watcher
    • View Profile
Re: Best way for cleaning up a Fortress for further playing later on.
« Reply #15 on: March 24, 2016, 08:58:15 am »

the one and only major culprit of lag is the population, both in fortress and adv mode. while theres not much you can do if you want to keep your population intact, the only thing i can think of is slaughtering every non-resident creature and retiring. usually when you retire a bunch of local creatures become "outcasts" and wander about your fort, this includes wagons and traders as well.

Completely disagreed. Ruling out flows, cave-in generators, mechanical megaprojects and other such (typically intentional) fps drainers, the two major sources of calculation drain are population and items. Of the two, item stacks are a considerably larger FPS killer because of how numerous they are, and they are numerous because people keep getting told this fairytale that it's all about the pathfinding.

The pathfinding is much less of a toll than people advertise, especially in modern versions because of path caching and other shortcuts.

But items... most fortresses accumulate gigantic amounts of stone, logs, people love keeping a surplus of raw materials like bars and blocks, and a surplus of clothes so nobody runs around naked, and massive stockpiles of meat (because animals overpopulate faster than their meat gets eaten), and prepared food stacks and drinks. If you're using dfhack and set it to produce more food when you have fewer than a certain "amount", then that gradually blows up the stack count because eating will slowly result in a massive number of food stacks with just 1 food in each.

I took it upon myself to destroy all unneeded items in my fortress. Extra meat? Destroyed it. All leathers and piles of cloth that I kept around? Gone. Gems and bars, it hurt but they had to go. All those logs, stones, everything but what I immediately needed had to go. Next I programmed a utility for dfhack to destroy all the remains creatures were leaving in the caverns, and all the unused webs, invader battle arrows that were lying around and being melted too slowly. I went from about 20k item stacks down first to only 9k, and with 80 population in my decades and decades old fortress, I shot back up to the 100 FPS I'd recorded back when I first got that population. I went crazy with it and slimmed down to 6,3 k and I've got scripts running to keep me there.

And it is god damn smooth sailing, brother. The years go by and my FPS is stable. My debugger is recording NO increase in computation time spent, except when caravans pass by or invasions arrive, but I've verified that after those events I go back to my baseline.

And I don't even have traffic areas or pathfinding design or any of that "old school" trickery. My guys wander the open areas to different miniforts that I've constructed for the separate species, and it is not killing FPS at all.
i dont think you should be so hasty to disagree. first and foremost, there is no huge disagreement between us, items are second to population in constant cpu stress, but when tested under proper conditions, theres just no competition, and eliminating the population lag is by far the biggest bolster to performance.

ive done similar tests as robsoie and got similar results. in old fortresses with many dwarves, destroying your items would be a very negligible gain, and that is if you didnt manage your items beforehand or had a very lengthy fort. but at that level, each additional living thing would be a huge detriment to framerate.

in situations where you dont have many dwarves, items are the main performance-decreasing culprit, but its evident why. its also, from tests ive conducted, takes a very unusual, large amounts of items to make a significant impact. not to mention that items are much easier to control with things like atom smashing, dfhack, refuse piles, and merchants.

flows and mechanical things are very minor if at all hindering unless you take everything to the extreme. i once drained oceans to fill the caverns and had no fps loss from 100 (at a low number of dwarves of course. i suspect doing the same at a fully-fledged fortress would bring it to its knees).

in conclusion, is it pathfinding? maybe. i dont know for certain. but one thing we know is that its derived from population.
Logged

malvado

  • Bay Watcher
    • View Profile
Re: Best way for cleaning up a Fortress for further playing later on.
« Reply #16 on: March 24, 2016, 10:41:38 am »

I've been thinking a little about the information we are getting here and I think there's a few hints at what might be causing the problem :

1 Access to database of items and localization : Things can get pretty slow when you as the bookkeeper goes through the records and checks for example how many "dolomite" rocks you have for use, my personal guess is that perhaps that whenever a dwarf goes to a stockpile and tries to access an item, the game goes through the whole "game database" for items in order to search for it.

I guess that a fix for this is to make a better database system that is quicker to access and leaves less strain on the resources, could probably even be used by a second computer core for these kinds of jobs. Stockpiles could probably also be managed better and probably an "organize" job for some of the dwarves could help stack up items making their access easier.

2 Pathfinding : I don't really think it's the worst problem, but certainly I've seen some trouble with some cavern layers, weirdly though if i "opened" these up a little i got better fps. Now I don't think this will really affect adventure mode as much, but definitely getting those caves "opened" up a little will probably help fps a little.

There's still a few things that I'm not sure about , such as impassable doors for pets, does they stay in front of the door so that an fps drop occurs? Hard to say. Seems dogs following their "trainger" might have this issue. Would have been nice if dogs could be issued an stay at kennel order and when they are supposed to help out ( like a hunter going on a hunt ) they could be picked up. Same with war dogs and other trainable war animals. A pet Trainer could probably also stay around that kennel treating wounds, training the war animals and so on .

So I'm hoping database optimizations and better item management can solve some of the fps drops we are currently seeing and this could perhaps ble applied on several parts of the game.
Logged

gchristopher

  • Bay Watcher
    • View Profile
Re: Best way for cleaning up a Fortress for further playing later on.
« Reply #17 on: March 25, 2016, 01:02:03 pm »

It only reads mat_type for items that are thread. Just out of curiosity, what was the item that you had that was thread but didn't have a material?
Sorry! That was me failing to copy/paste correctly.
Logged

Robsoie

  • Bay Watcher
  • Urist McAngry
    • View Profile
Re: Best way for cleaning up a Fortress for further playing later on.
« Reply #18 on: March 30, 2016, 04:44:32 pm »

Have anyone experimenting with checking the impact of building floors on a large zone of the surface (to avoid the inevitable repeated "treesplosion" ) ?
If you pave a large area of the map, it can mean a few thousands of floor tiles, isn't that going to similar problem as having too much items ?
Logged
Pages: 1 [2]