Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

[TOOL] Topographer [0.4.2] - Map your Minecraft world


  • Please log in to reply
42 replies to this topic

#1

31stCenturyMatt

Posted 15 April 2012 - 01:58 PM

Topographer is a program for generating overhead maps of Minecraft worlds. Currently only the Anvil format, introduced in Minecraft 1.2, is supported.

TopographerUI.exe provides a graphical user interface while TopographerCMD.exe
provides a command line interface.

Posted Image

Examples:
http://i.imgur.com/WYYa7.png
http://i.imgur.com/3IsUq.png

Download

Topographer requires the .NET Framework 4.0 (Client Profile) to run and has only been tested on Windows.

Topographer 0.4.2, April 27, 2012 (direct link)

All binary downloads can be found at https://github.com/m...apher/downloads.

License

Please view LICENSE.txt at https://github.com/m...ter/LICENSE.txt.

Changelog

Please view CHANGELOG.txt at https://github.com/m...r/CHANGELOG.txt.

Source

The source for Topographer is available at https://github.com/mblaine/Topographer.

Register or log in to remove.

#2

27duuude
    27duuude

    Out of the Water

  • Members
  • 6 posts

Posted 15 April 2012 - 05:44 PM

Very nice. It works well but it would be nice to have the option to change the texture file. I use the ExtrabiomesXL mod and the added blocks from that show up as black spots everywhere, so if I could change the texture file I could probably fix that.

#3

Neutrino
    Neutrino

    Tree Puncher

  • Members
  • 30 posts

Posted 15 April 2012 - 06:05 PM

Hi, there is a file named "blocks.txt", in there are hexadecimal colour codes for every block id, that is supported. You can expand that list, if you know the ids (and maybe the damage values, if necessary). ColourPicker (http://www.colorpicker.com/) can help you to choose the colour code.

syntax:

1;7e7e7e #stone
[id];[colour] #[info]

the colour code can be written with or without alpha channel for transparency (very clever Matt!)
aa=alpha rr=red gg=green bb=blue
in this format: aarrggbb or rrggbb

20,102;33ffffff #glass, panes
[id1],[id2];[colour] #[info]

35:0;dfdfdf #white wool
35:1;ea8037 #orange
35:2;bf4cc9 #magenta

[id]:[damage value];[colour] #[info]

#4

Neutrino
    Neutrino

    Tree Puncher

  • Members
  • 30 posts

Posted 15 April 2012 - 09:30 PM

Hi once more.
I tested it a bit. WOW! Works really great! You have also added a bunch of other blocks, thats good!
Also all the redstone looks now like I expected, with the power gradient, when powered.

Improvement proposals:

The transparency is good, but I think it could be better.
As I wrote in my very first comment in the Biome Painter thread, I think about it being repeatly processed for EVERY block in the column, that can be seen from above.
Now that I've seen it your way, it may be good to distinguish between "surface transparency" i.e. glass, and "volumetric transparency" (water, air)

Pinciple would be the following:

a column of blocks has volumetric transparency:
EVERY block mixes the colour from below with own alpha*colour

a column of blocks has surface transparency:
only ONE block of a column of the same blocks mixes the colour from below with own alpha*colour

I don't think, that it is really important, to have both implemented, but the water looks not natural, if it isn't darker, when it's deeper.
This is only my own opinion.

Then it has a problem with finding the folder for "the end".
Topographer looks for a folder named "DIM-2" what makes sense, but that doesn't work, since someone was so "bright" to name it "DIM1" instead...
\region\ -> Overworld
DIM-1\region\ -> Nether
DIM1\region\ ->The End
http://www.minecraft...rmat#Dimensions

I also want to let you know about a future change of the world folder structure:
https://gist.github.com/2362538

also:
-ouput of the biome map for each dimension
-slice of the world, (y1-y2, default: 0-255)

Edit:
Biome grass and leaf colour research
not very important, but maybe a bit helpful:
http://www.minecraft...s-graph-for-18/
Solution:
http://www.minecraft...ated-20feb2012/
Palette inside the minecraft.jar:
\misc\grasscolor.png
The leaf colour of only oak trees is the same as the grass colour. The leafs of other trees don't seem change.
http://www.minecraft...ki/Tree#Gallery

Edit 2:
I'd like to propose, that you provide the code to support different grass colours dependent on the biomes, and I try to make a colour list for each grass and leafs in each biome.
A tricky part is the blending between biomes.

I tested it just in MC, the blending is calculated through averaging the biome specific grass colours of a 3x3 field around the given position.
So the best option in my opinion would be the introduction of a biome_id value to the blocks.txt, maybe with such a syntax:

2,31;62a238 #grass, tall grass,default
2,31;bm0;62a238 #grass, tall grass,ocean
2,31;bm1;rrggbb #grass, tall grass,plains
2,31;bm2;rrggbb #grass, tall grass,desert
...


given: x,z,blockid

functions:
biomeid(x,z)
colour(blockid,dv,biomeid,colour_channel(0/1/2/3))
if an unsupported biome id is given to that function, it falls back to the normal grass colour without a biome value

basic code:

r_tmp=0
g_tmp=0
b_tmp=0

for tx=-1+x to 1+x
for tz=-1+z to 1+z
r_tmp=r_tmp+colour(blockid,dv,biomeid(tx,tz),1)
g_tmp=g_tmp+colour(blockid,dv,biomeid(tx,tz),2)
b_tmp=b_tmp+colour(blockid,dv,biomeid(tx,tz),3)
next
next

final_r=r_tmp/9
final_g=g_tmp/9
final_b=b_tmp/9

sorry for that long novel that I'm writing here Posted Image

#5

31stCenturyMatt

Posted 17 April 2012 - 09:16 PM

New version, please see the original post for a download link.

Blocks can now differ in color by biome, with and optional comma-separated list of biome ids between the block ids and the color code in Blocks.txt. Also now you can generate a color-coded biome map instead of the normal terrain map. Use Biomes.txt to alter the colors used for that.

Please see the changelog for further details. Thank you.

#6

Neutrino
    Neutrino

    Tree Puncher

  • Members
  • 30 posts

Posted 19 April 2012 - 10:37 PM

I did a whole bunch of research and mesurements about biomes now.
Since the colour of some blocks is dependent on the biome they are in, the colour is defined by special positions on grasscolor.png and foliagecolor.png inside minecraft.
It is so that a set of multiple biomes is each assigned to a single position on these textures. That means, that one has to find out, which biomes are one set! Swamp is a special case, because there is a purple overlay, that is not in the texture, but in the minecraft code.

Results:
Spoiler:

So what I did then, was modifying the terrain.png to smooth the grass and leaf greyscale overlay into a uniform texture, installing optifine to remove fog for distance-independent colours and then taking colour mesurements for every biome group.
I changed saturation and brightness a bit and created the block list.

I changed the biome map colours also, to include hills and edge biomes.

Lists:
blocks.txt (partial)
Spoiler:

biomes.txt
Spoiler:

(Edit: Forest colour corrected)

Here is an album of the progress:
http://imgur.com/a/Jhyu3
http://imgur.com/a/XUV3m

(Edit: Imgur does partially jpg...oh no...whatever)

The map is really stunning in my view Posted Image !
Here, for your next pick: Posted Image Posted Image Posted Image

One quite important thing would still be command-line parameters for my server.

#7

31stCenturyMatt

Posted 21 April 2012 - 01:23 AM

New version, please see op for download link. The changes are updated colors thanks to Neutrino, and a new command line utility, TopographerCMD.exe, in addition to the normal graphical interface in TopographerUI.exe.

TopographerCMD --help
Usage: TopographerCMD [OPTIONS] -i [DIRECTORY] -o [FILE]
Examples:
TopographerCMD /l 90 /h+ /t- -input /World1/DIM-1/region -output nether.png
TopographerCMD -map=biomes -r 270 -i /World1/region -o World1.biomes.png
TopographerCMD -x "8,9,78,79" --crop- -i /World1/region -o dry.png

Options:
  -i, --input=VALUE		  Path to directory containing *.mca region files. 
							   Can be relative to .minecraft/saves/.
  -o, --output=VALUE		 Path including file name for where the output 
							   png will be saved.
  -m, --map=VALUE			"terrain" to generate a terrain map or "biomes" 
							   to generate a color-coded biome map instead. 
							   Default: "terrain".
  -u, --upper=VALUE		  Only render the world below this elevation, 
							   between 0 and 255. Default: 255.
  -l, --lower=VALUE		  Only render the world down to this elevation, 
							   between 0 and 255. Default: 0.
  -b, --biome				Whether blocks such as grass should have their 
							   color vary based on biome. Default: enabled. Use 
							   -b+ to enable or -b- to disable.
  -h, --height			   Whether colors should be made lighter or darker 
							   based on elevation. Default: enabled. Use -h+ to 
							   enable or -h- to disable.
  -t, --transparency		 Whether areas beneath blocks such as water or 
							   glass should be visible. Default: enabled. Use -
							   t+ to enable or -t- to disable.
  -n, --only=VALUE		   A comma separated list of block ids that will be 
							   the only type(s) of blocks rendered.
  -x, --exclude=VALUE		A comma separated list of block ids that will 
							   not be rendered.
  -r, --rotate=VALUE		 How much the resulting map should be rotated. 
							   Valid values are 0, 90, 180, and 270. Default: 0.
  -c, --crop				 If empty portions along the edges of the map 
							   should be cropped. Default: enabled. Use -c+ to 
							   enable or -c- to disable.
  -y, --less-memory		  Generate the map in such a way that less memory 
							   is used, however cropping and rotating isn't 
							   supported. May be necessary for worlds with 100s 
							   of regions. Default: enabled. Use -y+ to enable 
							   or -y- to disable.
  -d, --dry-run			  If parameters should be parsed and any errors 
							   reported without actually doing anything.
  -?, --help				 Display this help message.
  -v, --version			  Display version information.

Edited by 31stCenturyMatt, 28 April 2012 - 03:10 AM.


#8

Neutrino
    Neutrino

    Tree Puncher

  • Members
  • 30 posts

Posted 21 April 2012 - 08:24 PM

Wow, I don't know how I can thank you for this!

I am courious how much time you spend doing this, how much fun this is to you, and if I am annoying, when I come up with new suggestions.

I have two new and simple things, that came into my mind:
- rotation of output map in 90° steps (important)
- cutting away the unused areas of the output map (maybe through "alpha-scanning" from the borders, until used area is found)

- (still) biome colour blending (not important)
- (still) limit the mapping depth (simple workaround, if else too complicated: replace anything under a certain value with air Posted Image ), so that it is possible to make a slice of the world -> example: "-l 30-35"
That would be useful to analyse certain structures in the world, dependent on the hight, without interference through blocks from deeper hights.
Also modifying the blocks.txt to make all block types black or fully transparent, except one, that is subject of a certain interest, one could highlight said block type in the world! All the possibilities! Posted Image

That said, Topographer is now a very fast and dynamic mapper with built-in biome extractor (the first? even mcmap still needs an external extractor)!

I think this and Biome Painter deserve more interest.
Do you know, how to insert this in
ttp://www.minecraftwiki.net/wiki/Programs_and_editors/Mapping#Mappers ?

Spoiler:


#9

31stCenturyMatt

Posted 21 April 2012 - 09:12 PM

I appreciate the suggestions. Beyond force filling my first Minecraft world with biomes from beta 1.7, I don't actually need either of these programs, though they have certainly been interesting to create and maintain. Suggestions from the people actually using them have been instrumental in developing both to where they are now. You and others suggest features that are obvious in hindsight but I never would have thought of by myself.

With every feature request I weigh how difficult it would be to implement, how much time it would take, how useful the feature would be, and since these are just side projects in my spare time, whether or not I would get bored doing it. :)

So suggestions are great! I just can't promise I'll act on any of them until I'm saying "here's a new version that implements whatever suggestion."

#10

31stCenturyMatt

Posted 23 April 2012 - 03:11 PM

New version, see original post for download link. Changes:
  • New options:
    • Crop output image.
    • Rotate output image.
    • Only render certain block ids.
    • Exclude certain block ids from being rendered.
  • Some command line options were renamed/reorganized to support new options. Anything passing arguments to TopographerCMD my break until refactored.
Also I've played with the colors further. Previous versions of Blocks.txt can be found at https://github.com/m...pher/Blocks.txt (click Browse code in the bottom left corner of a revision to view the complete file).

#11

LagAttack

Posted 24 April 2012 - 06:15 AM

Cool, finally a mapper that is up to date and just does top down maps instead of all the isometric maps.

Although, I have been trying to render a 3.15 GB map from my server, so what I have been doing is copying the server file into single player and then trying to render that map, I then let it process the 900 regions I have, and I've seen it get through 700 regions, but I can't seem to get a map from the program, it will always error out before it finishes/when it finishes

#12

31stCenturyMatt

Posted 24 April 2012 - 02:50 PM

View PostQwertyuiopas 89, on 24 April 2012 - 06:15 AM, said:

Cool, finally a mapper that is up to date and just does top down maps instead of all the isometric maps.

Although, I have been trying to render a 3.15 GB map from my server, so what I have been doing is copying the server file into single player and then trying to render that map, I then let it process the 900 regions I have, and I've seen it get through 700 regions, but I can't seem to get a map from the program, it will always error out before it finishes/when it finishes

What's the error, is a message displayed?

#13

lazyboy007
  • Location: Sssssss...
  • Minecraft: lazyboy007

Posted 24 April 2012 - 02:54 PM

Could you add "flat" with height selection and choose your own blocks for the floor? Would be nice for mappers. ;) Anyway, really nice tool.

Posted Image


#14

31stCenturyMatt

Posted 24 April 2012 - 03:01 PM

View Postlazyboy007, on 24 April 2012 - 02:54 PM, said:

Could you add "flat" with height selection and choose your own blocks for the floor? Would be nice for mappers. ;) Anyway, really nice tool.

I'm sorry I don't understand what you mean, could you explain that again? I appreciate it, thank you. :)

#15

Neutrino
    Neutrino

    Tree Puncher

  • Members
  • 30 posts

Posted 24 April 2012 - 08:55 PM

@lazyboy007

This is not a map editor or generator like mcedit, this tool is designed to create an image from above of worlds you already have.

@31stCenturyMatt

The new things work well, I made a nice map of our underground railway system!
The brighter grass colours are indeed better, but there may be some hard edges now, because some biomes are still darker than the others. I could easily make them brighter equally by brighten my "master image" Posted Image , if you want.

Since you have already implemented "highlighting" of certain blocks which I only saw in "Minecraft Topographical Survey" (http://www.minecraft...aphical-survey/), I have some useful suggestions for that.

blocks.txt
-> new entry for blocktype "unknown"
-> special behavior as a new variable: only render blocktype the 2nd time it is found (like air is implemented, air has to be changed then, maybe useful for netherrack in nether?)
-> maybe change in syntax (I could transfer the list, if necessary)

I tried cavemode by making some blocktypes fully transparent and lowering air transparency, turns out beautyful:
Parameters: 0-64 (against air below foliage), no highmap, no biome foliage
http://imgur.com/a/5SdBg

There seems to be a bug with transparency, air is white (ffffff), but as you can see , it darkens the lava, if air is partially transparent. The more air can be seen and the less air is transparent, the more the pixel should become white. The ravines have to be more white than the caves, since more air is in them, for example.

better formular for transparency, if you can implement this:

Spoiler:


User Interface:
[comments in brackets]

[Two columns]
Block colour [for all blocks]:
-by file: Blocks.txt (default) <open file symbol>
-black
-white
-custom [input (AA)RRGGBB]

Background colour
-transparent (default)
-white
-black
-custom [input (AA)RRGGBB]

Looking at MTS, your program already supports most of its rendering modes (you don't need to implement those):
Terrain (obvious)
Oblique (could be easily implemented, view from all 4 directions)
Highmap (all blocks black + highmapping)
Cavemap (only air (not rendered above surface) white or black (+alpha?))
Spectrograph ("Blocks->only...")

#16

McTwist
    McTwist

    Zombie Killer

  • Members
  • 246 posts
  • Location: Sweden
  • Minecraft: McTwist

Posted 24 April 2012 - 09:41 PM

I would suggest that for transparency, PixelMap uses this kind of formula:
// Blend two colors
void Color::Blend(const Color & color, int h)
{
Color temp;
float alpha1 = (float)a / 255;
float alpha2 = (float)color.a / 255;
float preAlpha = alpha2*(1 - alpha1);
float alpha = alpha1 + preAlpha;
if (alpha != 0)
{
  float preH = (float)h / 128;
  temp.r = COLOR((r*alpha1 + (color.r*preH)*preAlpha) / alpha);
  temp.g = COLOR((g*alpha1 + (color.g*preH)*preAlpha) / alpha);
  temp.b = COLOR((b*alpha1 + (color.b*preH)*preAlpha) / alpha);
  temp.a = COLOR(alpha*255);
}
else
{
  temp.r = 0;
  temp.g = 0;
  temp.b = 0;
  temp.a = 0;
}
// Copy new color to color
*this = temp;
}
There is also one for interpolation, which is somewhat easier to implement:
// Interpolate two colors
void Color::Interpolate(const Color & color, double n)
{
r = COLOR((1.0f-n)*(double)r + n*(double)color.r);
g = COLOR((1.0f-n)*(double)g + n*(double)color.g);
b = COLOR((1.0f-n)*(double)b + n*(double)color.B);
a = COLOR((1.0f-n)*(double)a + n*(double)color.a);
}

PixelMap - Beta(1.4) mapper, GUI, multithreading, portable, modular, source. Use the full power of your computer.

#17

Neutrino
    Neutrino

    Tree Puncher

  • Members
  • 30 posts

Posted 24 April 2012 - 10:32 PM

I think that is quite funny, McTwist, because I think that my suggestion would do exactly the same thing as your first exaple! Posted Image
So yes, I think this is the way to go.

Your second one seems to need the bottom-up method for colour calculation, it should have the same result, but it needs to start right at the bottom, where either the first non-transparent block or the void is. It does then the same backward, what the first example does foreward. Could also be used.

// Interpolate two colors, bottom-up transparency color mixing
void Color::Interpolate(const Color & color)
{
n=(double)color.a;
r = COLOR((1.0f-n)*(double)r + n*(double)color.r);
g = COLOR((1.0f-n)*(double)g + n*(double)color.g);
b = COLOR((1.0f-n)*(double)b + n*(double)color.B)
a = a + (1-a)*n
}

alpha hurts my brain...
Once again, I don't know, if my syntax is right and I don't understand every aspect of the c++ -like code.

#18

LagAttack

Posted 25 April 2012 - 06:25 AM

View Post31stCenturyMatt, on 24 April 2012 - 02:50 PM, said:

What's the error, is a message displayed?

I leave my computer to render (it takes several hours) and when I come back it says it has read 900 of 900 regions, although the windows 7 popup that says a program has stopped working is there and it tells me that TopographerUI has crashed

It gave me 3 files that stopped working in the program, although I didn't save what they were, so now I'm rendering the map again so I can post them

#19

DOTxTRI
    DOTxTRI

    Void Walker

  • Members
  • 1838 posts
  • Minecraft: Carniplex

Posted 25 April 2012 - 08:51 AM

I think this is why there's a minimap mod <_<
Posted Image

LIKE MY POST IF I HELPED YOU OUT :D


#20

LagAttack

Posted 25 April 2012 - 01:41 PM

View PostDOTxTRI, on 25 April 2012 - 08:51 AM, said:

I think this is why there's a minimap mod Posted Image

Minimap mods can't give you image files, they also cant capture your entire map.


-----------


Alright, I ran the render and the program crashed again, this is the error message I got in the "send error report" screen on windows 7:


Files that help describe the problem:
  C:\Users\(myname)\AppData\Local\Temp\WER9370.tmp.WERInternalMetadata.xml
  C:\Users\(myname)\AppData\Local\Temp\WERB0EF.tmp.appcompat.txt
  C:\Users\(myname)\AppData\Local\Temp\WERB15D.tmp.mdmp

Read our privacy statement online:
  http://go.microsoft....88&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
  C:\Windows\system32\en-US\erofflps.txt