diff --git a/core/src/mindustry/graphics/g3d/MeshBuilder.java b/core/src/mindustry/graphics/g3d/MeshBuilder.java index 44cb059120..64d9ef8ec6 100644 --- a/core/src/mindustry/graphics/g3d/MeshBuilder.java +++ b/core/src/mindustry/graphics/g3d/MeshBuilder.java @@ -3,6 +3,7 @@ package mindustry.graphics.g3d; import arc.graphics.*; import arc.math.geom.*; import mindustry.graphics.g3d.PlanetGrid.*; +import mindustry.maps.generators.*; public class MeshBuilder{ private static final Vec3 v1 = new Vec3(), v2 = new Vec3(), v3 = new Vec3(), v4 = new Vec3(); @@ -45,6 +46,10 @@ public class MeshBuilder{ public static Mesh buildHex(HexMesher mesher, int divisions, boolean lines, float radius, float intensity){ PlanetGrid grid = PlanetGrid.create(divisions); + if(mesher instanceof PlanetGenerator generator){ + generator.seed = generator.baseSeed; + } + begin(grid.tiles.length * 12 * (3 + 3 + 1)); for(Ptile tile : grid.tiles){ diff --git a/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java b/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java index 4bd8ea9c2c..22a1547384 100644 --- a/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java +++ b/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java @@ -67,6 +67,7 @@ public class ErekirPlanetGenerator extends PlanetGenerator{ Block getBlock(Vec3 position){ float ice = rawTemp(position); + Tmp.v32.set(position); float height = rawHeight(position); Tmp.v31.set(position); @@ -84,6 +85,15 @@ public class ErekirPlanetGenerator extends PlanetGenerator{ } } + position = Tmp.v32; + + //TODO tweak this to make it more natural + //TODO edge distortion? + //TODO should be part of planet visuals...? + if(result != Blocks.slag && Ridged.noise3d(seed + 3, position.x + 2f, position.y + 5f, position.z + 1f, 2, 0.89f) > 0.24){ + result = Blocks.beryllicStone; + } + return result; } @@ -101,9 +111,12 @@ public class ErekirPlanetGenerator extends PlanetGenerator{ tile.block = Blocks.air; } + //TODO only certain places should have carbon stone... if(Ridged.noise3d(seed + 2, position.x, position.y + 4f, position.z, 3, 6f) > 0.6){ tile.floor = Blocks.carbonStone; } + + } @Override @@ -141,17 +154,22 @@ public class ErekirPlanetGenerator extends PlanetGenerator{ erase(endX, endY, 15); //arkycite - //TODO arkycite biome //TODO ice biome //TODO arkycite is too disruptive to terrain, needs certain conditions and sub-biomes. - if(false) pass((x, y) -> { + if(floor != Blocks.beryllicStone) return; + + //TODO bad + if(Math.abs(noise(x, y + 500f, 5, 0.6f, 40f, 1f) - 0.5f) < 0.09f){ + floor = Blocks.arkyicStone; + } + if(nearWall(x, y)) return; - float noise = noise(x + 300, y - x*1.6f + 100, 4, 0.8f, 120f, 1f); + float noise = noise(x + 300, y - x*1.6f + 100, 4, 0.8f, 80f, 1f); - if(noise > 0.71f){ + if(noise > 0.6f){ floor = Blocks.arkyciteFloor; } });