Skip to content

Decrease memory usage 7x!

Compare
Choose a tag to compare
@serg06 serg06 released this 12 Jan 07:14
· 223 commits to master since this release

New features:

  • Memory footprint is 7x smaller. Can reach 100 render distance on 32-bit compilation!
  • Chunk generation is much faster (don't need to allocate so much space).
  • Fix movement bug that was causing snapping-to-edges for the past month.
  • No longer crashes when minimizing / alt-tabbing.
  • Prioritize meshing existing chunks over new ones.
    • Adding/destroying blocks will look good even while other chunks are queued up to be meshed.
  • Prettier and scarier underwater tint.
  • No more background pixels shining through terrain (unless looking through water.)
  • Smoother mouse.
    • Disable raw mouse input by default. (Can toggle with R.)

Technical details:

  • Represent world using interval maps instead of arrays.
  • Chunk meshing tiny bit slower because accessing arrays is O(1) but accessing interval maps is O(log(num intervals)).
  • Starting window dimensions can now be anything, instead of only 800/600.
  • Wake up threads with the proper amount of cv.notify_one() instead of shotgunning with cv.notify_all().
  • T-junctions are now fixed by filling in all pixels with max depth (1.0) except for ones where we drew a transparent pixel (e.g. leaves).
  • Clean up old code by making variables/functions const and passing classes by reference.

Controls:

  • F11 fullscreen
  • R toggle mouse raw input
  • T toggle t-junction fixing
  • Mouse look around
  • WASD move around
  • Shift/space move up/down
  • ESC quit
  • N toggle noclip
  • P cycle polygon mode
  • [+ or numpad+] (press once or hold) increase render distance
  • [- or numpad-] (press once or hold) decrease render distance (without unloading existing chunks)
  • C toggle face culling
  • Left-click destroy block
  • Right-click place flowing water
  • F3 enable debug overlay
  • Scroll change block type (active block type visible in debug menu)