editor-core icon indicating copy to clipboard operation
editor-core copied to clipboard

Use specs' saveload functionality for serialization

Open randomPoison opened this issue 6 years ago • 1 comments

Supposedly saveload is the "right" way of handling serialization/deserialization of component data with specs. The documentation doesn't make it very clear how to use this functionality, but there's an example that should be enough to get us started.

This change will likely change the format of the serialized data, so we'll have to update the Electron editor to work with the new format.

randomPoison avatar Sep 09 '18 06:09 randomPoison

After some investigation, I'm not sure that saveload is the right approach to use for the editor for a few reasons:

  • You must know all the types that you want to serialize at compile time. This makes it hard for 3rd party crates to automatically register their own types for serialization.
  • As far as I know serialization for the different component types isn't processed in parallel. This might be able to be fixed within saveload, but the approach of registering each type as its own system already fits in well with amethyst's multi-threading scheme.

That said, I'm not entirely opposed to using saveload. If someone would like to put together a prototype of using saveload for serialization, that would help me to understand how the approach works in practice 🙂

randomPoison avatar Sep 10 '18 14:09 randomPoison