Item Network SA

by djmalk

This mod adds a network for transporting items and fluids. Now with QUALITY support.

Tweaks
2 months ago
2.0
830
Logistics Fluids Logistic network Storage Cheats

b crash when attempting to integer overflow a stored fluid

4 months ago

"The mod Item Network SA (0.8.9) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event item-network-sa::on_nth_tick(120)
Given min value (2.14752e+09) is too big, allowed values are from -2147483648 to 2147483647
stack traceback:
[C]: in function 'set_slot'
item-network-sa/src/NetworkChest.lua:1283: in function <item-network-sa/src/NetworkChest.lua:1253>"

my stored water count exceeded 2^31-1 (32 bit integer limit)
in 1.1 its unrealistic to manage to get a fluid count this high, but with quality it becomes easy and sometimes accidental

fix: the "no limit" button should not actually have no limit. it should instead limit at 2^31-1

4 months ago

also probably applies to items but i haven't gotten there yet. only 12 million iron ore stored spare and climbing (slowly)

4 months ago

well crap. now its happening a set time after i load my autosave even if i disable all my pumps and i dont know what pump i forgot to disable

4 months ago

LOL, I don't think "year" thought about someone actually reaching that limit and neither did I. This is an insanely big number. I'll check it out when I have time, but it's not an urgent fix. You're probably the only one messing with numbers that huge. Set limits and don't prick your save games.

4 months ago

Ok, I actually got curious and took a peek.
The problem is with network sensors — circuit signals can't go that high, and it crashes.
I clamped the value at the max allowed signal value.
Storage network itself should allow bigger numbers, but I'm not going to test it — you can tell me if it can safely go above 2,147,483,647 or if it crashes.
Either way, network sensors now only show a maximum value of 2,147,483,647. Fix is in next patch.

4 months ago

Damn it, your post really made me curious, so I did some testing and research and found out that:

In Factorio's version of Lua (LuaJIT), numbers are stored as 64-bit floating point numbers ("double" precision).
That means:
You can safely represent integers exactly up to about 9,007,199,254,740,992 (around 9 quadrillion — 9×10¹⁵).
After that, integers lose precision (they get fuzzy).

Lua exact integer storage:
Up to 9,007,199,254,740,992 (2⁵³): exact
After that: numbers still exist, but small changes (like +1) get lost

The network can count way past 2 billion without any issue.
It could even reach trillions without problems inside Lua.
The problem only happens if you need exact control over insanely high numbers past 9 quadrillion — but that's wildly outside any normal gameplay.

So good luck breaking that! :D

This thread has been locked.