I'm currently trying to learn game developing in Java with LibGDX and have a few questions regarding infinite map generation in an isometric type tile game. My current code in a Screen constructor looks like this.
for (int col = MAP_WIDTH - 1; col >= 0; --col) {
for (int row = MAP_HEIGHT - 1; row >= 0; --row) {
int x = (col * TILE_WIDTH / 2) - (row * TILE_WIDTH / 2);
int y = (col * TILE_HEIGHT / 2) + (row * TILE_HEIGHT / 2);
float noise = OpenSimplex2.noise2_ImproveX(SEED, ((float) col) * scale, ((float) row * scale));
mainStage.addActor(new TileActor(x, y, col, row, getNameFromNoise(noise), mainStage));
}
}
This adds and Actor in a set MAP_WIDTH and MAP_HEIGHT and changes the texture of that tile depending on a simplex noise algorithm. How would I best go about changing this to an infinite world? Should all the noise values be calculated beforehand and then the actors be loaded when the camera pans over their position? How would i best store this generated map? Thanks.