I have made a java game engine that generates a terrain of size 800, 800 on the x z coordinates.
Each terrain object, however, only recognises coordinates of 1 to -1 on each axis and these are the bounds of the terrain. When the terrain is generated a seed is used to generate the heights of each coord from 1 to -1 on both axis.
Below is the code to generate the first terrain (I know it doesnt help much but Im just showing you so you know where the initial terrain is generated [in terrain coords x=0
z=-1
. It is then added to an array of terrains and in the main game loop everything is rendered. An important note is that a new seed is generated every time a terrain is generated which I know isnt going to work for multiple terrains.
How would I make it so that terrain chunks are loaded in the direction the player is walking and they are all part of 1 seed. Also would this go in the terrain generation class or the main game loop? thanks
Terrain terrain = new Terrain(0,-1,loader,texturePack, blendMap, "heightmap", 0); //land
List<Terrain> terrains = new ArrayList<Terrain>();
terrains.add(terrain);
renderer.renderScene(treeEntities, terrains, light, camera); // in game loop
[I'm using lwjgl]