TSM Outpost Builder Addon


Turn your extended factory into a massive virtual robot construction zone with the support of the rail system. This mod automates the construction of massive modular gigabases with trains delivering the exact construction materials needed to distant outpost contstruction projects..

Content
1 year, 27 days ago
0.18 - 1.1
873
Logistics

g Dealing with trash

4 years ago

Scenario #1: Train is loading with cargo when the user moves a different job to the top of the queue.

Scenario #2: Loading wood, stone, etc from the outpost build site to return it to base.

The second situation is potentially the easiest. If the train schedule includes a trash unload stop before the ME loading stop, it can arrive at the loading station fresh and empty.

That arrangement could also work for the first case, but you'd have to be careful at the unloads to use filter inserters and your circuit conditions to only unload what you want. For that trip, the wagon may work at reduced capacity since it'd be partially full of stuff for a now-postponed job. However, once it continues the schedule, the trash stop will take care of it. It's not the most elegant solution, but it works within the current limits of the mod and game.

I just spent some time trying to improve on that by adding a typical vanilla trash circuit on the other side of the wagons. (take what you want, invert the count, read train contents and combine the counts, send any count > 0 to filter inserters so they unload whatever's not part of the request.) Then I discovered that the ME Combinator stops outputting the signal for an item as soon as it is received, even when it's on the train. D'oh. Of course it does. It'd have to. That kinda puts a stop to the idea of unloading everything that isn't part of the current request since the mod (rightly) considers everything on the train to be no longer part of the current request.

I'm not sure if there is a more elegant way to do it that doesn't involve too much code bloat. :/

I thought of maybe the ME Combinator could pulse a special signal when a new job moves to the top. With some circuitry (maybe an RS-NOR latch and timer) one could stop loading, unload the train, then start loading again. That feels a bit "ugh" to be honest.

It also doesn't cover the simple task of unloading the trees and other construction debris.

I guess you could default-lock the loading inserters, and send signal to a timer when a train arrives. Timer gives unloaders enough time to unload, then locks unloaders while unlocking loaders. Again, kinda ugh.

Another option might be that a manual change in the queue might have is, if the current job gets manually changed and a train is in the loading station, first send it a new schedule that tells it to head to the trash stop and then the ME loading station. Even if it is currently at the ME loading station, it should head out, empty, and return. Yeah that might not be any better than simply letting it haul the outdated load to the new job site and then stopping by trash unload on the way to the ME load after all.

I dunno. Just kinda brainstorming and thinking out loud. Maybe it'll spark ideas/conversation. It's a bit of a bummer that I can't seem to figure out a combination loading/trash stop. Does anyone have any slick suggestions?

Thanks for the mod LordKTor. You're a legand. :)

4 years ago
(updated 4 years ago)

Notes about setting up a separate trash stop:

  • Must use an ME Train Stop for the trash station too. Vanilla stops will be erased from the schedule when the schedules update.

  • Trash stop should be the first stop in the schedule, before any of the loading stations.

  • To solve the infinite loop between the trash and loading stations when there were no jobs, I added the "read train contents" to the loading station, sent that through a decider with "if anything > 0, send one T" and sent that back to the train station on a separate color to avoid an infinite loop. Next, modify the schedule at the loading station to have the condition "AND circuit condition T > 0." You can use whatever signal you want other than T. That's just the one I picked. In order to not have the "read train contents" loop back to set the inserter filters, I firewalled the red wire with an arithmatic combinator (multiply everything by 1 and output everything.) The inserters should be able to send their pulses to the stop, but not the other way around.

  • Decider on the ME combinator to output T whenever there's an active request won't work reliably for the same reason as I outlined in the OP. The ME combinator will stop outputting before your inactivity countdown completes so it'll never be true once the last items are loaded and you'll have a stuck train.

Spoke too soon. The combinators on the stop are messing with the counts for fulfillment.

4 years ago

Well, when I built something similar using combinators a couple of years ago (albeit it was less powerful) I created a separate train stop for trash. This is really easy to do with TSM itself. I get the elegance of using the same train for trash though. I think it may ne possible.

4 years ago
(updated 4 years ago)

Elegance aside, without building in some sort of trash mechanism into your route, if you were to change the job queue order when the train only had a couple of slots empty, you might be stuck running very slowly, shuttling only a couple of stacks of the desired items until the new job is complete and the queue works it's way down to the one where the items you've got clogging your wagons are actually needed/unloaded.

A separate trash stop is working fine, as long as I have the first stop in the schedule be an ME stop for trash before the loading stop(s). The problem is when the job queue is empty, the train just does continuous loops between the trash and loading stops every 5 seconds.

I've spent some hours now trying to figure out some additional wait conditions, combinator magic, etc but it's gotten ugly. I'm currently resorting to some really ugly things with latches and deciders and power switches and...

Feature request: ME Combinator outputs a special custom signal when there are any active jobs. Binary would work, but how about a signal for the number of jobs in the list? I'm sure people would find other uses for this, but I'd like to send it to the ME Train Stop so I can add a wait condition AND circuit "special signal" > 0

4 years ago

I guess that leads to Feature Request #2: Adding some up/down arrows to more easily adjust the job queue order.

Say you have a slow job waiting on nuclear components to be crafted. Depending on your factory capacity, you could be stalling your queue for a long time. Maybe you want to nudge a mining outpost job to the top because you know you have the materials for that and you could be knocking out some builds while you wait for those nuclear materials?

When I ran into that last night, I simply cut the wire at the outpost to remove it from the queue. (Hence all my headaches with cluttered wagons described above.)

It'd be nice if you could just rearrange the order in the GUI.

That also had me brainstorming if there'd be any good ways to allow multiple jobs in parallel without the code getting nasty and bloated.

4 years ago

Yeah the cancel or deprioritise current job is an obvious feature. However, I am resisting feature creep until happy that it is operating more or less bug free in wider audience.

4 years ago

SeemsGood. :)

New response