voxelImprovements #5

Merged
railgun merged 21 commits from voxelImprovements into master 2024-11-07 15:08:54 -05:00
3 changed files with 22 additions and 7 deletions
Showing only changes of commit ae4c0aa4e5 - Show all commits

View File

@ -53,7 +53,7 @@ public class ClientDrawCellManager {
/** /**
* The distance for sixteenth resolution * The distance for sixteenth resolution
*/ */
public static final double SIXTEENTH_RES_DIST = 48 * ServerTerrainChunk.CHUNK_DIMENSION; public static final double SIXTEENTH_RES_DIST = 128 * ServerTerrainChunk.CHUNK_DIMENSION;
/** /**
* Lod value for a full res chunk * Lod value for a full res chunk
@ -237,8 +237,9 @@ public class ClientDrawCellManager {
List<DrawCellFace> highResFaces = this.solveHighResFace(node); List<DrawCellFace> highResFaces = this.solveHighResFace(node);
//actually send requests //actually send requests
this.requestChunks(node, highResFaces); if(this.requestChunks(node, highResFaces)){
cell.setHasRequested(true); cell.setHasRequested(true);
}
Globals.profiler.endCpuSample(); Globals.profiler.endCpuSample();
updated = true; updated = true;

View File

@ -45,7 +45,12 @@ public class ClientTerrainManager {
/** /**
* Maximum concurrent terrain requests * Maximum concurrent terrain requests
*/ */
public static final int MAX_CONCURRENT_REQUESTS = 500; public static final int MAX_CONCURRENT_REQUESTS = 500;
/**
* Number of frames to wait before flagging a request as failed
*/
public static final int FAILED_REQUEST_THRESHOLD = 500;
//The interpolation ratio of terrain //The interpolation ratio of terrain
public static final int INTERPOLATION_RATIO = ServerTerrainManager.SERVER_TERRAIN_MANAGER_INTERPOLATION_RATIO; public static final int INTERPOLATION_RATIO = ServerTerrainManager.SERVER_TERRAIN_MANAGER_INTERPOLATION_RATIO;
@ -70,7 +75,7 @@ public class ClientTerrainManager {
/** /**
* Tracks what outgoing requests are currently active * Tracks what outgoing requests are currently active
*/ */
Map<Long,Boolean> requestedMap = new ConcurrentHashMap<Long,Boolean>(); Map<Long,Integer> requestedMap = new ConcurrentHashMap<Long,Integer>();
/** /**
* Constructor * Constructor
@ -158,6 +163,15 @@ public class ClientTerrainManager {
for(TerrainMessage message : bouncedMessages){ for(TerrainMessage message : bouncedMessages){
messageQueue.add(message); messageQueue.add(message);
} }
//evaluate if any chunks have failed to request
for(Long key : this.requestedMap.keySet()){
int duration = this.requestedMap.get(key);
if(duration > FAILED_REQUEST_THRESHOLD){
this.requestedMap.remove(key);
} else {
this.requestedMap.put(key,duration + 1);
}
}
lock.release(); lock.release();
Globals.profiler.endCpuSample(); Globals.profiler.endCpuSample();
} }
@ -219,7 +233,7 @@ public class ClientTerrainManager {
worldZ, worldZ,
stride stride
)); ));
this.requestedMap.put(this.getRequestKey(worldX, worldY, worldZ, stride), true); this.requestedMap.put(this.getRequestKey(worldX, worldY, worldZ, stride), 0);
rVal = true; rVal = true;
} }
lock.release(); lock.release();

View File

@ -24,7 +24,7 @@ public class TestGenerationChunkGenerator implements ChunkGenerator {
/** /**
* The size of the realm for testing generation * The size of the realm for testing generation
*/ */
public static final int GENERATOR_REALM_SIZE = 64; public static final int GENERATOR_REALM_SIZE = 512;
/** /**
* The default biome index * The default biome index