Skip to content
Bartosz Skrzypczak edited this page Jan 6, 2018 · 3 revisions

What is Cubic Chunks?

Hopefully everyone reading this knows that Minecraft world is (almost) infinite. You can travel hundreds of thousands of blocks without encountering any limit. But things are not the same when you want to go higher or deeper. This limitation exists since very early Minecraft versions and is the consequence of splitting the world into 16x16x sections called "Chunks".

This mod attempts to remove this limitation by changing chunk size to 16x16x16 and stacking them on top of each other. By dynamically loading and unloading these smaller Chunks it's possible to almost completely remove height and depth limits.

Considering how Minecraft works internally, the unbreakable limit would be about 2147483647 blocks up and 2147483648 blocks down. Beyond that, 32-bit block coordinates would wrap around and result in breaking almost every aspect of the game. Making the code work with that would mean designing many algorithms with that wrap-around in mind. In this mod the limit is around 1 billion blocks up and down (1073741823 blocks up and 1073741824 blocks down) and planned change to 2147479551=2^31-4096-1 up and 2147479552=2^31-4096 down (with the subtracted 4096 so that Minecraft will never try to load anything beyond the hard limit)

The issues with Cubic Chunks and how this mod attempts to solve them

There are a few hard to solve issues when implementing the idea. Especially when implementing it as a mod. Here are a few of them:

  • Skylight calculation:

    Minecraft skylight idea is relatively simple: if a block is below the top non-transparent block - make it dark. If it's above it - make it fully lit. Then apply the same light spread algorithm to lit blocks as to normal block light sources.

    Since not all parts of the world are loaded at once, when someone breaks the top block - the next top block may be hundreds of thousands of blocks down, and it may not be loaded at that time. And another hundreds of thousands of blocks down there may be other player who wants to see skylight update.

    While it may be possible to invent a completely new skylight idea just for Cubic Chunks - it would most likely eighter break in some situation or would have the same issues as the current one.

    Th the mod this mod is based on - Tall Worlds Mod - Cuchaz attempted to fix it using a data structure that in a highly compressed form stores all block opacity value. And because of the way this data structure works - it's very easy to get the top opaque block position. But because in some cases this structure may need a lot of memory - the plan is to eventually load only parts of it necessary to determine the top block and store everything else on disk (more details about it in "how it internally works?" section)

  • Generating the world fast enough:

    With cubic chunks generating terrain becomes a bit more complex, so it can't be as fast as the current vanilla terrain generator. Several different values that need to be calculated for each x/z coordinate now need to be recalculated every time new Cubic Chunk is generated. And there is some (constant) overhead when generating a piece of terrain. Since pieces of terrain generated at once are smaller, it will increase.

    But that alone isn't the biggest problem as players usually don't move very fast when generating new terrain, at least in horizontal direction. But player falling down from a platform into not yet generated parts of the world requires generating terrain way faster than it's possible. Player terminal velocity is somewhere between 50 and 70 blocks/second, which is 3-5 Cubic Chunk heights per second. With render distance 10 chunks, it would mean that server needs to generate between 1323 and 2205 chunks per second. For each falling player.

    This can be solved by first generating chunks close to the player and trying to predict which chunks are more important based on movement direction and if that is not enough - pausing player movement when needed.

  • Compatibility with other mods

    A lot of mods assume that world height is 256 and that there are no blocks below y=0. This mod breaks this fundamental assumption so a lot of mods won't work correctly. There are also many technical details that make it nearly impossible to make some mods compatible with Cubic Chunks without modifying these mods.

    In current development stage mod compatibility is very low priority so it's very unlikely to be compatible with anything.

Short history of Cubic Chunks mod

Note: this section is mostly based on old MineCrak's thread How to get higher and deeper worlds? and my own experiences.

Probably the first mod that attempted to increase world height in Minecraft was ymod created for Minecraft versions beta 1.2_02 and beta 1.3_1. But it didn't use Cubic Chunks - it simply increased Chunk height to some arbitrary values. Unfortunately author of this mod disappeared.

The next mod that increased world height was Robinton's Cubic Chunks mod. It was initially created for Minecraft beta 1.7.3, then updated to beta 1.8 and 1.0.0. Updates to 1.1 and 1.2 have been attempted, but it was never finished. This mod increased world height and depth initially to 2048 blocks up/down, then to ~32000 blocks up and down. This mod inspired Jeb to create Anvil world format and increase world height to 256 blocks.

There are also a few other mods that appeared around that time that increased world height without using Cubic Chunks technique:

  • Spoutcraft (up to Minecraft 1.2) - unfortunately all links seem to be down
  • MineUp/GravityCraft+MineUp - Minecraft beta 1.8.1 and 1.2.5
  • DynamicHeight - unfortunately the page with relased version doesn't exist anymore - Minecraft beta 1.9pre1 and 1.0.0
  • Height Mod - beta 1.9pre1, 1.0.0 and 1.1.0
  • MapHeight 256 - Minecraft 1.0.0 - 1.1.0 12w06a, after that - vanilla had world height of 256 blocks.

The next version of CubicChunks was tech demo of my early 1.6.2 mod, therwe was also unpublished 1.6.4 version (even 1.6.2 version was never supposed to be public).

Then, while I was waiting for proper MCP for Minecraft 1.7, Cuchaz started working on his own version of Cubic Chunks mod - Tall Worlds mod, but the first beta release was for Minecraft 1.8. It uses completely new modding environment created by Cuchaz - M3L, which is incompatible with MinecraftForge. After 2 beta releases Cuchaz declared that he won't work on this mod anymore - I forked the project and ported it to MinecraftForge. This mod is result of that fork.