-
Hello! I'm curious about the feasibility of serializing and deserializing a world into a binary file. I've noticed that there's a new serialization feature built on the reflection framework in Flecs 3.2, but my situation is unique. I'm using the Flecs C99 interface with C# and I'm adding components by ID, size, and pointer. Is it possible to load and save component data without needing a definition in the reflection framework? Thanks for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
That is possible, as long as you implement your own reflection solution. If you want to serialize components for a subset of entities in the world, one thing you can do is iterate a query that matches those entities and serialize their components. This is what the JSON world serializer does: https://github.com/SanderMertens/flecs/blob/master/src/addons/json/serialize.c#L2076 If you want to serialize components of a specific entity, you can iterate the component ids/values of that entity. The |
Beta Was this translation helpful? Give feedback.
Thank you for the quick response!