GameMaker: Studio

GameMaker: Studio

View Stats:
BatBlaster Mar 19, 2015 @ 6:52pm
Maximum Array Size
What is the maximum size of an array, I want to make a turn based game where there could be potentially millions of elements in an array.
< >
Showing 1-11 of 11 comments
Daynar Mar 19, 2015 @ 7:10pm 
I believe you could make an array infinite and if not you could faily easily code a system to have it just use another array when you reach one's max capacity.

However, this is absolutely not what you should do. Unless you're working on something revolutionary there is surely a more optomised way to do what you want to do. Having a million large array would be a huge memory hog even if it was completely boolean variables, and I assume you want to store far more complex variables than that.
BatBlaster Mar 19, 2015 @ 7:40pm 
I suppose I should store the bats in groups. The idea is to make a game about White Nose Syndrome, the fungal disease killing North American bats, and maybe I should store them in groups of hundreds or by roost.
BatBlaster Mar 19, 2015 @ 8:18pm 
I'll do it by roost and simulate kills by doing n random ints and incrementing a counter if it is below a save value.
Daynar Mar 19, 2015 @ 8:30pm 
Well since it's turn based you could probably just use a large array if needed. For some reason I thought it was an rts and was a dumb. It would be better to haved more specific array though as it will take significantly shorter or sort through them and may take up less memory. (that said if your planning on using the arrays primarily for storage it probably wont matter too much if you have a huge million index array or a thousand tousand index arrays)
Last edited by Daynar; Mar 19, 2015 @ 8:30pm
BatBlaster Mar 19, 2015 @ 8:38pm 
I will just store counts of each species per roost
Blind Mar 20, 2015 @ 11:39am 
I did a stress test, using objects with just one vector and one alarm I started getting slowdown at about 400'000 objects and I'm on a pretty good PC.

So, maybe that many?

+Also, if the individual bats don't need any AI you could render them as particles - you can have many more particles than objects plus they can have physics properties.
Last edited by Blind; Mar 20, 2015 @ 11:40am
BatBlaster Mar 20, 2015 @ 5:39pm 
I was just going to handle them with counters. In another question, how do I figure out the distance between every instance of a roost with every other roost, instead of just the distance to nearest
Blind Mar 20, 2015 @ 5:44pm 
From the roost, do a with(roost) - not sure if it would double-check self
BatBlaster Mar 20, 2015 @ 8:59pm 
I got it, I figured it out with help from the game maker documentation
BatBlaster Mar 23, 2015 @ 2:42am 
Screencap: http://batblaster.deviantart.com/art/WING-Newsfeed-521748867
Also, how do i find the index of the greatest element in an array, and then the second greatest...
Daynar Mar 23, 2015 @ 10:43am 
var largest_index = 0 for(var i = 0; i < array_length_1d(array); i ++) { if array > array[largest_index]
largest_index = i
}
Last edited by Daynar; Mar 23, 2015 @ 10:43am
< >
Showing 1-11 of 11 comments
Per page: 1530 50

Date Posted: Mar 19, 2015 @ 6:52pm
Posts: 11