Page 2 of 2

"Read Chest contents" - Indicate if empty

Posted: Sun Jan 07, 2024 12:24 am
by someone1337
Following setup: I have a train-to-train smelter (and basically everything else). I disable a station if I dont have enought products to fill up a train at max speed*.

In the same way, I want to make ingredient deliveries: Enable the station, if I can unload at least a whole train at max speed*.

* max speed is defined as: not waiting for smelters/AMs to process inputs to outputs.

This works great... except when asymmetric drain happens. For example this smelter. It works at max speed*, except if for example only the first wagon gets emptied for a while. In that case 5 of the 6 (or 10 of the 12) chests are fully full of ingredients, and 1 (or 2) are fully empty and this is not enought to call in a train to fill up all the chests.
screen_20240107_005050.png
screen_20240107_005050.png (737.21 KiB) Viewed 1527 times
If we stick to the copper ore example, we have 6*2*2400=28800 copper ore storage. A 6 wagon train has a capacity of 6*2000=12000 copper ore. Therefore I need to call in a train only if i have less than 16800 copper ore stored.

Suppose we have assymetric drain, 2 of the chests are fully emptied while the others are full: used capacity: 5*2*2400=24000 which is more than 16800. The result: The station stays disabled and no train is called in to restock.
There is no easy way to fix this. I have tried one solution of overcommitting which leads to trains hogging the unloading stations basically all the time, which becomes an issue, if you have more than one resource per train track (second screenshot; low density structures production).
screen_20240107_011050.png
screen_20240107_011050.png (704.15 KiB) Viewed 1527 times
This whole issue could easily be mitigated, if empty chests would return a selectable signal to indicate when they are empty: That way one could know what chests are fully empty and just override the relevant, but disabled station with combinators.
chest_info.png
chest_info.png (406.49 KiB) Viewed 1527 times

Re: Container free space signal

Posted: Sun Jan 07, 2024 12:26 am
by Locane
Surprised this still isn't a thing. I have an array of storage warehouses I wanted to show free slots available on, and there's no way to do that apparently?

Just trying to get an idea of how full or not my storage space is.

Re: Container free space signal

Posted: Sun Jan 07, 2024 12:30 am
by someone1337
Oh lol, I like just now posted a really similar feature request.

-> viewtopic.php?f=6&t=110550

Re: "Read Chest contents" - Indicate if empty

Posted: Sun Jan 07, 2024 6:35 pm
by computeraddict
First, I think you should redesign to avoid asymmetric drain.

Second, you can get what you want from a decider with "everything = 0, output 1 placeholder" attached to each chest or set of chests you're interested in.

Re: "Read Chest contents" - Indicate if empty

Posted: Sun Jan 07, 2024 8:00 pm
by someone1337
computeraddict wrote:
Sun Jan 07, 2024 6:35 pm
First, I think you should redesign to avoid asymmetric drain.

Second, you can get what you want from a decider with "everything = 0, output 1 placeholder" attached to each chest or set of chests you're interested in.
Show me where you would put that one decider per chest in my first screenshot. I dont see a way to do that. Unless I accept to lose the efficiency of beacons, by getting rid of one, implying i would need to use more active entities.

Disregarding the creation of inefficient designs and adding more active entities, I would already need like 50k of such chests/deciders right now and im reasonably sure it would put a load on the cpu that is going to be felt.

So yeah, im not a fan of that ^^

Fixing asymmetric drain is obviously a priority, but not easy, since over the course of the game it adds up and at some point you will end up with broken stations :(

Re: "Read Chest contents" - Indicate if empty

Posted: Sun Jan 07, 2024 8:06 pm
by Illiander42
someone1337 wrote:
Sun Jan 07, 2024 8:00 pm
computeraddict wrote:
Sun Jan 07, 2024 6:35 pm
First, I think you should redesign to avoid asymmetric drain.

Second, you can get what you want from a decider with "everything = 0, output 1 placeholder" attached to each chest or set of chests you're interested in.
Show me where you would put that one decider per chest in my first screenshot. I dont see a way to do that. Unless I accept to lose the efficiency of beacons, by getting rid of one, implying i would need to use more active entities.
I can fit 5 arithmetic/decider combinators in there per assembler, 3 per furnace with your setups (2 per furnace if you're determined to keep the light).

Which is enough if you're willing to wire the three copper plate chests together (or do them as a 2&1, or 2 overlapping pairs).

And the way you avoid asymmetric drain at the points where you eventually take things off the train (labs, the workshop and walls) is you unload into active providers or only call a train where there's enough space to unload it fully.

Re: "Read Chest contents" - Indicate if empty

Posted: Sun Jan 07, 2024 9:00 pm
by Tertius
In my opinion, by trying to find a means to send your trains away early and requesting a feature for this, you're requesting a workaround for a problem you don't want to solve genuinely.
You solve this problem by implementing even load and unload. By doing this, you also increase efficiency, because you use the full content of a train and not only part of it.
How you solve this, is the challenge the game presents to you, the player.
If with a given station layout balancing cannot be established, that station layout isn't feasible.

There are other missing features better suited for implementation, because they help solving the problem and other problems, not help establishing just some workaround. Such a feature would be the ability to read wagon content in addition to reading train content. If you were able to do this, you would be able to balance train loading and unloading with direct control of wagon content.

Your setup seems to be very dependent of the unloading of the plastic+steel and at the same time loading low density structures into the slots that became free. If incoming wagons don't have perfect content (ratio 2:5) and not too full (you need 10 slots for lds but only 2+5=7 slots for plastic+steel). Seems difficult to achieve for shared slots because you're unable to read each wagon's content. If you instead use filtered slots, you need an additional train to transport the low density structures away.

To balance the drain, balance the output: the chests used for buffering the low density structures. Make sure they all contain the same amount of items by first adding all their content, then divide this by the negative amount of chests. Wire this negative average to each chest-to-train inserter, and wire each chest to its inserter with a different color, so you get the difference of chest content and average. Activate each inserter with condition ANYTHING < 12. This way the same chest cannot be faster filled than any other chest. If you make sure at the same time an incoming train is fully empty you're inserting the low density structures into, you have an even pull of source items.

Additionally, there is always a very small imbalance for sources, so add a waiting condition with inactivity > 10 seconds to make trains leave whose unloading has stalled due to such an imbalance.

I cannot tell if your setup also requires actively controlled unload, but in case the above solution doesn't fully work, you also need to control the train-to-chest inserters for copper/steel/plastic in a similar way as the low density inserters, i. e. make sure every buffer chest has the same amount of source items as its neighbors.

Re: "Read Chest contents" - Indicate if empty

Posted: Sun Jan 07, 2024 11:11 pm
by computeraddict
someone1337 wrote:
Sun Jan 07, 2024 8:00 pm
Show me where you would put that one decider per chest in my first screenshot.
For the ore just stick them in next to the train. There's an entire free column there.

If you wanted to do it for plates too you can lose the lamps.

Make chest connected to networks output Fullness percentage

Posted: Fri Jan 26, 2024 4:36 pm
by Oshida
TL;DR
Making chest/containers connected to networks output Fullness percentage
What ?
It would be great if you could add a "Read fullness" on the Circuit Connections of chests and give it a signal to output on (from 0 to 100 as signals doesn't works with floats), being able to choose what signal to output would also allow to still "read" the exact content of the chest
Why ?
On some trains stations i added some logic that disable the station if the chests are too empty or too full to disable the station so a train doesn't come to deliver or take away 5 plates

An issue i found is that i need to calculate myself the "fullness" of the station everytimes

Ores stack to 50 while plates stack to 100, while some other things stacks to 10, And then you have different sizes of chests.

It would be great if you could add a "Read fullness" on the Circuit Connections of chests and give it a signal to output on (from 0 to 100 as signals doesn't works with floats), being able to choose what signal to output would also allow to still "read" the exact content of the chest

then on the station i can just do "if F (for Fullness) < 300 (i have 4 chests so 4 full would be 4x100 400, so this is 75%) then enable the station"

I checked on both "suggested, implemented and in 2.0" and i couldn't find something mentioning percentages, so i hope this idea isn't a dup

Re: Make chest connected to networks output Fullness percentage

Posted: Sat Jan 27, 2024 6:16 pm
by Illiander42
Only way this could work is a "number of occupied/empty slots".

Anything else becomes useless as soon as you have two items with different stack sizes in the same chest.

Re: Container free space signal

Posted: Sun Jan 28, 2024 8:29 am
by Koub
[Koub] Merged several threads revolving around chests outputting to the logistic network signals about how full or empty they are.

Re: Make chest connected to networks output Fullness percentage

Posted: Sun Jan 28, 2024 11:19 am
by Oshida
Illiander42 wrote:
Sat Jan 27, 2024 6:16 pm
Anything else becomes useless as soon as you have two items with different stack sizes in the same chest.
I didn't though of that, maybe output the number of occupied slots on something like "S" would make more sense and be easier to calculate

Although i don't know if it should be "full slots" or just "slot where at least 1 item is"

Readout full and empty slots of chests

Posted: Sun Feb 18, 2024 2:46 pm
by Ugotu
TL;DR
Add a readout of the full and empty slots of Chests

What ?
It is often interesting to know how much chest space is already used to determine alarms or influence train stations. If we can read the number of full and empty slots in chests we can save a bunch of combinator logic.
chests.jpg
chests.jpg (270.29 KiB) Viewed 1011 times


Why ?
This change makes the setup of train stations and other logic simpler, less prone to errors, and easier to use for newer users

Re: Container free space signal

Posted: Sun Feb 18, 2024 3:31 pm
by Koub
[Koub] Merged into older thread with a similar suggestion.

Re: "Read Chest contents" - Indicate if empty

Posted: Thu Feb 22, 2024 10:25 am
by mrvn
someone1337 wrote:
Sun Jan 07, 2024 8:00 pm
computeraddict wrote:
Sun Jan 07, 2024 6:35 pm
First, I think you should redesign to avoid asymmetric drain.

Second, you can get what you want from a decider with "everything = 0, output 1 placeholder" attached to each chest or set of chests you're interested in.
Show me where you would put that one decider per chest in my first screenshot. I dont see a way to do that. Unless I accept to lose the efficiency of beacons, by getting rid of one, implying i would need to use more active entities.

Disregarding the creation of inefficient designs and adding more active entities, I would already need like 50k of such chests/deciders right now and im reasonably sure it would put a load on the cpu that is going to be felt.

So yeah, im not a fan of that ^^

Fixing asymmetric drain is obviously a priority, but not easy, since over the course of the game it adds up and at some point you will end up with broken stations :(
Fixing asymetric drain has nothing to do with this feature request. Neither knowing when a chest is empty or how many free slots a chest has will fix asymetric consumption. You need to balance chests and you can already do that simply by comparing the number of items in each chest. You just need the space for it.

My suggestion: don't have asymetric drain. Only ever use full or at least balanced trains and this will never be an issue.