loading display work
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2025-05-28 23:35:49 -04:00
parent 3f401dfde3
commit 2d20e2d389
5 changed files with 149 additions and 10 deletions

View File

@ -2046,6 +2046,7 @@ Farm plots properly save/load to/from disk
Farm plots place dirt Farm plots place dirt
Farmland voxel type Farmland voxel type
Farm plots place farmland Farm plots place farmland
More verbose loading display

View File

@ -117,6 +117,26 @@ public class ClientBlockCellManager {
*/ */
boolean initialized = false; boolean initialized = false;
/**
* The number of cells waiting on the network
*/
private int waitingOnNetworkCount = 0;
/**
* The number of cells that triggered a model generation last frame
*/
private int generationLastFrameCount = 0;
/**
* The number of cells that either split or joined last frame
*/
private int partitionLastFrameCount = 0;
/**
* The number of cells that triggered a request last frame
*/
private int requestLastFrameCount = 0;
/** /**
* Constructor * Constructor
* @param voxelTextureAtlas The voxel texture atlas * @param voxelTextureAtlas The voxel texture atlas
@ -138,6 +158,11 @@ public class ClientBlockCellManager {
public void update(){ public void update(){
Globals.profiler.beginCpuSample("ClientBlockCellManager.update"); Globals.profiler.beginCpuSample("ClientBlockCellManager.update");
if(shouldUpdate && Globals.clientState.playerEntity != null){ if(shouldUpdate && Globals.clientState.playerEntity != null){
//reset tracking
this.waitingOnNetworkCount = 0;
this.generationLastFrameCount = 0;
this.partitionLastFrameCount = 0;
this.requestLastFrameCount = 0;
Vector3d playerPos = EntityUtils.getPosition(Globals.clientState.playerEntity); Vector3d playerPos = EntityUtils.getPosition(Globals.clientState.playerEntity);
Vector3i playerWorldPos = Globals.clientState.clientWorldData.convertRealToWorldSpace(playerPos); Vector3i playerWorldPos = Globals.clientState.clientWorldData.convertRealToWorldSpace(playerPos);
int distCache = this.getDistCache(this.lastPlayerPos, playerWorldPos); int distCache = this.getDistCache(this.lastPlayerPos, playerWorldPos);
@ -209,6 +234,9 @@ public class ClientBlockCellManager {
//update neighbors //update neighbors
this.conditionalUpdateAdjacentNodes(container, container.getChildren().get(0).getLevel()); this.conditionalUpdateAdjacentNodes(container, container.getChildren().get(0).getLevel());
//update tracking
this.partitionLastFrameCount++;
Globals.profiler.endCpuSample(); Globals.profiler.endCpuSample();
updated = true; updated = true;
@ -222,6 +250,9 @@ public class ClientBlockCellManager {
cell.setHasRequested(true); cell.setHasRequested(true);
} }
evaluationMap.put(node,true); evaluationMap.put(node,true);
//update tracking
this.requestLastFrameCount++;
Globals.profiler.endCpuSample(); Globals.profiler.endCpuSample();
updated = true; updated = true;
@ -234,11 +265,14 @@ public class ClientBlockCellManager {
if(node.getData().getFailedGenerationAttempts() > FAILED_GENERATION_ATTEMPT_THRESHOLD){ if(node.getData().getFailedGenerationAttempts() > FAILED_GENERATION_ATTEMPT_THRESHOLD){
node.getData().setHasRequested(false); node.getData().setHasRequested(false);
} }
this.requestLastFrameCount++;
} else if(node.getData() != null){ } else if(node.getData() != null){
this.waitingOnNetworkCount++;
node.getData().setFailedGenerationAttempts(node.getData().getFailedGenerationAttempts() + 1); node.getData().setFailedGenerationAttempts(node.getData().getFailedGenerationAttempts() + 1);
if(node.getData().getFailedGenerationAttempts() > FAILED_GENERATION_ATTEMPT_THRESHOLD){ if(node.getData().getFailedGenerationAttempts() > FAILED_GENERATION_ATTEMPT_THRESHOLD){
node.getData().setHasRequested(false); node.getData().setHasRequested(false);
} }
this.generationLastFrameCount++;
} }
evaluationMap.put(node,true); evaluationMap.put(node,true);
Globals.profiler.endCpuSample(); Globals.profiler.endCpuSample();
@ -247,6 +281,7 @@ public class ClientBlockCellManager {
} else { } else {
if(this.shouldJoin(playerPos, node, distCache)) { if(this.shouldJoin(playerPos, node, distCache)) {
this.join(node); this.join(node);
this.partitionLastFrameCount++;
updated = true; updated = true;
} else { } else {
this.validCellCount++; this.validCellCount++;
@ -865,6 +900,38 @@ public class ClientBlockCellManager {
return this.chunkTree.getNodeCount(); return this.chunkTree.getNodeCount();
} }
/**
* Gets the number of cells that are waiting on the network
* @return The number of cells that are waiting on the network
*/
public int getWaitingOnNetworkCount(){
return this.waitingOnNetworkCount;
}
/**
* Gets the number of cells that triggered a model generation last frame
* @return The number of cells
*/
public int getGenerationLastFrameCount(){
return this.generationLastFrameCount;
}
/**
* Gets the number of cells that triggered an octree split/join last frame
* @return The number of cells
*/
public int getPartitionLastFrameCount(){
return this.partitionLastFrameCount;
}
/**
* Gets the number of cells that triggered a terrain data request last frame
* @return The number of cells
*/
public int getRequestLastFrameCount(){
return this.requestLastFrameCount;
}
} }

View File

@ -8,7 +8,7 @@ public class ClientCharacterManager {
/** /**
* The list of characters available * The list of characters available
*/ */
ClientCharacterListDTO characterList; private ClientCharacterListDTO characterList;
/** /**
* Tracks whether we're waiting on the character list or not * Tracks whether we're waiting on the character list or not

View File

@ -152,6 +152,26 @@ public class ClientDrawCellManager {
*/ */
boolean bustDistCache = false; boolean bustDistCache = false;
/**
* The number of cells waiting on the network
*/
private int waitingOnNetworkCount = 0;
/**
* The number of cells that triggered a model generation last frame
*/
private int generationLastFrameCount = 0;
/**
* The number of cells that either split or joined last frame
*/
private int partitionLastFrameCount = 0;
/**
* The number of cells that triggered a request last frame
*/
private int requestLastFrameCount = 0;
/** /**
* Constructor * Constructor
* @param voxelTextureAtlas The voxel texture atlas * @param voxelTextureAtlas The voxel texture atlas
@ -173,6 +193,11 @@ public class ClientDrawCellManager {
public void update(){ public void update(){
Globals.profiler.beginCpuSample("ClientDrawCellManager.update"); Globals.profiler.beginCpuSample("ClientDrawCellManager.update");
if(shouldUpdate && Globals.clientState.playerEntity != null){ if(shouldUpdate && Globals.clientState.playerEntity != null){
//reset tracking
this.waitingOnNetworkCount = 0;
this.generationLastFrameCount = 0;
this.partitionLastFrameCount = 0;
this.requestLastFrameCount = 0;
Vector3d playerPos = EntityUtils.getPosition(Globals.clientState.playerEntity); Vector3d playerPos = EntityUtils.getPosition(Globals.clientState.playerEntity);
Vector3i playerWorldPos = Globals.clientState.clientWorldData.convertRealToWorldSpace(playerPos); Vector3i playerWorldPos = Globals.clientState.clientWorldData.convertRealToWorldSpace(playerPos);
int distCache = this.getDistCache(this.lastPlayerPos, playerWorldPos); int distCache = this.getDistCache(this.lastPlayerPos, playerWorldPos);
@ -248,6 +273,9 @@ public class ClientDrawCellManager {
//update neighbors //update neighbors
this.conditionalUpdateAdjacentNodes(container, container.getChildren().get(0).getLevel()); this.conditionalUpdateAdjacentNodes(container, container.getChildren().get(0).getLevel());
//update tracking
this.partitionLastFrameCount++;
Globals.profiler.endCpuSample(); Globals.profiler.endCpuSample();
updated = true; updated = true;
@ -267,6 +295,9 @@ public class ClientDrawCellManager {
} }
evaluationMap.put(node,true); evaluationMap.put(node,true);
//update tracking
this.requestLastFrameCount++;
Globals.profiler.endCpuSample(); Globals.profiler.endCpuSample();
updated = true; updated = true;
} else if(this.shouldGenerate(playerPos, node, minLeafLod, distCache)){ } else if(this.shouldGenerate(playerPos, node, minLeafLod, distCache)){
@ -284,11 +315,13 @@ public class ClientDrawCellManager {
if(node.getData().getFailedGenerationAttempts() > FAILED_GENERATION_ATTEMPT_THRESHOLD){ if(node.getData().getFailedGenerationAttempts() > FAILED_GENERATION_ATTEMPT_THRESHOLD){
node.getData().setHasRequested(false); node.getData().setHasRequested(false);
} }
this.generationLastFrameCount++;
} else if(node.getData() != null){ } else if(node.getData() != null){
node.getData().setFailedGenerationAttempts(node.getData().getFailedGenerationAttempts() + 1); node.getData().setFailedGenerationAttempts(node.getData().getFailedGenerationAttempts() + 1);
if(node.getData().getFailedGenerationAttempts() > FAILED_GENERATION_ATTEMPT_THRESHOLD){ if(node.getData().getFailedGenerationAttempts() > FAILED_GENERATION_ATTEMPT_THRESHOLD){
node.getData().setHasRequested(false); node.getData().setHasRequested(false);
} }
this.waitingOnNetworkCount++;
} }
evaluationMap.put(node,true); evaluationMap.put(node,true);
Globals.profiler.endCpuSample(); Globals.profiler.endCpuSample();
@ -300,6 +333,7 @@ public class ClientDrawCellManager {
System.out.println("Joining target node"); System.out.println("Joining target node");
} }
this.join(node); this.join(node);
this.partitionLastFrameCount++;
updated = true; updated = true;
} else { } else {
this.validCellCount++; this.validCellCount++;
@ -1100,6 +1134,37 @@ public class ClientDrawCellManager {
this.bustDistCache = true; this.bustDistCache = true;
} }
/**
* Gets the number of cells that are waiting on the network
* @return The number of cells that are waiting on the network
*/
public int getWaitingOnNetworkCount(){
return this.waitingOnNetworkCount;
}
/**
* Gets the number of cells that triggered a model generation last frame
* @return The number of cells
*/
public int getGenerationLastFrameCount(){
return this.generationLastFrameCount;
}
/**
* Gets the number of cells that triggered an octree split/join last frame
* @return The number of cells
*/
public int getPartitionLastFrameCount(){
return this.partitionLastFrameCount;
}
/**
* Gets the number of cells that triggered a terrain data request last frame
* @return The number of cells
*/
public int getRequestLastFrameCount(){
return this.requestLastFrameCount;
}
} }

View File

@ -66,7 +66,7 @@ public class ClientLoading {
WindowUtils.recursiveSetVisible(Globals.elementService.getWindow(WindowStrings.WINDOW_MENU_MAIN), false); WindowUtils.recursiveSetVisible(Globals.elementService.getWindow(WindowStrings.WINDOW_MENU_MAIN), false);
WindowUtils.replaceMainMenuContents(MenuGenerators.createEmptyMainMenu()); WindowUtils.replaceMainMenuContents(MenuGenerators.createEmptyMainMenu());
WindowUtils.recursiveSetVisible(Globals.elementService.getWindow(WindowStrings.WINDOW_LOADING), true); WindowUtils.recursiveSetVisible(Globals.elementService.getWindow(WindowStrings.WINDOW_LOADING), true);
WindowUtils.updateLoadingWindow("Waiting on server"); WindowUtils.updateLoadingWindow("WAITING ON SERVER");
//disable menu input //disable menu input
Globals.controlHandler.hintUpdateControlState(ControlHandler.ControlsState.NO_INPUT); Globals.controlHandler.hintUpdateControlState(ControlHandler.ControlsState.NO_INPUT);
//initialize the client thread (client) //initialize the client thread (client)
@ -76,26 +76,22 @@ public class ClientLoading {
ClientLoading.initClientThread(); ClientLoading.initClientThread();
} }
//while we don't know what races are playable, wait //while we don't know what races are playable, wait
WindowUtils.updateLoadingWindow("Waiting on lore"); WindowUtils.updateLoadingWindow("WAITING ON LORE");
int framesWaited = 0; int framesWaited = 0;
while(Globals.gameConfigCurrent.getCreatureTypeLoader().getPlayableRaces().size() == 0){ while(Globals.gameConfigCurrent.getCreatureTypeLoader().getPlayableRaces().size() == 0){
if(framesWaited % LORE_RESEND_FRAMES == (LORE_RESEND_FRAMES - 1)){ if(framesWaited % LORE_RESEND_FRAMES == (LORE_RESEND_FRAMES - 1)){
//request playable races //request playable races
Globals.clientState.clientConnection.queueOutgoingMessage(LoreMessage.constructRequestRacesMessage()); Globals.clientState.clientConnection.queueOutgoingMessage(LoreMessage.constructRequestRacesMessage());
//request characters available to this player
Globals.clientState.clientConnection.queueOutgoingMessage(CharacterMessage.constructRequestCharacterListMessage());
} }
try { try {
TimeUnit.MILLISECONDS.sleep(5); TimeUnit.MILLISECONDS.sleep(5);
} catch (InterruptedException ex) {} } catch (InterruptedException ex) {}
framesWaited++; framesWaited++;
} }
WindowUtils.updateLoadingWindow("Waiting on characters"); WindowUtils.updateLoadingWindow("WAITING ON CHARACTERS");
framesWaited = 0; framesWaited = 0;
while(Globals.clientState.clientCharacterManager.isWaitingOnList()){ while(Globals.clientState.clientCharacterManager.isWaitingOnList()){
if(framesWaited % LORE_RESEND_FRAMES == (LORE_RESEND_FRAMES - 1)){ if(framesWaited % LORE_RESEND_FRAMES == (LORE_RESEND_FRAMES - 1)){
//request playable races
Globals.clientState.clientConnection.queueOutgoingMessage(LoreMessage.constructRequestRacesMessage());
//request characters available to this player //request characters available to this player
Globals.clientState.clientConnection.queueOutgoingMessage(CharacterMessage.constructRequestCharacterListMessage()); Globals.clientState.clientConnection.queueOutgoingMessage(CharacterMessage.constructRequestCharacterListMessage());
} }
@ -366,7 +362,12 @@ public class ClientLoading {
){ ){
i++; i++;
if(i % DRAW_CELL_UPDATE_RATE == 0){ if(i % DRAW_CELL_UPDATE_RATE == 0){
WindowUtils.updateLoadingWindow("WAITING ON SERVER TO SEND TERRAIN (" + Globals.clientState.clientTerrainManager.getAllChunks().size() + ")"); WindowUtils.updateLoadingWindow("WAITING ON SERVER TO SEND TERRAIN (" +
Globals.clientState.clientDrawCellManager.getWaitingOnNetworkCount() + "/" +
Globals.clientState.clientDrawCellManager.getPartitionLastFrameCount() + "/" +
Globals.clientState.clientDrawCellManager.getRequestLastFrameCount() + "/" +
Globals.clientState.clientDrawCellManager.getGenerationLastFrameCount() +
")");
} }
try { try {
TimeUnit.MILLISECONDS.sleep(10); TimeUnit.MILLISECONDS.sleep(10);
@ -450,7 +451,12 @@ public class ClientLoading {
){ ){
i++; i++;
if(i % DRAW_CELL_UPDATE_RATE == 0){ if(i % DRAW_CELL_UPDATE_RATE == 0){
WindowUtils.updateLoadingWindow("WAITING ON SERVER TO SEND BLOCKS (" + Globals.clientState.clientTerrainManager.getAllChunks().size() + ")"); WindowUtils.updateLoadingWindow("WAITING ON SERVER TO SEND BLOCKS (" +
Globals.clientState.clientBlockCellManager.getWaitingOnNetworkCount() + "/" +
Globals.clientState.clientBlockCellManager.getPartitionLastFrameCount() + "/" +
Globals.clientState.clientBlockCellManager.getRequestLastFrameCount() + "/" +
Globals.clientState.clientBlockCellManager.getGenerationLastFrameCount() +
")");
} }
try { try {
TimeUnit.MILLISECONDS.sleep(10); TimeUnit.MILLISECONDS.sleep(10);