ecsyjs / ecsy

Entity Component System for javascript

Home Page:https://ecsyjs.github.io/ecsy/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How would you serialize entities?

its-danny opened this issue · comments

commented

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)

commented

@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