I had RSO trigger message like on last screenshot in this post:
https://forums.factorio.com/forum/vie ... 76#p112276
It seems there is a limit on amount of resource in one node - whats the limit so I can protect the mod from generating that error by capping the values?
Resource limits
Re: Resource limits
There seems to be a limit of 4294967295. Does that make sense? 

Re: Resource limits
I played around and it's a 32 bit value but seems to be signed. So actual limit is about 2.1e9 or things go into negative.Zeblote wrote:There seems to be a limit of 4294967295. Does that make sense?
I'm adding a hard limit of 1e9 just in case.
-
- Filter Inserter
- Posts: 478
- Joined: Sat Aug 23, 2014 11:43 pm
- Contact:
Re: Resource limits
The actual value is probably (2^31) - 1 = 2147483647orzelek wrote:I played around and it's a 32 bit value but seems to be signed. So actual limit is about 2.1e9 or things go into negative.Zeblote wrote:There seems to be a limit of 4294967295. Does that make sense?
I'm adding a hard limit of 1e9 just in case.
Different number type limits
Waste of bytes : P
-
- Filter Inserter
- Posts: 310
- Joined: Fri Nov 07, 2014 3:46 am
- Contact:
Re: Resource limits
well, 2.14e9 is about 2.1e9...
the 4.29e9 would be if it's an unsigned int
so technically correct?
the 4.29e9 would be if it's an unsigned int
so technically correct?
Re: Resource limits
It doesn't make sense for it to be signed. Why would you have negative resources?
Tho maybe it is...
Tho maybe it is...
Re: Resource limits
The negative part got me also.
I encountered that kind of amounts with mod only so might be why - devs didn't expect that big resource piles
As for the exact values - I was lazy thats all
In practice 2e9 or 2.14e9 works - I stayed with 1e9 just in case. Oil patch with that value has lots of % but seems workable.
I encountered that kind of amounts with mod only so might be why - devs didn't expect that big resource piles

As for the exact values - I was lazy thats all

In practice 2e9 or 2.14e9 works - I stayed with 1e9 just in case. Oil patch with that value has lots of % but seems workable.
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Resource limits
Why would it be signed? when coding in C/C++ (and persumable C#, never looked into it), if you don't explicitly tell a value to be unsigned, it will default to signed.
When coding myself I tend to make sure I get what I want by using the self predefined uint32, which I defined as an unsigned long. (I think, it could have actually been something more secure, I'm not sure without looking it up).
Yes... depending on what software you compile with, what OS you are using, and what the target platform is, int can be a huge number of different things, including 16bit and 64bit variables.
When coding myself I tend to make sure I get what I want by using the self predefined uint32, which I defined as an unsigned long. (I think, it could have actually been something more secure, I'm not sure without looking it up).
Yes... depending on what software you compile with, what OS you are using, and what the target platform is, int can be a huge number of different things, including 16bit and 64bit variables.