profiling work
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
d831509290
commit
8784b08fe4
@ -2006,6 +2006,7 @@ VectorPool->JomlPool
|
||||
Major NetArranger architecture rework
|
||||
No allocations on client receiving chunk of blocks or terrain
|
||||
Meshgen acceleration structure for block meshgen
|
||||
More profiling
|
||||
|
||||
|
||||
|
||||
|
||||
@ -218,7 +218,9 @@ public class CursorState {
|
||||
cursorPos = cursorPos.add(new Vector3d(eyePos).normalize().mul(-BlockChunkData.BLOCK_SIZE_MULTIPLIER));
|
||||
}
|
||||
cursorPos.set(this.clampPositionToNearestBlock(cursorPos));
|
||||
EntityUtils.getPosition(Globals.cursorState.playerBlockCursor).set(cursorPos);
|
||||
if(Globals.cursorState.playerBlockCursor != null){
|
||||
EntityUtils.getPosition(Globals.cursorState.playerBlockCursor).set(cursorPos);
|
||||
}
|
||||
cursorPos.sub(BlockChunkData.BLOCK_SIZE_MULTIPLIER / 2.0,BlockChunkData.BLOCK_SIZE_MULTIPLIER / 2.0,BlockChunkData.BLOCK_SIZE_MULTIPLIER / 2.0);
|
||||
EntityUtils.getPosition(CursorState.playerFabCursor).set(cursorPos);
|
||||
if(gridAlignmentData != null){
|
||||
|
||||
@ -77,6 +77,7 @@ public class ServerContentManager {
|
||||
//Block for macro data generation if relevant
|
||||
//
|
||||
List<MacroObject> objects = null;
|
||||
Globals.profiler.beginCpuSample("ServerContentManager.generateContentForDataCell - collision check macro data");
|
||||
if(macroData == null){
|
||||
objects = new LinkedList<MacroObject>();
|
||||
} else {
|
||||
@ -98,6 +99,7 @@ public class ServerContentManager {
|
||||
throw new Error("Failed to generate content " + notFullResCount + " " + waitCount);
|
||||
}
|
||||
}
|
||||
Globals.profiler.endCpuSample();
|
||||
|
||||
|
||||
|
||||
@ -105,33 +107,48 @@ public class ServerContentManager {
|
||||
//Actual generation/loading
|
||||
//
|
||||
String fullPath = "/content/" + cellKey + ".dat";
|
||||
Globals.profiler.beginCpuSample("ServerContentManager.generateContentForDataCell - Actual generation/loading");
|
||||
if(generateContent){ //in other words, if not arena mode
|
||||
if(FileUtils.checkSavePathExists(Globals.serverState.currentSave.getName(), fullPath)){
|
||||
Globals.profiler.beginCpuSample("ServerContentManager.generateContentForDataCell - Load from existing key");
|
||||
//if on disk (has already been generated)
|
||||
ContentSerialization contentRaw = FileUtils.loadObjectFromSavePath(Globals.serverState.currentSave.getName(), fullPath, ContentSerialization.class);
|
||||
contentRaw.hydrateRawContent(realm,cell);
|
||||
Globals.profiler.endCpuSample();
|
||||
} else {
|
||||
Globals.profiler.beginCpuSample("ServerContentManager.generateContentForDataCell - Generate from scratch");
|
||||
//else create from scratch
|
||||
ServerContentGenerator.generateContent(realm, this.macroData, cell, worldPos, HashUtils.hashIVec(worldPos.x, worldPos.y, worldPos.z));
|
||||
Globals.profiler.endCpuSample();
|
||||
}
|
||||
} else {
|
||||
//just because content wasn't generated doesn't mean there isn't data saved under that key
|
||||
if(FileUtils.checkSavePathExists(Globals.serverState.currentSave.getName(), fullPath)){
|
||||
Globals.profiler.beginCpuSample("ServerContentManager.generateContentForDataCell - Load from on-disk file without key");
|
||||
//if on disk (has already been generated)
|
||||
ContentSerialization contentRaw = FileUtils.loadObjectFromSavePath(Globals.serverState.currentSave.getName(), fullPath, ContentSerialization.class);
|
||||
contentRaw.hydrateRawContent(realm,cell);
|
||||
Globals.profiler.endCpuSample();
|
||||
}
|
||||
}
|
||||
Globals.profiler.endCpuSample();
|
||||
//checking for null because there are cases where we might not have macro data to instantiate from
|
||||
//ie, if we load an asset-defined (not save-defined) scene that does not have save data
|
||||
//ie, imagine a puzzle room or something like that
|
||||
Globals.profiler.beginCpuSample("ServerContentManager.generateContentForDataCell - Macro data");
|
||||
if(macroData != null){
|
||||
Globals.profiler.beginCpuSample("ServerContentManager.generateContentForDataCell - Get nearby characters");
|
||||
List<Character> nearbyCharacters = Globals.serverState.characterService.getCharacters(worldPos);
|
||||
Globals.profiler.endCpuSample();
|
||||
Globals.profiler.beginCpuSample("ServerContentManager.generateContentForDataCell - Spawn characters");
|
||||
for(Character character : nearbyCharacters){
|
||||
this.spawnMacroObject(realm, character);
|
||||
}
|
||||
Globals.profiler.endCpuSample();
|
||||
}
|
||||
Globals.profiler.endCpuSample();
|
||||
|
||||
Globals.profiler.endCpuSample();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -213,7 +213,7 @@ public class CharacterService extends SignalServiceImpl {
|
||||
*/
|
||||
public List<Character> getCharacters(Vector3i worldPos){
|
||||
List<Character> rVal = new LinkedList<Character>();
|
||||
List<Character> allCharacters = this.getAllCharacters();
|
||||
List<Character> allCharacters = this.getLoadedCharacters();
|
||||
for(Character character : allCharacters){
|
||||
if(ServerWorldData.convertRealToChunkSpace(character.getPos()).equals(worldPos.x, worldPos.y, worldPos.z)){
|
||||
rVal.add(character);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user