Bay 12 Games Forum

Please login or register.

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

Author Topic: Minecarts for moving magma  (Read 18297 times)

Xinael

  • Bay Watcher
    • View Profile
Minecarts for moving magma
« on: May 01, 2013, 12:59:28 pm »

I'm trying out some alternatives to pump stacks. I don't like pump stacks, because they use a lot of FPS and making enough pumps to move magma up a lot of z-levels is a ridiculous chore. I started experimenting with using minecarts to move magma, something that the wiki only touches on very briefly, at least compared to the amount of detail on pump stacks.

I'm having a lot of trouble getting the minecarts to work reliably, though. Has anyone had success using them? I'm just trying to set up a small-scale proof of concept at the moment:



The channel on the right has a roller along its entire length, set to max speed, and there's a source of power off the bottom making it run. Ignore the inner loop of track, that's from an earlier failed experiment. The stop above the left-hand channel is set to lowest friction and dumping south. The stop to the north is on highest friction, to stop the cart after each revolution (if this was a real-life application I'd probably fully automate it using a retracting bridge to redirect the cart into a siding but I didn't bother for this small-scale experiment).

The cart works fine with no magma there, so I know all is well in terms of track layout, route setup and so on. Once I put the magma into the channel, though, the cart made it through three or four revolutions before getting stuck at the ramp out of the magma channel:



It looks like it's being pushed up the hill by the roller, not quite reaching the top, and rolling back down into the red stuff.

Anyone have any ideas how to fix this? I'm going to try building another roller before the ramp down into the magma channel and see if more speed helps. The only other alternative I can think of is making the cart drop a bunch of z-levels before it enters the magma to build up speed. That might be a more true-to-life scenario anyway (since the cart will be coming from way up near the surface and dropping 30 or more z-levels in the process), but I found it weird that it worked a few times and then suddenly failed. Since it starts each revolution from a full stop with a push, they should all have been identical.
Logged

MrSparky

  • Bay Watcher
    • View Profile
Re: Minecarts for moving magma
« Reply #1 on: May 01, 2013, 01:12:48 pm »

I found it weird that it worked a few times and then suddenly failed. Since it starts each revolution from a full stop with a push, they should all have been identical.
Was it the same dwarf pushing every time? The strength and/or agility of the pusher might have an influence on the initial velocity.
Logged

Xinael

  • Bay Watcher
    • View Profile
Re: Minecarts for moving magma
« Reply #2 on: May 01, 2013, 01:29:09 pm »

The strength and/or agility of the pusher might have an influence on the initial velocity.
Not according to this post:

A dwarven push starts the minecart at 19990 in the middle of the next tile, in that the first nonzero speed that the cart has is 19990.
Logged

MrSparky

  • Bay Watcher
    • View Profile
Re: Minecarts for moving magma
« Reply #3 on: May 01, 2013, 01:37:33 pm »

The strength and/or agility of the pusher might have an influence on the initial velocity.
Not according to this post:

A dwarven push starts the minecart at 19990 in the middle of the next tile, in that the first nonzero speed that the cart has is 19990.
Ooh, useful thread. Thank you for debunking my incorrect hypothesis so formally!
Logged

Button

  • Bay Watcher
  • Plants Specialist
    • View Profile
Re: Minecarts for moving magma
« Reply #4 on: May 01, 2013, 02:03:30 pm »

From the post you linked to:

Quote
If the cart at least 6/7 deep, and it has room, it will take 2/7 into itself.

I see you've been dumping magma between tests; have you doublechecked the cart to make sure that the magma (and the weight of the magma!) has been correctly removed?

I'm thinking maybe a bug with the minecart's magma-unloading.

Incidentally, if you put an object into a minecart with magma in, does it get incinerated?
« Last Edit: May 01, 2013, 02:09:18 pm by Button »
Logged
I used to work on Modest Mod and Plant Fixes.

Always assume I'm not seriously back

gestahl

  • Bay Watcher
    • View Profile
Re: Minecarts for moving magma
« Reply #5 on: May 01, 2013, 02:13:05 pm »

I'm assumeing you've read
Quote
Rollers may be placed directly on ramps to help pull carts up Z levels. Currently rollers can only be placed on up or down ramps or open spaces if this results in being connected to existing powered components (gears, axles, or pumps). For that matter, rollers themselves transfer power along their sides but not from their front or back (the edges on the track) - the opposite of how horizontal axles work. Care must be taken in glaciers and other extremely cold biomes, since rollers can be rendered inoperable when exposed to freezing temperatures. The effects of floorless rollers on carts are not yet documented.

Because of their one-way nature, rollers are unsuitable for most two-way minecart tracks. However, a minecart set to be guided is not affected by rollers at all — this allows a one-way track to be used in both directions. In addition, rollers do not affect minecarts when disengaged: switching mechanisms (such as a pressure plate attached to powering gear assembly) can be used to create complex paths.

Rollers cannot be powered from above.
I can't tell if the roller in the channel extends the whole way to the ramp, if not, maybe it should. Also a roller on the upper level that covers the down ramp and the next tile might help make sure the cart doesn't slip back down.

Also, the minecart doesn't have to be moving to fill up with magma. Make a pit, put a minecart stockpile in it, pump that magma in, pump it out, sent the cart on it's way. It's slower since you have to wait for the last 1/7 magma to dry out to get to the carts, but if you only need a small amount of magma once (like bringing the forges upstairs with the rest of the fort) it's not bad.
Logged
Cultural assimilation through conquest.
Sure, got a few unburied corpses lying around

RenoFox

  • Bay Watcher
    • View Profile
Re: Minecarts for moving magma
« Reply #6 on: May 01, 2013, 03:58:12 pm »

Could you use nether cap logs to make magma safe rollers? They might keep the carts moving in the magma channel.

Xinael

  • Bay Watcher
    • View Profile
Re: Minecarts for moving magma
« Reply #7 on: May 01, 2013, 04:29:24 pm »

have you doublechecked the cart to make sure that the magma (and the weight of the magma!) has been correctly removed?

I'm thinking maybe a bug with the minecart's magma-unloading.
No problems with unloading - you can see that the middle three tiles of the left channel are red. That's magma from the first two or three revolutions before the cart got stuck.

Could you use nether cap logs to make magma safe rollers? They might keep the carts moving in the magma channel.
You don't actually use logs on rollers - just mechanisms and chains. My chains are iron and my mechanisms alunite, so they're magma-safe and operating fine under the magma :)

I'm assumeing you've read...
I'd actually missed the part about rollers on ramps requiring adjacent components and assumed that the part saying you could build there was out of date. I just did some experimentation with it and found the following:

It doesn't actually require components to be powered or even constructed to place the roller over the ramp, but it does require that something that can be powered be designated adjacent to the roller to build.
You can even designate a gear for building next to the roller, designate the roller for building, and then delete the gear designation, without unpausing, and the roller will still be built.
The adjacent power provider doesn't have to be adjacent to the ramp tile, it can be anywhere along the roller.

To summarise, my mistake was simply designating the roller in the channel before I designated the gear on the same z-level. If I'd done the roller second, I could've extended it onto the ramp and it would've been able to push my cart out of the hole. It's now picking up the magma just fine, which is fantastic.

It looks like the only worry will be whether or not the system is fast enough to fill a reservoir ~50 zlevels up from scratch. I think a bit of micro-management channeling out reservoir access in phases will stop evaporation to get the system primed, and then it should take care of itself :) Though having to designate a bunch of gears and rollers on all the up-ramps will be tedious as hell. On to full-scale testing! :D
« Last Edit: May 01, 2013, 04:35:59 pm by Xinael »
Logged

Sutremaine

  • Bay Watcher
  • [ETHIC:ATROCITY: PERSONAL_MATTER]
    • View Profile
Re: Minecarts for moving magma
« Reply #8 on: May 01, 2013, 04:36:14 pm »

Extending on that, it's possible to make rollers powered by gears in front of or behind them, so long as you designate the roller and the gear in the right order (roller last? I forget). It's also possible to make crazy paving rollers that transmit power in unintended directions, again so long as the order is correct.

It's never occured to me to check whether or not you can put powering gears above or below a roller...
Logged
I am trying to make chickens lay bees as eggs. So far it only produces a single "Tame Small Creature" when a hen lays bees.
Honestly at the time, I didn't see what could go wrong with crowding 80 military Dwarves into a small room with a necromancer for the purpose of making bacon.

Xinael

  • Bay Watcher
    • View Profile
Re: Minecarts for moving magma
« Reply #9 on: May 01, 2013, 04:49:54 pm »

The wiki says above and below gears don't work, and I think my own tests showed that, too - you have to use adjacent gears to transfer the power down. You can see this in my screenshots above - the space below where the cart is has a gear in it, which corresponds to the gear above.
Logged

gchristopher

  • Bay Watcher
    • View Profile
Re: Minecarts for moving magma
« Reply #10 on: May 01, 2013, 05:07:42 pm »

It looks like you've got it figured out, but FWIW, you can raise magma with just one powered roller sitting on the ramp in a 2-wide magma trench. A pump can provide power the roller, make the ramp eligible for building the roller, and keep the trench at 7 magma so the carts fill instantly.

Here's one layout that works and has some nice properties.
Code: [Select]
▒▒▒
▒#▒    # = floor grate, ideally above a magma flow tile
▒%▒    % = south facing pump
▒%▒▒
▒▲▲▒   Left ramp ▲ has a left-pushing roller (at least Low speed? I don't recall the minimum offhand.)
▒▒▒▒   Right ramp ▲ has a retracting bridge
If you drop minecarts in directly from at least 2 z-levels above onto the right ramp, this setup has the magical property that it can handle an arbitrary number of minecarts, and dispense them at a constant controlled rate. Carts are pushed up the left ramp by the roller.

If you extend the right bridge, that tile ceases to be a ramp. Exactly one minecart will fall onto the tile and stay there, and all other minecarts dropped from above will form a quantum pile 1 z-level up.

The last time I built one, I timed the cart dispensing rate at 1 per 8 ticks. This is slow enough that carts can be brought to the surface using an impulse ramp spiral, but fast enough that you can still quickly cover a large area with magma.

The same design works with water, for giving you a lot of flexibility creating tall waterfalls without pump stacks, quickly and cheaply.
Logged

Sutremaine

  • Bay Watcher
  • [ETHIC:ATROCITY: PERSONAL_MATTER]
    • View Profile
Re: Minecarts for moving magma
« Reply #11 on: May 01, 2013, 05:21:54 pm »

The wiki says above and below gears don't work, and I think my own tests showed that, too
Just tried it... Nope, no dice. Didn't occur to me to check the wiki either. :P
Logged
I am trying to make chickens lay bees as eggs. So far it only produces a single "Tame Small Creature" when a hen lays bees.
Honestly at the time, I didn't see what could go wrong with crowding 80 military Dwarves into a small room with a necromancer for the purpose of making bacon.

Xinael

  • Bay Watcher
    • View Profile
Re: Minecarts for moving magma
« Reply #12 on: May 02, 2013, 07:17:56 am »

If you drop minecarts in directly from at least 2 z-levels above onto the right ramp...

If you extend the right bridge, that tile ceases to be a ramp. Exactly one minecart will fall onto the tile and stay there, and all other minecarts dropped from above will form a quantum pile 1 z-level up.

...brought to the surface using an impulse ramp spiral, but fast enough that you can still quickly cover a large area with magma.
This is really great. I especially like the security the grate provides (I hadn't thought about keeping everyone safe too much yet).

I was with you until "drop 2 z levels" - you're saying drop the carts off a ledge and through open space onto the right hand ramp, and not just that they go down two z-levels of ramps? I'm also not sure what you're saying will happen with the carts backing up - don't carts falling onto one another form a stack? And, finally, what do you mean by "impulse ramp spiral"?
Logged

Button

  • Bay Watcher
  • Plants Specialist
    • View Profile
Re: Minecarts for moving magma
« Reply #13 on: May 02, 2013, 11:34:22 am »

have you doublechecked the cart to make sure that the magma (and the weight of the magma!) has been correctly removed?

I'm thinking maybe a bug with the minecart's magma-unloading.
No problems with unloading - you can see that the middle three tiles of the left channel are red. That's magma from the first two or three revolutions before the cart got stuck.

While you've clearly solved your practical problem well enough, I'm still curious about the cart getting stuck after 3-4 revolutions.

My bug comment wasn't about the magma not getting unloaded - I did see that, yes - but about magma unloading having a bug on the coding side. The fact that the minecart always stopped at 3 or 4 revolutions does suggest that the bug has something to do with fullness.

My hypothesis, without actually looking into the properties of minecarts cause I don't know how:

We already know that weight has an effect upon momentum. Heavier carts travel further on any given push. If the liquid level for momentum purposes is stored in a single byte, and there is a bug where that byte doesn't get reset to 0 when the magma is dumped, then the journey of your minecart would be as follows:

Start: Minecart momentum calculations believe it is at 0/7.
Round 1, starts at 0 liquid, gains 2 liquid, rolls uphill, dumps 2 liquid. Minecart momentum calcs believe it is 2/7.
Round 2, starts at 0 liquid, gains 2 liquid, rolls uphill, dumps 2 liquid. Minecart momentum calcs believe it is 4/7.
Round 3, starts at 0 liquid, gains 2 liquid, rolls uphill, dumps 2 liquid. Minecart momentum calcs believe it is 6/7.
Round 4, starts at 0 liquid, gains 2 liquid, rolls uphill, dumps 2 liquid. Momentum calc fluid level overflowsto 0/7, because in single-byte arithmetic 6+2=0. It therefore doesn't have enough momentum to push the minecart's weight up the ramp.

Just my two cents.
Logged
I used to work on Modest Mod and Plant Fixes.

Always assume I'm not seriously back

gchristopher

  • Bay Watcher
    • View Profile
Re: Minecarts for moving magma
« Reply #14 on: May 02, 2013, 01:00:16 pm »

This is really great. I especially like the security the grate provides (I hadn't thought about keeping everyone safe too much yet).
Glad you like it! It's missing a couple details, like a pump or raising bridge to drain/empty the magma trench.

I was with you until "drop 2 z levels" - you're saying drop the carts off a ledge and through open space onto the right hand ramp, and not just that they go down two z-levels of ramps? I'm also not sure what you're saying will happen with the carts backing up - don't carts falling onto one another form a stack?
No. If you drop, say, 6 carts down a shaft, then they do not form a pile of carts 6 z-levels high. Instead, one cart will fall to the bottom, then every other cart will land directly on top of that first cart. So you end up with one cart on the bottom z-level, and 5 carts quantum piled one z-level up.

This is extremely important for automated, high-throughput cart systems, because it's very easy to create a traffic jam if carts are too close together at any point. This lets you load arbitrarily many carts into the system without carefully checking if it's too many. As long as whatever's launching the carts from the base of the stack is slower than every other point in the track loop, you'll never get a jam, because the carts pile up (infinitely) in the vertical shaft and are never released close-enough together to jam up farther down the line.

And, finally, what do you mean by "impulse ramp spiral"?
An impulse ramp is a trick that several people have observed, where if a cart derails onto an upward ramp, the ramp accelerates the cart as though it was dropping a z-level, even if the cart is just moving in a straight line. QuantumMenace pioneered weaponizing this to fling water "boulders."

It's possible to make water cannons about half the size and at least 75% faster, but that thing is already monstrous enough to stop a clown rush and make sieges into a comedy show.

Example:
Code: [Select]
═ : Normal track   ╚ : N/E Track/Ramp
 ▒▒▒▒▒▒▒▒▒▒
═╚╚╚╚╚╚╚╚╚╚═
If a cart enters from the left, it will speed up on every track/ramp and exit to the right going very very fast. Acceleration from ramps have a much much higher maximum velocity than a roller on highest.

The other crazy thing about impulse ramps is that they produce slightly more acceleration than it takes to move a cart UP one ramp. So you can just make an upward spiral alternating impulse ramps and regular upward ramps. It takes no power, is quick and cheap to build, requiring only channeling and track carving, it handles the 1 cart / 8 tick rate of the launcher, and the cart goes up fast, but not so fast that it launches its contents.

Here's one way (of many) to build one.
Code: [Select]
z +0    z +1    z +2    z +3
░░░░░   ░░░░░   ░░░░░   ░░░░░
░╔░░░   ░▼╚╗░   ░░▼▼░   ░░░░░
░╝░░░   ░▼░░░   ░░░╔░   ░░░▼░
░▼▼░░   ░░░░░   ░░░╝░   ░╚╗▼░
░░░░░   ░░░░░   ░░░░░   ░░░░░

░=Wall, ╔,╚,╗,╝=Track/Ramp, ▼=Down Ramp (empty space)
Logged
Pages: [1] 2 3