Skip to content
Len edited this page Apr 16, 2022 · 1 revision

Memory usage

The raytracer is rendering from one single superchunk. Outside the view of the player, chunks are inserted into the superchunk to make the world appear infinite.

The size of the superchunk is dependent on the view distance. The smallest superchunk size is 4*4 chunks. This minimum exists since there needs to be at least one visible chunk in each direction (3x3 chunks) and a 1-wide invisible frame around it.

This superchunk architecture with copying chunks into it is used in order to reduce the raytracer's overhead as much as possible. When chunks were stored individually in memory, one more hop per block lookup would be needed. Per frame, there are usually 100s of thousands of block lookups and another hop for each of them would be expensive.

To see how much memory the superchunk uses, see diagnostic information.

Storage usage

When a modified chunk gets out of reach (when it needs to be overwritten by a new chunk, the superchunk is recreated or the game is quit), it is compressed by a tiny lz compressor and then stored inside localeStorage.

The browser should keep these storage items forever, making the Minicraft world persistent. Nothing is transmitted or stored anywhere else, so when you let your browser clear the page's data, your world will be gone.

The page's storage can be managed inside your browser's developer tools, in tab "Application".

Clone this wiki locally