LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

Array Size

Root / Programming Questions / [.]

Waffles_XCreated:
For a new game i'm making I need to know what is the most amount of elements and array can hold in SB. Does anyone know that limit?

With an integer array it’s like 2000x2000
ARRAY%[2000,2000]
It won’t work because it’s too big but it’s some where around there.

Wow, that a lot! I was expecting it to be lower. With there is no way possible for my game to make arrays that big, but I still just wanted to know. Thanks.

Wow, that a lot! I was expecting it to be lower. With there is no way possible for my game to make arrays that big, but I still just wanted to know. Thanks.
It is a lot lower if you use regular arrays. Be sure to remember the % at the end of the array name, that makes it an integer array. Integers take up a lot less space then floats. XD

I see...

I believe unless I am thinking wrong, integer arrays just make the number in an array a whole number like "0" instead of there normal which would be "0.0". one uses decimals or something iirc, in any case it should not be a problem.

I believe unless I am thinking wrong, integer arrays just make the number in an array a whole number like "0" instead of there normal which would be "0.0". one uses decimals or something iirc, in any case it should not be a problem.
Integer arrays only hold numbers like 0,1,2,3,4 and 5 and nothing in between. Regular arrays hold those numbers and any decimal in between (up to 99 numbers in total before or after the decimal).

SB gives you access to about 8MB (8*1024*1024 bytes) of memory, and since integers are 4 bytes and floats are 8, the biggest array would technically be 2097152 (integer) or 1048576 (float). In reality it's slightly less than that, and of course it also depends on how many other variables and arrays you have.