Inserter (Stack or Not) Should not be Limited to 254.0
Moderator: ickputzdirwech
Inserter (Stack or Not) Should not be Limited to 254.0
In this current version, inserter's capacity bonus is limited to 254.
So, please don't restrict its value.
So, please don't restrict its value.
-
- Smart Inserter
- Posts: 2547
- Joined: Tue Apr 25, 2017 2:01 pm
- Contact:
Re: Inserter (Stack or Not) Should not be Limited to 254.0
Hmm, that sounds like they restricted it to 1 byte of data. They may have done this for memory reasons, similar to tile IDs.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles
Re: Inserter (Stack or Not) Should not be Limited to 254.0
I wonder what 0 and 255 is used for then.
-
- Smart Inserter
- Posts: 2547
- Joined: Tue Apr 25, 2017 2:01 pm
- Contact:
Re: Inserter (Stack or Not) Should not be Limited to 254.0
Hmm, I wonder if they actually use 0 & 1 for disabled/enabled, then use the remaining 254 for stack size? Would save a small bit of memory.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles
Re: Inserter (Stack or Not) Should not be Limited to 254.0
Then how would you disable a 200 stack size inserter? Disabling would overwrite the stack size.FuryoftheStars wrote: ↑Sun Oct 31, 2021 8:49 pmHmm, I wonder if they actually use 0 & 1 for disabled/enabled, then use the remaining 254 for stack size? Would save a small bit of memory.
If they used the first bit then max size would be 127 or 128.
-
- Smart Inserter
- Posts: 2547
- Joined: Tue Apr 25, 2017 2:01 pm
- Contact:
Re: Inserter (Stack or Not) Should not be Limited to 254.0
I wasn’t thinking of the bits, but yeah, what was going through my head I don’t think is possible.mrvn wrote: ↑Sun Oct 31, 2021 10:19 pmThen how would you disable a 200 stack size inserter? Disabling would overwrite the stack size.FuryoftheStars wrote: ↑Sun Oct 31, 2021 8:49 pmHmm, I wonder if they actually use 0 & 1 for disabled/enabled, then use the remaining 254 for stack size? Would save a small bit of memory.
If they used the first bit then max size would be 127 or 128.
Hmm, well, 0 at least can be explained not being used by stack size as that’s essentially the same as disabling it. Not sure about 255, though.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles
Re: Inserter (Stack or Not) Should not be Limited to 254.0
People that squish such numbers into bytes also tend to special case unused numbers to mean something else. Or offset all values. So 0 could mean 256 or stack size - 1 is stored.FuryoftheStars wrote: ↑Sun Oct 31, 2021 11:21 pmI wasn’t thinking of the bits, but yeah, what was going through my head I don’t think is possible.mrvn wrote: ↑Sun Oct 31, 2021 10:19 pmThen how would you disable a 200 stack size inserter? Disabling would overwrite the stack size.FuryoftheStars wrote: ↑Sun Oct 31, 2021 8:49 pmHmm, I wonder if they actually use 0 & 1 for disabled/enabled, then use the remaining 254 for stack size? Would save a small bit of memory.
If they used the first bit then max size would be 127 or 128.
Hmm, well, 0 at least can be explained not being used by stack size as that’s essentially the same as disabling it. Not sure about 255, though.
Re: Inserter (Stack or Not) Should not be Limited to 254.0
https://ibb.co/sqZDHJt
I don't think so, the field in the LuaForce class has uint data type.
It holds 32-bit unsigned integer. Possible values are 0 to 4,294,967,295.
So, it should be restricted in the code by conditional flow.
I don't think so, the field in the LuaForce class has uint data type.
It holds 32-bit unsigned integer. Possible values are 0 to 4,294,967,295.
So, it should be restricted in the code by conditional flow.
Re: Inserter (Stack or Not) Should not be Limited to 254.0
That's the LUA interface and in no way means the C++ type is an uint32_t.
Re: Inserter (Stack or Not) Should not be Limited to 254.0
Can the property be changed? so it can store a larger value.
I'm struggling to flush the output out of the furnace/assembling machine using the inserter, due to its high productivity (mods' effect).
Imagine the property of worker robots storage bonus is not limited, but why not with the inserter capacity bonus?
It creates a perfect imbalance.
I'm struggling to flush the output out of the furnace/assembling machine using the inserter, due to its high productivity (mods' effect).
Imagine the property of worker robots storage bonus is not limited, but why not with the inserter capacity bonus?
It creates a perfect imbalance.
Re: Inserter (Stack or Not) Should not be Limited to 254.0
It makes some sense to use 8 bits to store the set stack size of an inserter instance, since there are typically many of them. Same goes for items currently in the inserter's hand.
There surely needs to be a value to indicate "unset" or "max", ie use stack size according to prototype and inserter capacity bonus. I can't see why any other value is reserved though. Perhaps it's hysterical raisins.
Worker robots don't store a cargo size (only held item count), and perhaps the expectation is there will be fewer active bots, so the benefit of reducing stored size is less.
Re: Inserter (Stack or Not) Should not be Limited to 254.0
Its the property name in LuaForce class by the way (Factorio API docs).
It's talking about handling massive items and bottleneck occurs because of the inserters.
Re: Inserter (Stack or Not) Should not be Limited to 254.0
inserter_capacity_bonus and stack_inserter_capacity_bonus are LuaForce properties but maximum values are also limited by per-entity state (eg "items in hand" and "stack size override"), and it seems almost certain this is limited to eight bits.
To go back to your earlier post:
It's likely it could be increased, but I expect it won't be for several reasons, such as the fact that (due to the above) allowing a greater maximum would increase the overall memory requirements by an amount proportional to the number of inserters.
-
- Smart Inserter
- Posts: 2547
- Joined: Tue Apr 25, 2017 2:01 pm
- Contact:
Re: Inserter (Stack or Not) Should not be Limited to 254.0
Yup, just like the tile ID limit situation. They're not going to blow up memory consumption of the game to accommodate mods (and I don't blame them).
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles
Re: Inserter (Stack or Not) Should not be Limited to 254.0
I agree. But, why worker_robots_storage_bonus can be updated up to 65535.0?
I think, increasing the number of robots drastically decreases UPS/FPS performance compared to inserters.
I think, increasing the number of robots drastically decreases UPS/FPS performance compared to inserters.
Re: Inserter (Stack or Not) Should not be Limited to 254.0
Because bots do not store the storage size. There is no cost per bot for the worker_robots_storage_bonus.
As to why they can actually carry that many items that is probably because they have a standard inventory and not their own internal counter for items. Restricting all inventories to 255 items per slot would be bad.
As to why they can actually carry that many items that is probably because they have a standard inventory and not their own internal counter for items. Restricting all inventories to 255 items per slot would be bad.
Re: Inserter (Stack or Not) Should not be Limited to 254.0
One question: WHY is it needed?
I have different ideas about the why, I want to know it from the source.
I have different ideas about the why, I want to know it from the source.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...