GameMaker: Studio

GameMaker: Studio

檢視統計資料:
BatBlaster 2015 年 3 月 19 日 下午 6:52
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.
< >
目前顯示第 1-11 則留言,共 11
Daynar 2015 年 3 月 19 日 下午 7:10 
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 2015 年 3 月 19 日 下午 7:40 
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 2015 年 3 月 19 日 下午 8:18 
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 2015 年 3 月 19 日 下午 8:30 
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)
最後修改者:Daynar; 2015 年 3 月 19 日 下午 8:30
BatBlaster 2015 年 3 月 19 日 下午 8:38 
I will just store counts of each species per roost
Blind 2015 年 3 月 20 日 上午 11:39 
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.
最後修改者:Blind; 2015 年 3 月 20 日 上午 11:40
BatBlaster 2015 年 3 月 20 日 下午 5:39 
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 2015 年 3 月 20 日 下午 5:44 
From the roost, do a with(roost) - not sure if it would double-check self
BatBlaster 2015 年 3 月 20 日 下午 8:59 
I got it, I figured it out with help from the game maker documentation
BatBlaster 2015 年 3 月 23 日 上午 2:42 
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 2015 年 3 月 23 日 上午 10:43 
var largest_index = 0 for(var i = 0; i < array_length_1d(array); i ++) { if array > array[largest_index]
largest_index = i
}
最後修改者:Daynar; 2015 年 3 月 23 日 上午 10:43
< >
目前顯示第 1-11 則留言,共 11
每頁顯示: 1530 50

張貼日期: 2015 年 3 月 19 日 下午 6:52
回覆: 11