MovingBlocks/Terasology — pull request #417 by mbrotz (2013-01-15 18:35:29+00:00)
Title: Chunk storage - new attempt

Let's try it again! :) I have created this new branch called "chunk-storage", which is based on the latest develop branch, and cherry picked my latest changes into it. I hope, it works like this and is acceptable for you.

Original pull request: https://github.com/MovingBlocks/Terasology/pull/409

----------------

I've implemented protobuf support for TeraArrays and Chunks.

Enocoding and decoding of TeraArrays:

* TeraArrays.getInstance().encode(TeraArray)
* TeraArrays.getInstance().decode(ChunksProtobuf.TeraArray)

Encoding and decoding of Chunks:

* Chunks.getInstance().encode(Chunk)
* Chunks.getInstance().decode(ChunksProtobuf.Chunk)

Further i've added a new chunk store which internally uses protobuf to store chunks. I haven't made any benchmarks yet, but i get the feeling that the new chunk store is faster than the old one. And it definitly yields slightly better compression for chunks and entire worlds.

I think, existing worlds which were created using the old chunk store should still work! They just keep using the old chunk store when you load them. At least, it works on my machine. I hope, it works on yours too, i don't have very old worlds to test it against...

I can add a conversion mechanism so your old worlds can switch to the new chunk store.

Maybe someone can test, wether old worlds still work? Don't forget to backup your old worlds!