Bug: Incomplete Unloading for Time-Limited Trains

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

Post Reply
bcwhite
Inserter
Inserter
Posts: 42
Joined: Thu Jan 31, 2019 10:37 pm
Contact:

Bug: Incomplete Unloading for Time-Limited Trains

Post by bcwhite »

TL/DR: Trains that abort filling due to a timeout will often fail to unload completely under the same tech because it times out just before the last items are removed.

I love this mod! I've never had any problems with it. I find it so insanely useful that I wrote a long article called Brian's Trains on how to use it, complete with station blueprints.

However... Deciding to punish myself by trying to launch a rocket with both Bob's and Angel's mods, I hit a snag with my early train network when I did not yet have stack inserters.

The larger stack sizes and longer tech curve for stack inserters means that early trains have to load/unload with basic inserters, a very slow process even with 12 of them (per car) operating in parallel. The cars are only about 1/4 full when the 120s timeout is reached an the train proceeds to its destination. This would not be a problem except that unloading uses the same tech with the same timeout. Frequently, the train departs just before the last few items can be extracted -- one more swing of the inserters would have cleared it completely -- meaning items being returned to the depot (which is a problem in my designs).

Could you add a separate "unload timeout" setting or simply make the unload timeout 10s longer than the load timeout?

-- Brian

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2916
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Bug: Incomplete Unloading for Time-Limited Trains

Post by Optera »

TL/DR: Not going to add redundant complexity to timeouts.

Use smart station designs for loading and unloading.
Set timeout to the longest duration possible with your mods.

For granular per stop control enable "Schedule circuit conditions".
Adds circuit conditions to wait for red = 0 OR green ≥ 1 to all stops. Warning: All LTN stops require having "send to train" enabled and a circuit connection. Otherwise trains will be stuck waiting forever.

Edit: No one seems to check mod settings and knows about this feature, so I'm going to copy the mod setting description to the manual.

bcwhite
Inserter
Inserter
Posts: 42
Joined: Thu Jan 31, 2019 10:37 pm
Contact:

Re: Bug: Incomplete Unloading for Time-Limited Trains

Post by bcwhite »

Increasing the timeout to 500s was the solution I chose when I first observed the problem. I thought it might be good to have something that is safe "out of the box" is all.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2916
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Bug: Incomplete Unloading for Time-Limited Trains

Post by Optera »

I've tested default values to be safe for sensible, at least 5 inserter per wagon, vanilla station designs.

bcwhite
Inserter
Inserter
Posts: 42
Joined: Thu Jan 31, 2019 10:37 pm
Contact:

Re: Bug: Incomplete Unloading for Time-Limited Trains

Post by bcwhite »

A base std inserter does 0.83 items/second. A stock ore car holds 2000 items. You'd need 21 parallel inserters to fill that car in under 120s.

With an un-modded game, I don't see anyone not having stack inserters by the time trains start running so it seems unlikely that everyone would ever encounter this... in an un-modded game. But they've already installed at least one mod (LTN) so it's perhaps a little less unlikely. Under Bob's, stack inserters don't come until tier-3 of the logistics items and it's a lot of work to build those under that mod, hence my use of std inserters in my initial stations.

Anyway, my intent wasn't to start an argument. This is great work you've done and I promote it to everyone I find who plays the game. I just wanted to give back by reporting the race condition.

Thanks for all your work.
-- Brian

mrvn
Smart Inserter
Smart Inserter
Posts: 5709
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Bug: Incomplete Unloading for Time-Limited Trains

Post by mrvn »

bcwhite wrote:
Thu Jan 30, 2020 12:44 pm
A base std inserter does 0.83 items/second. A stock ore car holds 2000 items. You'd need 21 parallel inserters to fill that car in under 120s.

With an un-modded game, I don't see anyone not having stack inserters by the time trains start running so it seems unlikely that everyone would ever encounter this... in an un-modded game. But they've already installed at least one mod (LTN) so it's perhaps a little less unlikely. Under Bob's, stack inserters don't come until tier-3 of the logistics items and it's a lot of work to build those under that mod, hence my use of std inserters in my initial stations.

Anyway, my intent wasn't to start an argument. This is great work you've done and I promote it to everyone I find who plays the game. I just wanted to give back by reporting the race condition.

Thanks for all your work.
-- Brian
On the other hand Bob inserters can work in a 90° arc quit early, doubling the speed. That gives you the speed of 24 inserters per wagon which is enough.

And on the third hand: I found the timeouts are never what you want. Best to set them to 1000000000 and watch for stuck trains instead of getting the base completely messed up when a timeout happens.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2916
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Bug: Incomplete Unloading for Time-Limited Trains

Post by Optera »

mrvn wrote:
Thu Jan 30, 2020 12:50 pm
And on the third hand: I found the timeouts are never what you want. Best to set them to 1000000000 and watch for stuck trains instead of getting the base completely messed up when a timeout happens.
Using arbitrary high numbers in mod settings can cause overflows and unpredictable behavior.
If disabling a setting makes sense it can be disabled by setting it to 0.

User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 2420
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Bug: Incomplete Unloading for Time-Limited Trains

Post by BlueTemplar »

Yeah, if you're using Bob's why wouldn't you use a high number of longer ranged inserters ?
Even in vanilla, 24 long-ranged inserters with stack bonus 1 (green science) should be able to move 57.6 items/s, loading 6912 items in 120 seconds !
And with Bob, you also have (extensible!) fast 3-stack inserters in science2 (which you need for trains anyway) (and which only require bronze, which isn't hard to get !), and can likely have more than 24 of them per wagon with the configurable angle !
P.S.: Was there any item stack size tweaking involved ?
BobDiggity (mod-scenario-pack)

mrvn
Smart Inserter
Smart Inserter
Posts: 5709
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Bug: Incomplete Unloading for Time-Limited Trains

Post by mrvn »

Optera wrote:
Thu Jan 30, 2020 1:47 pm
mrvn wrote:
Thu Jan 30, 2020 12:50 pm
And on the third hand: I found the timeouts are never what you want. Best to set them to 1000000000 and watch for stuck trains instead of getting the base completely messed up when a timeout happens.
Using arbitrary high numbers in mod settings can cause overflows and unpredictable behavior.
If disabling a setting makes sense it can be disabled by setting it to 0.
Oh yeah. Where possible I use that, sorry. I don't think it is for all the once I wanted disabled last I tried.

bcwhite
Inserter
Inserter
Posts: 42
Joined: Thu Jan 31, 2019 10:37 pm
Contact:

Re: Bug: Incomplete Unloading for Time-Limited Trains

Post by bcwhite »

Bronze? Heh. I can only produce yellow belts and not in great quantities! Right now all my stations run grey (basic) tech with the exception of a few yellow underground belts needed for their reach.

I like using trains for everything. I get to create proper, efficient, extensible, bulk generation of material somewhere else and bring in exactly the materials I need in the quantities I need them to whatever is being created next in the chain. LTN makes this possible... easy in fact.

Even my plan for the "general production" (i.e. "mall") area of the base will bring in small trains on three sides to feed it whatever is needed at that stage.

In the future, I'm sure the various levels of stack-inserter at 12-per-car will make for very fast load/unload. I'm just not there yet.

-- Brian

User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 2420
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Bug: Incomplete Unloading for Time-Limited Trains

Post by BlueTemplar »

Ok, then - what about 24+ "2-handed" normal inserters ?
BobDiggity (mod-scenario-pack)

Post Reply

Return to “Logistic Train Network”