diff --git a/assets/Config/settings.json b/assets/Config/settings.json index e3b6869e..98846a8d 100644 --- a/assets/Config/settings.json +++ b/assets/Config/settings.json @@ -1,11 +1,14 @@ { "gameplayGenerateWorld" : false, + "gameplayPhysicsCellRadius" : 2, "displayWidth" : 1920, "displayHeight" : 1080, "graphicsFOV" : 90.0, - + + + "graphicsPerformanceLODChunkRadius" : 5, "graphicsPerformanceEnableVSync" : true, "graphicsPerformanceDrawShadows" : true, diff --git a/src/main/java/electrosphere/game/client/cells/DrawCellManager.java b/src/main/java/electrosphere/game/client/cells/DrawCellManager.java index 0613fac3..4eb7b528 100644 --- a/src/main/java/electrosphere/game/client/cells/DrawCellManager.java +++ b/src/main/java/electrosphere/game/client/cells/DrawCellManager.java @@ -95,6 +95,10 @@ public class DrawCellManager { program = Globals.defaultMeshShader; + drawRadius = Globals.userSettings.getGraphicsPerformanceLODChunkRadius(); + drawStepdownInterval = Globals.userSettings.getGameplayPhysicsCellRadius(); + physicsRadius = Globals.userSettings.getGameplayPhysicsCellRadius(); + update = true; } diff --git a/src/main/java/electrosphere/game/config/UserSettings.java b/src/main/java/electrosphere/game/config/UserSettings.java index 5e21bbf0..5d1328ea 100644 --- a/src/main/java/electrosphere/game/config/UserSettings.java +++ b/src/main/java/electrosphere/game/config/UserSettings.java @@ -14,6 +14,7 @@ public class UserSettings { //Gameplay settings // boolean gameplayGenerateWorld; + int gameplayPhysicsCellRadius; // @@ -29,6 +30,7 @@ public class UserSettings { //general float graphicsFOV; //performance + int graphicsPerformanceLODChunkRadius; boolean graphicsPerformanceEnableVSync; boolean graphicsPerformanceDrawShadows; //debug @@ -78,6 +80,14 @@ public class UserSettings { public boolean graphicsDebugDrawMovementVectors() { return graphicsDebugDrawMovementVectors; } + + public int getGameplayPhysicsCellRadius() { + return gameplayPhysicsCellRadius; + } + + public int getGraphicsPerformanceLODChunkRadius() { + return graphicsPerformanceLODChunkRadius; + } @@ -100,11 +110,13 @@ public class UserSettings { //gameplay settings rVal.gameplayGenerateWorld = true; + rVal.gameplayPhysicsCellRadius = 2; //graphics settings rVal.graphicsDebugDrawCollisionSpheres = false; rVal.graphicsDebugDrawMovementVectors = false; rVal.graphicsDebugDrawPhysicsObjects = false; + rVal.graphicsPerformanceLODChunkRadius = 5; rVal.graphicsFOV = 90.0f; rVal.graphicsPerformanceDrawShadows = true; rVal.graphicsPerformanceEnableVSync = true; diff --git a/src/main/java/electrosphere/net/server/Player.java b/src/main/java/electrosphere/net/server/Player.java index 2163924e..aa02d91c 100644 --- a/src/main/java/electrosphere/net/server/Player.java +++ b/src/main/java/electrosphere/net/server/Player.java @@ -1,6 +1,7 @@ package electrosphere.net.server; import electrosphere.entity.Entity; +import electrosphere.main.Globals; import electrosphere.net.parser.net.message.NetworkMessage; import java.util.concurrent.Semaphore; @@ -25,6 +26,7 @@ public class Player { id = idIncrementer; idIncrementer++; idIncrementerLock.release(); + this.simulationRadius = Globals.userSettings.getGameplayPhysicsCellRadius(); } public int getId() {