More generation improvements
This commit is contained in:
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 138 KiB |
@@ -18,7 +18,7 @@ import static io.anuke.mindustry.Vars.*;
|
|||||||
|
|
||||||
public class Sectors{
|
public class Sectors{
|
||||||
private static final int sectorImageSize = 16;
|
private static final int sectorImageSize = 16;
|
||||||
private static final float sectorLargeChance = 0.15f;
|
private static final float sectorLargeChance = 0.23f;
|
||||||
|
|
||||||
private GridMap<Sector> grid = new GridMap<>();
|
private GridMap<Sector> grid = new GridMap<>();
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ public class Sectors{
|
|||||||
|
|
||||||
/**Creates a sector at a location if it is not present, but does not unlock it.*/
|
/**Creates a sector at a location if it is not present, but does not unlock it.*/
|
||||||
public void createSector(int x, int y){
|
public void createSector(int x, int y){
|
||||||
boolean isLarge = Mathf.randomSeed(Bits.packInt((short)round2(x), (short)round2(y))) < sectorLargeChance;
|
boolean isLarge = Mathf.randomSeed(3+Bits.packInt((short)round2(x), (short)round2(y))) < sectorLargeChance;
|
||||||
|
|
||||||
if(isLarge){
|
if(isLarge){
|
||||||
x = round2(x);
|
x = round2(x);
|
||||||
|
|||||||
@@ -221,26 +221,15 @@ public class WorldGenerator{
|
|||||||
int x = sectorX * sectorSize + localX + Short.MAX_VALUE;
|
int x = sectorX * sectorSize + localX + Short.MAX_VALUE;
|
||||||
int y = sectorY * sectorSize + localY + Short.MAX_VALUE;
|
int y = sectorY * sectorSize + localY + Short.MAX_VALUE;
|
||||||
|
|
||||||
Block floor = Blocks.stone;
|
Block floor;
|
||||||
Block wall = Blocks.air;
|
Block wall = Blocks.air;
|
||||||
|
|
||||||
double ridge = rid.getValue(x, y, 1f / 400f);
|
double ridge = rid.getValue(x, y, 1f / 400f);
|
||||||
double iceridge = rid.getValue(x+99999, y, 1f / 500f);
|
double iceridge = rid.getValue(x+99999, y, 1f / 300f) + sim3.octaveNoise2D(2, 1f, 1f/14f, x, y)/11f;
|
||||||
double elevation = sim.octaveNoise2D(detailed ? 7 : 2, 0.5, 1f / 500, x, y) * 6.1 - 1 - ridge;
|
double elevation = sim.octaveNoise2D(detailed ? 7 : 2, 0.5, 1f / 500, x, y) * 6.1 - 1 - ridge;
|
||||||
double temp = vn.noise(x, y, 1f / 300f) * sim3.octaveNoise2D(detailed ? 2 : 1, 1, 1f / 13f, x, y)/13f
|
double temp = vn.noise(x, y, 1f / 300f) * sim3.octaveNoise2D(detailed ? 2 : 1, 1, 1f / 13f, x, y)/13f
|
||||||
+ sim3.octaveNoise2D(detailed ? 12 : 6, 0.6, 1f / 920f, x, y);
|
+ sim3.octaveNoise2D(detailed ? 12 : 6, 0.6, 1f / 920f, x, y);
|
||||||
|
|
||||||
double r = sim2.octaveNoise2D(1, 0.6, 1f / 70, x, y);
|
|
||||||
double edgeDist = Math.max(sectorSize / 2, sectorSize / 2) - Math.max(Math.abs(x - sectorSize / 2), Math.abs(y - sectorSize / 2));
|
|
||||||
//double dst = Vector2.dst((sectorX * sectorSize) + sectorSize/2f, (sectorY * sectorSize) + sectorSize/2f, x, y);
|
|
||||||
double elevDip = 30;
|
|
||||||
|
|
||||||
double border = 14;
|
|
||||||
|
|
||||||
if(edgeDist < border){
|
|
||||||
// elevation += (border - edgeDist) / 6.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(elevation < 0.7){
|
if(elevation < 0.7){
|
||||||
floor = Blocks.deepwater;
|
floor = Blocks.deepwater;
|
||||||
}else if(elevation < 0.79){
|
}else if(elevation < 0.79){
|
||||||
@@ -263,22 +252,11 @@ public class WorldGenerator{
|
|||||||
floor = Blocks.stone;
|
floor = Blocks.stone;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(elevation > 2 && iceridge > 0.3){
|
if(elevation > 3.3 && iceridge > 0.25){
|
||||||
elevation ++;
|
elevation ++;
|
||||||
floor = Blocks.ice;
|
floor = Blocks.ice;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if(dst < elevDip){
|
|
||||||
// elevation -= (elevDip - dst) / elevDip * 3.0;
|
|
||||||
/*}else*///if(detailed && r > 0.9){
|
|
||||||
//floor = Blocks.water;
|
|
||||||
//elevation = 0;
|
|
||||||
|
|
||||||
//if(r > 0.94){
|
|
||||||
// floor = Blocks.deepwater;
|
|
||||||
//}
|
|
||||||
//}
|
|
||||||
|
|
||||||
if(((Floor)floor).liquidDrop != null){
|
if(((Floor)floor).liquidDrop != null){
|
||||||
elevation = 0;
|
elevation = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,8 +27,9 @@ public class ColorMapper implements ContentList{
|
|||||||
if(elevation > 0){
|
if(elevation > 0){
|
||||||
if(tmpColors.get() == null) tmpColors.set(new Color());
|
if(tmpColors.get() == null) tmpColors.set(new Color());
|
||||||
Color tmpColor = tmpColors.get();
|
Color tmpColor = tmpColors.get();
|
||||||
float mul = 1.1f + elevation / 4f;
|
|
||||||
tmpColor.set(color);
|
tmpColor.set(color);
|
||||||
|
float maxMult = 1f/Math.max(Math.max(tmpColor.r, tmpColor.g), tmpColor.b) ;
|
||||||
|
float mul = Math.min(1.1f + elevation / 4f, maxMult);
|
||||||
tmpColor.mul(mul, mul, mul, 1f);
|
tmpColor.mul(mul, mul, mul, 1f);
|
||||||
color = Color.rgba8888(tmpColor);
|
color = Color.rgba8888(tmpColor);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user