Monday, June 20, 2011

43 – Stocking some piles, part 1

Let me start again by congratulating Irrlicht on being random. I was loading some textures, and I accidentally deleted a few of them. So what does a responsible little toolkit do? Drop FPS by about 70 of course. I can understand not showing an error or something, but dropping performance like this is very silly. *whine* *whine* *whine*

So in this short series I will be demonstrating the final implementation for stockpiles, followed by another short series for buildings. And after I will post an updated feature set for version 0.1, complete with color coding and progress report so I can see how close I am to the release feature wise. Some of the content in this series will be familiar, some new.

The new inspection panel plays a big part here, so let me show it first. Here we see it in action showing the information for a single floor tile:

We see the current coordinates, a preview of the floor, a description, the type of the material and the current grass coverage. Now I'll cut down a tree and see what the panel shows:

Nothing ground breaking here: we are informed that we have 5 pine logs and that there is a trunk in the cell. The interesting part comes when we involve stockpiles.

But before, I would like to talk about a change in the stockpile system that might turn out to be quite controversial. I've decided to make stockpiles nontraversable. A dwarf will no longer be able to enter the cell occupied by a stockpile, the same as if they try to enter a cell with a solid obstacle, like a wall. There is no technical limitation for this decision and in the past stockpiles were traversable. I just grew tired of the way stockpiles are set up usually: a huge rectangular sea of stuff. This change should lead to more interesting stockpile shapes and change the way you structure your fortress.

Back to wood stockpiles:

First the panel is informing us that we have a wood stockpile with 5 logs inside. Then, it tells us exactly what kind of logs: 5 pine logs. Let us cut down an oak:

As expected, we now have 5 pine logs and 5 oak logs in the stockpile. One more tree, this time a willow:

Just as expected! A wood stockpile can only hold 12 logs. The remaining 3 logs are still in their original cell:

Of course, you can create larger sections of wood stockpiles, but if you are not careful, since stockpiles are nontraversable, you can waste area if you create rectangular ones:

The to stockpiles in the middle are not reachable, so we wasted two squares there. Another thing to notice is that the panel grows to accommodate all content.

So now we can easily tell what logs are in a single pile. And no, I will not differentiate logs from different trees visually. Maybe sometime in the far future. But how can we get an overview of all our resources? Surely clicking on each stockpile is not that efficient. This is where the item browser comes in:

By browsing the appropriate tab, we see our total stockpiles of logs, together with small icons and color coding.

That's it for wood stockpiles. Join me next time for food stockpiles, which are surprisingly a lot more complicated.

So now that you read that, what do you think? I tried to make the system as easy to use as possible, especially for people who are not that happy with the way stockpiles work in other games and how involved the process can be.


  1. stock piles are not traversable- that seems reasonable enough.
    but why do i want to know what type of logs are in each pile?

    also, do logs or any other stocks (except rock..) degrade in time?

  2. I agree with the non-traversable stockpiles. That is all.

  3. non-traversable stockpiles... sounds good here as well :-) Keep up the great work.

    and thanks for the frequent updates!

  4. yea, i try to avoid making huge rectangle stockpiles in DF because it looks bad. i like the non taraversable stockpiles. can they be reached diagonally? the corners from the inside of a U shaped stockpile.

  5. As a general rule, walking diagonally is OK, even if you have solid obstacles at the corners, but you can't execute tasks diagonally.

    It seemed to make more sense to only allow task to be executed horizontally or vertically since you wouldn't have enough space to reach a tile diagonally while still trying to do a good job.

  6. I had no idea you were using Irrlicht. It's quite a nice little engine but I think you'll find they all have their quirks. I mostly use UDK and I can't even imagine what a nightmare it would be to implement this system into that engine. On one of my more recent productions, my team ran into a crippling memory leak that seemingly came out of nowhere. The problem resolved itself but none of us are really sure why this happened.

    Also, when it comes to time to do some testing on this beast, please let me know. I'd really like to be part of that and help out in some way.

  7. Hi, sorry for the late response....i only have time to catch up on DwarvesH development every few weeks.

    Anyway, it seems to me that making stockpiles non-traversable will strongly discourage players from having big ugly rectangular stockpiles, at the price of forcing them to micro-manage the exact placement of lots of little stock piles.

    I have no particular opinion on whether the rectangle-hatred is a Good Thing or not, but the forced micromanagement of trivia seems to me to be a definite Bad Thing. The price is too high.

    as a player, my attitude to stockpiles would be something like "yes, yes, chuck that sh*t in a pile over there somewhere and don't bother me about it...i've got walls to engrave and beer to brew"

    my 2c worth, anyway.


    ps: that's what sand levels are good for - enormous rooms with huge rectangular stockpiles. your miners can dig 'em out fast and its not like any right-thinking dwarf would want to live with sandy walls (like a filthy hobbit!) rather than decent stone anyway.

  8. Hi Craig!

    Thanks for the feedback! You do make a good point about micromanagement. I did try to take a few steps to keep micro at minimum levels. For starters, you can tell the content and the relative fullness of a stockpile thanks to graphics. Stockpiles only accept a subset of items based on their type and you can't create custom stockpiles. Distances from stockpiles to workshops are important, but not that hard to manage. Items can be used even if they are "out in the open", without involving stockpiles.

    I hope that the only side effect this change will have is that stockpiles will require a larger space from your free usable space on the map, thus making you plan your space distribution differently. The only micromanagement will be related to where you place stockpiles and how much free capacity do you still have.

    You comment gave me the idea to make sand extremely difficult to dig. Roofs will collapse and digging out a stone or soil square next to a sand one will cause the sand to slowly spill out.

  9. yeah, sand probably should collapse. but that would effectively make sand levels equivalent to aquifer levels in DF. sand levels are functionally useful in DF at the moment (e.g. for getting ugly stockpiles out of your pretty living/working areas of the fortress)...making them collapse would make them annoying, just like aquifer levels.

    as for stockpile non-traversability, i think the biggest effect will be that it forces players to have lots and lots of little stockpiles rather than a smaller number of big ones. and there'll be a lot of wasted space due to the need to have at least one traversable space next to each stockpile. probably resulting in alternating lines (vert or horiz) of stockpile and empty floor. or diagonal crosshatch patterns.

    btw, one of the big reasons i use stockpiles (and garbage pits) in DF is to un-clutter the floor - get rid of the crafted items and rock rubble so that i can see the map without all the rubbish uglifying it.

    other people probably have different opinions but overall, i just don't see micromanagement of stockpiles to be in any way fun. i see it as tedious anti-fun that gets in the way of doing more interesting things.

    hmmmm. another way of handling stock management would be if Storeman (Store-dwarf) were a possible job skill for some dwarves that automagicked the mundane micromanagement of storing stuff. similar to the way bookkeeper does the accounting in DF. without high skill levels, the more stuff you have, the easier it can get lost...and the more apprentice storedwarves you need to store, find, and haul stuff (and participate in magic rituals essential to the craft, like the smoko break, hooning around on the forklift, and even the stop-work union meeting).


  10. Hmm, I fail to see where you think that micromanagement sets in? Sure, you need more space and more stockpiles. But you can group a lot of small stockpiles in close vicinity to make things easier to find: wood region, finished products regions, etc. Or you can group by workshops, placing a workshop and stockpiles around it.

    Other than placing the stockpiles, you only need to ask yourself a single question: is there any place left? What other micromanagement do you see? There is no need to have specific layout or to move stuff around. Stockpiles are generally needed for finished goods only. They are a tool to make things easier, not a goal in itself.

    Could you describe some micro scenarios that you encountered in DF? I can then see if this is an issue or not.

  11. i guess, ultimately, it's the fact that you have to worry about it at all. i'd rather just dig out a big room, call it a "warehouse" zone and assign a dwarf (or a few) to look after it - it's their job to know where stuff is and find it, not mine. then i wouldn't have to think about stock levels or especially where an item is.

    Furniture stockpiles are the worst. say you're digging out a residential area for all the migrants. you're going to need a bed and a door, plus maybe a coffer or cabinet for each dwarf. and maybe weapon and armor racks for squad members. so you set your carpenters and masons to creating all those things. pretty soon, your furniture stock pile is full so you have to get your miners to stop digging out the bedrooms, so they can dig out another big room, then designate some or all of it as a furniture stockpile. then you have to dump all the stone in the room so that you can actually store the beds, coffers, doors, etc.

    all of which is a tedious distraction from what I wanted to do - design and build a residential level.

    I can see the point of having mini-stockpiles of raw materials next to workshops, so that they're automatically filled by serf dwarfs while the crafts-dwarves just keep on working. OTOH, that could be handled by each workshop having a "built-in" storage bin or two.