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 10075 times)

gnidan

  • Bay Watcher
    • View Profile
Minecart Routing Project
« on: January 08, 2016, 01:21:01 pm »

Update: I'm putting a schematics documentation work in progress in my dfwiki user page at http://dwarffortresswiki.org/index.php/User:Gnidan

So I decided to make a minecart router using logic circuits and bit storage.

I figured out a scheme that vaguely works as follows:
  • There are sections of "shared track"
  • Each shared track segment has exactly two ways in and one way out.
  • Shared track segments are typically in pairs, for both directions.
  • Each shared track segment has 1 bit for "in use", and 1 bit for each hauling route that uses the segment
  • Shared track segment entrances have rollers and doors, along with 2 more bits for the two entrances, to indicate that a cart is waiting.
  • A simple AND circuit determines if a cart has permission to enter the shared track, triggering an open door.
Let's see it!

Overview:
Spoiler (click to show/hide)
Follow a cart as it travels a full loop.

Waiting Area:
Spoiler (click to show/hide)

There are two minecart waiting bits on each end of the track:
  • Route 1 Waiting
  • Route 2 Waiting
These are used, along with the appropriate "Track use bit", to provide input to the waiting circuit (left of armor stockpile). The pressure plates in the waiting circuit trigger the corresponding doors to open, allowing a waiting cart through.

Basically, a cart waits if the track is in use, or if another cart is already waiting. When neither of those are true, the door opens, and the cart is off!

Track Use Storage:
Spoiler (click to show/hide)

There are 6 "track use" bits, in two rows. The top row of bits is for westbound, the bottom for eastbound. From left to right, the bits are used for:
  • Track in Use
  • Route 1 Active
  • Route 2 Active
The active route bits are used for roller switching. Track use bits are used for waiting carts.

Conclusion:
This has been a ton of fun! I've got a ton of next steps to complete to get it fully the way I want it (removing a couple extraneous bits, then adding support for more than two routes), but overall I'm super excited to build a vast network of minecarts zooming at high speeds around my fort.

EDIT: Here's the imgur album link https://imgur.com/a/0fL5E
« Last Edit: January 27, 2016, 12:21:20 pm by gnidan »
Logged

martinuzz

  • Bay Watcher
  • High dwarf
    • View Profile
Re: Minecart Routing Experiment: Success!
« Reply #1 on: January 08, 2016, 01:34:52 pm »

The post is masterfully encrusted with SCIENCE and masterfully studded with INGAME FOOTAGE.

I must approve
Logged
Friendly and polite reminder for optimists: Hope is a finite resource

We can ­disagree and still love each other, ­unless your disagreement is rooted in my oppression and denial of my humanity and right to exist - James Baldwin

http://www.bay12forums.com/smf/index.php?topic=73719.msg1830479#msg1830479

Symmetry

  • Bay Watcher
    • View Profile
Re: Minecart Routing Experiment: Success!
« Reply #2 on: January 08, 2016, 02:06:38 pm »

This is excellent.  I'm trying to think how I can usefully direct the carts.  It needs some way to choose which of N drink stockpiles need drink the most, say, so we can direct the carts there.  I can see ways of doing it but they all use a lot of logic and this is quite nicely minimal.
Logged

gnidan

  • Bay Watcher
    • View Profile
Re: Minecart Routing Experiment: Success!
« Reply #3 on: January 08, 2016, 02:11:56 pm »

This is excellent.  I'm trying to think how I can usefully direct the carts.  It needs some way to choose which of N drink stockpiles need drink the most, say, so we can direct the carts there.  I can see ways of doing it but they all use a lot of logic and this is quite nicely minimal.

Heh, yeah. I was thinking about how to achieve that, but it's kind of tricky. My approach requires one hauling route per source/destination, so my plan is to divide my source stockpiles into multiple piles, so there'd be a roughly equitable division of goods to each destination. It's also tricky with bins/barrels... I was thinking of an approach where I could use the "Give to Stockpile" option in the hauling route, rather than just dumping items. I imagine this could be workable... dwarves would pull from the cart until it's empty or until the dest. stockpile is full.

Also: glad you like!
« Last Edit: January 08, 2016, 02:15:50 pm by gnidan »
Logged

therahedwig

  • Bay Watcher
    • View Profile
    • wolthera.info
Re: Minecart Routing Experiment: Success!
« Reply #4 on: January 08, 2016, 04:01:39 pm »

A new era of hauling has arrived!

Seriously though, it's really cool to see minecarts being used in such a sophisticated hauling system since most mentioned applications are launchers, logic systems, quantum stockpiling and magma. I wish we had more threads like these. Or at the least, minecart track recipes.

(Currently experimenting with getting booze/food to the taverns and barrels and pots back to the farms, though there's still the desired items container bug, and it seems that I should limit movement to prepared meals and booze and leave the rest at the farms. And to get around the first issue it seems that even with guiding turned on, you should have a double track that loops to make sure that the minecart gets filled with food, booze, pots and barrels at stop 1, emptied at 2, filled with barrels and pot at 3, and then emptied again at 4, as dwarves will stop at the first stop they come across)
Logged
Stonesense Grim Dark 0.2 Alternate detailed and darker tiles for stonesense. Now with all ores!

SyrusLD

  • Bay Watcher
  • [NOCTURNAL]
    • View Profile
Re: Minecart Routing Experiment: Success!
« Reply #5 on: January 08, 2016, 04:15:49 pm »

Were you trying to play Transport Tycoon in Dwarf Fortress?


Looks amazing though. I normally just tend to have my dwarves push the minecarts themselves, since that already causes enough injuries/deaths.

About booze ... I always had the problem that you can't quantum stockpile barrels, so I always kept them in their seperate stockpile - or just in the still.


I still feel like automated minecart systems lack some options to make them really more than just a very technically sophisticated way of transporting goods which could just as well be transported by a dwarf "guiding the minecart". But once you see this working...have to say, I am impressed!
Logged
In Remembrance of Bengel Hairybasement,
Strangler of a Sasquatch, Troglodytes and a Cyclops,
Slayer of a Giantess, whom he burned alive.
Died in a Heroic Fight with a Grizzly Bear.

Innocent Dave

  • Bay Watcher
    • View Profile
Re: Minecart Routing Experiment: Success!
« Reply #6 on: January 09, 2016, 08:02:00 am »

Wow.  This is what I always wanted to do with minecarts, but was never smart enough to figure out :)
Logged
Reaching one's life goal shouldn't come with a happy thought.  It should come with a sudden existential crisis.

BlackBronze

  • Bay Watcher
    • View Profile
Re: Minecart Routing Experiment: Success!
« Reply #7 on: January 09, 2016, 08:49:17 pm »

*whistles* pretty intense! Definitely something that I would love to try to implement one day (if I ever figure out how to properly route rail carts, that is.) I like the engineering that goes behind this, and respect the mind behind this marvel even more so.
Logged

steel jackal

  • Bay Watcher
  • [UNIQUE_DEMON]
    • View Profile
Re: Minecart Routing Experiment: Success!
« Reply #8 on: January 09, 2016, 09:12:52 pm »

i cant even begin to wrap my mind around this

tbh i dont even know how to use minecarts, period

im guessing that minecarts are like the redstone of minecraft, but can also haul stuff?
Logged
i am a dwarf and im digging a hole, diggy diggy hole

my art: http://www.furaffinity.net/gallery/tylerrobotnik/

Nagidal

  • Bay Watcher
    • View Profile
    • My gaming channel
Re: Minecart Routing Experiment: Success!
« Reply #9 on: January 09, 2016, 10:30:57 pm »

This sounds very exciting, thanks for the great post.
Logged
I stream most of my DF sessions: gaming.youtube/nagidal146, they are archived on my youtube channel. (Dwarf Fortress Tutorials)

gnidan

  • Bay Watcher
    • View Profile
Re: Minecart Routing Experiment: Success!
« Reply #10 on: January 10, 2016, 01:00:46 am »

Thanks for the encouraging feedback all! My goal with this is to get automated hauling of goods around my fort for many/all industries. This first pass has just been kind of a proof of concept. Once I figure out some of the trickier route-switching stuff, I'm going to try to do a full implementation, and document the engineering in the form of schematics/detailed explanations. (Basically, I just hate the aesthetics of "central staircase" designs, so gotta cart all the things!)
Logged

therahedwig

  • Bay Watcher
    • View Profile
    • wolthera.info
Re: Minecart Routing Experiment: Success!
« Reply #11 on: January 10, 2016, 01:04:24 pm »

Who needs central staircase designs when you can have center ramp-spiral downwards! Takes only a little more effort, is mine-cart future-proof, and are prettier, imho.(They are, theoretically, also a little easier on the FPS due to the limited amount of ways you can move on a ramp)
Logged
Stonesense Grim Dark 0.2 Alternate detailed and darker tiles for stonesense. Now with all ores!

gnidan

  • Bay Watcher
    • View Profile
Re: Minecart Routing Experiment: Success!
« Reply #12 on: January 11, 2016, 12:31:27 am »

And... corrupted save :-[ suddenly everything collapsed and HFS is exposed. Heed dfhack's pre-release warnings, folks.
Logged

Button

  • Bay Watcher
  • Plants Specialist
    • View Profile
Re: Minecart Routing Experiment: Success!
« Reply #13 on: January 11, 2016, 01:15:12 am »

A good way to handle "Where needs what?" input is to use minecarts on pressure plates instead of traditional stockpiles at the destination.
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 Experiment: Success!
« Reply #14 on: January 11, 2016, 12:04:26 pm »

A good way to handle "Where needs what?" input is to use minecarts on pressure plates instead of traditional stockpiles at the destination.

This. Wow. That's a really great idea. Minecart without enough weight triggers some circuitry to indicate "need more food here", then the router switches to that destination. Can one minecart dump into another? Button, I am not sure if I should thank you or curse you, because now I have to do this.
Logged
Pages: [1] 2 3