kpreid/cubes — Issue #1: Preserve blockset identity in serialization
Author: kpreid
Created: 2011-11-06 00:31:15+00:00
State: open

When a world as generated by the default world generator is serialized, the color blockset is duplicated for every world that uses it rather than pointing to the same object. This should be fixed because

* It is a semantic change; the user probably doesn't want many copies to edit independently.
* It increases the size of the serialized form and the time taken to serialize.

In order to fix this, I see two strategies:

* Use a generic object-graph serialization form. In this case, we should avoid inventing a new format and use existing JSON-targeting formats and libraries.
* Make the serialization aware of the “layers” — top world is built of blockset 1 all of whose worlds are built of blockset 2...". This limits the possible graphs, but in a way which probably makes sense for the user interface.