dop2000 - 25x25 is just where it starts to faulter. I'm really trying to aim for 100x100. Think of each pixel of the heightmap as a chunk of the map. The idea is to take every chunk and expand it into a second array so that chunk is in reality 100x100 tiles. I do realize this is an absurd amount of data. As far as reusing the array I could, but wouldn't that wind up in losing the processed data. I suppose I could dump it to json after ever single cell expansion of the main map. Would be a lot of files being created however.
gskunk
Still, why do you need to hold all 10.000 chunks of the map in full detail in memory at all times?
Take Google Maps approach - it loads a portion of the map only when you zoom into it.
You can load/generate a block of 3x3 chunks to allow players to move freely and load new chunks once they move to a new area.
Also, how do you populate that second array? If it's randomly generated, you should use seeded random, this will allow you to store just one number in the first array (the seed) and you will not need the second array at all! You will be able to recreate the data in each chunk of map at any time from the seed.
And if your player makes some changes on the map (kills enemies, opens chests etc.) and you need to keep track of these changes, maybe consider creating another array just for that. It could be something as simple as [tile, newdata].
This will save you hundreds Mbytes of memory.
EDIT: You can go even further and get rid of the first array too!
Compress your entire 100 million tiles map into a single number - MasterSeed.
Use MasterSeed and a pixel from your heightmap image to generate MapChunkSeed, then use MapChunkSeed to generate 100x100 tiles portion of the map. You probably should be able to do this in real-time with very little or no lag.