Here's another thought. Just because the map is, say 100 by 100, doesn't mean you need an array of cubes 100x100. You only need enough cubes to fill the visible map. It's then just a case of positioning the cubes around the player and swapping textures/colours about to make the cube look correct for the location it's in. The last point can be handled by having an array that holds all the information for each cell for the entire map.
Here's an example of what I'm taking about (written in 2.14b so you might need to tweak it a little to get it to work on 2.15):
remstart
example of large grid style map using a small number of objects to show the physical map
written in AGK v2.14b
controls
w and s to move backward and forward
a and d to turn
hold space and w/s to move up and down
remend
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SetVirtualResolution(1280,720)
SetWindowSize(1280,720,0)
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// holds all the variables for the player
type _player_type
cell_x as integer
cell_y as integer
cell_z as integer
endtype
player as _player_type
// this an array of idents for the physical boxes that will represent the visible map
dim block_obj[9,9,9]
// this is the array and type that hold the information for the cells for the whole map
type _cell_type
state as integer
red as integer
green as integer
blue as integer
endtype
dim cell[100,100,100] as _cell_type
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// create the blocks that will make the visible map
for y = 1 to 9
for z = 1 to 9
for x = 1 to 9
block_obj[x,y,z] = CreateObjectBox(18,18,18)
next x
next z
next y
// create a light
CreateLightDirectional(1,-1,-1,0,255,255,255)
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// create solid floors every other vertical layer
for y = 1 to 99 step 2
for z = 1 to 100
for x = 1 to 100
cell[x,y,z].state = 1
// increase red with y
if y < 25
cell[x,y,z].red = 64
elseif y < 50
cell[x,y,z].red = 128
elseif y < 75
cell[x,y,z].red = 190
else
cell[x,y,z].red = 255
endif
// increase green with z
if z < 25
cell[x,y,z].green = 64
elseif z < 50
cell[x,y,z].green = 128
elseif z < 75
cell[x,y,z].green = 190
else
cell[x,y,z].green = 255
endif
// increase blue with x
if x < 25
cell[x,y,z].blue = 64
elseif x < 50
cell[x,y,z].blue = 128
elseif x < 75
cell[x,y,z].blue = 190
else
cell[x,y,z].blue = 255
endif
next x
next z
next y
// create floor with just columns
for y = 2 to 100 step 2
for z = 1 to 100 step 4
for x = 1 to 100 step 4
cell[x,y,z].state = 1
cell[x,y,z].red = 100
cell[x,y,z].green = 100
cell[x,y,z].blue = 100
next x
next z
next y
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// position player at the centre of the map
SetCameraPosition(1,1000,1000,1000)
SetCameraRotation(1,0,0,0)
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
do
// player controls
If GetButtonState(1) = 0
MoveCameraLocalZ(1,GetJoystickY()*-1)
else
MoveCameraLocalY(1,GetJoystickY()*-1)
endif
RotateCameraGlobalY(1,GetJoystickX()*2)
// determine which cell the player is in
player.cell_x = GetCameraX(1)/20
player.cell_y = GetCameraY(1)/20
player.cell_z = GetCameraZ(1)/20
// make all the cubes invisible
for y = 1 to 9
for z = 1 to 9
for x = 1 to 9
SetObjectVisible(block_obj[x,y,z],0)
next x
next z
next y
// look four cell in all direction and turn those cells "on"
for dy = -4 to 4
for dz = -4 to 4
for dx = -4 to 4
// determine cell number
cx = player.cell_x+dx
cy = player.cell_y+dy
cz = player.cell_z+dz
// check to see if cell is within the bounds of the map
if cy => 1 and cy =< 100
if cz => 1 and cz =<100
if cx => 1 and cx =<100
// if there is a block in the cell then position it to the corrosponding cell
// and colour it according the cell's information
if cell[cx,cy,cz].state = 1
bx = dx+5
by = dy+5
bz = dz+5
SetObjectPosition(block_obj[bx,by,bz],cx*20,cy*20,cz*20)
SetObjectColor(block_obj[bx,by,bz],cell[cx,cy,cz].red,cell[cx,cy,cz].green,cell[cx,cy,cz].blue,255)
SetObjectVisible(block_obj[bx,by,bz],1)
endif
endif
endif
endif
next dx
next dz
next dy
print(str(player.cell_x) + " : " + str(player.cell_y) + " : " + str(player.cell_z))
print("fps : " + str(ScreenFPS()))
sync()
loop
This only create an array of cubes 9x9x9, ie four cubes in all direction to make up the visible map. It then swaps the colour and turns cubes off depending on what cell the player is in. I tried this on my Nexus 10 and was getting 55 fps. But I expect a bit of further optimisation will get it at a rock solid 60 fps.
If I added collision I would only check with those cells directly adjacent to the cell the player was in, so you'd only be checking a maximum of 20 cells (9 on the floor, 9 on the ceiling and 8 for the walls), not all of them will be filled with cubes so it'll actually be less then this most of the time.
This is kind of a simple example but hopefully it gives the idea.