afonsolage / projekto

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

Added compression/decompression on chunk cache generation #17

Closed afonsolage closed 2 years ago

afonsolage commented 2 years ago

Added compression/decompression using library https://github.com/pseitz/lz4_flex

Closes #13

Here are some benchmarking tests:

Without Compression

Clean run (full generation) | chunk 16³ | landscape 16³: 27.35s Normal run (existing cache) | chunk 16³ | landscape 16³: 11.89s

With Compression

Clean run (full generation) | chunk 16³ | landscape 16³: 3.22s Normal run (existing cache) | chunk 16³ | landscape 16³: 2.69s

So we have a considerable reduction. I think it's possible to have even better time reduction. but when walking on normal speed, the time used to generate a new line of chunks (16²) is about 0.5s, so the next bottle neck is the mesh generation, which should be addressed in another PR.