Page 1 of 1

Circuit networks reads unreliably from train content

Posted: Mon Jan 20, 2020 3:03 pm
by Nemo4809
I have 4 inserters at an output loading ores into a train wagon.

2 of them are set to enable when iron < 625
2 of them are set to enable when copper < 625

Somehow I ended up with a train full of copper.

Also tried loading ammo onto the same wagon. Set inserter to enable when ammo < 200. Sometimes the inserter just ignores that limit and continues adding ammo to the wagon. This is especially true if you just dropped a brand new train on the track - it will start filling but it won't stop.

Just thought I would ask around to see if I'm messing up somewhere before filing a bug report.

Re: Circuit networks reads unreliably from train content

Posted: Mon Jan 20, 2020 3:25 pm
by Loewchen
Post a simple save that shows that behavior.

Re: Circuit networks reads unreliably from train content

Posted: Mon Jan 20, 2020 4:59 pm
by Premu
Could it be that your copper inserter is not connected properly to the station?

If it doesn't receive any signal for copper at all it is assumed to be 0, so it will be always active.

Re: Circuit networks reads unreliably from train content

Posted: Mon Jan 20, 2020 5:51 pm
by mmmPI
Nemo4809 wrote: Mon Jan 20, 2020 3:03 pm This is especially true if you just dropped a brand new train on the track - it will start filling but it won't stop.
It may also be that the train is not detected by the station, missing a pixel while driving manually or adding a brand new trains could let the train seemingly on the station, but the game may consider the train to be on the track and not on the station. ( It would detect the automatic schedule only ?).

Re: Circuit networks reads unreliably from train content

Posted: Tue Jan 21, 2020 4:36 am
by TruePikachu
mmmPI wrote: Mon Jan 20, 2020 5:51 pm
Nemo4809 wrote: Mon Jan 20, 2020 3:03 pm This is especially true if you just dropped a brand new train on the track - it will start filling but it won't stop.
It may also be that the train is not detected by the station, missing a pixel while driving manually or adding a brand new trains could let the train seemingly on the station, but the game may consider the train to be on the track and not on the station. ( It would detect the automatic schedule only ?).
I believe the station will only emit signals when a train is stopped at a station as part of an automatic schedule, and not ever when either (a) waiting at a signal, (b) in manual mode, or (c) NO PATH-ing.

Re: Circuit networks reads unreliably from train content

Posted: Tue Jan 21, 2020 9:10 am
by Nemo4809
TruePikachu wrote: Tue Jan 21, 2020 4:36 am
mmmPI wrote: Mon Jan 20, 2020 5:51 pm
Nemo4809 wrote: Mon Jan 20, 2020 3:03 pm This is especially true if you just dropped a brand new train on the track - it will start filling but it won't stop.
It may also be that the train is not detected by the station, missing a pixel while driving manually or adding a brand new trains could let the train seemingly on the station, but the game may consider the train to be on the track and not on the station. ( It would detect the automatic schedule only ?).
I believe the station will only emit signals when a train is stopped at a station as part of an automatic schedule, and not ever when either (a) waiting at a signal, (b) in manual mode, or (c) NO PATH-ing.
The automatic scheduling requirement could be what did me in. I think I switched the trains to manual a few times at the stations to line things up. That's probably when the inserters stop obeying circuit network logic and gummed up the whole system.

They should really consider removing the automatic scheduling requirement. Makes things a tad fragile.

Regardless, I have switch to using one wagon per material.

Thanks for all the help guys.

Re: Circuit networks reads unreliably from train content

Posted: Wed Jan 22, 2020 5:24 pm
by mmmPI
Nemo4809 wrote: Tue Jan 21, 2020 9:10 am They should really consider removing the automatic scheduling requirement. Makes things a tad fragile.
When a train is parked at a station that is connected to a circiuit wire, you can "read train ID".

This mechanism allow to detect only train that are from automatic schedule.

I guess you can then only allow inserter to be active when there is train detected at the station, i may test that in my game :)

Re: Circuit networks reads unreliably from train content

Posted: Wed Jan 22, 2020 5:34 pm
by BlueTemplar
Probably "just" the trap where inserters activate once the train arrives at the station, because at that specific tick they can already insert, but haven't received any signals from the train yet, so consider the train to be empty, regardless of its *actual* contents ?

Re: Circuit networks reads unreliably from train content

Posted: Wed Jan 22, 2020 8:21 pm
by planetmaker
Nemo4809 wrote: Tue Jan 21, 2020 9:10 am The automatic scheduling requirement could be what did me in. I think I switched the trains to manual a few times at the stations to line things up. That's probably when the inserters stop obeying circuit network logic and gummed up the whole system.
That's something I trapped over a lot in one of my savegames where I frequently used the outpost supply and construction trains to give me a ride... and then their carefully-planned contents got messed-up such that it always took me 15 minutes at least to sort it again.

Re: Circuit networks reads unreliably from train content

Posted: Wed Jan 22, 2020 8:31 pm
by 5thHorseman
Nemo4809 wrote: The automatic scheduling requirement could be what did me in. I think I switched the trains to manual a few times at the stations to line things up. That's probably when the inserters stop obeying circuit network logic and gummed up the whole system.
Note the inserters did not disobey circuit logic. They were obeying the logic perfectly. They were just being told something that you didn't expect but was true: that the value of copper was 0.

EDIT: My phone decided I meant "invaders" and not "inserters." I've fixed it.

Re: Circuit networks reads unreliably from train content

Posted: Wed Jan 22, 2020 10:26 pm
by netmand
5thHorseman wrote: Wed Jan 22, 2020 8:31 pm
Nemo4809 wrote: The automatic scheduling requirement could be what did me in. I think I switched the trains to manual a few times at the stations to line things up. That's probably when the inserters stop obeying circuit network logic and gummed up the whole system.
Note the invaders did not disobey circuit logic. They were obeying the logic perfectly. They were just being told something that you didn't expect but was true: that the value of copper was 0.
the circuit was signalling nothing which is different from measuring a train with no items in it. Since the inserter was set to enable for copper less than 625, it'll start working when-ever it finds a place to insert the items from the chest because no signal satisfies the less than 625 setting; which in this case was a stopped cargo wagon with its locomotive set to manual.

To help alleviate this sort of issue, the circuit should include measuring train ID in addition to the level of cargo to signal the inserters to enable. Though most would argue it over-complicating a simple task. I suppose it depends on one's attention to detail to pursue automation to their fun's extent.

What's interesting is that I didn't see any suggestions to leverage filtering (i.e. middle-click wagon slot while holding the item to be stored) to the wagon to assure that both copper and iron made it onto the wagon. But this point is moot now since it was decided to use separate wagons.

Re: Circuit networks reads unreliably from train content

Posted: Thu Jan 23, 2020 12:22 am
by BlueTemplar
Well, in my case, it was already filtered - but I wanted less than one stack...

Re: Circuit networks reads unreliably from train content

Posted: Thu Jan 23, 2020 1:18 am
by 5thHorseman
netmand wrote: Wed Jan 22, 2020 10:26 pm To help alleviate this sort of issue, the circuit should include measuring train ID in addition to the level of cargo to signal the inserters to enable. Though most would argue it over-complicating a simple task. I suppose it depends on one's attention to detail to pursue automation to their fun's extent.
I never have this problem so don't know offhand, but can't you read the train's ID (or at least read that a train is present) from the station? If so, you can run that through combinators so your inserters properly work or not based on (presence of train) + (lack of resource)
netmand wrote: Wed Jan 22, 2020 10:26 pm What's interesting is that I didn't see any suggestions to leverage filtering (i.e. middle-click wagon slot while holding the item to be stored) to the wagon to assure that both copper and iron made it onto the wagon. But this point is moot now since it was decided to use separate wagons.
I was actually going to but I got caught up on the logistics of the network.