MCTCP / TerrainControl

Minecraft Terrain Generator for SpigotMC and Forge
https://www.spigotmc.org/threads/terraincontrol.37980/
MIT License
230 stars 163 forks source link

BufferedImage overloaded when loading large image file. #413

Open sync667 opened 8 years ago

sync667 commented 8 years ago

Hello, i use last at this moment TC version 138 and Spigot 1465. We try to generate world bigger then 100k x 100k. So we prepared image png that have about 10MB. And TC can't handle that because of int max value.

Full error log: http://pastebin.com/u7zkBeBN

We must get it working so we are ready to help with coding fix for that if needed. Thanks for help :)

sync667 commented 8 years ago

I think the easiest way to handle that would be use many png files and add only proper data quota to generator or use library for png that can handle bigger files.

rutgerkok commented 8 years ago

Your image is uncompressed bigger than 4GB, so TC cannot load it. As you said, we would need to split up the image.

Keep in mind that each pixel is 4x4 blocks, so an image of 2000x2000 pixels will already spawn 8000x8000 blocks.

sync667 commented 8 years ago

@rutgerkok It's any way that we can do it? Yea of course we know long time ago that 4x4 is 1x1px ;) but we want to develop one of the most biggest worlds in MC in size more then 100k x 100k blocks.

rutgerkok commented 8 years ago

Theoretically, yes, but I'm not going to code it. It's a lot of work, it will make the image reading code of TerrainControl much more complicated (so more difficult to maintain), etc. It will also only be useful to very few people.

sync667 commented 8 years ago

So maybe any tool to connect many that big parts in one map? Any machine will handle that or it's much to do to get it working.

rutgerkok commented 8 years ago

Connecting two worlds is easy: just pick the .mca files in the region folder that you want and put them in one world. Generating the right mca files is the difficult part; you'd need to cut up the image into smaller parts, and generate worlds based on the smaller images. Maybe splitting up the image into four quadrants will work?