Replies: 3 comments 2 replies
-
|
hi @Iwan91, 1. Customize JSON serializationI added some examples to the documentation public struct MyComponent : IComponent {
[Serialize("v")]
public int value;
}2. pretty parameter to format JSON in
|
Beta Was this translation helpful? Give feedback.
-
|
An additional note to JSON vs MessagePack serialization regarding the size. The unzipped JSON version will be larger than unzipped MessagePack. JSON requires simply more control characters (bytes). Btw: |
Beta Was this translation helpful? Give feedback.
-
|
4)I looked at "EntitySerializer" and how it write/read data to JSON. I think that JSON serializer/deserializer should be a separate project that depends on ECS framework. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
1)I know that there is attribute "ComponentKey" for changing component name when serializing/deserialaizing.
I can't find in project attribute that do the same when serializing/deserialaizing variable.
Can you add support for something like "VariableKey".
Example:
2)I see that "EntitySerializer" only write output as "pretty". In code I can see that you have a parameter "pretty" in methods but it is set to always true in code. Can you add this parameter to constructor of EntitySerializer?
Example:
converter.EntityToDataEntity(entity, writeEntity, true);3)Is planned support for serializing/deserializing in binary format or for example MessagePack or other format that take less space on disk and probably is faster to serialize/deserialize than JSON?
I ask because 1_000_000 entities with one component (above example 1) is around 85MB, after I zipped it it is around 5.5MB. It it still a lot. I know that parsing a large file of json is not very efficient on mobiles espacialy on android.
Beta Was this translation helpful? Give feedback.
All reactions