diff --git a/readme.md b/readme.md index 6563e06..62408cf 100644 --- a/readme.md +++ b/readme.md @@ -9,7 +9,8 @@ There are 2 main reasons I'm making this: 1. I wanted to be able to check one or more existing seeds for resoureces and/or make maps of those resources. 2. I wanted to make a non-spoiling way to select a good seed. (aka be sure it has some decent resources within a reasonable radius of spawn, without knowing where to go look) -**For a color legend, see [below](#legend).** + +**For info about the maps, including a color legend, see [below](#legend).** Download builds [here](https://jenkins.dries007.net/job/TFCSeedMaker/). @@ -48,6 +49,10 @@ Done/Todo Legend ------ +The lines on the map are 1000x1000 grid lines. +The resolution is 1 block per pixel. +The "combined" map is a biome map with the outlines of the rock and tree layers. + You can also generate this image by running the `net.dries007.tfc.seedmaker.MainLegend` class. ![A color map](legend.png) \ No newline at end of file diff --git a/src/main/java/net/dries007/tfc/seedmaker/CommandLineInterface.java b/src/main/java/net/dries007/tfc/seedmaker/CommandLineInterface.java index 5dfc0e5..07a1e52 100644 --- a/src/main/java/net/dries007/tfc/seedmaker/CommandLineInterface.java +++ b/src/main/java/net/dries007/tfc/seedmaker/CommandLineInterface.java @@ -26,7 +26,7 @@ public class CommandLineInterface implements Runnable @Parameter(names = {"-r", "--radius"}, description = "Radius in blocks") public int radius = 1024 * 5; - @Parameter(names = {"-c", "--chunksize"}, description = "Size per 'chunk'") + @Parameter(names = {"-c", "--chunksize"}, description = "Size per 'chunk', more is faster but used (a lot) more RAM") public int chunkSize = 128; @Parameter(names = {"-s", "--seed", "--seeds"}, description = "The seeds to use, if none provided one random seed is chosen per thread. Comma separated list of strings") diff --git a/src/main/java/net/dries007/tfc/seedmaker/datatypes/Rock.java b/src/main/java/net/dries007/tfc/seedmaker/datatypes/Rock.java index 2c790ad..9662615 100644 --- a/src/main/java/net/dries007/tfc/seedmaker/datatypes/Rock.java +++ b/src/main/java/net/dries007/tfc/seedmaker/datatypes/Rock.java @@ -14,6 +14,8 @@ public enum Rock implements IDataType GRANITE(0, new Color(0xff8080)), DIORITE(1, new Color(0xae80ff)), GABBRO(2, new Color(0x80ffdc)), + //3 + //4 SHALE(5, new Color(0xf3ff80)), CLAYSTONE(6, new Color(0xff80c5)), ROCKSALT(7, new Color(0x8097ff)), diff --git a/src/main/java/net/dries007/tfc/seedmaker/util/WorldGen.java b/src/main/java/net/dries007/tfc/seedmaker/util/WorldGen.java index d9905eb..73006ae 100644 --- a/src/main/java/net/dries007/tfc/seedmaker/util/WorldGen.java +++ b/src/main/java/net/dries007/tfc/seedmaker/util/WorldGen.java @@ -31,10 +31,6 @@ public class WorldGen implements Runnable public static final int COLORS[] = new int[256]; // Biomes ids overlap with others, so they have their own maps public static final int COLORS_BIOME[] = new int[256]; -// public static final int COLORSROCK[] = new int[256]; -// public static final int COLORSTREE[] = new int[256]; - //private static final String[] FILENAMES = {"Combined", "Rock_Top", "Rock_Middle", "Rock_Bottom", "Tree_0", "Tree_1", "Tree_2", "EVT", "Rain", "Stability", "PH", "Drainage", "Biomes"}; - //private static final boolean[] COMBINE = {false, true, true, true, true, true, true, false, false, false, false, false, false}; public final String seedString; public final long seed; @@ -330,34 +326,40 @@ public void run() treeMap2.put(Tree.LIST[trees2[i]], treeMap2.get(Tree.LIST[trees2[i]]) + 1); } - // If we are drawing the combined layer draw the biome color. (But not if we are on a 1000 x 1000 grid line) - if (maps[0] && x + xx % 1000 != 0 && y + yy % 1000 != 0) + // If we are drawing the combined layer draw the biome color. (but not if we are on a grid line) + if (maps[0] && (x + xx) % 1000 != 0 && (yy + y) % 1000 != 0) { // maps[0] and imageLines[0] are from COMBINED (id = 0) ImageLineHelper.setPixelRGB8(imageLines[0][yy], x + xx - xOffset, COLORS_BIOME[biomeId]); } - // if xx or yy isn't on a chunk's edge (because then we can't check the bordering column) - if (xx != 0 && yy != 0 && xx + 1 != chunkSize && yy + 1 != chunkSize) + + // Per image + for (Layers layer : Layers.values()) { - // Per image - for (Layers layer : Layers.values()) + // Skip the combined layer, its special + if (layer == COMBINED) continue; + // If we aren't drawing it, skip + if (!maps[layer.ordinal()]) continue; + // Get the int values + final int[] ints = layers[layer.ordinal()]; + // The value at this column + final int us = ints[i]; + // Draw the pixel on row yy, at the adjusted x coordinates. + int color = COLORS[us]; + // Biome colors overlap, those get a seperate color + if (layer == BIOMES) color = COLORS_BIOME[us]; + + // Don't draw on grid lines + if ((x + xx) % 1000 != 0 && (yy + y) % 1000 != 0) { - // Skip the combined layer, its special - if (layer == COMBINED) continue; - // If we aren't drawing it, skip - if (!maps[layer.ordinal()]) continue; - // Get the int values - final int[] ints = layers[layer.ordinal()]; - // The value at this column - final int us = ints[i]; - // Draw the pixel on row yy, at the adjusted x coordinates. Separated colour spaces so I don't go insane. - int color = COLORS[us]; - if (layer == BIOMES) color = COLORS_BIOME[us]; - ImageLineHelper.setPixelRGB8(imageLines[layer.ordinal()][yy], x + xx - xOffset, color); + } + // if xx or yy isn't on a chunk's edge (because then we can't check the bordering column) + if (xx != 0 && yy != 0 && (xx + 1) != chunkSize && (yy + 1) != chunkSize) + { // if a tree or rock layer and we are drawing the combined layer - if (layer.addToCombined && maps[COMBINED.ordinal()]) + if (layer.addToCombined && maps[0]) { // get the 4 neighbouring columns final int up = ints[xx + (yy + 1) * chunkSize];