[2.0.26] Logistic Group Multipliers rounded to 1 Decimal Place

Post your bugs and problems so we can fix them.
eugenekay
Fast Inserter
Fast Inserter
Posts: 165
Joined: Tue May 15, 2018 2:14 am
Contact:

[2.0.26] Logistic Group Multipliers rounded to 1 Decimal Place

Post by eugenekay »

Tangential to 117118's observations about Rocket Capacity and "0.25 Stacks" vs "0.3 Stacks", I found another place which apparently mixes precision levels when handling Numbers.

What did you do?
- Create a Logistic Group, with a Signal in it (example: Medium Electric Pole : 500)
- Place a Logistic Chest (example: Buffer Chest)
- Click the Pencil icon, and select the Logistic Group created in Step 1.
- Set a "Multiplier" which is between 0 and 1, and has 2 decimal places (Example: 0.25)
- "Apply Change" to confirm the addition of the Logistic Group
- Re-click the Pencil Icon next to the Logistic Group name
What happened?
- The "Multiplier"'s displayed Value has been Rounded to 1 decimal place - "0.3"
What did you expect to happen instead? It might be obvious to you, but do it anyway!
- The Exact value that I put into the box would be displayed.
Does it happen always, once, or sometimes?
- If using more than 1 decimal place of Precision

This only affects the Multiplier Displayed in the UI. The actual multiplier is saved as "0.25" internally, and the resulting Request count or Signal value (if applied to a Constant Combinator) does match - the Tooltip shows 500 * 0.25 = 125 Medium Electric Poles. This is consistent among all the places that it is possible to set a Logistic Request, including Chests, Space Platform Hub, Landing Pad, Constant Combinator, etc.

Buffer Chest:
Screenshot 2024-12-17 225433.png
Screenshot 2024-12-17 225433.png (148.55 KiB) Viewed 406 times
Screenshot 2024-12-17 225450.png
Screenshot 2024-12-17 225450.png (259.34 KiB) Viewed 406 times
Constant Combinator:
Screenshot 2024-12-17 225923.png
Screenshot 2024-12-17 225923.png (268.82 KiB) Viewed 406 times
Screenshot 2024-12-17 225948.png
Screenshot 2024-12-17 225948.png (339.27 KiB) Viewed 406 times
Last edited by eugenekay on Wed Dec 18, 2024 4:46 am, edited 1 time in total.
eugenekay
Fast Inserter
Fast Inserter
Posts: 165
Joined: Tue May 15, 2018 2:14 am
Contact:

[2.0.26] Logistic Group Multiplier Negative Values Cause Buffer overflow

Post by eugenekay »

And while playing-around with this Multiplier, I thought to myself "Hey, what if I set it to a Negative value?".... because I like chaos :twisted:. The Use case here is that I have a Logistic Group which cannot fit into a single Buffer Chest, so I am trying to split it up into parts, to be fulfilled by multiple chests. I think I will actually achieve this goal with some Combinator magic instead, using 1 Chest per Item Type.... anyway!


Replying to the same topic, but please note that this is a DIFFERENT issue causing a Buffer Overflow on display; not Rounding like the original. Please split this to a new Topic if appropriate. :-)

What did you do?
- Create a Logistic Group with a Value of "Small Electric Pole : 50"
- Place a Logistic chest (Requester Chest in my example)
- Add a Logistic Group, with a Multiplier value of "-1"
What happened?
- Satisfaction tooltip shows "0/4294967246" (Exactly 2^32 - 50)

What did you expect to happen instead? It might be obvious to you, but do it anyway!
- Satisfaction tooltip shows as "0/0" or "0/-50"
Does it happen always, once, or sometimes?
When using a Negative number for the "Multiplier" of a Logistic Group.
Screenshot 2024-12-17 231926.png
Screenshot 2024-12-17 231926.png (305.51 KiB) Viewed 398 times
I also added a second Logistic Group to this same chest, requesting "Small Electric Pole : 100". The Chest did get "100 - 50 = 50 Small Electric Poles" delivered.
Screenshot 2024-12-17 232015.png
Screenshot 2024-12-17 232015.png (308.93 KiB) Viewed 398 times
In a third Test, I moved the Negative symbol from the Multiplier ("1) to the Value ("-50"). The chest kept the same 50 Small Electric Poles in it.
Screenshot 2024-12-17 232603.png
Screenshot 2024-12-17 232603.png (313.16 KiB) Viewed 398 times
In a fourth test, I removed the "Test2" group, and added a second copy of "Test", with a Multiplier of "-2". This is the only Test where I saw the expected "Satisfaction: 50/50" tooltip.
Screenshot 2024-12-17 233915.png
Screenshot 2024-12-17 233915.png (306.5 KiB) Viewed 398 times
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: [2.0.26] Logistic Group Multiplier Negative Values Cause Buffer overflow

Post by IsaacOscar »

eugenekay wrote: Wed Dec 18, 2024 4:44 am And while playing-around with this Multiplier, I thought to myself "Hey, what if I set it to a Negative value?".... because I like chaos :twisted:. The Use case here is that I have a Logistic Group which cannot fit into a single Buffer Chest, so I am trying to split it up into parts, to be fulfilled by multiple chests. I think I will actually achieve this goal with some Combinator magic instead, using 1 Chest per Item Type.... anyway!


Replying to the same topic, but please note that this is a DIFFERENT issue causing a Buffer Overflow on display; not Rounding like the original. Please split this to a new Topic if appropriate. :-)

What did you do?
- Create a Logistic Group with a Value of "Small Electric Pole : 50"
- Place a Logistic chest (Requester Chest in my example)
- Add a Logistic Group, with a Multiplier value of "-1"
What happened?
- Satisfaction tooltip shows "0/4294967246" (Exactly 2^32 - 50)

What did you expect to happen instead? It might be obvious to you, but do it anyway!
- Satisfaction tooltip shows as "0/0" or "0/-50"
Does it happen always, once, or sometimes?
When using a Negative number for the "Multiplier" of a Logistic Group.
Screenshot 2024-12-17 231926.png

I also added a second Logistic Group to this same chest, requesting "Small Electric Pole : 100". The Chest did get "100 - 50 = 50 Small Electric Poles" delivered.
Screenshot 2024-12-17 232015.png

In a third Test, I moved the Negative symbol from the Multiplier ("1) to the Value ("-50"). The chest kept the same 50 Small Electric Poles in it.
Screenshot 2024-12-17 232603.png

In a fourth test, I removed the "Test2" group, and added a second copy of "Test", with a Multiplier of "-2". This is the only Test where I saw the expected "Satisfaction: 50/50" tooltip.
Screenshot 2024-12-17 233915.png
Thanks! I'll update my bug report 121919 to mention this case.
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: [2.0.26] Logistic Group Multiplier Negative Values Cause Buffer overflow

Post by IsaacOscar »

IsaacOscar wrote: Wed Dec 18, 2024 5:22 am Thanks! I'll update my bug report 121919 to mention this case.
Actually, it's not the same issue as that has a valid range of -1000 and 1000:
12-18-2024, 15-51-43.png
12-18-2024, 15-51-43.png (202.43 KiB) Viewed 362 times
Putting values outside that range correctly clamps the numbers.
The issue is how the displayed/clamped number is interpreted:
12-18-2024, 15-52-57.png
12-18-2024, 15-52-57.png (99.59 KiB) Viewed 362 times
As you've discovered though, negative logistic requests do work correctly, it's just the tooltip is wrong (as is the colour highlighting, which shows the request as red/unsatisfied when it isn't).

(Also, if I mod happens along, could they please move the discussion about negative requests to a serrate bug report thread?)
eugenekay
Fast Inserter
Fast Inserter
Posts: 165
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: [2.0.26] Logistic Group Multiplier Negative Values Cause Buffer overflow

Post by eugenekay »

Fifth Test:
- Logistic Group request for "Small Electric Pole : -50" x "-1"
- Logistic Bots deliver -50 * -1 = +50 Small Electric Pole
- Check "Trash unrequested"
- Items are moved to the Trash slot?! (and disappear from Alt-mode view of Chest)
- Logistic Bots show up to empty the Trash slot; but never do anything....
Screenshot 2024-12-18 135540.png
Screenshot 2024-12-18 135540.png (748.11 KiB) Viewed 276 times
- Uncheck "Trash unrequested" --> Items pop back into chest Inventory; Logistic Bots go home
Screenshot 2024-12-18 135819.png
Screenshot 2024-12-18 135819.png (722.77 KiB) Viewed 276 times
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: [2.0.26] Logistic Group Multipliers rounded to 1 Decimal Place

Post by IsaacOscar »

eugenekay wrote: Wed Dec 18, 2024 4:18 am Tangential to 117118's observations about Rocket Capacity and "0.25 Stacks" vs "0.3 Stacks", I found another place which apparently mixes precision levels when handling Numbers.

What did you do?
- Create a Logistic Group, with a Signal in it (example: Medium Electric Pole : 500)
- Place a Logistic Chest (example: Buffer Chest)
- Click the Pencil icon, and select the Logistic Group created in Step 1.
- Set a "Multiplier" which is between 0 and 1, and has 2 decimal places (Example: 0.25)
- "Apply Change" to confirm the addition of the Logistic Group
- Re-click the Pencil Icon next to the Logistic Group name
What happened?
- The "Multiplier"'s displayed Value has been Rounded to 1 decimal place - "0.3"
What did you expect to happen instead? It might be obvious to you, but do it anyway!
- The Exact value that I put into the box would be displayed.
Does it happen always, once, or sometimes?
- If using more than 1 decimal place of Precision

This only affects the Multiplier Displayed in the UI. The actual multiplier is saved as "0.25" internally, and the resulting Request count or Signal value (if applied to a Constant Combinator) does match - the Tooltip shows 500 * 0.25 = 125 Medium Electric Poles. This is consistent among all the places that it is possible to set a Logistic Request, including Chests, Space Platform Hub, Landing Pad, Constant Combinator, etc.

Buffer Chest:
Screenshot 2024-12-17 225433.png
Screenshot 2024-12-17 225450.png

Constant Combinator:
Screenshot 2024-12-17 225923.png
Screenshot 2024-12-17 225948.png
Note that you can put formulas there, e.g. 1/3, should that be converted to 0.3333333333333333? (which definitely will not fit in the text box!)
Post Reply

Return to “Bug Reports”