Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Machine guns that don't jam  (Read 3074 times)

Alastar

  • Bay Watcher
    • View Profile
Machine guns that don't jam
« on: June 13, 2021, 06:02:29 am »

I've been trying for an embarrassingly long time to design a minecart water cannon that combines high RoF with high velocity. Anything clever and compact that I tried was an abject failure, and a a simple loop with multiple minecarts ran into the issue of jamming. Maybe this is an old hat, but I finally found a simple solution that somewhat satisfies me. Strictly speaking, it jams all the time - but it recovers gracefully.

╬╬╬    
╬■╬    

╗╚
..
╗╚

╚╝

╬  Fortifications
■  Stationary Minecart
  Impulse ramps
  Loading channel with ramp and tracks below. Infinite water supply behind fortifications.


The idea: Fast minecarts that have gone through the loop pile up behind the stationary one, ejecting their load. The impulse ramps resolve the pile-up, pushing slow carts around the corner into the loading channel. The larger the pile-up, the more ramps contribute to this, speeding up the process: we move towards the desired equilibrium of a regular cycle.

Two things can break this if we have too many carts: minecarts move through the loading channel so fast they don't take on water, or loaded carts are jostled hard enough to eject their contents before they enter the acceleration loop.
Rollers would make things more predictable though, allowing for a consistent and higher cyclical RoF... but I haven't managed to make them work, they seem to invite both of the above problems even at low speeds. Impulse ramps with their gentle but addititve acceleration seem easier for a self-regulating system.

As things currently stand, RoF oscillates between approximately 4 and 15 ticks, with an average slightly below 10.
I'd be grateful for any improvements, or a pointer towards a better way of doing this.
Logged

Alastar

  • Bay Watcher
    • View Profile
Re: Machine guns that don't jam
« Reply #1 on: June 14, 2021, 06:26:01 am »

It seems that my testing methodology was flawed, and rollers definitely have potential for this.
The issues were caused by an insufficient water supply, creating unplanned collisions. Medium speed rollers on the last impulse ramps before the muzzle (medium and slow), and a highest-speed roller pushing south immediately after the loading channel give this a shot every 5-6 ticks.

Things take a little while to settle into a constant rhythm, a cold start may result in some spillage and random crashes - a problem when that happens on the southern corners. Roller and drainage there would allow us to power through, but it's preferable to start with excessive speed so the carts don't take on water, then slow it down to fire.
Logged

Dunamisdeos

  • Bay Watcher
  • Duggin was the hero we needed.
    • View Profile
Re: Machine guns that don't jam
« Reply #2 on: June 14, 2021, 07:28:56 pm »

I'd enjoy a gif of the thing in action, pulping goblins as I assume it's meant to do.
Logged
FACT I: Post note art is best art.
FACT II: Dunamisdeos is a forum-certified wordsmith.
FACT III: "All life begins with Post-it notes and ends with Post-it notes. This is the truth! This is my belief!...At least for now."
FACT IV: SPEECHO THE TRUSTWORM IS YOUR FRIEND or BEHOLD: THE FRUIT ENGINE 3.0

Alastar

  • Bay Watcher
    • View Profile
Re: Machine guns that don't jam
« Reply #3 on: June 17, 2021, 08:48:37 am »

No visitors and no carnage yet, but I can show it in action compared to an unpowered minimal gun. First frame by frame, then in default 50/100FPS.

https://imgur.com/a/O4HFGm6
Logged

Dunamisdeos

  • Bay Watcher
  • Duggin was the hero we needed.
    • View Profile
Re: Machine guns that don't jam
« Reply #4 on: June 18, 2021, 02:45:48 pm »

That's wonderful.
Logged
FACT I: Post note art is best art.
FACT II: Dunamisdeos is a forum-certified wordsmith.
FACT III: "All life begins with Post-it notes and ends with Post-it notes. This is the truth! This is my belief!...At least for now."
FACT IV: SPEECHO THE TRUSTWORM IS YOUR FRIEND or BEHOLD: THE FRUIT ENGINE 3.0

Alastar

  • Bay Watcher
    • View Profile
Re: Machine guns that don't jam
« Reply #5 on: June 22, 2021, 05:57:39 pm »

Thank you! I had hoped to further increase the RoF by adding a second loading system, most promising was a half-loop fed by the launching crash and slowed by underwater track stops... but I couldn't quite synchronise that with the existing one. The current design is ready for general use, and I'll post any significant improvements I stumble upon.
Logged

gchristopher

  • Bay Watcher
    • View Profile
Re: Machine guns that don't jam
« Reply #6 on: June 22, 2021, 11:11:27 pm »

Here's my old Squirt Gun design

I'm pretty sure higher ROF has happened by now, I was getting 1/11 ticks or something like that, using time for a cart to fall from stopping as the rate limiter.

I'm not sure what state of the art is now for ROF, but 5-6 ticks is very good. I think the fastest ROF I've seen was like yours, using a roller to get the cart out of the way after firing.

I went with carts falling because it let me pack 4 barrels into a 5-wide area, and stackable for 2/3 barrel density, but you're going to have some megaproject-level effort dealing with the resulting water flooding downrange once you get there.

I never found a compact substitute for the ~21 long impulse-ramp (or long slope) to get carts up to maximum velocity without sacrificing ROF to letting a cart spin up in an impulse ramp circle.
Logged

Loud Whispers

  • Bay Watcher
  • They said we have to aim higher, so we dug deeper.
    • View Profile
    • I APPLAUD YOU SIRRAH
Re: Machine guns that don't jam
« Reply #7 on: June 23, 2021, 05:38:55 am »

I don't have any expertise to add where I possess none, but I do feel obligated to note this is an elegant machine for a noble cause in any Fortress

Alastar

  • Bay Watcher
    • View Profile
Re: Machine guns that don't jam
« Reply #8 on: June 23, 2021, 06:13:28 am »

@ Loud Whispers: Glad you got some enjoyment out of it!

@ gchristopher: I definitely had a few good looks at that! Thanks for giving your thought processes behind a design I never really got before. There are interesting trade-offs, overall space/labour efficiency, space efficiency at the muzzle, reliability, responsiveness... and there's a point where further optimisation hardly matters. Once we go through so much water that we need to recycle it from an enclosed kill zone, we might as well run things over with minecarts directly. But building a better !!giant rat trap!! is always fun.

As for an alternative to long loops of impulse ramps... I had some fun trying to bounce lighter carts with heavier ones, but that didn't really go anywhere. A short closed loop that a cart goes through multiple times, like this soggy failcannon, has some niche attractions, but again I've not come up with a way to sustain both velocity and RoF.
Many of my attempts owe inspiration to a series of designs by Larix, the powered variant should also be able to maintain a RoF of 5-6.

Code: [Select]
.WF       WF       WF
 RR       ╗═       ew
~▼▲W     ~║╚W     ~▼▲W
 RR       ╔╚       nw
 W        W

visible     track   rollers

The launching mechanism is more compact than mine, and pulling slightly to one side  may even be an advantage. As implemented, it works beautifully even with a second cart. However, all variations that I tested seemed prone to jams when multiple high-velocity carts were introduced, requiring perfect setup and a 100% reliable water supply. Maybe I did something wrong (roller build order?), but for now I feel that a stationary minecart as a speed gate is more robust, and may allow even higher RoF with adjusted loading arrangements. The slightly erratic unpowered version proved that 4 ticks are possible without jamming.
« Last Edit: June 23, 2021, 06:15:46 am by Alastar »
Logged

Dunamisdeos

  • Bay Watcher
  • Duggin was the hero we needed.
    • View Profile
Re: Machine guns that don't jam
« Reply #9 on: June 23, 2021, 01:30:43 pm »

I would certainly recommend a bit of spread, goblins tend to move in loose clusters.

Please post an image if you get a chance to pulp a goblin with it.

Logged
FACT I: Post note art is best art.
FACT II: Dunamisdeos is a forum-certified wordsmith.
FACT III: "All life begins with Post-it notes and ends with Post-it notes. This is the truth! This is my belief!...At least for now."
FACT IV: SPEECHO THE TRUSTWORM IS YOUR FRIEND or BEHOLD: THE FRUIT ENGINE 3.0

gchristopher

  • Bay Watcher
    • View Profile
Re: Machine guns that don't jam
« Reply #10 on: June 24, 2021, 03:11:24 am »

Many of my attempts owe inspiration to a series of designs by Larix, the powered variant should also be able to maintain a RoF of 5-6.

Code: [Select]
.WF       WF       WF
 RR       ╗═       ew
~▼▲W     ~║╚W     ~▼▲W
 RR       ╔╚       nw
 W        W

visible     track   rollers
Thanks! Glad you'd already found that post by Larix, I think that's the best reference for the high ROF loop, but I didn't have the link handy. I don't use compact designs like that in practice because the projectiles aren't going anywhere near the fastest, most damaging speeds.

A couple performance questions:

- For reliability, I think given the effort and the fact that these things are machines for murdering your own dwarves if they need repair, wouldn't you want to aim for 100% reliability? I kill enough workers through careless construction orders and adding repair casualties seems bad. I think your recovery mechanism counts as 100%, since you're not sending dwarves in to clear jams.
- Velocity matters, especially if you want those wonderful "explodes into a cloud of gore" results. Wouldn't you also want a pretty high priority on getting everything to max velocity? (Checking the cart speed with dfhack makes it easier to confirm.) I think if I'm reading your diagram right, you've got repeating ramps to get up to full speed.

Once we go through so much water that we need to recycle it from an enclosed kill zone, we might as well run things over with minecarts directly. But building a better !!giant rat trap!! is always fun.
Huh, really? I found that a fast watergun fills pretty much any space with water so quickly that enemies no longer path, unless they're swimmers. It's also a FPS killer to rely on water draining via simple flow. That's why I ended up stealing QuantumMenace's firing range with the overhead pumps.

For the most serious of situations (clown rush with large fleshy or hard material body types), I _think_ that having the impact be at maximum velocity will make a big difference, and it's hard to get a cart grinder to cover enough space AND have the carts stay at max velocity, since (if I understand it right) they stop when they transfer momentum on impact and start up with only 1 impulse ramp's worth of speed.

Platinum minecarts weigh 856 and a water "boulder" weighs 459, so you're giving up some mass with water, but with a high ROF and max velocity, I think the squirt guns should end up delivering more energetic impacts over a larger target area, especially since running multiple carts on a track with enemies in the way has a high risk of jamming.

(In practice, Platinum is limited, so I use Rose Gold for cart grinders, both because it conserves gold while magically not losing mass, and also because it creates purple spinning mazes of death.)
Logged

Alastar

  • Bay Watcher
    • View Profile
Re: Machine guns that don't jam
« Reply #11 on: June 24, 2021, 08:47:40 am »

- Yes, reliability is a major concern; my main motivation behind trying something else was my unwillingness to manually clear jams.
Amusingly, the further you get from the business end the more problematic things become: The speed gate works like a charm, the loading arrangement seems to limit RoF, and if there's a stuck cart it's on the SW corner, implying that my feeding mechanism (see the GIF) is bad.
The axle powers rollers at the southern corners so jams there resolve themselves. I should really rethink the feeding arangement, perhaps quantum stockpiles are the way.

I'm more than satisfied with the firing mechanism's reliability, it should also be good for a much higher RoF. So things to do:
1) Find a feed mechanism that doesn't suck (minor annoyance. Current system fixes itself with a bit of kludgy machinery, no recurring problems if we turn off firing by throttling water rather than stopping the carts)
2) Find a loading arrangement that allows Rof 2 or so (major unrealised potential). My attempts with a longer channel or branching channels in sequence just before the speed gate didn't work, both caused unwanted quantum stockpiles of minecarts.

- Yes, the dots in the schematic stand for more ╗╚ ramps, I think ~20 more of each are necessary for maximum velocity.



I have no experience with pumps above the firing range, my arrangement had the kill zone consist of down stairs and fed the water back to the loading channel and a slight buffer beyond. That's a closed system* that eliminates drainage, water supply, pathing and mostly FPS concerns. Do pumps offer an advantage I missed? Letting gravity and natural pressure do the work seems easier.

Regarding guns vs grinders: I always thought we had a Newton's Cradle effect with full conversation of momentum. My overstuffed minecart loops (usually quite small, 5x9 or 5x7, with a magma mister or a waterwheel for powered rollers inside) seemed more effective than what I'd expect from your description of the mechanics... but after checking, they also don't seem to run at anything close to maximum velocity. I am confused.
That's good news to me though, it means there is some semi-practical merit to ridiculously overpowered and overengineered guns.


* We might want a modest inflow and drainage arrangement so we don't need water-permeable floor on all tiles. E.g. fortifications barriers to force a winding path, and to give targets a chance to *splat*.
Logged

DwarfStar

  • Bay Watcher
    • View Profile
Re: Machine guns that don't jam
« Reply #12 on: June 25, 2021, 01:19:42 pm »

I've been working on a much more primitive magma machine gun, with just rollers, making up for it with much larger floor plan and a massive power plant. I still don't really understand impulse ramps yet myself, but maybe one of these days I should give them a try. It's a bit off topic for machine guns "that don't jam" because jamming has been a consistent problem that has taken me several revisions to address, and it's probably not 100% fixed yet. But, I have video of the thing killing mobs so I wanted to share!

My design just circulates a huge number of mine carts through a pool of magma, down a 20-z level ramp, and crash them into a fortification above a pit that has a recovery mechanism at the bottom. The carts have to pass through the magma on low speed rollers so they can fill, which limits the cycle time to 28, but I make up for it with triple barrels.

The loading and security aspects took me a while to work out. The loading mechanism is basically a roller, with multiple cart routes that push onto it from the side. From the roller, they drop down into the same waiting area as carts returned by the return mechanism. While they're down there, they're unreachable by the dwarfs, which is handy so they don't try to reload the cart route. On the hauling screen, the "loaded" carts (not necessarily with magma...just the ones loaded into the system) have a red X next to them which is critical to differentiate them. If I get tired of scrolling past the red Xs, I can d-b-f forbid all the loaded carts so they disappear from the hauling screen. Or I can do that if I need to unforbid the hatch to do work down there (for example, there was a loading accident, sadly). It's still a chore to get all 300 carts loaded into the system, though. Doesn't seem like I need all of them, though.



On the left you can see my attempt to deposit the carts evenly among the barrels, but it doesn't work very reliably yet. The orthoclase rollers push the cart towards the pit at the top (where they fall down onto rollers), and the microcline rollers push the carts sideways as they go. The pressure plates turn the microcline rollers on and off so that the carts end up either going straight, left, or right. But I still am having a problem where one of the microcline rollers gets powered from an orthoclase roller and doesn't shut off via the gear mechanism. There's probably a design that avoids that problem, but I haven't found it yet. It would be cool if we could link rollers directly to pressure plates. Note that replacing the roller on the same Y row as the microcline roller with an axle would help, but then minecarts get stuck on top of the axle. One of the rollers is working at least so the gun still functions.

The one problem with this design as in the video is that trolls decide to destroy the iron grates on the right side where the gun doesn't hit. There's nothing down there for them but firey death: a pool of magma with a drain to the edge of the map. But since I took the video, I replaced those grates with constructed floors. But, I made a few too many into floors since the chamber got blocked with magma the last time I used it. So this is still a work in progress. I also built a wall in front of the fortifications at this level, because things were getting stuck inside them (there's no way to un-carve fortifications on a map edge, right?).

Anyway, without further ado:

https://i.imgur.com/RfZjUiM.mp4
Logged

Alastar

  • Bay Watcher
    • View Profile
Re: Machine guns that don't jam
« Reply #13 on: April 16, 2022, 06:27:44 am »

Many attempts, still no fundamental breakthroughs - but I found out the reason for malfunctions at the south end:
Apparently, a single roller after the loading trench is insufficient and can result in crashes with water ejection.
This seems to work:

╬╬╬    
╬■╬    



╗╚
..
╗╚

╚╝



where yellow denotes southward-pushing rollers at highest speed on top of impulse ramps, orange northward-pushing at low speed and purple northward-pushing at medium speed. The idea is that the front cart will be pushed out a little faster in case of a clump to prevent pile-ups. With 10 moving cars, I get a perfectly regular cycle of 20 shots in 109 ticks (RoF 5.45).
Logged