The block system has become way too complex for absolutely no reason besides me trying to save memory usage.
Currently, a chunk, in it's lowest state will consume 65536 bits for raw chunk data, we can however drastically reduce it by implementing a new system.
Block API changes
- Changing the purpose of
BlockType from an actual block type but more as an material info container
- Removal of
ComplexBlock
- Removal of
chunk_block_data_t and block_data_t
- Reduce size of
block_id_t to uint8_t
Chunk API changes
- Every block getting function will now be uniform and will return a block type
block_id_t
- Add an
emhash7::HashMap<size_t, void*> inside Chunk in order to store pointers pointing to block data objects with the key representing the index
- Add a
block_data_container class base which is purely here to represent every block data class
- Add an
get_data function on Chunk
Final Note
The following changes will both be incredibly important and useful in terms of development speed for the server, it also will give us great performance improvements in both ram and file size!
The block system has become way too complex for absolutely no reason besides me trying to save memory usage.
Currently, a chunk, in it's lowest state will consume
65536bits for raw chunk data, we can however drastically reduce it by implementing a new system.Block API changes
BlockTypefrom an actual block type but more as an material info containerComplexBlockchunk_block_data_tandblock_data_tblock_id_ttouint8_tChunk API changes
block_id_temhash7::HashMap<size_t, void*>insideChunkin order to store pointers pointing to block data objects with the key representing the indexblock_data_containerclass base which is purely here to represent every block data classget_datafunction onChunkFinal Note
The following changes will both be incredibly important and useful in terms of development speed for the server, it also will give us great performance improvements in both ram and file size!