Factorio

Factorio

View Stats:
pat Mar 12, 2019 @ 5:53am
Leave when one wagon is empty
I've researched this for a while, and it appears that it isn't possible, but I'll ask just in case anything has changed.

I often have the case where one cargo wagon is unloading a lot faster than another. There will just be a lot more demand of what is coming from the first wagon than from the second. So the first wagon empties immediately, and the second slowly drains. I've got the departure set to Empty Cargo OR Time Passed. It would be a lot more efficient if it could somehow tell if ANY wagon was empty and then depart.

Inactivity won't work, because the second train IS constantly emptying, but very slowly.

I understand belt balancing, and that is a workaround, but if there is a direct method that I don't know about...
< >
Showing 1-15 of 23 comments
Horoai Mar 12, 2019 @ 6:06am 
Wait this should be pretty easy actually.

For one thing you can just check if all unloading inserters for that wagon go idle (empty hands, maybe with a timer if you want to be super sure).

Secondly, it's a matter of whether both wagons load the same or different item types.

In case it's the same then, yes, indeed even a simple balancer makes this a non-issue and not using one would be over-engineering. :P

In case they have different loads, you can just hook the train contents to circuit network and check for the specific item types - make the train leave as soon as one of them or even a specific one runs out.
Last edited by Horoai; Mar 12, 2019 @ 6:07am
pat Mar 12, 2019 @ 6:19am 
Originally posted by Yggdrasil:
For one thing you can just check if all unloading inserters for that wagon go idle (empty hands, maybe with a timer if you want to be super sure).

They're never idle. Just very slow, as the goods are moving slowly. But probably not idle for more than a second.

Originally posted by Yggdrasil:
In case it's the same then, yes, indeed even a simple balancer makes this a non-issue and not using one would be over-engineering.

It's hard to imagine what would be considered over-engineering compared to an 18-in -> 18-out belt balancer.
Last edited by pat; Mar 12, 2019 @ 6:20am
THE kilroy Mar 12, 2019 @ 6:22am 
If its the same item type belt balancing or unloading balancing IS what you are looking for. If the types are different and you know the you know the item types of each wagon, you can use 2 methods. If you onky have belt balancing you can still unload your wagons unbalanced and get stuck in the station.

Stationbased, read train contents from station and use combinators to decise when to send a leave signal to the train via station.

Trainschedulebased, you can add multiple conditions on the schedule, such as leave when, ((time pased and iron is 0)or (cargo empty)).

Easiest to do is balance the unloading inserters and belts that they feed, but reading your post sounds like this situation may require more.
Horoai Mar 12, 2019 @ 6:26am 
Originally posted by pat:
Originally posted by Yggdrasil:
For one thing you can just check if all unloading inserters for that wagon go idle (empty hands, maybe with a timer if you want to be super sure).

They're never idle. Just very slow, as the goods are moving slowly. But probably not idle for more than a second.
I was refering to the wagon which "empties immediatly", not the other one which "slowly drains". When it's empty, the hands won't move.



Originally posted by pat:
Originally posted by Yggdrasil:
In case it's the same then, yes, indeed even a simple balancer makes this a non-issue and not using one would be over-engineering.

It's hard to imagine what would be considered over-engineering compared to an 18-in -> 18-out belt balancer.
It can just be a row of regular belt balancer entities if that is too much hassle. The point is, when you start micromanaging stuff with the circuit network which the game would normally do for you if you just let it then you're going down an endless rabbit hole of things you need to take care of as well.
For exmaple, given you have a train with 5 wagons and a whole network of them running around. Sending it away with 1 empty wagon and 4 almost full ones just creates problems elsewhere. Not just because it is inefficient but it puts stress on your network, adds delays to resource delievery because your trains will move around a lot more for no reason and in the end even your mines will be drained lobsidedly.
Then you start fixing this by adding a second train stop aligned in such a way that instead of leaving the unloading area the train just moves up every wagon by one slot and on and on it goes, infinitely complicated.

The point is, if the game offers you an internal solution then you're mostly likely better off taking it.
Killcreek2 Mar 12, 2019 @ 7:06am 
Just use a balanced unloading setup, so that all the wagons empty evenly. There are many ways to do this. Eg: Belt balancing the outputs; Or using a circuit to balance the inserters; Or using the logi net directly to throttle the inserters equally.

Trying to read when only one wagon is empty, ore empty them 1 at a time, is a lot more effort.
brian_va Mar 12, 2019 @ 7:37am 
Can't try it now to verify but maybe you can wire one of the inserts from the wagon that emptys faster to a combinator to output a value when empty or inactive or something, and set that value as an OR condition to leave the station. Seems like that should work anyways. Surely someone more versed in combinators can confirm or correct.
Eternal Mar 12, 2019 @ 7:55am 
Just check total quantity and set station to stay till ores reach 20%...
impetus_maximus Mar 12, 2019 @ 8:08am 
an example of a balanced circuit based iron ore unload station (two cars wagons/12 chests onto red belts)

0eNrVWsFymzAQ/RedTYukFdg+9NBbv6GT8WCsJJpi8Ag500yGf6+wp4kjs8qKG5dk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Bj+AQ2kpAW3yi0BbUSld5GrAiA3NqNhc1/gp8gEILWwkqFYsalwQ+L0HoIBX2vlzJWRM8/9pjKJg1iVGQ1axJjIKcqDvXL6DE17qjyjnAnAC8njUBULjYzDGf/OvOVORz7DIFmM9xDXfA/qG6PLzbm3+BWbGm8iD+2s+qqdpaH3a//CO9O7dNVx387Rdt+8v+UuYc1rIUsBmGf1/e6fw=

if you have inserter stack bonuses, you can replace 'if > -1' with 'if > -[INSERTERBONUS]
Killcreek2 Mar 12, 2019 @ 8:23am 
@Impetus ~ I recognise that design, it is the inverted MadZuri "smart" loader. Reliable setup, especially if you program the inserters for their current hand size (as you noted), to get maximum throughput.


Suppose I ought to add my logi-net bot-based balanced unloader design too. Small annotated description pic ~ here.[i.imgur.com] & an ingame station to show how compact the system can be ~ here.[i.imgur.com]
impetus_maximus Mar 12, 2019 @ 8:30am 
Originally posted by Killcreek2:
@Impetus ~ I recognise that design, it is the inverted MadZuri "smart" loader. Reliable setup, especially if you program the inserters for their current hand size (as you noted), to get maximum throughput.

correct. i use > -1 instead of 0 since if all chests have the same amount the insterters would stop. xD
Killcreek2 Mar 12, 2019 @ 8:36am 
Hah, yes. Easy to make a mistake setting up those circuits (so many times I have missed a single wire, or forgot to adjust the combi to the # of chests used).

Though you could use >=0 for same effect.
impetus_maximus Mar 12, 2019 @ 8:55am 
Originally posted by Killcreek2:
Hah, yes. Easy to make a mistake setting up those circuits (so many times I have missed a single wire, or forgot to adjust the combi to the # of chests used).

Though you could use >=0 for same effect.
same here. having 1 wire out of place will screw it up. i keep forgetting ≥ was added to the game. xD
LvlLord Mar 12, 2019 @ 10:19am 
I think the thread creator meant something like this.
0eNrtXMFu4zgM/Refk4Eoy5Jd7GfMnhaDwE2U1pjEDmynmGKQD9i/2Mv+2H7J2k6TZhwxIdnD+NBLCzf1kyhRjxIflZ/R42bvd3VRttHDz6hYVmUTPfz1M2qKpzLf9H9rX3c+eoiK1m+jWVTm2/7J/9jVvmnmbZ2Xza6q2/m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BO3lkQNe8XDOizmYm7zW24oyS95pU4gCG+21b4S/bAqOl4hPEPPXpxpK9uIfDyxXBoJR+mx2/uezh4tvSZtGLr5vhDRcrSMCaTKeHw//zGxix

Here you can decide with "green tick" constant the amount of cycles, a group of inserters needs to idle, before the train leaves.

The start condition for the train would be

- wait until full
or (one second passed
and "green signal" is > 0")

This works this way:
The inserter from the cargo are set to output as a pulse their content. Therefore they just picked something up.

The first comparator will check, if anything is there and will set the "info" signal.
The second comparator will count the cycles, since the last info signal came.
The third comparator checks if the configured time (in cycles) has passed and will output a "green signal" if ok.

All green signal of each cargo wagon are summed together (just wired togehter) and send to the train. Which then can check if any of the cargo wagons are empty (because the timer value has been reached) and will leave.

The condition for "wait 1 second" needs to be there, because there is some delay before items are picked up, which would otherwise mean the train will leave instantly again.
Last edited by LvlLord; Mar 12, 2019 @ 10:23am
Nellvan Mar 12, 2019 @ 11:26am 
Originally posted by LvlLord:
I think the thread creator meant something like this.

As people already have explainded, the thread creator also got things the wrong way round. Balancing the unloading process IS the solution and anything else is the workaround and most likely will be causing more issues down the line.
Last edited by Nellvan; Mar 12, 2019 @ 11:27am
brian_va Mar 12, 2019 @ 11:47am 
they asked for a way to do what they wanted, wether or not it's the cause or effect of another problem is irrelevant.
< >
Showing 1-15 of 23 comments
Per page: 1530 50

Date Posted: Mar 12, 2019 @ 5:53am
Posts: 23