Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility for custom serializer implementation #54

Open
scatterlogical opened this issue Jan 23, 2025 · 2 comments
Open

Possibility for custom serializer implementation #54

scatterlogical opened this issue Jan 23, 2025 · 2 comments

Comments

@scatterlogical
Copy link

Would it be possible to provide a mechanism to implement our own serializers?
I want to be able to do a binary serialization of entities, via MemoryPack, which I'm already using for other elements in my game, but I'm unsure of the complexities of pulling and pushing stuff from the EntityStore.

@friflo
Copy link
Owner

friflo commented Jan 23, 2025

There is a similar request at #49

At the bottom of this discussion after a short explenation how to write a custom serializer.

A custom generic Writer can use Entity.Components to get entity component data. These components can be written as text or binary.

A custom generic Reader read binary / text data.
Than create an entity with store.CreateEntity(). The deserialized data can be added using [Entity] (https://github.com/friflo/Friflo.Engine-docs/blob/main/api/Entity.md)
or EntityUtils methods.

@scatterlogical
Copy link
Author

Oh ok, so there's no nuances to reconstructing an entity and components beyond just creating them and setting the members? Sorry I'm used to dealing with serialization of entities with unreal engine, and that is a nightmare of pitfalls 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants