neocturne / MinedMap

Minecraft map renderer and viewer
MIT License
99 stars 13 forks source link

1.18 support #22

Closed saadbruno closed 2 years ago

saadbruno commented 3 years ago

1.18 is in the pre-release phase, which means that no major changes are being made, and only bugfixes are being done before the official release.

I'm assuming no further changes are being made to the chunk data structure, so I tried generating a map using the latest snapshot (1.18 Pre-Release 2), and got the following error: Failed to generate /var/www/sandbox/minedmap/data/map/0/r.2.0.png: assertValue failed

Since no new blocks have been introduced (I followed the instructions in the resource directory), I can only assume this is due to the new world height, or maybe the new biomes.

I tried changing the MAXY to 320 in /src/World/Chunk.hpp, but that didn't work as well, I'm assuming a fix would be more involved than that anyways.

neocturne commented 3 years ago

Yeah, there are tons of code that expect Y values to be positive. I've started working on a fix.

dreadnaut commented 2 years ago

Anything we could help with? Want to push a partial branch?

neocturne commented 2 years ago

Anything we could help with? Want to push a partial branch?

Sorry, I procrastinated working on this a bit too much... I just pushed my current changes to wip/mc1.18. The code should now be able to extract block types from the new 1.18 chunk structures. Getting biome and light data from the new chunks is not implemented yet, but I should be able to finish this in the next few days.

neocturne commented 2 years ago

I just pushed 1.18 support to the main branch, please test.

While implementing support for negative Y values, I also found and fixed an integer underflow issue that caused wrong biome colors for blocks below Y=64 since MinedMap 1.14.

Before the fix: r -5 1-old

After the fix: r -5 1

saadbruno commented 2 years ago

Worked great for me! Crazy to see how the world generation changed.

I got 1 single small issue tho:

Failed to generate ./scripts/../MinedMapExport/overworld/biome/r.19.-20.png: unsupported biome palette size
Failed to generate ./scripts/../MinedMapExport/overworld/map/0/r.19.-20.png: unsupported biome palette size

My entire world has more than 8gb, and I only got this error on this specific chunk. There must be something wrong with it. I can investigate further tomorrow.

But this particular region is an (originally) 1.17 chunk upgraded to 1.18, and has a bunch of buildings and whatnot. Any ideas of what I should look for in that particular chunk? I'm fine with uploading the files here as well if needed.

neocturne commented 2 years ago

I pushed a fix that should solve this - there was an obvious mistake in the code checking the biome palette size.

dreadnaut commented 2 years ago

Hello, and thank for the update! I also have a 1.17 world updated to 1.18, and now on 1.18.1.

Most of the regions visited after the 1.18 upgrade rendered correctly. None of the unvisited regions produced a tile. Unrendered tiles showed assertValue failed errors in the output:

Generating [...]/minedmap/biome/r.-1.1.png from [...]/region/r.-1.1.mca... Failed to generate [...]/minedmap/biome/r.-1.1.png: assertValue failed
Generating [...]/minedmap/biome/r.0.1.png from [...]/region/r.0.1.mca... Failed to generate [...]/minedmap/biome/r.0.1.png: assertValue failed
Generating [...]/minedmap/biome/r.1.1.png from [...]/region/r.1.1.mca... Failed to generate [...]/minedmap/biome/r.1.1.png: assertValue failed
Generating [...]/minedmap/biome/r.-2.2.png from [...]/region/r.-2.2.mca... Failed to generate [...]/minedmap/biome/r.-2.2.png: assertValue failed
Generating [...]/minedmap/biome/r.-1.2.png from [...]/region/r.-1.2.mca... Failed to generate [...]/minedmap/biome/r.-1.2.png: assertValue failed
Generating [...]/minedmap/biome/r.0.2.png from [...]/region/r.0.2.mca... Failed to generate [...]/minedmap/biome/r.0.2.png: assertValue failed
Generating [...]/minedmap/biome/r.1.2.png from [...]/region/r.1.2.mca... Failed to generate [...]/minedmap/biome/r.1.2.png: assertValue failed
Generating [...]/minedmap/biome/r.1.5.png from [...]/region/r.1.5.mca... Failed to generate [...]/minedmap/biome/r.1.5.png: assertValue failed

I had to install pkg-config to compile the new version, I think that comes from an earlier change (fdce587c)

neocturne commented 2 years ago

@dreadnaut Can you upload one of the failing .mca files, so I can have a look?

dreadnaut commented 2 years ago

Sure! GitHub doesn't appreciate region or zip files, so they are temporarily here: --gone--

r.-1.2.mca is a region we have not visited since the 1.18 upgrade (although converted via "optimize world"), while we travelled through r.-3.-4.mca.

neocturne commented 2 years ago

Two more fixes pushed. It seems that "optimize world" creates some unusual deviations in the chunk structure, I didn't have any of these in my test worlds.

dreadnaut commented 2 years ago

That was fast! All looks great now, no errors, all tiles generated.

Thank you again 🙇

saadbruno commented 2 years ago

Looks good to me as well! No errors.

Thanks a bunch!

AaronWebster commented 2 years ago

Works for me as well, thanks!