Bay 12 Games Forum

Please login or register.

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

Author Topic: Minecart Routing Project  (Read 10294 times)

gnidan

  • Bay Watcher
    • View Profile
Re: Minecart Routing Project
« Reply #30 on: January 27, 2016, 03:35:46 am »

OK I have gotten enough built that I can say this is viable and extremely useful.

In case anyone is interested, I've documented the basic components of my minecart router on my user page on the wiki, at http://dwarffortresswiki.org/index.php/User:Gnidan#Minecart_Routing. I'm not sure how clearly it's written, but hopefully it gets the ideas across and maybe someone will find it interesting/useful!

Since I like GIFs of minecarts whizzing about, here's one properly waiting for track to clear, then turning a switch on just in time to get to the right destination:

Spoiler (click to show/hide)

So, so far I have 6 routes in play, and I haven't had to reset the system in over a year. I have circuitry built for 16 routes, but this will have to do. I had wanted to get my fort to have this super awesome everything-routes-everywhere system that I could show off, but I'm afraid to spend even more time on this than I have been already. So, I'll settle on documenting my efforts in hopes to inspire other designs/implementations!

Feel free to ask if anything's unclear! (I would like to document more, about signal timing problems and whatnot, but I think I've got the basics down, so I'll leave it at that for now unless people are curious about the nitty-gritty.)
Logged

Button

  • Bay Watcher
  • Plants Specialist
    • View Profile
Re: Minecart Routing Project
« Reply #31 on: January 27, 2016, 10:11:50 am »

Dwarfy as fuck.

What are you actually hauling with your router, if I might ask?
Logged
I used to work on Modest Mod and Plant Fixes.

Always assume I'm not seriously back

gnidan

  • Bay Watcher
    • View Profile
Re: Minecart Routing Project
« Reply #32 on: January 27, 2016, 10:43:29 am »

Dwarfy as fuck.

What are you actually hauling with your router, if I might ask?

At the moment, I have the following routes implemented:

Farms -> Workshops: thread, dye
Workshops -> Farms: barrels, bags, ash for potash making
Workshops -> Bridge megaproject "landing": Blocks blocks blocks. Tables, chairs, doors.
Bridge "landing" -> Workshops: Stone
Farms -> Bridge: Prepared Food, Drink
Bridge -> Farms: Empty barrels

Basically I'm just using the (h)auling menu to control what I want where at a given time. So I've got 3 hauling routes defined (two way), and I've been constantly adjusting what I need for the actual dwarfy projects. So, now that workshops sent a ton of blocks to the bridge landing, and I have the bridge built, I added to the Workshops/Bridge route to additionally send furniture.

In the future, I will send ore to my Metals area, which will send completed furniture back to Workshops. Or maybe I'll move my Metals area altogether... I'd actually like to send magma around in these carts. Because nothing screams dwarf like automated minecart systems carting around magma. Plus other things. Additional stone/ore mining routes. If I build a library, workshops should send paper/quires/bookbindings to that, etc.

I'd gotten the whole system mapped out, but I find that as I'm completing this stuff, the locations I thought I needed are slightly off. The idea is for every industry location to use minecarts to send materials to the appropriate other industries.

EDIT: added more things I forgot I'm already carting around
« Last Edit: January 27, 2016, 10:51:16 am by gnidan »
Logged

Button

  • Bay Watcher
  • Plants Specialist
    • View Profile
Re: Minecart Routing Project
« Reply #33 on: January 27, 2016, 12:28:56 pm »

I take it that you set which route is intended for a given minecart by using a suite of tracks with pressure plates, which then join up for the routing section? Or do you set the signal by levers, or some other mechanism? I'm quite interested in your route circuitry.

When I was designing my aborted attempt at something similar, I planned to have a centralized "sorting facility" to receive all goods and load up each workstation's payload. That really simplified the architecture, because it meant that every other workstation would only need to send goods to a single place. Then the sorting facility was going to have a loop-route for each type of good, which would detour to a track stop for each workstation if that workstation didn't have enough of that good. The problem was that I was going to use a different track for each loop, which was going to be a problem for workstations that were down below the caves. Your single-track routing seems like the solution.
Logged
I used to work on Modest Mod and Plant Fixes.

Always assume I'm not seriously back

gnidan

  • Bay Watcher
    • View Profile
Re: Minecart Routing Project
« Reply #34 on: January 27, 2016, 01:38:59 pm »

I take it that you set which route is intended for a given minecart by using a suite of tracks with pressure plates, which then join up for the routing section? Or do you set the signal by levers, or some other mechanism? I'm quite interested in your route circuitry.

I'm using a suite of tracks. So, loading up the game, cause a screenshot helps explain:
Spoiler (click to show/hide)

This is the workshops loading area, which leads upstairs to workshops/stockpiles. There are four entrances/exits into the loading area, corresponding to four source/destination pairs. So, the bottom track goes to the bridge, and at the bridge there is a similar looping track end specifically for sending carts back to workshops. Any cart that enters the system on the Workshops->Bridge track will end up at Bridge, regardless of what's in the cart, what the hauling route says to do, etc.

The purple black bronze wall has pressure plates that open the doors. This is just to keep dwarves from picking up the carts when they are waiting.

Inside the walled section, there are three shared track segments which control the influx of carts from the four points of entry. These are each marked by two pressure plate/roller/door setups, and correspond 1-to-1 with a "track circuit" elsewhere. When a track circuit sends releasedir, releasing, say, Workshops->Bridge, the "route stepper" or whatever you want to call it (the Route Circuit in my wiki page), gets triggered and keeps track that the minecart is en route.

Basically, this relies on having these different track entrances, so that a given track circuit knows that whenever it releases the right side, it's starting a specific route. Subsequent track circuits trigger to all possible relevant routes, so some track circuit might be used to ferry both Workshops->Bridge and Farms->Bridge, so it'd send a signal to both of those routes. The only route that would update is the one known to occupy the shared track getting released.

Also worth mentioning the white rollers. I've been calling these "switching rollers", and they're controlled by the route bits. So the Farms->Workshops route, for instance, has a bit for when it's on the track that has the switching roller it needs, and thus that bit turns that roller on.

When I was designing my aborted attempt at something similar, I planned to have a centralized "sorting facility" to receive all goods and load up each workstation's payload. That really simplified the architecture, because it meant that every other workstation would only need to send goods to a single place. Then the sorting facility was going to have a loop-route for each type of good, which would detour to a track stop for each workstation if that workstation didn't have enough of that good. The problem was that I was going to use a different track for each loop, which was going to be a problem for workstations that were down below the caves. Your single-track routing seems like the solution.

This is a neat approach! I was considering systems along these lines - I had wanted to sort minecarts by weight, and have centralized dispatch. Ultimately I kind of just settled on this scheme because it was the first thing I could think of that I could assure myself could work.

I don't really mind having separate loading zones for each destination - I figure the dwarves are going to be loading the minecarts by hand at some point anyway, might as well have them do the destination-sorting up front and make that load only happen the once. But lots of the same goods do go to more than one destination... having a centralized storage area makes a lot of sense. Now that I think about it, it doesn't really matter what track topology to use (as long as there's some way of identifying the carts as they enter the system.) The waiting/release circuitry just makes it so that the hand-off record-keeping becomes possible.

My system also doesn't do any kind of quantity checking, dwarf-assisted or otherwise. With food I'm using the hauling "Give to Stockpile" option, so the dwarves do the quantity checking, leaving excess food in the cart to get sent back. It would've been nice if it could've happened automatically, but I'm keeping the scope of the project to just the routing aspect for now.
Logged

Button

  • Bay Watcher
  • Plants Specialist
    • View Profile
Re: Minecart Routing Project
« Reply #35 on: January 27, 2016, 03:25:22 pm »

Would you mind uploading the save so we/I can look at your routing circuits more closely?

I'm getting excited about possibly trying my hand at this again!
Logged
I used to work on Modest Mod and Plant Fixes.

Always assume I'm not seriously back

Gentlefish

  • Bay Watcher
  • [PREFSTRING: balloon-like qualities]
    • View Profile
Re: Minecart Routing Project
« Reply #36 on: January 27, 2016, 03:45:05 pm »

Hm. With that give to stockpile option with food, you could have a single circuit provide meals and alcohol to a multitude of taverns, with first stops taking priority. That's... Really neat, wow.

gnidan

  • Bay Watcher
    • View Profile
Re: Minecart Routing Project
« Reply #37 on: January 27, 2016, 04:54:37 pm »

Would you mind uploading the save so we/I can look at your routing circuits more closely?

I'm getting excited about possibly trying my hand at this again!

:D I'll post it later tonight, after I hook up another route or two. Most of the track circuits right now don't link to anything but each other, so it's less clear than it could be. Do I need to do anything to make the save platform-independent? Just compress the region folder and provide that?
Logged

gnidan

  • Bay Watcher
    • View Profile
Re: Minecart Routing Project
« Reply #38 on: January 28, 2016, 01:45:29 am »

http://dffd.bay12games.com/file.php?id=11721

So, I tried to add another route to show off as a technical demo, and I found a timing problem. So here it is with 3 (or 6, if you count two way separately... which I do!) routes working simultaneously. Two minecarts are actually being used to transport goods, the third is on continual loop just to monkey test, so to speak. The fourth minecart in the system is currently set to forbid, but feel free to reclaim that if you want things to break!

EDIT: I just loaded this up and realized a better place to unpause is 1 z-level up, at 137. Two minecarts are about to be launched from the workshops area.
« Last Edit: January 28, 2016, 02:03:05 am by gnidan »
Logged

gnidan

  • Bay Watcher
    • View Profile
Re: Minecart Routing Project
« Reply #39 on: January 30, 2016, 05:00:17 am »

I've fixed the timing problems and I've uploaded a new version of my fort to the saved games on DFFD. I've also made a couple test minecarts color-coded so it's easy to see their destinations.

After heavy testing, I'm considering this project implemented enough to serve as a demo for all those interested. I'd be more than happy to discuss my approach if anyone has any questions now or in the future. I will likely flesh out some of the docs on my user page in the next few weeks, but my fort development plans themselves are on hold until I'm done with some other responsibilities. (Anyway I mostly just wanted to get this routing system working and documented... reaping the benefits of the system is secondary :D)

If anyone does look into doing minecart routing or any other complex automated fort operations, I'd love to hear about it! Especially if my efforts here find themselves of any use!

Here's the "omg it works! omg it's actually working" demo reel GIF:

Spoiler (click to show/hide)
Logged

Gentlefish

  • Bay Watcher
  • [PREFSTRING: balloon-like qualities]
    • View Profile
Re: Minecart Routing Project
« Reply #40 on: January 30, 2016, 05:21:55 pm »

I really have to say, minecart gifs are the best gifs to come out of dwarf fortress.

How do you make them, by the by? And do you have a schematic for the setup?

gnidan

  • Bay Watcher
    • View Profile
Re: Minecart Routing Project
« Reply #41 on: January 30, 2016, 06:30:36 pm »

I really have to say, minecart gifs are the best gifs to come out of dwarf fortress.

:D well, I don't know about that... I've seen some !!FUN!! gifs of firey destruction...

How do you make them, by the by? And do you have a schematic for the setup?

For making the gifs, I'm using a program called LICEcap for Windows/Mac.

As far as schematics go, I've got schematics of individual components at my DFwiki user page, namely track itself, the "track circuit" for waiting/release, and the "route circuits" for updating the position of each cart. My plan for the page is to write a complete how-to guide for a minimal setup using my concepts, but I'm going to have to wait until I can find the time to do so.

That being said, I'm curious for feedback about what makes sense or not, if anyone cares to glance over my madness. I admit that my documentation is quite premature. My thinking is just that this is something I've wanted to do in DF ever since minecarts got released, and it seems I'm not alone. Not saying my approach is the best-- I just love the idea of megaprojects involving seriously creative engineering, and my hope is to help inspire more of that.
Logged

Gentlefish

  • Bay Watcher
  • [PREFSTRING: balloon-like qualities]
    • View Profile
Re: Minecart Routing Project
« Reply #42 on: January 30, 2016, 10:18:11 pm »

The only thing I am having a problem understanding is the mechanics image. Otherwise the tracks (and even pillars!) are pretty clear.

gnidan

  • Bay Watcher
    • View Profile
Re: Minecart Routing Project
« Reply #43 on: January 30, 2016, 11:55:30 pm »

The only thing I am having a problem understanding is the mechanics image. Otherwise the tracks (and even pillars!) are pretty clear.

OK I expanded that section a bit. Basically, the color-coded gear assemblies/pressure plates are linkages that make the logic function.
Logged
Pages: 1 2 [3]