Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Stairs or Ramps?  (Read 599 times)

Pan

  • Bay Watcher
    • View Profile
Stairs or Ramps?
« on: October 06, 2010, 10:02:00 pm »

Hi everyone. I just saw a discussion on whether stairs or ramps kill fps. Seeing how the opinions are rather mixed, I got no information. Does anyone know which one is the fps killer?
Logged

BigJake

  • Bay Watcher
  • Know-it-all and bragart
    • View Profile
Re: Stairs or Ramps?
« Reply #1 on: October 06, 2010, 10:05:01 pm »

Forgive the snarkiness, but you just saw a discussion on the topic and decided to make a post to continue the exact same argument?
Logged

Namfuak

  • Bay Watcher
    • View Profile
Re: Stairs or Ramps?
« Reply #2 on: October 06, 2010, 10:06:09 pm »

The reason opinions are mixed is simply because it isn't clear.  In theory, a ramp is more effective because they choose one path.  But, it is also theorized that stairs are more effective since they go straight up and down.  And that doesn't even speak to which works for what you are trying to do.

I personally use stairs because it's easier.  But I'm the worst, I make 3x3 staircases for my main fort (and maybe 2x1 when going down to magma sea).
Logged

Pan

  • Bay Watcher
    • View Profile
Re: Stairs or Ramps?
« Reply #3 on: October 06, 2010, 10:18:47 pm »

Forgive the snarkiness, but you just saw a discussion on the topic and decided to make a post to continue the exact same argument?

 No, cuz I actually saw it yesterday (no idea why I said I 'just' saw it. Probrably cuz I was eating breakfast at the same time.), so that topic may be in page 3-4 or something. And also cuz it's actually pretty important information if one of them kills your fps, and the other one helps it.

I make 3x3 staircases for my main fort
Man, I do that all the time...
 
Logged

BigJake

  • Bay Watcher
  • Know-it-all and bragart
    • View Profile
Re: Stairs or Ramps?
« Reply #4 on: October 06, 2010, 10:22:39 pm »

Unfortunately, the topic has not become clearer in the day since you read that thread.  They both have an effect on FPS.  There are a TON of variables that affect to what degree they do that and, at least for me, it's been an act of congress to try and pin them down.

What I'm trying to say is, more !!science!! is required.
Logged

Miuramir

  • Bay Watcher
    • View Profile
Re: Stairs or Ramps?
« Reply #5 on: October 07, 2010, 10:04:17 am »

There's a lot of confusion because there is no single simple answer.  Pathfinding slowdown comes primarily from a combination of three main factors: how many pathfinding jobs are being generated to start, how much work the pathfinder algorithm has to do to find the correct path, and how often the pathfinder has to re-path due to some change along the way. 

The first factor can be sort of controlled by having less going on in your fort; long-distance hauling is a major factor, particularly stone and post-invasion rubbish, and in some forts seeds.  Assigning more haulers improves the rate that things get cleaned up in dwarf-time, but has increasingly diminishing returns in computer-time (and therefore human-time) as they start interfering with each other.  Additionally, having short and direct paths between commonly-used destinations can help considerably.  Site temporary mason's workshops near where the stone is being produced, for instance.  Produce plenty of bins, and try to focus on things that can be stored and hauled in bins; that can divide some hauling by a literal factor of ten (especially to the trade depot). 

The second factor can be controlled by giving the pathfinding algorithm fewer choices over long distances, but not too few.  If there are several ways to get someplace, it will effectively need to investigate all of them in parallel, which slows things down.  However, if there are too few paths, it will have to keep recalculating when it is blocked; remember that by default one dwarf fits in a square, forcing a second into it reduces to crawling speed. 

You've got basically three tools to optimize this second factor, and different people think they are differently hard. 

The first optimization strategy is to create a highly optimized, dense fort; if no dwarf ever needs to travel more than a few dozen tiles to do anything they need to do, pathfinding stays quick.  This tends to be tricky to lay out, is vulnerable to mistakes, doesn't flex to deal with the natural terrain easily, and some think it lacks epicness.  Various sorts of fractal or ant-farm-derived layouts dominate here.  It does improve efficiency in both dwarf-time and computer-time however; if you are concerned with pure efficiency over aesthetics this is probably the way to go.  You can also design a "work camp" that is a highly efficient 3-D modular system for your dwarves to use while they build the opulent palace-fortress of their dreams for later. 

Another option is to lay out areas with plenty of space for movement and expansion, and use the path painting system DF has to lay out high and low traffic areas to speed the pathfinder.  This seems to be what Toady One assumed we'd do, as we've got some fairly detailed settings and systems available to us.  The key improvements here are not in laying out high-traffic stripes down major hallways (it helps, but the computer can usually figure that out itself), but in using low-traffic markings in dead-end doorways (e.g. most rooms with only one entrance) to "pre-prune" the pathfinder's decision making (discourage it from wasting time checking out every square in the room to see if there's a way to shortcut through it).  This allows you to (within reason) design your fort however you want, and then fine-tune the dwarf pathing directly; it does require learning how to use another system however, and it helps if you read up on A* and the like. 

A third option is to engineer your fort to *force* dwarves to path the way you want.  This requires a bit more knowledge of how DF actually works to design, and is harder to rearrange than the above; but it may be easier to describe in a cookie-cutter fashion for new players.  Basically, by using DF tricks to force there to be only a few paths from one place to another, you hope to reduce re-pathing.  Disadvantages also include that it can slow your dwarves in dwarf-time even though it improves computer-time performance, especially if something happens to block a route; the design by nature doesn't have a lot of backup paths, sometimes forcing dwarves to go around obscure long routes or cancel tasks. 

The worst option is to do none of the above; a medium-sized block column of stairs connecting a vertically sprawling fort with no pathing markings and busy dwarves is pretty much a worst-case scenario.  Smaller stair columns or complex ramp arrangements are ways to implement the third option; path markings in your halls and stairs implements the second option; not having things separated that much (e.g. moving the fort down rather than the materials up) implements the first option. 
Logged