Cleanup
This commit is contained in:
@@ -140,50 +140,8 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
|
||||
}
|
||||
}
|
||||
|
||||
private @Nullable String lastSec;
|
||||
|
||||
private void sec(String name){
|
||||
if(lastSec != null){
|
||||
float elapsed = Time.elapsed();
|
||||
Log.info("@: @ (@ sec)", lastSec.toUpperCase(), elapsed, Strings.fixed(elapsed / 1000f, 2));
|
||||
}
|
||||
if(name != null){
|
||||
Time.mark();
|
||||
}
|
||||
lastSec = name;
|
||||
}
|
||||
|
||||
//TODO remove
|
||||
@Override
|
||||
public void generate(Tiles tiles, Sector sec, int seed){
|
||||
this.tiles = tiles;
|
||||
this.seed = seed + baseSeed;
|
||||
this.sector = sec;
|
||||
this.width = tiles.width;
|
||||
this.height = tiles.height;
|
||||
this.rand.setSeed(sec.id + seed + baseSeed);
|
||||
|
||||
long begin = Time.millis();
|
||||
sec("genTile");
|
||||
|
||||
TileGen gen = new TileGen();
|
||||
for(int y = 0; y < height; y++){
|
||||
for(int x = 0; x < width; x++){
|
||||
gen.reset();
|
||||
Vec3 position = sector.rect.project(x / (float)tiles.width, y / (float)tiles.height);
|
||||
|
||||
genTile(position, gen);
|
||||
tiles.set(x, y, new Tile(x, y, gen.floor, gen.overlay, gen.block));
|
||||
}
|
||||
}
|
||||
|
||||
generate(tiles);
|
||||
Log.info("TOTAL TILE: @ (@ sec)", Time.timeSinceMillis(begin), Strings.fixed(Time.timeSinceMillis(begin) / 1000f, 2));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void generate(){
|
||||
sec("tempPass");
|
||||
float temp = rawTemp(sector.tile.v);
|
||||
|
||||
if(temp > 0.7){
|
||||
@@ -208,8 +166,6 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
|
||||
});
|
||||
}
|
||||
|
||||
sec("cells1");
|
||||
|
||||
cells(4);
|
||||
|
||||
//regolith walls for more dense terrain
|
||||
@@ -229,14 +185,10 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
|
||||
endX = (int)(-trns.x + width/2f), endY = (int)(-trns.y + height/2f);
|
||||
float maxd = Mathf.dst(width/2f, height/2f);
|
||||
|
||||
sec("pathfinding");
|
||||
|
||||
erase(spawnX, spawnY, 15);
|
||||
brush(pathfind(spawnX, spawnY, endX, endY, tile -> (tile.solid() ? 300f : 0f) + maxd - tile.dst(width/2f, height/2f)/10f, Astar.manhattan), 9);
|
||||
erase(endX, endY, 15);
|
||||
|
||||
sec("arkycite");
|
||||
|
||||
//arkycite
|
||||
pass((x, y) -> {
|
||||
if(floor != Blocks.beryllicStone) return;
|
||||
@@ -259,26 +211,18 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
|
||||
|
||||
blend(Blocks.arkyciteFloor, Blocks.arkyicStone, 4);
|
||||
|
||||
sec("slag");
|
||||
|
||||
//TODO may overwrite floor blocks under walls and look bad
|
||||
blend(Blocks.slag, Blocks.yellowStonePlates, 4);
|
||||
|
||||
sec("distort");
|
||||
|
||||
distort(10f, 12f);
|
||||
distort(5f, 7f);
|
||||
|
||||
sec("arkycite-slag-median");
|
||||
|
||||
//does arkycite need smoothing?
|
||||
median(2, 0.6, Blocks.arkyciteFloor);
|
||||
|
||||
//smooth out slag to prevent random 1-tile patches
|
||||
median(3, 0.6, Blocks.slag);
|
||||
|
||||
sec("details 1");
|
||||
|
||||
pass((x, y) -> {
|
||||
//rough rhyolite
|
||||
if(noise(x, y + 600 + x, 5, 0.86f, 60f, 1f) < 0.41f && floor == Blocks.rhyolite){
|
||||
@@ -312,17 +256,11 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
|
||||
}
|
||||
});
|
||||
|
||||
sec("inverse flood fill");
|
||||
|
||||
inverseFloodFill(tiles.getn(spawnX, spawnY));
|
||||
|
||||
sec("redStone");
|
||||
|
||||
//TODO veins, blend after inverse flood fill?
|
||||
blend(Blocks.redStoneWall, Blocks.denseRedStone, 4);
|
||||
|
||||
sec("ores");
|
||||
|
||||
//make sure enemies have room
|
||||
erase(endX, endY, 6);
|
||||
|
||||
@@ -376,15 +314,8 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
|
||||
block = Blocks.crystalBlocks;
|
||||
ore = Blocks.air;
|
||||
}
|
||||
|
||||
//this is annoying as blocks under it can't be seen
|
||||
//if(block == Blocks.air && floor == Blocks.regolith && rand.chance(0.004) && !near(x, y, 3, Blocks.crystalBlocks)){
|
||||
// block = Blocks.crystalBlocks;
|
||||
//}
|
||||
});
|
||||
|
||||
sec("trim dark");
|
||||
|
||||
//remove props near ores, they're too annoying
|
||||
pass((x, y) -> {
|
||||
if(ore.asFloor().wallOre || block.itemDrop != null || (block == Blocks.air && ore != Blocks.air)){
|
||||
@@ -394,8 +325,6 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
|
||||
|
||||
trimDark();
|
||||
|
||||
sec("vents");
|
||||
|
||||
int minVents = rand.random(6, 9);
|
||||
int ventCount = 0;
|
||||
|
||||
@@ -503,8 +432,6 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
|
||||
}
|
||||
}
|
||||
|
||||
sec("decoration");
|
||||
|
||||
for(Tile tile : tiles){
|
||||
if(tile.overlay().needsSurface && !tile.floor().hasSurface()){
|
||||
tile.setOverlay(Blocks.air);
|
||||
@@ -524,7 +451,5 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
|
||||
//all sectors are wave sectors
|
||||
state.rules.waves = true;
|
||||
state.rules.showSpawns = true;
|
||||
|
||||
sec("");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user