Page 1 of 1

Mod to enable filter on chest slots

Posted: Wed Jan 05, 2022 7:45 am
by sdgmlj
The type of items can be locked in the storage box, just like the operation of a train carriage.

My English is not good. I translated it by computer. I don't know if I can express it clearly.

Re: Can such module function be realized?

Posted: Wed Jan 05, 2022 7:49 am
by sdgmlj
By storage box, I mean steel box, iron box and wooden box

Re: Can such module function be realized?

Posted: Wed Jan 05, 2022 8:39 am
by DaveMcW
It does not work for entities with type="container".

But you can use type="car", and make it look like a box.

Re: Can such module function be realized?

Posted: Wed Jan 05, 2022 10:46 am
by aka13
DaveMcW wrote:
Wed Jan 05, 2022 8:39 am
It does not work for entities with type="container".

But you can use type="car", and make it look like a box.
Was there a reason behind that? I think I remember some old thread where it was discussed, why the devs decided against filters in chests, but for filters in trains.

Re: Can such module function be realized?

Posted: Wed Jan 05, 2022 3:37 pm
by FuryoftheStars
aka13 wrote:
Wed Jan 05, 2022 10:46 am
DaveMcW wrote:
Wed Jan 05, 2022 8:39 am
It does not work for entities with type="container".

But you can use type="car", and make it look like a box.
Was there a reason behind that? I think I remember some old thread where it was discussed, why the devs decided against filters in chests, but for filters in trains.
I'm only guessing here, but I wonder if there's a non-zero impact to the game in just having filters available to containers, and seems you can achieve the goal of keeping X amount of something in a container with a simple attached wire, but a train with more than 1 wagon requires a more complex setup, that this is what led to their decision.

Re: Can such module function be realized?

Posted: Sat Jan 08, 2022 4:02 am
by Silari
aka13 wrote:
Wed Jan 05, 2022 10:46 am
DaveMcW wrote:
Wed Jan 05, 2022 8:39 am
It does not work for entities with type="container".

But you can use type="car", and make it look like a box.
Was there a reason behind that? I think I remember some old thread where it was discussed, why the devs decided against filters in chests, but for filters in trains.
Can't find it right now but i'm pretty sure there's a thread on the forums somewhere requesting filters be allowed on the container prototype and a dev saying it would add a performance penalty to every interaction (maybe just insertion) with a container, even ones that weren't using a filter. Since chests tend to be incredibly common it's too much of a performance hit, compared to cars/wagons/players which there tend to be much fewer of and much less interactions.

Re: Can such module function be realized?

Posted: Mon Apr 11, 2022 1:59 am
by DarkShadow44
A bit late to the party, but what about a "filterable chest"? Shouldn't affect normal chests in the slightest. Or simpler, a flag that enables filtering for an individual chest. Would at least limit the filter check to one operation per chest at minimum.

Re: Can such module function be realized?

Posted: Mon Apr 11, 2022 3:26 am
by robot256
"one operation per chest" is precisely the performance penalty that is severe enough to avoid. It would have to be an entirely new class of entity to avoid the penalty. And in fact, I believe you can make a modded "car" entity that behaves exactly like a chest except for that it has filters and can't be wired.

Re: Can such module function be realized?

Posted: Mon Apr 11, 2022 2:01 pm
by Xorimuth
Request: viewtopic.php?f=28&t=97967
Relevant developer comment: viewtopic.php?f=221&t=89674

Re: Can such module function be realized?

Posted: Mon Apr 11, 2022 5:14 pm
by DarkShadow44
robot256 wrote:
Mon Apr 11, 2022 3:26 am
"one operation per chest" is precisely the performance penalty that is severe enough to avoid.
Are you sure about that? Because I can't image it being that bad.

Re: Can such module function be realized?

Posted: Mon Apr 11, 2022 5:26 pm
by robot256
It's the same reason they give for not filtering LuaInventory objects, and for not connecting certain things to the circuit network. It's always a cost-benefit equation, based on the number of chests in a typical game, versus the number of players who will actually use the filtering feature, versus the effect on gameplay progression and challenges.

Not to say it won't *ever* happen, as other features have been added when faster computers and more optimizations made it practical.

Re: Can such module function be realized?

Posted: Wed May 18, 2022 11:04 pm
by sdgmlj
robot256 wrote:
Mon Apr 11, 2022 5:26 pm
It's the same reason they give for not filtering LuaInventory objects, and for not connecting certain things to the circuit network. It's always a cost-benefit equation, based on the number of chests in a typical game, versus the number of players who will actually use the filtering feature, versus the effect on gameplay progression and challenges.

Not to say it won't *ever* happen, as other features have been added when faster computers and more optimizations made it practical.
In fact, if this function is added, a lot of signal calculation can be saved. For example, I want to put the material of a machine into one box, so each box needs 2-4 signal lines and multiple arithmetic units. If there are many boxes, it will save more.

I don't understand the game mechanism. I don't know whether the signal calculation will affect the game performance, but it must be lower than the cost of adding this new function. However, this is also a reason for me to request this function. The most important thing is that it can save a lot of work.

Re: Can such module function be realized?

Posted: Thu May 19, 2022 12:24 am
by robot256
I did end up making a car-type container mod if you want to experiment with it. I think I left filtering enabled. It would be possible to make a 1x1 grid-snapped version, I suppose.

https://mods.factorio.com/mod/shipping-containers

Re: Can such module function be realized?

Posted: Thu May 19, 2022 3:03 am
by sdgmlj
robot256 wrote:
Thu May 19, 2022 12:24 am
I did end up making a car-type container mod if you want to experiment with it. I think I left filtering enabled. It would be possible to make a 1x1 grid-snapped version, I suppose.

https://mods.factorio.com/mod/shipping-containers
OK, I fully support you

Re: Can such module function be realized?

Posted: Thu May 19, 2022 8:54 am
by sdgmlj
robot256 wrote:
Thu May 19, 2022 12:24 am
I did end up making a car-type container mod if you want to experiment with it. I think I left filtering enabled. It would be possible to make a 1x1 grid-snapped version, I suppose.

https://mods.factorio.com/mod/shipping-containers
Can I give you a suggestion?
Can the following information be hidden? Because it will look more perfect

Re: Can such module function be realized?

Posted: Thu May 19, 2022 9:46 am
by Xorimuth
sdgmlj wrote:
Thu May 19, 2022 8:54 am
robot256 wrote:
Thu May 19, 2022 12:24 am
I did end up making a car-type container mod if you want to experiment with it. I think I left filtering enabled. It would be possible to make a 1x1 grid-snapped version, I suppose.

https://mods.factorio.com/mod/shipping-containers
Can I give you a suggestion?
Can the following information be hidden? Because it will look more perfect
No, that's the problem with (ab)using different entity types for unintended purposes. Such tooltips are hardcoded into the game.

Re: Can such module function be realized?

Posted: Thu May 19, 2022 11:54 am
by sdgmlj
Xorimuth wrote:
Thu May 19, 2022 9:46 am
No, that's the problem with (ab)using different entity types for unintended purposes. Such tooltips are hardcoded into the game.
Thank you. I don't know anything about this. Although this does not affect the use, it always feels imperfect.

However, I found that some mods can add some "false information" here. For example, an electric train mod (I forgot its name) made a new fuel named "power", so that "power consumption" can be displayed in the information bar. It feels more realistic