The 4 array dimensions were easy to manage when controlling the chunks and tiles: [ChunkCoordinateX]CunkCoordinateY][TileCoordinateX][TileCoordinateY]
btw the first array value is not [chunkCoordinateX] but instead the pointer to the ENTITY* .
[..]
I might not have a good idea how to use an array like that.. I stop posting with unhelpful confusion.
I tend to use it like this:
WorldPackSoilEntity[InputCoorX][InputCoorY][iSoilCoorX][iSoilCoorY] =
ent_create("soil.hmp",
vector(WorldPackSoilData[InputCoorX][InputCoorY][iSoilCoorX][iSoilCoorY][getPositionX],
WorldPackSoilData[InputCoorX][InputCoorY][iSoilCoorX][iSoilCoorY][getPositionY],
4),0);
But it seems to be unefficient / redundant memory allocation(?) so I switch to a one dimensional array.
Anyway, I can't understand the need of the secondary division, since a terrain area is bidimensional you only need two dimensions in your array.
Since I need a few but regular connections to the "underworld" underneath the landscape I have to bundle many small terrains to a group - a group of terrains makes a chunk.
Each Tile(terrain) has a idividual height value; each terrain is deformed depending on its surrounding terrains.
How do you hide and show the visible chunks? Creating and removing entity terrains? If so, I would suggest you recycling the removed one. [/quote]
Yes, thanks, recycling sounds nice to me, therefore I wouldnt need 4 dimensional arrays(Only 1)!
Thanks for you input
Regards,
Geist
EDIT: The rapdily increasing nexus and video memory was caused due to the fact that I used terrains. I've ported the basics to models and it worked fine with good fps. Everytime you delete a terrain but keep the pointer and then create a new terrain in the pointer the nexus will increase for some reason..
Thank you for your help, think it's solved so far