Bay 12 Games Forum

Please login or register.

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

Author Topic: "Using up stone" How does that REALLY work for fps?  (Read 9395 times)

caperon

  • Escaped Lunatic
    • View Profile
Re: "Using up stone" How does that REALLY work for fps?
« Reply #30 on: June 28, 2010, 02:13:05 pm »

As some people said before, using a spiral ramp design got better fps than whit a stacked staircase. Helps  having only 1 possible route for any place too.
Logged

uber pye

  • Bay Watcher
  • murderhobo extraordinaire
    • View Profile
Re: "Using up stone" How does that REALLY work for fps?
« Reply #31 on: June 28, 2010, 03:04:53 pm »

kill everyone  ;D
Logged
"Immortal" just means that you haven't killed it hard enough

X-MAS TIME!!!!!
the mad immortal child! xmas themed

Hyndis

  • Bay Watcher
    • View Profile
Re: "Using up stone" How does that REALLY work for fps?
« Reply #32 on: June 28, 2010, 03:20:02 pm »

Like if you had a 1000 socks a dwarf going to get a new sock would have to choose from a 1000 socks, which makes it a "harder" decision than picking up the only sock on the map.  I imagine this would be exponential in the case of stone but simply forbidding the vast amount of it will have the same effect.  However the fps difference will be minimal and not really noticeable in the majority of cases though.  Basically unless you have millions of stone you are really not going to see a noticeable performance drop caused by the stone. 

There actually is a difference, and a very noticable one.

I use a custom workshop with a custom reaction to prospect stone for metal. Toss in 5 junk stones, 1 unit of fuel, and out comes 1 metal bar.

With more than 5,000 stone there is a noticeable pause whenever I select the workshop. The workshop needs to decide what jobs it can show, and so it finds all items that it can potentially use, which is every stone that has ever been mined. With 15,000 stone its a full 1-2 second pause.

Eating up the stone reduces the delay until its unnoticeable again. Each time a task is assigned the game must check every possible object and path relating to that task to decide what the task should involve. Reducing the number of variables does improve things.



Also just killing all of your pets helps out a ton. If you want meat just create a military squad, give them nice weapons and armor, and have them defend a burrow that is designated to be an entire underground cavern. They will automatically attack hostile creatures, and nearly all underground creatures are hostile. The dead creatures are then hauled to a refuse stockpile where they are butchered for meat and leather.
Logged

Hyndis

  • Bay Watcher
    • View Profile
Re: "Using up stone" How does that REALLY work for fps?
« Reply #33 on: June 28, 2010, 03:27:23 pm »

I would say that in my case goblinite creates far more items than any stone I dig up. All the crap from 20 goblins a year adds up extremely fast. I wonder how forbidden junk affects frame rate.

Create several garbage chutes for easy access, with an atom smasher at the bottom, and each atom smasher linked to the same lever or repeater. Just dump the stuff into those chutes and atom smash it into oblivion. If you create a few around your killing zone dumping it all will be done very quickly. If a dwarf only needs to haul an item a few step before dumping it the area will be cleaned up in no time at all.
Logged

thijser

  • Bay Watcher
  • You to cut down a tree in order to make an axe!
    • View Profile
Re: "Using up stone" How does that REALLY work for fps?
« Reply #34 on: June 28, 2010, 03:43:15 pm »

or you just use magma to get rid of your garbage.
Perhaps someone could experiment what happens when you wall of almost all of the outside world and wall of every carvern. Just to see whatever those large empty zones are doing anything for the lag.
Logged
I'm not a native English speaker. Feel free to point out grammar/spelling mistakes. This way I can learn better English.

Daetrin

  • Bay Watcher
    • View Profile
Re: "Using up stone" How does that REALLY work for fps?
« Reply #35 on: June 28, 2010, 06:11:28 pm »

or you just use magma to get rid of your garbage.
Perhaps someone could experiment what happens when you wall of almost all of the outside world and wall of every carvern. Just to see whatever those large empty zones are doing anything for the lag.

I noticed an FPS jump when I walled off a cavern.  I'd honestly suggest putting in drawbridges to block off caverns when you aren't using them, not to keep out monsters, but to stop the pathing.
Logged
All you need to know about Ardentdikes
It is really, really easy to flood this place with magma fwiw.

Doors stop fire, right?

MC Dirty

  • Bay Watcher
    • View Profile
Re: "Using up stone" How does that REALLY work for fps?
« Reply #36 on: June 28, 2010, 06:49:27 pm »

or you just use magma to get rid of your garbage.
Perhaps someone could experiment what happens when you wall of almost all of the outside world and wall of every carvern. Just to see whatever those large empty zones are doing anything for the lag.

I noticed an FPS jump when I walled off a cavern.  I'd honestly suggest putting in drawbridges to block off caverns when you aren't using them, not to keep out monsters, but to stop the pathing.
I could be wrong, but I'm pretty sure drawbridges don't stop the pathing process. It's like the old problem with forbidden/pet-forbidden doors where tightly closed, forbidden doors stop pathfinding while every other combination actually doesn't, regardless of whether the creature can actually go through them.
Logged

Retro

  • Bay Watcher
  • o7
    • View Profile
Re: "Using up stone" How does that REALLY work for fps?
« Reply #37 on: June 28, 2010, 06:50:00 pm »

To weigh in, I find that stone count (and I'm only saying stone instead of all loose items because it's easier to track) doesn't have a noticeable effect until you're in excess of 5k stone, and doesn't start to really slow down your fort until 10k-15k. However, loose items get more of a bad rap than they're due, FPS-wise. The main things that kill FPS are mass designations, fluid motion, inefficient pathing (and most people will never notice the first).

I'm not sure if this has been brought up in the thread as I kind of skimmed it, but building floors and what not out of stone does increase your FPS, albeit by an incredibly tiny and insignificant fraction. My reasoning is thus: terrain is procedurally generated via various codes and biome information; data is not necessarily always tracked. This is why pouring desalinated water past the z-level of a salt-water aquifer (with the aquifer being contained and not contacting the fresh water) will result in magically salinated water, and why casting obsidian in a soil layer, then building a floor on it and deconstructing it will result in a soil floor. The game knows what z-level of what biome ought to be salt water and what z-level of what biome ought to be what stone/soil type. So if you have a regular microcline cavern floor and build a felsite floor on it using a loose stone, the game is suddenly tracking one less bit of data: Before you build it, the game is tracking biome information, that specific tile's information (natural, microcline, unsmoothed, unengraved, no liquids, etc), and the stone unit. Afterwards, it is only tracking biome information and the tile information - it is no longer tracking that the floor was a microcline floor. Upon deconstructing the felsite floor, a new microcline floor is created and tracked via biome information, much like the soil-on-cast-obsidian thing. Just a theory, but one I have a lot of confidence in. When you wipe items from your game (chasming, proper boiling, atom-smashing) FPS does increase, but not enough that anything you can do without editing the raws will cause a noticeable impact. If you have a fort of 100 dwarves hauling stone to the magma sea for a year nonstop, they'll probably only clear a few thousand stone, which probably won't really make a difference to your FPS at all, and frankly, isn't worth the damn time, whereas if you're not above it, you can edit all the [layer stone] to boil into a pleasant mist, forward your game one frame, then remove the appropriate tags, eliminating a few hundred thousand stone in one go and throwing on 10-40 FPS depending on your fort. The best non-raw-editing thing you can do about stone is just avoid purposeless digging. Your average fort isn't going to generate enough stone to run down the processor unless you're doing something radical. And if you take the time to pave areas down with the stone you dig, it'll probably help slightly in the long run.

Outside of item tracking, the best things you can do for FPS are to keep efficiency very high (and use traffic orders) and try and get fluids to even out - an area of completely motionless 3/7 is just as lagless as a full 7/7 area, so a keenly-observed bucket brigade can balance most things out. Also, if you're not megaprojecting or building a massive military, there's no harm in culling migrants before they befriend anyone.

God, I hope this post made sense. I think I rambled on a bit there.

cephalo

  • Bay Watcher
    • View Profile
Re: "Using up stone" How does that REALLY work for fps?
« Reply #38 on: June 28, 2010, 07:03:58 pm »

In the process of building a garbage smasher, I realized while looking around that if merchants die, you can end up with many hundreds of items in one shot. I found one square that looked like a cage on the ground, but really there was like 80 items there!
Logged
PerfectWorldDF World creator utility for Dwarf Fortress.

My latest forts:
Praisegems - Snarlingtool - Walledwar

bdog

  • Bay Watcher
    • View Profile
Re: "Using up stone" How does that REALLY work for fps?
« Reply #39 on: June 28, 2010, 07:26:35 pm »

I'm not quite sure that traffic orders can improve a lot if one screwed up entire layout (they just force tiles to be treated as they would appear further away for pathfinder and calculating still takes place - and if wrongly used can significantly drop fps)
What would be better option would be a reverse-burrows (you assign dwarfs who cannot enter them; when burrows will be fixed ofc) rather than using traffic orders IMHO.

As for stones: I didn't do any dwarven science about this matter but it sounds that they wouldn't lag as long as there's no job associated with them (no stockpiles, no masons, no pathfinding from/to them and so the *only* thing left is temperature calculations).

Ok, now the question: why no one said anything about shamelessly big food/booze stockpiles on which ANY item at ANY given time could be a target for eating/drinking/moving/vermin eating/rotting?
As times go on fortresses go bigger and bigger and with easy 'fire and forget' food chain management one can get dozens of plump helmets in hundreds of barrels (just an example) and any one of that plump helmet if I'm not wrong could force pathfinder to recalculate its "closest" path avoiding obstacles, other dwarves and pets in meeting hall/dining room.

Its just a long/wild shoot but IMO but we shouldn't blame only stones for low fps.
Logged

Nihilist

  • Bay Watcher
    • View Profile
Re: "Using up stone" How does that REALLY work for fps?
« Reply #40 on: June 28, 2010, 08:03:17 pm »

I need to experiment with the food thing but that has some merit, I mean my last fort that died an FPS death had some 3000 food and 7000 seeds and 2000+boozes stocks, with all run with R(not manger). I'll report on that tomarrow
Logged

Sarudak

  • Bay Watcher
    • View Profile
Re: "Using up stone" How does that REALLY work for fps?
« Reply #41 on: June 28, 2010, 10:46:13 pm »

Funny... I got over 100 dorfs and I felt like it was going really slow. I turned on the FPS counter and it says 60... I can't imagine playing with less than 20 FPS... I would surely die...
Logged

Olreich

  • Escaped Lunatic
    • View Profile
Re: "Using up stone" How does that REALLY work for fps?
« Reply #42 on: June 29, 2010, 12:51:08 am »

Pathfinding is the single largest eater of FPS. Everything but pathfinding eats up an almost negligible amount of FPS in comparison. Thus, a few simple rules govern your framerate almost entirely:

The less things that are pathfinding, the higher the FPS.
The easier the pathfinding, the higher the FPS.
The shorter the paths found, the higher the FPS.

First Question: What is a "thing" that would be pathfinding?
Animals, Enemies, and Dwarves. These are the only things that pathfind, but considering the average fortress has 75-125 dwarves, 20-30 goblins every year, 300 cats, and a healthy dose of other animals, that's enough to bring most processors halting when trying to find the shortest path between all of the starting locations and ending locations available.
Some things that don't pathfind (or do so to no ill-effect): caged/restrained animals, caged enemies, anything locked in a 1 square room (rooms of <10 squares are negligible when pathfinding)

Second Question: What makes pathfinding easier?
Straight lines. Walking 1000 steps directly toward an object is much faster than walking 200 steps around 100 objects to get to the destination. So, if you have a central staircase, make sure anything that might want to go to the central staircase has as close to a straight line to it as possible.

Avoid this shape for any room:
Code: [Select]
LEGEND: W = Wall, D = Dwarf, X = Staircase, . = Floor
...........XXX
...........XXX
...........XXX
.WWWWWWWWWW...
..........W...
..........W...
..........W...
..........W...
..........W...
..........W...
..........W...
..........W...
..........W...
D.............
The pathfinder checks each tile to try to get from the Dwarf to the Staircase. The first tiles will be in a straight line to the corner of the room (shortest distance). Then it will check the tiles next to the ones it's already checked, eventually checking every tile in the room, and many of the tiles in one of the hallways.

A better layout:
Code: [Select]
...........XXX
...........XXX
...........XXX
.WWWWWWWW.....
..............
..........W...
..........W...
..........W...
..........W...
..........W...
..........W...
..........W...
..........W...
D.............
This layout allows the game to go directly to the staircase to get where it is going. For vertical efficiency, more stairs is usually better (allows more lines up and down, just make sure to keep your layouts open, but for the issues of decor and cave stability)

And finally, the third question: How do I make shorter paths (and why should I anyways)?
First off, shorter paths are easier for the game to calculate (less squares checked = less computing power required). Short paths also stop the sputtering that long paths may create when a dwarf wants to go deep into the wilderness to get a log, but needs a 300 square path to get there.

To make shorter paths, it's fairly easy, just put everything closer together and keep straight lines as much as possible. This doesn't work so well for wood-cutting and the like, but that can be solved either by wood-cutting inside on tower-caps, or by creating a high-traffic zone in a path directly to the wood-cutting site (making the game use the pre-defined path, instead of checking 3000 squares just to get outside). Another option is to build the wood-cutter a home out in the boonies and have it stocked with some food and water and a bed, so he never has to run back to the fortress.

However, running out to the site isn't usually a trouble (happens once every couple of minutes at most). What is a problem is getting all that wood cut back into the fortress and into a stockpile (happens 100 or 200 times for every large designation of woodcutting). The wood is all spread out, and has to find it's way back to the fortress. One can use the high-traffic paths again, but a slightly more efficient manner is to create a few stockpiles in direct lines to one another, that take from one stockpile to the next. This will create a queue of wood going to the main stockpile as well as provide short, straight paths to get the wood back to the fortress.
Logged

Hammurabi

  • Bay Watcher
    • View Profile
Re: "Using up stone" How does that REALLY work for fps?
« Reply #43 on: June 29, 2010, 07:07:20 am »

On Pathfinding, I wonder if the dorfs pathfind each frame?  Or do they pathfind once upon taking a new job, and only re-pathfind if something happens to their current path?
Logged
Back in 1971, Nolan Bushnell of Atari said, "All the best games are easy to learn, and difficult to master," a design philosophy now treated as instinctual by nearly every designer in the industry.

afoninv

  • Bay Watcher
    • View Profile
Re: "Using up stone" How does that REALLY work for fps?
« Reply #44 on: June 29, 2010, 07:16:56 am »

I hope that's not derailing...
This is a *great* thread re pathfinding, algorithms used and best practices for fort layout. A must read for everyone who wants to increase FPS.
Logged
-
V.
Pages: 1 2 [3] 4 5 ... 7