afonsolage / projekto

Voxel game made with Bevy Engine
MIT License
59 stars 4 forks source link

Change Chunk Height to 128/256 #10

Closed afonsolage closed 2 years ago

afonsolage commented 2 years ago

Currently chunk has a cubic size, defined by AXIS_SIZE here: https://github.com/afonsolage/projekto/blob/928d2eb9b30205665beb6444d8ca790c32275fb7/src/world/storage/chunk.rs#L11

Overview

Most of the time, voxels are distributed along the X and Z axis, since usually the world tends to spread on those directions. While also there are mountains, cliffs and peeks around the generated world, those are sparse and most blocks on Y axis above ground will be empty.

By changing chunk height to be a higher value, like many other Voxel Engine does, the number of Chunks is reduced by one magnitude, since it's most likely to have only a single chunk visible on Y axis. On worst case, there will be 3 chunks per Y axis, but that's way lower than currently one.

This should be done before #8, since it'll affect how chunks are cached.

Caveats