Code Monkey home page Code Monkey logo

mcmap's People

Contributors

andresbott avatar andrewminer avatar baptr avatar buscher avatar bxvcd-732 avatar cvsync avatar flarn2006 avatar flps42 avatar glyph avatar kmpm avatar mroderick avatar netherwhal avatar orphu avatar rjp avatar spongecade avatar spoutn1k avatar wrim avatar zahl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mcmap's Issues

Compilation issues

Hello.
I love your software and was using it previously on my Ubuntu 20.04 LTS installation from the Win10 Store.
However recently I had to reinstall Ubuntu and I'm encountering issues when doing cmake.

This is what I get after typing cmake .

-- The CXX compiler identification is GNU 9.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
-- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.6.37")
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
-- Could NOT find QT (missing: QT_DIR)
CMake Warning (dev) at CMakeLists.txt:20 (FIND_PACKAGE):
  Policy CMP0084 is not set: The FindQt module does not exist for
  find_package().  Run "cmake --help-policy CMP0084" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find Qt3 (missing: QT_QT_LIBRARY QT_INCLUDE_DIR QT_MOC_EXECUTABLE)
CMake was unable to find desired Qt version: 3. Set advanced values QT_QMAKE_EXECUTABLE and QT3_QGLOBAL_H_FILE.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dami/mc/mcmap 

I wanted to see if I can just ignore those errors and went ahead and wrote

make -j

and I got this

Scanning dependencies of target format
[  4%] Building CXX object src/include/fmt/CMakeFiles/format.dir/format.cpp.o
[  8%] Linking CXX static library libformat.a
[  8%] Built target format
Scanning dependencies of target regionReader
Scanning dependencies of target nbt2json
Scanning dependencies of target json2bson
Scanning dependencies of target extractChunk
[ 12%] Building CXX object scripts/CMakeFiles/json2bson.dir/json2bson.cpp.o
[ 16%] Building CXX object scripts/CMakeFiles/extractChunk.dir/extractChunk.cpp.o
[ 20%] Building CXX object scripts/CMakeFiles/regionReader.dir/regionReader.cpp.o
[ 24%] Building CXX object scripts/CMakeFiles/nbt2json.dir/nbt2json.cpp.o
[ 28%] Linking CXX executable ../bin/extractChunk
[ 28%] Built target extractChunk
[ 32%] Linking CXX executable ../bin/regionReader
[ 36%] Linking CXX executable ../bin/json2bson
[ 36%] Built target regionReader
[ 36%] Built target json2bson
[ 40%] Generating colors.bson
Scanning dependencies of target mcmap_core
[ 44%] Building CXX object src/CMakeFiles/mcmap_core.dir/block_drawers.cpp.o
[ 48%] Building CXX object src/CMakeFiles/mcmap_core.dir/canvas.cpp.o
[ 52%] Building CXX object src/CMakeFiles/mcmap_core.dir/chunk.cpp.o
[ 56%] Building CXX object src/CMakeFiles/mcmap_core.dir/colors.cpp.o
[ 60%] Building CXX object src/CMakeFiles/mcmap_core.dir/helper.cpp.o
[ 64%] Building CXX object src/CMakeFiles/mcmap_core.dir/mcmap.cpp.o
[ 68%] Building CXX object src/CMakeFiles/mcmap_core.dir/png.cpp.o
[ 72%] Building CXX object src/CMakeFiles/mcmap_core.dir/savefile.cpp.o
[ 76%] Building CXX object src/CMakeFiles/mcmap_core.dir/section.cpp.o
[ 80%] Building CXX object src/CMakeFiles/mcmap_core.dir/settings.cpp.o
[ 84%] Building CXX object src/CMakeFiles/mcmap_core.dir/worldloader.cpp.o
[ 88%] Linking CXX executable ../bin/nbt2json
[ 88%] Built target nbt2json
[ 92%] Linking CXX static library libmcmap_core.a
[ 92%] Built target mcmap_core
Scanning dependencies of target mcmap
[ 96%] Building CXX object src/cli/CMakeFiles/mcmap.dir/cli.cpp.o
[100%] Linking CXX executable ../../bin/mcmap
[100%] Built target mcmap

But in the end I was unable to invoke it. Tried with "mcmap" ".mcmap" and how I used to do it "./mcmap"

I tried installing GTest and QT, but I ended up with more issues than before and it felt quite time consuming. On top of that I didn't have to do that the last time I used your software so I decided to ask you for help.

std::bad_alloc

Maybe this is on my end. I'm new to compiling source on linux. It compiles fine but when I run it I get the following output...

mcmap 2.1
McRegion world format detected.
Scanning world...
Min: (-166|-121) Max: (225|255)
Image dimensions are 18954x8570, 32bpp, 619.64MiB
Pass 1 of 4...
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Terrain takes up 1169.69MiBAborted

1.20 support

Getting the following error:

[2023-06-24 08:12:36.314] [error] Canvas is empty !
[2023-06-24 08:12:36.321] [error] Error rendering terrain.

Misleading error message on empty world

I've tried with both the latest releases and a new build using the commands in Readme.md.
Anything in #64 didn't help.

Here's the command I'm running:
[path-to-mcmap-executable] -from -2006464 -1995968 -to -2006337 -1995841 -vv [path-to-world]

And here's the output of the command:

[Debug] Parsing [path-to-world]/level.dat
[Debug] Processed boundaries: 2147483647.2147483647.-64 ~> -2147483648.-2147483648.319 (North-West)
[Error] Nothing to render: -from X Z has to be <= -to X Z
Usage: [path-to-mcmap-executable] <options> WORLDPATH
...

I've also tried swapping -from and -to.
As you can see, -from X Z <= -to X Z.

Ubuntu on Windows 10

I try to compile and get this error:

make -j
make -C scripts json2bson
g++ -O3 -c -std=c++17 -Wall -I../src/include json2bson.cpp -o json2bson.default.o
json2bson.cpp:1:10: fatal error: boost/filesystem.hpp: No such file or directory
 #include <boost/filesystem.hpp>
          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:23: recipe for target 'json2bson.default.o' failed
make[2]: *** [json2bson.default.o] Error 1
Makefile:55: recipe for target 'src/colors.bson' failed
make[1]: *** [src/colors.bson] Error 2
Makefile:50: recipe for target 'all' failed
make: *** [all] Error 2

Is there a compiled version or did I miss a step? I updated windows, ubuntu, and gcc. Can someone please help me?

[suggestion] move /scripts to a separate repo or do some other thing to support cross-compile

TLDR : i'm trying to compile mcmap to wasm using emscripten , /scripts makes it hard to do that "cross-compile"

Rencently , player of my creative server want to render some small part of map (e.g. a single floor of a big building ) , due to the truncate on y-axis this can't be achieved by dynmap. So I plan to compile mcmap to wasm to make they render thier building in browser. The problem here is because tools in /scripts got compiled to wasm format , too. It can't run when called in MakeFile.

I know I can tell players to use the Windows GUI one, but it's difficult for them to read English , and it seems the program isn't able to read spigot server world (except overworld , other show error "... not a save folder")

Make json->bson optional also helps ,since it's the only tool got called by now.

This change will make cross-compile easier in general , not only c++->wasm

My large world map is throwing an error

I'm trying to run mcmap on my Ubuntu 11.04 32-bit vps server. I have a large map, and it throws an error when renderingd
The error is shown below:

root@server:~/mcmap# ./mcmap /root/Minecraft/world/
mcmap 2.2 by Zahl
McRegion world format detected.
Scanning world...
Min: (-199|-239) Max: (198|262)
Image dimensions are 17994x9258, 32bpp, 635.48MiB
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted

The map size is a 3000 block radius circular map.

GUI v3.0.3 entry point error

The new GUI version returns an error and fails to start, unlike the prior 3.0.2 version (which unfortunately did not work with 1.20.1+)

mcmap-gui.exe - Entry Point Not Found
The procedure entry point CreateDXGIFactory2 could not be located in the dynamic link library dxgi.dll.

Issues when rendering some chunks sections

Hey!

Thanks for the awesome work on maintaining this iconic project! Im currently trying to move my rendering pipeline to use this version of mcmap.

In that process I discovered a very strange problem: Some chunk sections seem 'scrambled up'. All blocks inside are positioned quite random.

See for example see this render (1.16.4 world):

Note: The images in this issue have been scaled by GitHub, open the image in a new tab to see the full details.

This happens for all sorts of version and server software combinations. But I should note here, that the world savefile that was used here was written by a mineflayer bot. I'm also not sure if its an issue with their implementation of the anvil storage format or with mcmap itself.


I tried to write down how I approached this and where I think might be the cause of the issue.

My first impression was, that something wrote the chunks wrong to disk. So I started up a Minecraft client and loaded the world.

As you can see the red marked section was loaded correctly. This was the same chunk section that rendered wrong before. Its the scrambled up section on the right. Same savefile. Same chunks.

Now I was sure that the chunks wore at least in some kind of readable format on disk. I saved and quitted Minecraft and rendered the world again.

Before After load & save
example_03_before example_03_after

As you can see Minecraft somehow fixed these chunks and as result mcmap was able to render them like it should. You can still see some chunks that are 'scrambled up', these chunks were just not loaded by the client. Note: The Minecraft client generated some new terrain that I cropped away.

The Minecraft client must have altered the chunk section in some form. I opened both worlds using NBT Studio and compared the chunk section in question.

Before After load & save
example_04_before example_04_after
value37191016277606400 33825 0 68719476736 0 2357352929953794 68719575043 4398046511104 5242880 5497558138882 4194304 4398052802624 67108864 2052 4196416 68721641632 2206541545472 2322168557862912 2251799813685248 70368744180739 72130161805361152 14338 2147483712 0 0 0 0 103082360928 0 5497558138884 0 4398046511109 6597069766656 4 4194304 4398046511104 167772160 7881299347898368 7 0 106404249600 0 0 0 0 0 0 0 108089689692438528 370702544327933952 4465995 320357116197 373109799749943296 482272188221620228 4567462 4753871744320 335918783468142592 370596991211667460 271691 7347200 0 111572942428569600 0 0 0 0 0 0 0 105553116266496 98304 4682935510272 335918783473385472 445082306923724800 339341 4789331472736 373109799744700416 407892425625829376 4499820 147450045600 7696581394432 0 0 101475 0 0 0 0 0 0 0 0 3298534883328 401946266742816768 141676 12227849216 158090440594161664 444906385063280640 11661 4677019648 7937099563008 0 0 0 106404249600 373034608490446848 265 0 0 0 0 0 0 0 3 347411456 11659609995476992 444730463202836480 11661 11119470752 364281946177536 0 0 0 0 108195242708041728 0 278211913 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 106300440576 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 111464090777419776 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
value1229782938247299072 0 35184372088832 144678138029277184 2305895798693429248 1125899906842624 562949953748992 1125899907170304 1125925678743552 145241087984795648 1128236369051648 35193537691648 8707506176 35651584 9007199305269760 577059032657821696 144115325514809344 0 0 0 52789446180864 1125899906842624 327680 1125899907170304 1125925676646400 1125899906842624 1125899906842624 5242880 30182211584 0 858980352 0 0 0 0 0 52789446180864 1296035281371136 188900373233664 1333565278453760 1352291621797888 1333565278126080 1314800279748608 170135370334208 30182211584 0 858980352 0 0 0 0 0 52776561278976 1296035281371136 188900373233664 207665371283456 1352291621797888 207665371283456 1314800279748608 82174440112128 30064771072 0 858980352 0 0 0 0 0 0 12884901888 83347145490432 14151313260544 85654219259904 14151318503424 5281920581632 31943819264 0 0 858980352 664591269888 0 0 0 0 0 12884901888 810490527744 12978501976064 14151313260544 12978507218944 810406641664 0 0 0 808648704 664591269888 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 855638016 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 855638016 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

It seems pretty clear what happened here: The chunk section must have been stored in some inefficiency way, the Minecraft client compacted it from 342 down to 256 longs.

I looked at the post116 function. Maybe this function could not deal with this strange case?

void post116(const uint8_t index_length,
const std::vector<int64_t> *blockStates,
Section::block_array &buffer) {
// NEW in 1.16, longs are padded by 0s when a block cannot fit, so no more
// overflow to deal with !
for (uint16_t index = 0; index < 4096; index++) {
// Determine how many indexes each long holds
const uint8_t blocksPerLong = 64 / index_length;
// Calculate where in the long array is the long containing the right index.
const uint16_t longIndex = index / blocksPerLong;
// Once we located a long, we have to know where in the 64 bits
// the relevant block is located.
const uint8_t padding = (index - longIndex * blocksPerLong) * index_length;
// Bring the data to the first bits of the long, then extract it by bitwise
// comparison
const uint16_t blockIndex = ((*blockStates)[longIndex] >> padding) &
((uint64_t(1) << index_length) - 1);
buffer[index] = blockIndex;
}
}

I added a debug statement to analyse the different blockstates lengths and index_lengths. This were the counts and the lengths that occurred while rendering the world.

1876 [Deep Debug] blockStates length: 256; index_length: 4;
  35 [Deep Debug] blockStates length: 342; index_length: 4;
 508 [Deep Debug] blockStates length: 342; index_length: 5;

When ignoring all chunk sections that have blockStates->size() == 342 you can see that more then the scrambled sections get removed. When also filtering on the index_length == 4, we get only the scrambled sections removed.

blockStates->size() == 342 && index_length == 4 (inverted)

I did not test this behaviour with other blockStates lengths. From my testing with very different worlds and versions, some sort of error happens in all versions from 1.13 to 1.16.5.

Expand for a test matrix with different versions

Note: This also contains worlds (1.8 - 1.12) that were rendered using a legacy version of mcmap. These dont show this error.
Reminder: These worlds were generated using the specified server software, then 'downloaded' by mineflayer and then rendered.

Screenshot 2021-12-08 at 22-01-48 Screenshot


I tried 'fixing' the chunk reading in mcmap myself, even reimplemented the function heavily inspired from nms code:

  for (uint16_t index = 0; index < 4096; index++) {
    const uint16_t j = index * index_length;
    const uint16_t k = j >> 6;
    const uint16_t l = (index + 1) * index_length - 1 >> 6;
    const uint16_t i1 = j ^ k << 6;

    uint16_t blockIndex = 0;

    if (k == l) {
        blockIndex = (int) ((unsigned((*blockStates)[k])) >> i1 & mask);
    } else {
        int j1 = 64 - i1;

        blockIndex = (int) (((unsigned((*blockStates)[k])) >> i1 | (*blockStates)[l] << j1) & mask);
    }

    buffer[index] = blockIndex;
  }

Sadly this didnt bring any success and I'm not really sure how to go on from here: It seems that there is an issue how mineflayer writes the chunks to disk. But at the same time Minecraft somehow is able to handle this. I would assume that it would be best to fix this in mineflayer, but I'm not really sure I can pinpoint the bug over there.

Maybe you could give some hints or help getting this resolved? Any help is really appreciated. Thanks for reading this really long issue.

Release

is there any working release? I don't really have time to dive in, just wondering if there is any simple way to render out large map

Errors about being unable to access cache files

Using a world created in 21w43a. Built mcmap from source using 819a077 with snapshots enabled on Windows.

mcmap 3.0.1 64bit (compatible with Minecraft v1.13+) Snapshots enabled
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\512.1648.-64 ~> 1535.2671.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\512.1648.-64 ~> 1535.2671.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\3584.1648.-64 ~> 4607.2671.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\3584.1648.-64 ~> 4607.2671.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\1536.1648.-64 ~> 2559.2671.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\1536.1648.-64 ~> 2559.2671.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\2560.1648.-64 ~> 3583.2671.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\2560.1648.-64 ~> 3583.2671.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\3584.-4496.-64 ~> 4607.-3473.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\3584.-4496.-64 ~> 4607.-3473.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\512.-3472.-64 ~> 1535.-2449.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\512.-3472.-64 ~> 1535.-2449.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\3584.-3472.-64 ~> 4607.-2449.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\3584.-3472.-64 ~> 4607.-2449.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\3584.-2448.-64 ~> 4607.-1425.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\3584.-2448.-64 ~> 4607.-1425.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\1536.-4496.-64 ~> 2559.-3473.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\1536.-4496.-64 ~> 2559.-3473.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\3584.-1424.-64 ~> 4607.-401.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\3584.-1424.-64 ~> 4607.-401.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\512.-2448.-64 ~> 1535.-1425.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\512.-2448.-64 ~> 1535.-1425.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\512.624.-64 ~> 1535.1647.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\512.624.-64 ~> 1535.1647.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\2560.-4496.-64 ~> 3583.-3473.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\2560.-4496.-64 ~> 3583.-3473.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\3584.624.-64 ~> 4607.1647.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\3584.624.-64 ~> 4607.1647.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\512.-1424.-64 ~> 1535.-401.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\512.-1424.-64 ~> 1535.-401.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\3584.-400.-64 ~> 4607.623.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\3584.-400.-64 ~> 4607.623.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\512.-400.-64 ~> 1535.623.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\512.-400.-64 ~> 1535.623.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\1536.-3472.-64 ~> 2559.-2449.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\1536.-3472.-64 ~> 2559.-2449.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\2560.-3472.-64 ~> 3583.-2449.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\2560.-3472.-64 ~> 3583.-2449.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\1536.-2448.-64 ~> 2559.-1425.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\1536.-2448.-64 ~> 2559.-1425.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\2560.-2448.-64 ~> 3583.-1425.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\2560.-2448.-64 ~> 3583.-1425.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\1536.-1424.-64 ~> 2559.-401.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\1536.-1424.-64 ~> 2559.-401.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\2560.-1424.-64 ~> 3583.-401.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\2560.-1424.-64 ~> 3583.-401.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\1536.624.-64 ~> 2559.1647.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\1536.624.-64 ~> 2559.1647.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\1536.-400.-64 ~> 2559.623.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\1536.-400.-64 ~> 2559.623.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\2560.624.-64 ~> 3583.1647.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\2560.624.-64 ~> 3583.1647.319 (North-West)' for reading: Invalid argument
[Error] [PNGWriter] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\2560.-400.-64 ~> 3583.623.319 (North-West)' for writing: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\2560.-400.-64 ~> 3583.623.319 (North-West)' for reading: Invalid argument
[Error] [PNGReader] Error opening 'C:\Users\retep\AppData\Local\Temp\mcmap_cache\512.-3472.-64 ~> 1535.-2449.319 (North-West)' for reading: Invalid argument

A case study in large maps

The capabilities of this program are astounding.

I've been taking daily images of my server's map since September. Recently, some folks have decided to go on walkabout, and the images are still rendering (and rather quickly, too!). They have become large. Quite large.

The most recent daytime image is 142MB in size. That's not the map; that's the image. After being processed by pngcrush.

The resultant monstrosity is so large that it will not open in Firefox, Opera, Safari, or Chrome. But it will open in the GIMP if you have 10GB to let the program swap out to.

mcmap is generating an image measuring in at 48842 × 19434 pixels. At 72 DPI, it would, if printed, be 678.361 × 269.917 inches, or 56 feet, 6 inches, by 22 feet, 5 inches.

This is an extremely robust program. I am impressed. I'd offer to share the image, but I don't think any image hosts will allow such a behemoth.

Color file lookup segmentation fault

root@ubuntu: ~/mcmap ./mcmap ~/level
mcmap 3.0.0, compatible with Minecraft since v13, 64bit
Segmentation fault (core dumped)

build log:

root@ubuntu:~/mcmap# make
g++ -O3 -std=c++17 -c -Wall -fomit-frame-pointer -pedantic -DWITHPNG -D_FILE_OFF                                                                                                                               SET_BITS=64 -fopenmp main.cpp -o main.default.o
g++ -O3 -std=c++17 -c -Wall -fomit-frame-pointer -pedantic -DWITHPNG -D_FILE_OFF                                                                                                                               SET_BITS=64 -fopenmp helper.cpp -o helper.default.o
g++ -O3 -std=c++17 -c -Wall -fomit-frame-pointer -pedantic -DWITHPNG -D_FILE_OFF                                                                                                                               SET_BITS=64 -fopenmp colors.cpp -o colors.default.o
g++ -O3 -std=c++17 -c -Wall -fomit-frame-pointer -pedantic -DWITHPNG -D_FILE_OFF                                                                                                                               SET_BITS=64 -fopenmp worldloader.cpp -o worldloader.default.o
g++ -O3 -std=c++17 -c -Wall -fomit-frame-pointer -pedantic -DWITHPNG -D_FILE_OFF                                                                                                                               SET_BITS=64 -fopenmp draw_png.cpp -o draw_png.default.o
g++ -O3 -std=c++17 -c -Wall -fomit-frame-pointer -pedantic -DWITHPNG -D_FILE_OFF                                                                                                                               SET_BITS=64 -fopenmp settings.cpp -o settings.default.o
g++ -O3 -std=c++17 -c -Wall -fomit-frame-pointer -pedantic -DWITHPNG -D_FILE_OFF                                                                                                                               SET_BITS=64 -fopenmp canvas.cpp -o canvas.default.o
g++ main.default.o helper.default.o colors.default.o worldloader.default.o draw_                                                                                                                               png.default.o settings.default.o canvas.default.o -lz -lpng -fopenmp -o mcmap

Re-introduction of height gradient

Is it no longer possible to bring this back? Zahl originally added shading (skylight), but it's no longer present in the updated version of mcmap.
1 12 render
new version 1 12 rende

Improve command line parsing with getopt.h

Hello !

First of all, i'm new on github, so i don't know if i use the best method to tell you that.

I have been read the code, and the command line parsing seems very complex and hardly maintenable.
I think we can use getopt to improve this system.
I can work about, but is it useful ?

-marker broken since 1.2

i dont know for sure if it was since 1.2 or some time before 1.2, but adding -marker r 0 0 won't add any marker at all.

i tested this with several maps on several machines (self compiled on mac 10.6, 10.7 and debian 4)

is this just overlooked or a serious change with the new map-format?

What happened to the ability to render the map to multiple tiles?

The openlayers script doesn't seem to work anymore as it uses a -split argument which isn't understood by mcmap anymore. I have a decently sized world that I'd like to share a map of, but the gigantic single png it creates is really unwieldy (over 200 MB). It would be great if there was a way to create a web map using individual tiles that could be easy to render.

Hmmmm, I wonder how feasible it would be to create a Rust program that loads the gigantic PNG and generates tiles...

Error [LINUX]

Hi, I've tried to compile mcmap, but there's an error: mcmap/src/graphical/mcmap-gui_autogen/include/./ui_mainwindow.h:138:40: error: ‘MarkdownText’ is not a member of ‘Qt’ 138 | outputLabel->setTextFormat(Qt::MarkdownText); Can you fix that plz?

Feature Request: Pin Markers

It'd be nice to be able to specify one or more points using the in-world (X,Z) coordinate system, and have mcmap generate 'pins' at those locations à la Google Maps.

This could be used, for example, to show the current saved location / spawn point of the player.

build fails on mac os x 10.6, but simple to fix

draw.cpp: In function ‘bool createBitmap(FILE*, size_t, size_t, bool)’:
draw.cpp:86: error: ‘fseeko64’ was not declared in this scope

just replace all "fseek064" in draw.cpp with "fseek" and it works fine

just need to find appropriate #ifdef...

Nothing to render: -from X Z has to be <= -to X Z

I'm trying to render part of a world and this error message always appears.
I'm using the pre-compiled version for windows and the imput is:

.\mcmap -from 700 0 -to 200 400 -min 50 -sw -v

And, the debug message with the error says:

[Debug] World spans from -6144.-7312.0 ~> 4095.6655.255 (North-West)
[Debug] Processed boundaries: 700.0.50 ~> 200.400.255 (South-West)
[Error] Nothing to render: -from X Z has to be <= -to X Z

The -sw option is used and the debug message says that is the correct direction.
What I can do?

make fails on mac snowleopard

Hi,

I just pulled your latest code changes and tried to build, but I got this error:

mcmap $ make
g++ -O3 -c -Wall -fomit-frame-pointer -pedantic -DWITHPNG -I/usr/local/include main.cpp -o main.default.o
main.cpp: In function ‘int main(int, char*)’:
main.cpp:374: error: ‘mkdir’ was not declared in this scope
make: *
* [main.default.o] Error 1

Regions cause segmentation fault and stack smashing

I have a world where some region files are causing mcmap to segfault or abort due to stack smashing.

Using the official archlinux:latest docker image, I built mcmap from the latest source (as of today) like:

$ docker run --privileged -v=`pwd`:/shared:rw -it archlinux:latest sh
# pacman -Sy --noconfirm --needed git gcc make libpng tree
# cd /shared
# rm -rf mcmap && git clone http://github.com/spoutn1k/mcmap
# cd mcmap && make -j

I have been operating a vanilla Minecraft server with a very old world that has been through numerous version upgrades over the years. It's currently running Minecraft 1.16.3. There are some areas around the world that were made by users in creative mode, some that have things created using commands (mostly custom player heads, armor stands, and a few mobs), and some that have blocks tweaked using the debug stick (like changing the orientation of stairs and walls), but I believe all of these should be standard "supported" blocks and entities.

I pulled a backup of our world's files and tried rendering only a subset of the most recently modified regions, but mcmap blows up with *** stack smashing detected ***: terminated and Segmentation fault on some region files. Unfortunately, even with the -v verbose flag set, I don't get a lot of helpful information. So, I captured my terminal session to show my attempts to build and use mcmap against each of our world's region files. It looks like we have at least 4 region files (just in this subset that I examined) that cause mcmap to crash. Here's the asciinema recording: mcmap segfaults and stack smashing

FWIW, I have been experimenting with multiple Minecraft mapping solutions. Minecraft-Overviewer and minutor's latest nightly build both rendered these regions without error.

Are there any additional arguments I can give mcmap to produce more verbose debug output? I'm happy to try building again from a custom branch or fork if there are any additional checks or messages you'd like to see when I process these region files.

Error when trying to make

When trying to make the program I get the following error:

In file included from ./draw_png.h:9,
                 from main.cpp:2:
././colors.h:123:22: error: ‘filesystem’ in namespace ‘std’ does not name a type
  123 | bool load(const std::filesystem::path &, Palette *);
      |                      ^~~~~~~~~~
././colors.h:123:39: error: expected unqualified-id before ‘&’ token
  123 | bool load(const std::filesystem::path &, Palette *);
      |                                       ^
././colors.h:123:38: error: expected ‘)’ before ‘&’ token
  123 | bool load(const std::filesystem::path &, Palette *);
      |          ~                           ^~
      |                                      )
././colors.h:123:39: error: non-member function ‘bool Colors::load(...)’ cannot have ref-qualifier
  123 | bool load(const std::filesystem::path &, Palette *);
      |                                       ^
././colors.h:123:50: error: expected initializer before ‘*’ token
  123 | bool load(const std::filesystem::path &, Palette *);
      |                                                  ^
././colors.h:124:22: error: ‘filesystem’ in namespace ‘std’ does not name a type
  124 | bool load(const std::filesystem::path &, const std::vector<string> &filter,
      |                      ^~~~~~~~~~
././colors.h:124:39: error: expected unqualified-id before ‘&’ token
  124 | bool load(const std::filesystem::path &, const std::vector<string> &filter,
      |                                       ^
././colors.h:124:38: error: expected ‘)’ before ‘&’ token
  124 | bool load(const std::filesystem::path &, const std::vector<string> &filter,
      |          ~                           ^~
      |                                      )
././colors.h:124:39: error: non-member function ‘bool Colors::load(...)’ cannot have ref-qualifier
  124 | bool load(const std::filesystem::path &, const std::vector<string> &filter,
      |                                       ^
././colors.h:124:42: error: expected unqualified-id before ‘const’
  124 | bool load(const std::filesystem::path &, const std::vector<string> &filter,
      |                                          ^~~~~
In file included from ././settings.h:5,
                 from ./draw_png.h:11,
                 from main.cpp:2:
./././worldloader.h:74:24: error: ‘filesystem’ in namespace ‘std’ does not name a type
   74 |   void load(const std::filesystem::path &regionDir);
      |                        ^~~~~~~~~~
./././worldloader.h:74:41: error: expected unqualified-id before ‘&’ token
   74 |   void load(const std::filesystem::path &regionDir);
      |                                         ^
./././worldloader.h:74:40: error: expected ‘)’ before ‘&’ token
   74 |   void load(const std::filesystem::path &regionDir);
      |            ~                           ^~
      |                                        )
./././worldloader.h:74:41: error: expected ‘;’ at end of member declaration
   74 |   void load(const std::filesystem::path &regionDir);
      |                                         ^
      |                                          ;
./././worldloader.h:74:42: error: ‘regionDir’ does not name a type
   74 |   void load(const std::filesystem::path &regionDir);
      |                                          ^~~~~~~~~
./././worldloader.h:75:30: error: ‘filesystem’ in namespace ‘std’ does not name a type
   75 |   void loadRegion(const std::filesystem::path &regionFile, const int regionX,
      |                              ^~~~~~~~~~
./././worldloader.h:75:47: error: expected unqualified-id before ‘&’ token
   75 |   void loadRegion(const std::filesystem::path &regionFile, const int regionX,
      |                                               ^
./././worldloader.h:75:46: error: expected ‘)’ before ‘&’ token
   75 |   void loadRegion(const std::filesystem::path &regionFile, const int regionX,
      |                  ~                           ^~
      |                                              )
./././worldloader.h:75:47: error: expected ‘;’ at end of member declaration
   75 |   void loadRegion(const std::filesystem::path &regionFile, const int regionX,
      |                                               ^
      |                                                ;
./././worldloader.h:75:48: error: ‘regionFile’ does not name a type
   75 |   void loadRegion(const std::filesystem::path &regionFile, const int regionX,
      |                                                ^~~~~~~~~~
In file included from ./draw_png.h:11,
                 from main.cpp:2:
././settings.h:19:8: error: ‘filesystem’ in namespace ‘std’ does not name a type
   19 |   std::filesystem::path saveName, outFile, colorFile;
      |        ^~~~~~~~~~
././settings.h:59:8: error: ‘filesystem’ in namespace ‘std’ does not name a type
   59 |   std::filesystem::path regionDir() {
      |        ^~~~~~~~~~
././settings.h: In constructor ‘Settings::WorldOptions::WorldOptions()’:
././settings.h:40:5: error: ‘saveName’ was not declared in this scope
   40 |     saveName = "";
      |     ^~~~~~~~
././settings.h:42:5: error: ‘outFile’ was not declared in this scope
   42 |     outFile = "output.png";
      |     ^~~~~~~
././settings.h:43:5: error: ‘colorFile’ was not declared in this scope
   43 |     colorFile = "colors.json";
      |     ^~~~~~~~~
In file included from main.cpp:2:
./draw_png.h: At global scope:
./draw_png.h:84:20: error: ‘filesystem’ in namespace ‘std’ does not name a type
   84 |   Image(const std::filesystem::path file, const IsometricCanvas &canvas,
      |                    ^~~~~~~~~~
./draw_png.h:84:37: error: expected unqualified-id before ‘file’
   84 |   Image(const std::filesystem::path file, const IsometricCanvas &canvas,
      |                                     ^~~~
./draw_png.h:84:36: error: expected ‘)’ before ‘file’
   84 |   Image(const std::filesystem::path file, const IsometricCanvas &canvas,
      |        ~                           ^~~~~
      |                                    )
./draw_png.h:84:32: error: expected ‘;’ at end of member declaration
   84 |   Image(const std::filesystem::path file, const IsometricCanvas &canvas,
      |                                ^~~~
      |                                    ;
./draw_png.h:84:37: error: ‘file’ does not name a type
   84 |   Image(const std::filesystem::path file, const IsometricCanvas &canvas,
      |                                     ^~~~
main.cpp: In function ‘int main(int, char**)’:
main.cpp:50:8: error: ‘std::filesystem’ has not been declared
   50 |   std::filesystem::path regionDir = options.regionDir();
      |        ^~~~~~~~~~
main.cpp:54:22: error: ‘regionDir’ was not declared in this scope
   54 |   world.terrain.load(regionDir);
      |                      ^~~~~~~~~
main.cpp:56:29: error: ‘struct Settings::WorldOptions’ has no member named ‘colorFile’
   56 |   if (!Colors::load(options.colorFile, world.terrain.cache, &colors))
      |                             ^~~~~~~~~
main.cpp:68:28: error: ‘struct Settings::WorldOptions’ has no member named ‘outFile’
   68 |   PNG::Image image(options.outFile, canvas, colors);
      |                            ^~~~~~~
<builtin>: recipe for target 'main' failed
make: *** [main] Error 1

Final PNG libpng error

Compiled 2011-02-26 18:00 GMT on a Debian Lenny system.

Last set of messages from the output...

Pass 16 of 16...
Creating temporary image: 4032x2275, 32bpp, 34.99MiB
Terrain takes up 130.03MiB
Loading all chunks..
[0.00%]
[100.00%]
Optimizing terrain...
[0.00%]
[22.24%]
[40.66%]
[73.31%]
[87.59%]
[99.61%]
[100.00%]
Drawing map...
[0.00%]
[100.00%]
Composing final png file...
[0.00%]
libpng error: png_write_info was never called before png_write_row.
Job complete.

issue with building on macOS

Hello I get the following error when I try to build the program.

mac:build macpro$ make -j
[  3%] Building CXX object src/include/fmt/CMakeFiles/format.dir/format.cc.o
[  7%] Linking CXX static library libformat.a
[  7%] Built target format
[ 17%] Building CXX object scripts/CMakeFiles/extractChunk.dir/extractChunk.cpp.o
[ 17%] Building CXX object scripts/CMakeFiles/regionReader.dir/regionReader.cpp.o
[ 21%] Building CXX object scripts/CMakeFiles/json2bson.dir/json2bson.cpp.o
[ 21%] Building CXX object scripts/CMakeFiles/nbt2json.dir/nbt2json.cpp.o
/Users/macpro/mcmap/scripts/json2bson.cpp:1:10: fatal error: 'filesystem' file not found
#include <filesystem>
         ^~~~~~~~~~~~
/Users/macpro/mcmap/scripts/nbt2json.cpp:1:10: fatal error: 'filesystem' file not found
#include <filesystem>
         ^~~~~~~~~~~~
/Users/macpro/mcmap/scripts/extractChunk.cpp:1:10: fatal error: 'filesystem' file not found
#include <filesystem>
         ^~~~~~~~~~~~
/Users/macpro/mcmap/scripts/regionReader.cpp:1:10: fatal error: 'filesystem' file not found
#include <filesystem>
         ^~~~~~~~~~~~
1 error generated.
make[2]: *** [scripts/CMakeFiles/regionReader.dir/regionReader.cpp.o] Error 1
make[1]: *** [scripts/CMakeFiles/regionReader.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
1 error generated.
make[2]: *** [scripts/CMakeFiles/extractChunk.dir/extractChunk.cpp.o] Error 1
make[1]: *** [scripts/CMakeFiles/extractChunk.dir/all] Error 2
1 error generated.
make[2]: *** [scripts/CMakeFiles/json2bson.dir/json2bson.cpp.o] Error 1
make[1]: *** [scripts/CMakeFiles/json2bson.dir/all] Error 2
1 error generated.
make[2]: *** [scripts/CMakeFiles/nbt2json.dir/nbt2json.cpp.o] Error 1
make[1]: *** [scripts/CMakeFiles/nbt2json.dir/all] Error 2
make: *** [all] Error 2

Compilation problem.

make -C scripts json2bson
g++ -O3 -c -std=c++17 -Wall -I../src/include json2bson.cpp -o json2bson.default.o
json2bson.cpp:1:10: fatal error: filesystem: Datei oder Verzeichnis nicht gefunden
 #include <filesystem>
          ^~~~~~~~~~~~
compilation terminated.
Makefile:26: recipe for target 'json2bson.default.o' failed
make[2]: *** [json2bson.default.o] Error 1
Makefile:55: recipe for target 'src/colors.bson' failed
make[1]: *** [src/colors.bson] Error 2
Makefile:50: recipe for target 'all' failed
make: *** [all] Error 2

If I want the code compilation.
Always comes this error.

Why?

Thanks in advance.

Would you consider adding a README.md file?

In Github parlance, adding this file to your repository will cause the readme to be automatically displayed in the Github web gui. If you're willing to consider it, would you further be willing to add a couple suggestions to those compiling the code for ubuntu? Something like:


Ubuntu

Compiles just fine up to Ubuntu 13.04 but you might need to apt get a couple packages if you don't have them already.

  • sudo apt-get install build-essential
  • sudo apt-get install zlib1g-dev
  • sudo apt-get install libpng12-dev
    Then of course 'make' in the source code directory and you should be good to go.

Couple run time suggestions

If you have low amounts of RAM on your box, the program will rightly complain. I found that -mem 300 worked on my machine and rendered well.

Thanks for your consideration of this addition.
--dooguls

32bit ARM support

Hi, When I compiled the program, following the tutorial, I get an error
-bash: ./mcmap: No such file or directory
I checked and make didn't make any files named mcmap

image

I also found this:

src/canvas.cpp:239:65: error: no matching function for call to ‘max(uint64_t, lo                                                                                                                                                             ng unsigned int)’
       std::max(uint64_t(ceil(log2(sectionPalette->size()))), 4ul);
                                                                 ^
In file included from /usr/include/c++/8/algorithm:61,
                 from src/././helper.h:4,
                 from src/./canvas.h:4,
                 from src/canvas.cpp:5:
/usr/include/c++/8/bits/stl_algobase.h:219:5: note: candidate: ‘template<class _                                                                                                                                                             Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)’
     max(const _Tp& __a, const _Tp& __b)
     ^~~
/usr/include/c++/8/bits/stl_algobase.h:219:5: note:   template argument deductio                                                                                                                                                             n/substitution failed:
src/canvas.cpp:239:65: note:   deduced conflicting types for parameter ‘const _T                                                                                                                                                             p’ (‘long long unsigned int’ and ‘long unsigned int’)
       std::max(uint64_t(ceil(log2(sectionPalette->size()))), 4ul);
                                                                 ^
In file included from /usr/include/c++/8/algorithm:61,
                 from src/././helper.h:4,
                 from src/./canvas.h:4,
                 from src/canvas.cpp:5:
/usr/include/c++/8/bits/stl_algobase.h:265:5: note: candidate: ‘template<class _                                                                                                                                                             Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compa                                                                                                                                                             re)’
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^~~
/usr/include/c++/8/bits/stl_algobase.h:265:5: note:   template argument deductio                                                                                                                                                             n/substitution failed:
src/canvas.cpp:239:65: note:   deduced conflicting types for parameter ‘const _T                                                                                                                                                             p’ (‘long long unsigned int’ and ‘long unsigned int’)
       std::max(uint64_t(ceil(log2(sectionPalette->size()))), 4ul);
                                                                 ^
In file included from /usr/include/c++/8/algorithm:62,
                 from src/././helper.h:4,
                 from src/./canvas.h:4,
                 from src/canvas.cpp:5:
/usr/include/c++/8/bits/stl_algo.h:3462:5: note: candidate: ‘template<class _Tp>                                                                                                                                                              constexpr _Tp std::max(std::initializer_list<_Tp>)’
     max(initializer_list<_Tp> __l)
     ^~~
/usr/include/c++/8/bits/stl_algo.h:3462:5: note:   template argument deduction/s                                                                                                                                                             ubstitution failed:
src/canvas.cpp:239:65: note:   mismatched types ‘std::initializer_list<_Tp>’ and                                                                                                                                                              ‘long long unsigned int’
       std::max(uint64_t(ceil(log2(sectionPalette->size()))), 4ul);
                                                                 ^
In file included from /usr/include/c++/8/algorithm:62,
                 from src/././helper.h:4,
                 from src/./canvas.h:4,
                 from src/canvas.cpp:5:
/usr/include/c++/8/bits/stl_algo.h:3468:5: note: candidate: ‘template<class _Tp,                                                                                                                                                              class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)’
     max(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
/usr/include/c++/8/bits/stl_algo.h:3468:5: note:   template argument deduction/s                                                                                                                                                             ubstitution failed:
src/canvas.cpp:239:65: note:   mismatched types ‘std::initializer_list<_Tp>’ and                                                                                                                                                              ‘long long unsigned int’
       std::max(uint64_t(ceil(log2(sectionPalette->size()))), 4ul);
                                                                 ^
make: *** [Makefile:40: src/canvas.default.o] Error 1

GCC-8 produces broken executable

Greetings!

compiling seems to be ok
using Ubuntu 16.04 and gcc-8

trying to run ./mcmap -h gives Segmentation Fault

:~/applications/minecraftmap/mcmap$ make realClean && make
find src -name *o -exec rm {} ;
make -C scripts clean
make[1]: Entering directory '/home/-redacted-/applications/minecraftmap/mcmap/scripts'
find . -name '*o' -exec rm -fr {} ;
make[1]: Leaving directory '/home/-redacted-/applications/minecraftmap/mcmap/scripts'
rm -fr mcmap output.png src/colors.bson
make -C scripts realClean
make[1]: Entering directory '/home/-redacted-/applications/minecraftmap/mcmap/scripts'
find . -name '*o' -exec rm -fr {} ;
git clean -fdx
Removing json2bson
make[1]: Leaving directory '/home/-redacted-/applications/minecraftmap/mcmap/scripts'
make -C scripts json2bson
g++ -O3 -c -std=c++17 -Wall -I../src/include json2bson.cpp -o json2bson.default.o
g++ -O3 -c -std=c++17 -Wall -I../src/include ../src/include/fmt/format.cpp -o ../src/include/fmt/format.default.o
g++ json2bson.default.o ../src/include/fmt/format.default.o -s -lstdc++fs -o json2bson
./scripts/json2bson src/colors.json > src/colors.bson
g++ -O3 -std=c++17 -c -Wall -fomit-frame-pointer -pedantic -D_FILE_OFFSET_BITS=64 -Isrc/include -fopenmp src/colors.cpp -o src/colors.default.o
g++ -O3 -std=c++17 -c -Wall -fomit-frame-pointer -pedantic -D_FILE_OFFSET_BITS=64 -Isrc/include -fopenmp src/canvas.cpp -o src/canvas.default.o
g++ -O3 -std=c++17 -c -Wall -fomit-frame-pointer -pedantic -D_FILE_OFFSET_BITS=64 -Isrc/include -fopenmp src/settings.cpp -o src/settings.default.o
g++ -O3 -std=c++17 -c -Wall -fomit-frame-pointer -pedantic -D_FILE_OFFSET_BITS=64 -Isrc/include -fopenmp src/helper.cpp -o src/helper.default.o
g++ -O3 -std=c++17 -c -Wall -fomit-frame-pointer -pedantic -D_FILE_OFFSET_BITS=64 -Isrc/include -fopenmp src/worldloader.cpp -o src/worldloader.default.o
g++ -O3 -std=c++17 -c -Wall -fomit-frame-pointer -pedantic -D_FILE_OFFSET_BITS=64 -Isrc/include -fopenmp src/logger.cpp -o src/logger.default.o
g++ -O3 -std=c++17 -c -Wall -fomit-frame-pointer -pedantic -D_FILE_OFFSET_BITS=64 -Isrc/include -fopenmp src/main.cpp -o src/main.default.o
g++ -O3 -std=c++17 -c -Wall -fomit-frame-pointer -pedantic -D_FILE_OFFSET_BITS=64 -Isrc/include -fopenmp src/draw_png.cpp -o src/draw_png.default.o
make[1]: 'src/include/fmt/format.default.o' is up to date.
g++ src/colors.default.o src/canvas.default.o src/settings.default.o src/helper.default.o src/worldloader.default.o src/logger.default.o src/main.default.o src/draw_png.default.o src/include/fmt/format.default.o -lz -lpng -lgomp -o mcmap

:~/applications/minecraftmap/mcmap$ ls -l
total 648
drwxrwxr-x 2 -redacted- -redacted- 4096 Sep 9 19:39 assets
drwxrwxr-x 3 -redacted- -redacted- 4096 Sep 9 19:39 contrib
-rw-rw-r-- 1 -redacted- -redacted- 35149 Sep 9 19:39 LICENSE
-rw-rw-r-- 1 -redacted- -redacted- 1557 Sep 9 20:09 Makefile
-rwxrwxr-x 1 -redacted- -redacted- 596584 Sep 9 19:41 mcmap
-rw-rw-r-- 1 -redacted- -redacted- 7954 Sep 9 19:39 README.md
drwxrwxr-x 2 -redacted- -redacted- 4096 Sep 9 19:41 scripts
drwxrwxr-x 3 -redacted- -redacted- 4096 Sep 9 19:41 src

~/applications/minecraftmap/mcmap$ ./mcmap -v
Segmentation fault (core dumped)

:~/applications/minecraftmap/mcmap$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 8.4.0-1ubuntu1~16.04.1' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 8.4.0 (Ubuntu 8.4.0-1ubuntu1~16.04.1)

:~/applications/minecraftmap/mcmap$ uname -v
#118~16.04.1-Ubuntu SMP Sat Sep 5 23:35:06 UTC 2020

apt install libpng-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libpng12-dev' instead of 'libpng-dev'
libpng12-dev is already the newest version (1.2.54-1ubuntu1.1).

No license information attached to source code

This is a great app and I'd like to build a GTK+-based GUI for use on Debian/Ubuntu and other Gnome-based Linux distros, however I have not been able to locate any information about what license under which this code is available.

MacOS Installation?

Are there installation instructions for MacOS?

I've installed homebrew, libpng (via brew), and gcc (via brew), but I'm not sure how to configure the Makefile.

GUI out of date

Compiling myself for Windows is above my head but it appears that issues still in the latest GUI version have already been corrected for 1.20.1 (#94/#95/#96/#97/#98) and 1.20.4 (#101) in the source. Is it at all acceptable to request a fresh Windows compile be pushed to releases? I'll attach the errors I'm seeing below (in the v3.0.2 GUI release for 1.19) just in case they don't match and more info is needed. Thanks!

[debug] Parsing C:/Users/default/AppData/Roaming/.minecraft/saves/lumina\level.dat
[info] Scanning C:/Users/default/AppData/Roaming/.minecraft/saves/lumina\region
[debug] World spans from -512.-432.-64.511.511.319.North-West
[debug] Rendering test with -512.-432.-64.511.511.319.North-West
[debug] Memory capacity: 72 fragments - 1 fragments scheduled
[debug] Rendering -512.-432.-64.511.511.319.North-West
[debug] Rendered in 841ms
[debug] Canvas canvas (0x0 for 2147483647.2147483647.32767.-2147483648.-2147483648.-32768.North-West)
 - Void canvas, offset 0.0
[error] Canvas is empty !

Support Anvil file format

Minecraft 1.2.2 (released today) now converts McRegion format region data to Anvil format. mcmap does not appear to recognize or process this new format at all.

Odd issue with 1.20.1 branch

Trying to use the new version with a 1.20 world and getting the canvas error even though I've built using the 1.20.1 banch.

[2023-07-14 20:40:28.824] [mcmap_cli] [debug] Parsing /data/minecraft/1.20/20230611/level.dat
[2023-07-14 20:40:28.835] [mcmap_cli] [debug] World spans from -5984.-4185696.-64 ~> 22069103.2367.319 (North-West)
mcmap 3.0.1 64bit
[2023-07-14 20:40:28.849] [mcmap_cli] [debug] Rendering 20230611 with -9.-9.-64 ~> 9.9.319 (North-West)
[2023-07-14 20:40:28.849] [mcmap_cli] [debug] Memory capacity: 9978 fragments - 1 fragments scheduled
[2023-07-14 20:40:28.851] [mcmap_cli] [debug] Rendering -9.-9.-64 ~> 9.9.319 (North-West)
[2023-07-14 20:40:28.853] [mcmap_cli] [trace] Chunk parsing failed for chunk -1 -1 in /data/minecraft/1.20/20230611/region/r.-1.-1.mca
[2023-07-14 20:40:28.853] [mcmap_cli] [trace] Chunk loading failed for -1 -1
[2023-07-14 20:40:28.854] [mcmap_cli] [trace] Chunk parsing failed for chunk -1 0 in /data/minecraft/1.20/20230611/region/r.-1.0.mca
[2023-07-14 20:40:28.854] [mcmap_cli] [trace] Chunk loading failed for -1 0
[2023-07-14 20:40:28.855] [mcmap_cli] [trace] Chunk parsing failed for chunk 0 -1 in /data/minecraft/1.20/20230611/region/r.0.-1.mca
[2023-07-14 20:40:28.855] [mcmap_cli] [trace] Chunk loading failed for 0 -1
[2023-07-14 20:40:28.856] [mcmap_cli] [trace] Chunk parsing failed for chunk 0 0 in /data/minecraft/1.20/20230611/region/r.0.0.mca
[2023-07-14 20:40:28.857] [mcmap_cli] [trace] Chunk loading failed for 0 0
[2023-07-14 20:40:28.859] [mcmap_cli] [debug] Rendered in 10ms
[2023-07-14 20:40:28.859] [mcmap_cli] [debug] Canvas canvas (0x0 for 2147483647.2147483647.32767 ~> -2147483648.-2147483648.-32768 (North-West))
 - Void canvas, offset 0.0
[2023-07-14 20:40:28.860] [mcmap_cli] [error] Canvas is empty !
[2023-07-14 20:40:28.860] [mcmap_cli] [error] Error rendering terrain.

git rev-parse HEAD shows 020c22e5c233807625c0532dcda9cafad27ad9fa which is the last one of the 1.20.1 branch.

position of 0,0,0-pixel in image

Hi,

i'm currently building a webapp to control a minecraft server and am using mcmap to render maps in tiles and then i push them into google maps.
also i'm parsing where the players are from the players/*.dat.

i want to put a live google map marker wherever the players are. but in order to so i need the exact position of the 0,0,0-minecraft-block in the rendered image. I already tried to calculate the position but its to hard for me because of the cropping etc.

so would it be possible to let mcmap put out an info-file which contains the mc-0,0,0-coord as a pixel-position in the image?

(i also tried to use the marker on an height 1 rendering in order to find the position by color-comparison but the marker did not work)

btw great tool!

Yet Another Filesystem Issue (not due to gcc version, I think!)

DL;DR: gcc complaining when I try to compile:
undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()' and undefined reference to `std::filesystem::status(std::filesystem::__cxx11::path const&)'.

Long story:
Tried to compile mcmap, gcc fails complaining about filesystem, I look for the solution, turns out my distro is outdated (new version came out), I dist-upgrade, everything works fine, no more errors like "filesystem not found" or whatever, just like it is mentioned in the README.
So, I try to compile again, with the latest version of gcc (8.3.0-6), working well, compiles one, two, three files, and BAM:

$ make -j
[...]
/usr/bin/ld: main.default.o: in function `Settings::WorldOptions::WorldOptions()':
main.cpp:(.text._ZN8Settings12WorldOptionsC2Ev[_ZN8Settings12WorldOptionsC5Ev]+0x1ae): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
[...]
/usr/bin/ld: settings.cpp:(.text+0x23e8): undefined reference to `std::filesystem::status(std::filesystem::__cxx11::path const&)'
[...]
$

(and I've skipped many).

Tech spechs:
I'm running under a vanilla Debian Buster (currently stable), gcc 8.3.0-6, NBT19133 branch (I pulled right before trying to compile), full stderr output.

Assert failure when generating tiled output

Attempting to generate a tiled map in 3.0.1 64-bit crashes with this assertion failure:

/usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = png_text_struct; _Alloc = std::allocator<png_text_struct>; reference = png_text_struct&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
Aborted

...near the end of the process. Output subdirs and mapinfo.json file are created, but only 0/0.png is created, and it is empty.

Build:

jhardin@davinci ~/develop/mcmap/build $ cmake ..
-- The CXX compiler identification is GNU 12.3.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: /usr/lib/libz.so (found version "1.2.13")  
-- Found PNG: /usr/lib/libpng.so (found version "1.6.40") 
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY) 
-- Found Git: /usr/bin/git (found version "2.41.0") 
-- Successfully downloaded https://github.com/nlohmann/json/releases/download/v3.9.1/json.hpp
-- Configuring done (4.5s)
-- Generating done (0.0s)
-- Build files have been written to: /home/jhardin/develop/mcmap/build

About:

Architecture: 64 bits
Compiler: GNU 12.3.1
Source version: 1c21ac9
Threading: OpenMP
fmt version: 9.1.0
libpng version: 1.6.40
spdlog version: 1.11.0
zlib version: 1.2.13

Processing same game save file as a single image completes successfully.

`make` fails on macOS 10.14.6 (Mojave)

Hi, thanks for making this software! Really seems like just what I've been looking for.

I tried building just a moment ago according to README. g++ --version outputs:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I have installed libpng and libomp and they are both latest available version.

cmake was not installed on my system, so I brew install cmake

And then cmake .

I then tried make -j but received numerous errors, so I went back and read if cmake had said anything notable.

Output of cmake .

-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenMP_CXX: -Xclang -fopenmp (found version "3.1") 
-- Found OpenMP: TRUE (found version "3.1")  
-- Found ZLIB: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libz.tbd (found version "1.2.11") 
-- Found PNG: /usr/local/lib/libpng.dylib (found version "1.6.37") 
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY) 
-- Could NOT find QT (missing: QT_DIR)
CMake Warning (dev) at CMakeLists.txt:20 (FIND_PACKAGE):
  Policy CMP0084 is not set: The FindQt module does not exist for
  find_package().  Run "cmake --help-policy CMP0084" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find Qt3 (missing: QT_QT_LIBRARY QT_INCLUDE_DIR QT_MOC_EXECUTABLE) 
CMake was unable to find desired Qt version: 3. Set advanced values QT_QMAKE_EXECUTABLE and QT3_QGLOBAL_H_FILE.
-- Configuring done
-- Generating done
-- Build files have been written to: /path/to/mcmap

So suspecting that missing qt was the issue, I once again brew install qt. I could not find GTest on brew but decided not to worry about it for now.

Then onto make -j.

I received the same kinds of errors, over and over again from multiple files.

mcmap/src/./canvas.h:168:51: error: 'path' is
      unavailable: introduced in macOS 10.15
mcmap/src/include/nbt/parser.hpp:329:53: error: 
      'string' is unavailable: introduced in macOS 10.15

So it seems the code is only playing nice with macOS 10.15, which is a shame. Upgrading to Catalina is untenable for me. Is there a possibility of an "easy fix" or is this the state of affairs for now? It would be good to mention in the README, as many people are running 10.14.

Segmentation Fault on Mac OS X when specifying -from and -to

DevBook >> ./mcmap -skylight -from -1 -1 -to 1 1 -file ~/Desktop/Main\ World\ Ch.png ~/Library/Application\ Support/minecraft/saves/Main\ World
mcmap 2.0a
McRegion world format detected.
Image dimensions are 202x362, 32bpp, 0.28MiB
Terrain takes up 0.78MiB, lightmap 0.39MiB
Loading all chunks..
[0.00%]
[100.00%]
Optimizing terrain...
[0.00%]
[100.00%]
Drawing map...
[0.00%]
[100.00%]
Writing to file...
[0.00%]
zsh: segmentation fault  ./mcmap -skylight -from -1 -1 -to 1 1 -file ~/Desktop/Main\ World\ Ch.png 

Cave mode issues

The recent push fixed cave mode mostly, but for some reason cave mode seems to find different caves than blendcave mode. Blendcave seems to work better, and is more like cave mode used to be. I've not spent much time looking into it yet.

Example:

http://mc.bubblemod.org/maps.php

Seg Fault 11 on Mac OS X.

I'm running Mac OS X - Big Sur - 11.14

No problem with cmake, make, etc. Running on 1.17.1 map, get the following error:

mcmap 3.0.1 64bit (compatible with Minecraft v1.13+)
libpng warning: Application built with libpng-1.5.29 but running with 1.6.37
Segmentation fault: 11

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.