Time Nick Message 05:00 MTDiscord I know this would require breaking compatibility, but has anyone considered variable-width content IDs for serialized mapblocks? The vast majority of mapblocks aren't going to contain over 256 node types, so it's a waste to always use 16-bit content ids when 8-bit IDs would work. 05:02 MTDiscord I tested 8-bit IDs on one fairly typical mapblock and was able to reduce the total size of the block by around 12%. Not huge, but that's an entire gigabyte saved on a 10 GB map. 14:23 MTDiscord Wouldn't you need to store a map/dictionary/set for each mapblock then? 14:23 sfan5 mapblock already do that 14:25 MTDiscord I mean one for node_ids 14:37 sfan5 yes? 14:38 sfan5 there is no translation table at runtime but that's not what he meant anyway 14:38 sfan5 there still is a legacy mode with 8-bit content IDs: content_width=1 14:39 sfan5 and for some reason it wasn't bound to the mapblock version so you can use it to save some space in mapblocks even today (with zero compat concerns) 17:45 MTDiscord There might be some compatibility issues. It looks like the upper 4 bits of param2 were used to store the rest of the content ID if it exceeded a certain value (I'm not quite sure how this works): https://github.com/minetest/minetest/blob/master/src/mapnode.cpp#L811 17:47 sfan5 yeah 17:47 sfan5 you can actually store 128 nodes with full param2 and 2048 nodes with param2 < 16 with this approach 20:04 v-rob Say, are dummy mapblocks even used anymore? I tried removing `dummy` from the constructor, and Minetest compiled fine, and there's no other way for dummy mapblocks to exist except through the constructor as far as I can tell. 20:04 sfan5 check where it's called and see? 20:05 sfan5 oh wait 20:08 sfan5 > If NULL, block is a dummy block. Dummy blocks are used for caching not-found-on-disk blocks. 20:09 sfan5 this sounds useful though, why don't we have this anymore? 20:11 v-rob Assuming we don't have a use for them, mapblocks could use a std::array for nodes and the `*Unsafe` methods could be removed, making the code simpler. 20:51 celeron55 i think it would be up to ServerMap::loadBlock to set that 20:52 celeron55 the logic there seems weird and possibly buggy