How would you serialize entities?
its-danny opened this issue · comments
In the context of saving game state, how would you serialize entities into a format that could be easily recreated?
I started a naive implementation #202 which basically will implement a toJSON
on world, systems, components and so on. And then it should have a fromJSON(json)
so you could recover the state of the world, by just doing world.fromJSON(json)
@fernandojsg exactly what i was looking for, what you have is dope. i'll follow that issue then.
We discussed that it makes more sense to move this out from the main repo as a serializer could be something really opinionated and it will be hard to fit all the use cases. So I'll work on an JSON implementation at https://github.com/fernandojsg/ecsy-serializer as a reference implementation, so we could move the discussion there