server sim optimization
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
This commit is contained in:
parent
560d306445
commit
4442256566
@ -1941,6 +1941,9 @@ Per-mesh draw calls in batched static draw calls
|
||||
Main content pipeline tracking
|
||||
Error checking on mesh rendering (making sure not trying to draw 0-element meshes)
|
||||
Fix generating rendering geometry for blocks/terrain with 0 elements
|
||||
GriddedDataCellManager filtering optimization
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -12,6 +12,7 @@ import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Semaphore;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.joml.Vector3d;
|
||||
import org.joml.Vector3i;
|
||||
@ -709,16 +710,17 @@ public class GriddedDataCellManager implements DataCellManager, VoxelCellManager
|
||||
|
||||
//micro simulation
|
||||
boolean runMicroSim = Globals.serverState.microSimulation != null && Globals.serverState.microSimulation.isReady();
|
||||
for(ServerDataCell cell : this.groundDataCells.values()){
|
||||
if(runMicroSim && this.shouldSimulate(cell)){
|
||||
if(runMicroSim){
|
||||
List<ServerDataCell> simulationTargets = this.groundDataCells.values().stream().filter((ServerDataCell cell) -> this.shouldSimulate(cell)).collect(Collectors.toList());
|
||||
for(ServerDataCell cell : simulationTargets){
|
||||
Globals.serverState.microSimulation.simulate(cell);
|
||||
}
|
||||
|
||||
//queue fluid simulation
|
||||
if(EngineState.EngineFlags.RUN_FLUIDS){
|
||||
Vector3i cellPos = this.getCellWorldPosition(cell);
|
||||
if(cellPos != null){
|
||||
this.serverFluidManager.queue(cellPos.x, cellPos.y, cellPos.z);
|
||||
//queue fluid simulation
|
||||
if(EngineState.EngineFlags.RUN_FLUIDS){
|
||||
Vector3i cellPos = this.getCellWorldPosition(cell);
|
||||
if(cellPos != null){
|
||||
this.serverFluidManager.queue(cellPos.x, cellPos.y, cellPos.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -749,10 +751,10 @@ public class GriddedDataCellManager implements DataCellManager, VoxelCellManager
|
||||
private boolean shouldSimulate(ServerDataCell cell){
|
||||
GriddedDataCellTrackingData trackingData = this.cellTrackingMap.get(cell);
|
||||
return
|
||||
//has player
|
||||
(cell.getPlayers().size() > 0 && trackingData.getClosestPlayer() < SIMULATION_DISTANCE_CUTOFF) ||
|
||||
//has creature
|
||||
(trackingData.getCreatureCount() > 0)
|
||||
(trackingData.getCreatureCount() > 0) &&
|
||||
//has player
|
||||
(cell.getPlayers().size() > 0 && trackingData.getClosestPlayer() < SIMULATION_DISTANCE_CUTOFF)
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user