I have had issues in the past with large map arrays and flash. This is how I was doing them…
mapDataArray = (0,0,0,1,3,4,etc…)
Each number representing a isometric tile type. Grass, water, etc… With maps with thousands and thousands of tiles this gets quite slow or simply crashes things… A 1000x1000 map is a million tiles!
Now, I have designed another system which is much more efficient.
This uses two arrays. Ill make them non multi-dimensional for clarity in this example.
mapTileArray = (1,2,1,2,1);
mapTileNumberArray(5,2,7,1,1);
That is all of the data required to generate that entire map. In the map tile array 1 represents grass and 2 represents water. The second array tells flash how many tiles to draw of that type.
It has reduced 16 data points down to 10. In actual use it will be even more efficient because this example map has higher complexity than my maps will have on average.
Anyone have any other ideas? Would it be better to use vectors or some other data type for storing map data? I have run into a brick wall with massive arrays… Maybe I should split up maps into different “blocks”.
Here is a better example… A 14x14 map which would be 196 data points via my old system…
It is reduced to…
array1(1,2,1,2,1,2,1)
array2(4,3,11,3,11,2,0) //Zero = Infinite/Fill to rest of map size
Reduction of 196 data points to 14! The average for me in my base tile maps is going to be a reduction of data by 75+%.
The base tiles are going to be three different types at most. Selection of proper water/land/etc transition tiles at corners/edges will be handled by an alogo.