diff --git a/docs/src/ideas/optimizationideas.md b/docs/src/ideas/optimizationideas.md index f787a417..013448b5 100644 --- a/docs/src/ideas/optimizationideas.md +++ b/docs/src/ideas/optimizationideas.md @@ -3,6 +3,8 @@ Automatically transition between instanced actors and non-instanced actors for non-animated models - Need to keep track of number of entities drawing a model, once that total passes a threshold convert them all to instanced actors - name it something fun like "HybridActor" or "ShapeshiftActor" + - Have a plane-based SUPER LOD version of models (like trees) + - Actor transitions to just plane when far enough away Merge all kinematic bodies in a scene into one - Need to keep track of individual entities' shapes after the merge diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index 5a890434..b8777eb8 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -1399,6 +1399,14 @@ Hills generator work Fix foliage manager and cells confusing worldpos and absolutevoxelpos Farther draw radius +(03/31/2025) +HillsGen visuals work + +(04/01/2025) +Falling min frames to activate increased +Reorganizing world creation ui file + + # TODO diff --git a/src/main/java/electrosphere/client/ui/menu/mainmenu/MenuGeneratorsMultiplayer.java b/src/main/java/electrosphere/client/ui/menu/mainmenu/MenuGeneratorsMultiplayer.java index 77ab2b12..8e7c59da 100644 --- a/src/main/java/electrosphere/client/ui/menu/mainmenu/MenuGeneratorsMultiplayer.java +++ b/src/main/java/electrosphere/client/ui/menu/mainmenu/MenuGeneratorsMultiplayer.java @@ -4,6 +4,7 @@ import electrosphere.auth.AuthenticationManager; import electrosphere.client.ui.components.CharacterCustomizer; import electrosphere.client.ui.components.InputMacros; import electrosphere.client.ui.menu.WindowUtils; +import electrosphere.client.ui.menu.mainmenu.worldgen.MenuWorldSelect; import electrosphere.engine.Globals; import electrosphere.engine.loadingthreads.LoadingThread; import electrosphere.engine.loadingthreads.LoadingThread.LoadingThreadType; diff --git a/src/main/java/electrosphere/client/ui/menu/mainmenu/MenuGeneratorsTitleMenu.java b/src/main/java/electrosphere/client/ui/menu/mainmenu/MenuGeneratorsTitleMenu.java index 11f0e262..eb800049 100644 --- a/src/main/java/electrosphere/client/ui/menu/mainmenu/MenuGeneratorsTitleMenu.java +++ b/src/main/java/electrosphere/client/ui/menu/mainmenu/MenuGeneratorsTitleMenu.java @@ -1,6 +1,7 @@ package electrosphere.client.ui.menu.mainmenu; import electrosphere.client.ui.menu.WindowUtils; +import electrosphere.client.ui.menu.mainmenu.worldgen.MenuWorldSelect; import electrosphere.engine.Globals; import electrosphere.engine.assetmanager.AssetDataStrings; import electrosphere.engine.loadingthreads.LoadingThread; diff --git a/src/main/java/electrosphere/client/ui/menu/mainmenu/MenuWorldSelect.java b/src/main/java/electrosphere/client/ui/menu/mainmenu/worldgen/MenuWorldSelect.java similarity index 98% rename from src/main/java/electrosphere/client/ui/menu/mainmenu/MenuWorldSelect.java rename to src/main/java/electrosphere/client/ui/menu/mainmenu/worldgen/MenuWorldSelect.java index cc5f6c59..f535f214 100644 --- a/src/main/java/electrosphere/client/ui/menu/mainmenu/MenuWorldSelect.java +++ b/src/main/java/electrosphere/client/ui/menu/mainmenu/worldgen/MenuWorldSelect.java @@ -1,9 +1,10 @@ -package electrosphere.client.ui.menu.mainmenu; +package electrosphere.client.ui.menu.mainmenu.worldgen; import java.util.List; import electrosphere.auth.AuthenticationManager; import electrosphere.client.ui.menu.WindowUtils; +import electrosphere.client.ui.menu.mainmenu.MenuGeneratorsTitleMenu; import electrosphere.engine.Globals; import electrosphere.engine.loadingthreads.LoadingThread; import electrosphere.engine.loadingthreads.LoadingThread.LoadingThreadType; diff --git a/src/main/java/electrosphere/entity/state/movement/fall/ServerFallTree.java b/src/main/java/electrosphere/entity/state/movement/fall/ServerFallTree.java index 58a26fc1..727fa5e6 100644 --- a/src/main/java/electrosphere/entity/state/movement/fall/ServerFallTree.java +++ b/src/main/java/electrosphere/entity/state/movement/fall/ServerFallTree.java @@ -44,7 +44,7 @@ public class ServerFallTree implements BehaviorTree { /** * The minimum frames to wait before playing landing animation on fall */ - public static final int MIN_FRAMES_BEFORE_LANDING_ANIM = 3; + public static final int MIN_FRAMES_BEFORE_LANDING_ANIM = 10; public ServerFallTree(Entity parent, FallMovementSystem fallMovementSystem){ this.parent = parent; diff --git a/src/main/java/electrosphere/server/terrain/generation/heightmap/HillsGen.java b/src/main/java/electrosphere/server/terrain/generation/heightmap/HillsGen.java index aefd7163..6304f6a2 100644 --- a/src/main/java/electrosphere/server/terrain/generation/heightmap/HillsGen.java +++ b/src/main/java/electrosphere/server/terrain/generation/heightmap/HillsGen.java @@ -34,10 +34,14 @@ public class HillsGen implements HeightmapGenerator { {0.3, 1.0}, }; - //distance from origin to sample for gradient calculation + /** + * Distance from origin to sample for gradient calculation + */ public static float GRADIENT_DIST = 0.01f; - //param for controlling how pointer the initial layers are + /** + * Param for controlling how pointer the initial layers are + */ public static float GRAD_INFLUENCE_DROPOFF = 0.35f; /** @@ -75,11 +79,13 @@ public class HillsGen implements HeightmapGenerator { float gradXAccum = 0; float gradYAccum = 0; + float warpX = (float)OpenSimplex2S.noise3_ImproveXY(SEED, x, y, 0); + float warpY = (float)OpenSimplex2S.noise3_ImproveXY(SEED, x, y, 1); for(int n = 0; n < GRAD_NOISE.length; n++){ //get noise samples - float noiseOrigin = (float)(OpenSimplex2S.noise2_ImproveX(SEED, x * GRAD_NOISE[n][0], y * GRAD_NOISE[n][0]) * GRAD_NOISE[n][1]); - float noiseX = (float)(OpenSimplex2S.noise2_ImproveX(SEED, x * GRAD_NOISE[n][0] + GRADIENT_DIST, y * GRAD_NOISE[n][0]) * GRAD_NOISE[n][1]); - float noiseY = (float)(OpenSimplex2S.noise2_ImproveX(SEED, x * GRAD_NOISE[n][0], y * GRAD_NOISE[n][0] + GRADIENT_DIST) * GRAD_NOISE[n][1]); + float noiseOrigin = (float)(OpenSimplex2S.noise2_ImproveX(SEED, (x + warpX) * GRAD_NOISE[n][0], (y + warpY) * GRAD_NOISE[n][0]) * GRAD_NOISE[n][1]); + float noiseX = (float)(OpenSimplex2S.noise2_ImproveX(SEED, (x + warpX) * GRAD_NOISE[n][0] + GRADIENT_DIST, (y + warpY) * GRAD_NOISE[n][0]) * GRAD_NOISE[n][1]); + float noiseY = (float)(OpenSimplex2S.noise2_ImproveX(SEED, (x + warpX) * GRAD_NOISE[n][0], (y + warpY) * GRAD_NOISE[n][0] + GRADIENT_DIST) * GRAD_NOISE[n][1]); //calculate gradient accumulation float gradX = (noiseX - noiseOrigin) / GRADIENT_DIST; float gradY = (noiseY - noiseOrigin) / GRADIENT_DIST; @@ -90,7 +96,8 @@ public class HillsGen implements HeightmapGenerator { float influence = 1.0f / (1.0f + gradientMagnitude * GRAD_INFLUENCE_DROPOFF); //add to height - rVal = rVal + (float)(OpenSimplex2S.noise2_ImproveX(SEED, x * GRAD_NOISE[n][0], y * GRAD_NOISE[n][0]) * GRAD_NOISE[n][1]) * influence; + float noiseValue = (float)(OpenSimplex2S.noise2_ImproveX(SEED, (x + warpX) * GRAD_NOISE[n][0], (y + warpY) * GRAD_NOISE[n][0]) * GRAD_NOISE[n][1]); + rVal = rVal + (noiseValue * noiseValue) * influence; } return rVal; } diff --git a/src/main/java/electrosphere/server/terrain/generation/heightmap/MountainGen.java b/src/main/java/electrosphere/server/terrain/generation/heightmap/MountainGen.java index 31434148..0a9fc23b 100644 --- a/src/main/java/electrosphere/server/terrain/generation/heightmap/MountainGen.java +++ b/src/main/java/electrosphere/server/terrain/generation/heightmap/MountainGen.java @@ -37,7 +37,9 @@ public class MountainGen implements HeightmapGenerator { */ static final float GEN_SCALE = 1.0f / HORIZONTAL_SCALE; - //the different scales of noise to sample from + /** + * The different scales of noise to sample from + */ static final double[][] NOISE_SCALES = new double[][]{ {0.01, 3.0}, {0.02, 2.0}, diff --git a/src/main/java/electrosphere/server/terrain/generation/heightmap/PlainsGen.java b/src/main/java/electrosphere/server/terrain/generation/heightmap/PlainsGen.java index 0f9afcb0..81c26d51 100644 --- a/src/main/java/electrosphere/server/terrain/generation/heightmap/PlainsGen.java +++ b/src/main/java/electrosphere/server/terrain/generation/heightmap/PlainsGen.java @@ -22,7 +22,9 @@ public class PlainsGen implements HeightmapGenerator { */ long seed = 0; - //the different scales of noise to sample from + /** + * The different scales of noise to sample from + */ static final double[][] NOISE_SCALES = new double[][]{ {0.01, 3.0}, {0.02, 2.0},