Shouldn't trains be empty at the depot?

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

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

Shouldn't trains be empty at the depot?

Post by mrvn »

As far as I can tell with LTN trains are supposed to start empty at the depot, go and pick up a specific amount of items at the first stop and then unload all items at the second stop before returning empty to the depot. Right?

Now I screwed something up with the inserters at some stop. As far as I can figure out they didn't stop loading at the requested amount and filled the train to the brim. Then on unloading the buffer chests where full and after 2 minutes the train continued to the depot with iron plates left over. Next the train went to pick up coal and drop it of. As a result I now have iron plates on the coal belt of my smelters. And who knows where else they did end up. I have to check every unloading station and clear the belts of iron plates. Also check all furnaces because some have now an iron plate in them. Or the inserter for coal has an iron plate in hand and can't drop it into the furnace because it contains copper ore.

Wouldn't it make sense for the depot to check the train contents, give an error if a train isn't empty and halt the train? It would be much easier to fix the problem before it spreads goods all over creation. Or must every stop use (stack)filter inserters to only unload the right type and amount of goods? So far I only used filter inserters on mixed good loading stations.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Shouldn't trains be empty at the depot?

Post by Optera »

Deopts are supposed to maintain trains: refuel locomotives and clean out wagons.
It's the players task to make sure trains are actually maintained in the depot. With changes to burners in 0.15 inserters are no longer capable of removing items from the fuel inventories, so cleaning trains in mixed depots became as simple as placing inserters removing everything from every carriage.

LTN is only as smart as it needs to be for minimal impact on performance. It will not do any sanity checks for the player that would require additional computing time.
Checking inventories is a relative expensive task, only finding entities and iterating filter slots are more taxing from what I've seen.
Shia
Burner Inserter
Burner Inserter
Posts: 18
Joined: Mon Oct 23, 2017 10:11 pm
Contact:

Re: Shouldn't trains be empty at the depot?

Post by Shia »

As a simple help, just set all depots like this:

station (itself) -> decider combinator -> LTN station lamp

Set the station to output cargo
Set the combinator to "everything = 0" output "Depot 1"

This way a train arriving at the depot with loaded item will not leave (LTN itself clears the path to only have the depot in list) and having items in cargo will remove the depot tag and LTN is not able to set a new path.
I also added a signal to it so I do know that something happened here:

Code: Select all

0eNq1VcFu2zAM/ZVCZ7tI3CTDDGzYYZfddxsKQbYZW6gsCZKczQj87yOlxMmQpM067GJYJPVIPT5Re1apAayTOrByz2RttGfljz3zstVCkS2MFljJZICeZUyLnlZOSMWmjEndwC9WLqfnjIEOMkhI++Ni5HroK3AYMO+0zrRO9L2oFOTegnhBf8as8bjZaMqIgIvHdcZGVubF4xrTYFnBGcUr6MROGkdRtXT1IANHXzNv3UrnA78ofiddGNAyV6GCzhuwJrCE7oMgBha06K1wIlAS9im6D4nI3EMA5wk55eA7gfxx6bmVoe5YuRXKA/Higxt6ZIHLJuJqEyD+r6aUUkNNVUewJX0cNOfUUWxxyh6X0zNt/rMQq8RYifqF74wa6HDI9WxrlamEUsgkloN14b/5ya1Ro+2MHg/1TuQAd3HEDmOj47g9WozmvbBHE0nmQHis8U7OU74evBctOb+hvPzDl4evKWDKLiRUzEAN1LIBl2OrKqljqy4FlOSzjPJppEtkJ0aviOkAeRKT/xs1pYgcduDG0EndvqWqjJkh2OEdSrUj1jigrLbO9FxqBDk28X5ZbVBHGStueJdn5NN6Taq70pCn0/kDzoO2C3kcCxe9yIvYjMU1kNXpoKaVPsg6JzCd+2Bsnli6gjjPB/y5Brt+FTbRdnvoLP7P0DnIROh7RPKZ3IMHTKUM3Ue6bv82Oa7wtHmNp1u3anGDHA+64cHwiDCPQgeiSWo92NPciAtOaSw095P3nb1/fC4jCfhSxbesPHv6MoZX18dzblarYvPxaVV8KKbpN2z7eus=
Depending on the Item that are at the depot, you can check what went wrong.
mrvn
Smart Inserter
Smart Inserter
Posts: 5848
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Shouldn't trains be empty at the depot?

Post by mrvn »

Shia wrote:As a simple help, just set all depots like this:

station (itself) -> decider combinator -> LTN station lamp

Set the station to output cargo
Set the combinator to "everything = 0" output "Depot 1"

This way a train arriving at the depot with loaded item will not leave (LTN itself clears the path to only have the depot in list) and having items in cargo will remove the depot tag and LTN is not able to set a new path.
I also added a signal to it so I do know that something happened here:

Code: Select all

0eNq1VcFu2zAM/ZVCZ7tI3CTDDGzYYZfddxsKQbYZW6gsCZKczQj87yOlxMmQpM067GJYJPVIPT5Re1apAayTOrByz2RttGfljz3zstVCkS2MFljJZICeZUyLnlZOSMWmjEndwC9WLqfnjIEOMkhI++Ni5HroK3AYMO+0zrRO9L2oFOTegnhBf8as8bjZaMqIgIvHdcZGVubF4xrTYFnBGcUr6MROGkdRtXT1IANHXzNv3UrnA78ofiddGNAyV6GCzhuwJrCE7oMgBha06K1wIlAS9im6D4nI3EMA5wk55eA7gfxx6bmVoe5YuRXKA/Higxt6ZIHLJuJqEyD+r6aUUkNNVUewJX0cNOfUUWxxyh6X0zNt/rMQq8RYifqF74wa6HDI9WxrlamEUsgkloN14b/5ya1Ro+2MHg/1TuQAd3HEDmOj47g9WozmvbBHE0nmQHis8U7OU74evBctOb+hvPzDl4evKWDKLiRUzEAN1LIBl2OrKqljqy4FlOSzjPJppEtkJ0aviOkAeRKT/xs1pYgcduDG0EndvqWqjJkh2OEdSrUj1jigrLbO9FxqBDk28X5ZbVBHGStueJdn5NN6Taq70pCn0/kDzoO2C3kcCxe9yIvYjMU1kNXpoKaVPsg6JzCd+2Bsnli6gjjPB/y5Brt+FTbRdnvoLP7P0DnIROh7RPKZ3IMHTKUM3Ue6bv82Oa7wtHmNp1u3anGDHA+64cHwiDCPQgeiSWo92NPciAtOaSw095P3nb1/fC4jCfhSxbesPHv6MoZX18dzblarYvPxaVV8KKbpN2z7eus=
Depending on the Item that are at the depot, you can check what went wrong.
Nice.

Currently I have one inserter per wagon taking out cargo at each depo onto a belt. The belt goes by all depos, past a speaker that sounds an alarm if anything is on the belt and then into a provider station with a provider threshold of 1 and priority 1000000.

The speaker lets me know that something is wrong and I can check it. But the inserter also fixes the problem for the time being so I don't have to rush over there and fix it manually.
VonFlaffenhausen
Inserter
Inserter
Posts: 27
Joined: Tue Oct 17, 2017 12:03 pm
Contact:

Re: Shouldn't trains be empty at the depot?

Post by VonFlaffenhausen »

Shia wrote:As a simple help, just set all depots like this:

station (itself) -> decider combinator -> LTN station lamp

Set the station to output cargo
Set the combinator to "everything = 0" output "Depot 1"

This way a train arriving at the depot with loaded item will not leave (LTN itself clears the path to only have the depot in list) and having items in cargo will remove the depot tag and LTN is not able to set a new path.
I also added a signal to it so I do know that something happened here:

Code: Select all

0eNq1VcFu2zAM/ZVCZ7tI3CTDDGzYYZfddxsKQbYZW6gsCZKczQj87yOlxMmQpM067GJYJPVIPT5Re1apAayTOrByz2RttGfljz3zstVCkS2MFljJZICeZUyLnlZOSMWmjEndwC9WLqfnjIEOMkhI++Ni5HroK3AYMO+0zrRO9L2oFOTegnhBf8as8bjZaMqIgIvHdcZGVubF4xrTYFnBGcUr6MROGkdRtXT1IANHXzNv3UrnA78ofiddGNAyV6GCzhuwJrCE7oMgBha06K1wIlAS9im6D4nI3EMA5wk55eA7gfxx6bmVoe5YuRXKA/Higxt6ZIHLJuJqEyD+r6aUUkNNVUewJX0cNOfUUWxxyh6X0zNt/rMQq8RYifqF74wa6HDI9WxrlamEUsgkloN14b/5ya1Ro+2MHg/1TuQAd3HEDmOj47g9WozmvbBHE0nmQHis8U7OU74evBctOb+hvPzDl4evKWDKLiRUzEAN1LIBl2OrKqljqy4FlOSzjPJppEtkJ0aviOkAeRKT/xs1pYgcduDG0EndvqWqjJkh2OEdSrUj1jigrLbO9FxqBDk28X5ZbVBHGStueJdn5NN6Taq70pCn0/kDzoO2C3kcCxe9yIvYjMU1kNXpoKaVPsg6JzCd+2Bsnli6gjjPB/y5Brt+FTbRdnvoLP7P0DnIROh7RPKZ3IMHTKUM3Ue6bv82Oa7wtHmNp1u3anGDHA+64cHwiDCPQgeiSWo92NPciAtOaSw095P3nb1/fC4jCfhSxbesPHv6MoZX18dzblarYvPxaVV8KKbpN2z7eus=
Depending on the Item that are at the depot, you can check what went wrong.
This is really awesome! Saved my butt just now!
Thanks.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Shouldn't trains be empty at the depot?

Post by Optera »

Shia wrote:As a simple help, just set all depots like this:

station (itself) -> decider combinator -> LTN station lamp

Set the station to output cargo
Set the combinator to "everything = 0" output "Depot 1"
I like it, it's simplistic, very easy to set up and has no negative effects on how LTN operates.
Carrot
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Jun 25, 2018 3:04 am
Contact:

Re: Shouldn't trains be empty at the depot?

Post by Carrot »

Shia wrote:As a simple help, just set all depots like this:

station (itself) -> decider combinator -> LTN station lamp

Set the station to output cargo
Set the combinator to "everything = 0" output "Depot 1"

This way a train arriving at the depot with loaded item will not leave (LTN itself clears the path to only have the depot in list) and having items in cargo will remove the depot tag and LTN is not able to set a new path.
I also added a signal to it so I do know that something happened here:

Code: Select all

0eNq1VcFu2zAM/ZVCZ7tI3CTDDGzYYZfddxsKQbYZW6gsCZKczQj87yOlxMmQpM067GJYJPVIPT5Re1apAayTOrByz2RttGfljz3zstVCkS2MFljJZICeZUyLnlZOSMWmjEndwC9WLqfnjIEOMkhI++Ni5HroK3AYMO+0zrRO9L2oFOTegnhBf8as8bjZaMqIgIvHdcZGVubF4xrTYFnBGcUr6MROGkdRtXT1IANHXzNv3UrnA78ofiddGNAyV6GCzhuwJrCE7oMgBha06K1wIlAS9im6D4nI3EMA5wk55eA7gfxx6bmVoe5YuRXKA/Higxt6ZIHLJuJqEyD+r6aUUkNNVUewJX0cNOfUUWxxyh6X0zNt/rMQq8RYifqF74wa6HDI9WxrlamEUsgkloN14b/5ya1Ro+2MHg/1TuQAd3HEDmOj47g9WozmvbBHE0nmQHis8U7OU74evBctOb+hvPzDl4evKWDKLiRUzEAN1LIBl2OrKqljqy4FlOSzjPJppEtkJ0aviOkAeRKT/xs1pYgcduDG0EndvqWqjJkh2OEdSrUj1jigrLbO9FxqBDk28X5ZbVBHGStueJdn5NN6Taq70pCn0/kDzoO2C3kcCxe9yIvYjMU1kNXpoKaVPsg6JzCd+2Bsnli6gjjPB/y5Brt+FTbRdnvoLP7P0DnIROh7RPKZ3IMHTKUM3Ue6bv82Oa7wtHmNp1u3anGDHA+64cHwiDCPQgeiSWo92NPciAtOaSw095P3nb1/fC4jCfhSxbesPHv6MoZX18dzblarYvPxaVV8KKbpN2z7eus=
Depending on the Item that are at the depot, you can check what went wrong.
I've just tried this and the train leaves the depot after the 5 second inactivity condition, is there something I'm missing?

The alarm goes off, but the new schedule gets added to the train anyways, giving it somewhere to go.
mrvn
Smart Inserter
Smart Inserter
Posts: 5848
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Shouldn't trains be empty at the depot?

Post by mrvn »

Carrot wrote:
Shia wrote:As a simple help, just set all depots like this:

station (itself) -> decider combinator -> LTN station lamp

Set the station to output cargo
Set the combinator to "everything = 0" output "Depot 1"

This way a train arriving at the depot with loaded item will not leave (LTN itself clears the path to only have the depot in list) and having items in cargo will remove the depot tag and LTN is not able to set a new path.
I also added a signal to it so I do know that something happened here:

Code: Select all

0eNq1VcFu2zAM/ZVCZ7tI3CTDDGzYYZfddxsKQbYZW6gsCZKczQj87yOlxMmQpM067GJYJPVIPT5Re1apAayTOrByz2RttGfljz3zstVCkS2MFljJZICeZUyLnlZOSMWmjEndwC9WLqfnjIEOMkhI++Ni5HroK3AYMO+0zrRO9L2oFOTegnhBf8as8bjZaMqIgIvHdcZGVubF4xrTYFnBGcUr6MROGkdRtXT1IANHXzNv3UrnA78ofiddGNAyV6GCzhuwJrCE7oMgBha06K1wIlAS9im6D4nI3EMA5wk55eA7gfxx6bmVoe5YuRXKA/Higxt6ZIHLJuJqEyD+r6aUUkNNVUewJX0cNOfUUWxxyh6X0zNt/rMQq8RYifqF74wa6HDI9WxrlamEUsgkloN14b/5ya1Ro+2MHg/1TuQAd3HEDmOj47g9WozmvbBHE0nmQHis8U7OU74evBctOb+hvPzDl4evKWDKLiRUzEAN1LIBl2OrKqljqy4FlOSzjPJppEtkJ0aviOkAeRKT/xs1pYgcduDG0EndvqWqjJkh2OEdSrUj1jigrLbO9FxqBDk28X5ZbVBHGStueJdn5NN6Taq70pCn0/kDzoO2C3kcCxe9yIvYjMU1kNXpoKaVPsg6JzCd+2Bsnli6gjjPB/y5Brt+FTbRdnvoLP7P0DnIROh7RPKZ3IMHTKUM3Ue6bv82Oa7wtHmNp1u3anGDHA+64cHwiDCPQgeiSWo92NPciAtOaSw095P3nb1/fC4jCfhSxbesPHv6MoZX18dzblarYvPxaVV8KKbpN2z7eus=
Depending on the Item that are at the depot, you can check what went wrong.
I've just tried this and the train leaves the depot after the 5 second inactivity condition, is there something I'm missing?

The alarm goes off, but the new schedule gets added to the train anyways, giving it somewhere to go.
Did you forget to remove the constant combinator that sets Depot=1?
Fuersten_Krone
Burner Inserter
Burner Inserter
Posts: 6
Joined: Wed Jul 18, 2018 10:16 am
Contact:

Re: Shouldn't trains be empty at the depot?

Post by Fuersten_Krone »

Carrot wrote:
Shia wrote:As a simple help, just set all depots like this:

station (itself) -> decider combinator -> LTN station lamp

Set the station to output cargo
Set the combinator to "everything = 0" output "Depot 1"

This way a train arriving at the depot with loaded item will not leave (LTN itself clears the path to only have the depot in list) and having items in cargo will remove the depot tag and LTN is not able to set a new path.
I also added a signal to it so I do know that something happened here:

Code: Select all

0eNq1VcFu2zAM/ZVCZ7tI3CTDDGzYYZfddxsKQbYZW6gsCZKczQj87yOlxMmQpM067GJYJPVIPT5Re1apAayTOrByz2RttGfljz3zstVCkS2MFljJZICeZUyLnlZOSMWmjEndwC9WLqfnjIEOMkhI++Ni5HroK3AYMO+0zrRO9L2oFOTegnhBf8as8bjZaMqIgIvHdcZGVubF4xrTYFnBGcUr6MROGkdRtXT1IANHXzNv3UrnA78ofiddGNAyV6GCzhuwJrCE7oMgBha06K1wIlAS9im6D4nI3EMA5wk55eA7gfxx6bmVoe5YuRXKA/Higxt6ZIHLJuJqEyD+r6aUUkNNVUewJX0cNOfUUWxxyh6X0zNt/rMQq8RYifqF74wa6HDI9WxrlamEUsgkloN14b/5ya1Ro+2MHg/1TuQAd3HEDmOj47g9WozmvbBHE0nmQHis8U7OU74evBctOb+hvPzDl4evKWDKLiRUzEAN1LIBl2OrKqljqy4FlOSzjPJppEtkJ0aviOkAeRKT/xs1pYgcduDG0EndvqWqjJkh2OEdSrUj1jigrLbO9FxqBDk28X5ZbVBHGStueJdn5NN6Taq70pCn0/kDzoO2C3kcCxe9yIvYjMU1kNXpoKaVPsg6JzCd+2Bsnli6gjjPB/y5Brt+FTbRdnvoLP7P0DnIROh7RPKZ3IMHTKUM3Ue6bv82Oa7wtHmNp1u3anGDHA+64cHwiDCPQgeiSWo92NPciAtOaSw095P3nb1/fC4jCfhSxbesPHv6MoZX18dzblarYvPxaVV8KKbpN2z7eus=
Depending on the Item that are at the depot, you can check what went wrong.
I've just tried this and the train leaves the depot after the 5 second inactivity condition, is there something I'm missing?

The alarm goes off, but the new schedule gets added to the train anyways, giving it somewhere to go.

I've run into the same problem. After digging around i found the following:
  • If you have a depot with only one station (that has an unikque name) there is no problem
  • If you have multible stations at your depot that have the same name, the train gets its dispatch orders from an active station
  • If you remove the "This station is an Depot" signal from all stations, the stations behave as they recieving the "This station is an Depot" signal (exept, that the light/s are purple instead of green/blue)
  • It happens no matter if LTN is your only mod or you have tons of mods installed
Pwez
Manual Inserter
Manual Inserter
Posts: 4
Joined: Mon Apr 11, 2016 12:14 pm
Contact:

Re: Shouldn't trains be empty at the depot?

Post by Pwez »

This is still an issue, if you have multiple stations as a depot with the same name, just disabling the station as a depot will not disable the train waiting from the LTN network. It will still receive new jobs.

I came up with exactly the same solution, with the combinator and have exactly the same issue.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Shouldn't trains be empty at the depot?

Post by Optera »

Thanks for reminding me about this issue.
Looking over the stop update handler I also fixed error states not removing trains from the available train list.
Depots now can be deactivated by circuit condition, short circuited or have the depot flag removed with the parked train behaving as expected (remains parked).
Antaguana
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun May 17, 2015 3:22 pm
Contact:

Re: Shouldn't trains be empty at the depot?

Post by Antaguana »

Im still having this issues were the trains are getting a new order and leaving even if the is depot flag is removed. (with multiple platforms with the same depot name).
It does work if I turn off ALL the depots with the same name when ANY depot with the same name has items at it.

Would be really helpful if this combinator logic was added directly into the station with a option to turn it on /off.
csduff
Fast Inserter
Fast Inserter
Posts: 110
Joined: Thu Nov 22, 2018 3:42 pm
Contact:

Re: Shouldn't trains be empty at the depot?

Post by csduff »

Shia wrote: Tue Nov 07, 2017 4:38 pm As a simple help, just set all depots like this:

station (itself) -> decider combinator -> LTN station lamp

Set the station to output cargo
Set the combinator to "everything = 0" output "Depot 1"
I did something similar to this. My method was to have all depot stations connected to a common combinator with "Depot = 1" signal on a red wire. The local station, set to output train contents, attached to a combinator that outputs a "Depot = -1" signal if train contents are > 0. This is fed back to the LTN combinator on a green wire. I think your system is more straight forward.
Post Reply

Return to “Logistic Train Network”