Train Foundry


A large train foundry building that assembles complete trains from blueprint templates: import a train blueprint, queue it, feed the parts with inserters, and watch the finished train fuel up and drive off onto your rail network on its own.

Content
11 hours ago
2.0 - 2.1
372
Trains

g Love the mod

a month ago

Hello I really like the mod it makes building trains quit easy. I would like to give some suggestions.

When playing I use the esc key to back out of in game gui's so making it so this mods gui dose the same would be nice.
I use 2-8 trains for most of the late game but the train foundry can only make 1-4 at max. My thought is making it so you can expand the train foundry by either placing another 1 behind the first, or having a separate expansion bay you can add the the foundry.
Final thought is about adding equipment grid support for mods that add them to locomotives.

a month ago

Hello I really like the mod it makes building trains quit easy. I would like to give some suggestions.

When playing I use the esc key to back out of in game gui's so making it so this mods gui dose the same would be nice.
I use 2-8 trains for most of the late game but the train foundry can only make 1-4 at max. My thought is making it so you can expand the train foundry by either placing another 1 behind the first, or having a separate expansion bay you can add the the foundry.
Final thought is about adding equipment grid support for mods that add them to locomotives.
Noticed the the mod doesn't seem to work with the mini trains mod, no matter how I fiddle with a blueprint it just says "the train in the blueprint must be placed on a straight rail".

a month ago

Thanks a lot for the feedback — all three suggestions are in the last release:

  • Escape now closes the window. The main window is a regular window again, so Escape (and clicking away) closes it. To make that work cleanly, blueprints are now dropped into a dedicated blueprint chest instead of being held in hand, so the blueprint library shortcut no longer fights with the window.
  • Longer trains. Place another Train Foundry right against the east side of an existing one and it chains on as an extension — the track and capacity extend across the whole hall, +5 vehicles per module (5, 10, 15, …). Build them as long as you like.
  • Equipment grids. Grid equipment from the blueprint is now installed on the built vehicles — and it's requested and consumed from the stock like fuel, so nothing is created for free.

Thanks again for taking the time to write it up — really helpful. Enjoy!

a month ago
(updated a month ago)

I had a question, un-asked, about the length issue. The update answered it, and provided a way around it. My thoughts went in a different direction. I was thinking that as a train was assembled the existing segment could be advanced by 2 cars (or 4) out of the foundry and more cars added. It would require the exit track to be straight with enough length to handle all but the final 2 or 4 cars.
The reason for 2 or 4 cars at a time is that you could have 'invisible' train stops which the train to advance to, keeping it always aligned with the bays in the foundry. Train stops for odd increments are off by 1 because of the 2-wide train stops being snapped to a 2x2 global grid like the rails are. (Or, perhaps it's just that the train stop snaps to the end of a rail piece. Results are the same.)
I don't know if you have a 'timer' on the assembly process, but it'd look neat to have the train slowly advance in steps as each new section was completed. It wouldn't save any space since you'd need as much empty rail on the exit as you currently need in the foundry using the extensions.
Admittedly, however, the extra long foundry for larger trains does fit the theme of a big building for a big train and a huge building for a long train. Either way, this is 100% going to be used when I prototype the Clapham junction.

Oh, crap. I just realized that the foundry requires an exit on the west exclusively. The places it'd be used around Clapham are east-facing exits. For example the Clapham Junction Train Depot, plus code 9C3XFR7G+6R

a month ago

Great thinking on the advance-and-add approach — the grid/train-stop details you spotted are exactly right. I did consider stepping the train out of the bays as it's built. The catch is it doesn't actually save space (you need as much clear straight track on the exit as the extensions take up inside), and driving a train in small hops via invisible stops adds a lot of moving state to keep in sync with the build timer, for what ends up being a cosmetic effect. So I've kept the "bigger building for a bigger train" route — which, as you noted, fits the theme.

On the west-only exit: you've put your finger on a real limitation. It's a deliberate design choice today — the exit direction is baked deep into the building (asymmetric footprint, the pixel-aligned rail sprite, the exit signal orientation, the module chaining, and even the blueprint import check, which requires a locomotive facing the exit). A mirrored variant was considered and set aside to keep things robust. But your Clapham use case is a concrete need for east-facing exits, so I'm noting it as a candidate for a future mirrored version rather than a flat no. No promises on timing, but it's on the list now.

a month ago

Appreciate the response, and the consideration for east-facing exit. For Clapham, however, there are enough limitations that I'm already aware it's going to be a very loose prototype. 90-degree rotation of the elevated ramps is a big one for trying to model a real rail setup.
I'll probably have the foundry somewhere off the 'map' and sneak the trains in on some convenient rail. I don't even know, yet, if all lines are accessible from one point, or even from each other. It is both passenger and cargo lines and the companies might not have rail sharing compacts.
It will certainly be fun, and the exit direction of a building is not going to set it back at all.

a month ago
(updated a month ago)

I had a simple idea: instead of doing mirroring or anything complicated, I just added an option to enable a right-side exit. It turned out to be tricky to get right, but still much simpler than mirroring or rotating the whole building.

It's live in the latest version — enable it from the Configuration window (the panel button in the foundry's title bar).

a month ago

Woo Hoo!

New response