Cervator edit: Moved to Core Projects. Might need a thread redo sometime to be more up to date, tons of changes since @Panserbjoern started with sparse chunks, now we have stacked chunks and so on too
Skaldarnar edit: Moved to incubator, added header
Name: Chunk Storage
Summary: Several ideas on how to improve storage with regard to memory usage. Initial attempt was additional »Sparse Chunks« to save some memory. Currently i am working on improved serialization of chunks and tera arrays.
Scope: Core
Current Goals: The current goal is to implement improved serialization for whole chunks including support for protobuf. This also touches caching of chunks at runtime and the storage format for entire worlds.
Phase: Implementation
Curator: Community
Related: Chunk Visualizer http://forum.movingblocks.net/threads/chunk-storage-sparse-chunks.665/page-2#post-6426
Hi all
In the past two weeks or so i was working on sparse chunks. The current implementation is working with all terrain generators and gives a very signifficant reduction in memory consumption.
Most chunks can be compressed by about 80 to 90 percent. And on my machine i have no signifficant impact on performance!
The implementation is based on four important classes:
There is still some tuning possible. Currently, chunks are compressed only once immediately after their state was set to COMPLETE. After that, they never get recompressed. Also, if a sparse array is completely filled with non-redundant data it uses more memory than its dense version. Switching back to its dense version in such a case would be desirable.
Further, all the classes are designed to make it easy to add alternative implementations in the future. It's also easy to switch to a bigger datatype for block id's in the future.
And of course every time a chunk is compressed it generates a nice log message to indicate by how much its data has been reduced.
Please take a look at it and give me some feedback.
I've created a pull request:
https://github.com/MovingBlocks/Terasology/pull/391
Panserbjoern
Name: Chunk Storage
Summary: Several ideas on how to improve storage with regard to memory usage. Initial attempt was additional »Sparse Chunks« to save some memory. Currently i am working on improved serialization of chunks and tera arrays.
Scope: Core
Current Goals: The current goal is to implement improved serialization for whole chunks including support for protobuf. This also touches caching of chunks at runtime and the storage format for entire worlds.
Phase: Implementation
Curator: Community
Related: Chunk Visualizer http://forum.movingblocks.net/threads/chunk-storage-sparse-chunks.665/page-2#post-6426
Hi all
In the past two weeks or so i was working on sparse chunks. The current implementation is working with all terrain generators and gives a very signifficant reduction in memory consumption.
Most chunks can be compressed by about 80 to 90 percent. And on my machine i have no signifficant impact on performance!
The implementation is based on four important classes:
- TeraDenseArray8Bit --> TeraSparseArray8Bit
- TeraDenseArray4Bit --> TeraSparseArray4Bit
There is still some tuning possible. Currently, chunks are compressed only once immediately after their state was set to COMPLETE. After that, they never get recompressed. Also, if a sparse array is completely filled with non-redundant data it uses more memory than its dense version. Switching back to its dense version in such a case would be desirable.
Further, all the classes are designed to make it easy to add alternative implementations in the future. It's also easy to switch to a bigger datatype for block id's in the future.
And of course every time a chunk is compressed it generates a nice log message to indicate by how much its data has been reduced.
Please take a look at it and give me some feedback.
I've created a pull request:
https://github.com/MovingBlocks/Terasology/pull/391
Panserbjoern
Last edited by a moderator: