Install Asset
Install via Godot
To maintain one source of truth, Godot Asset Library is just a mirror of the old asset library so you can download directly on Godot via the integrated asset library browser
Quick Information
A Godot's universal serializer for size optimizationFeature:1. Without losing type information. Need not type detection andforced typce conversion in Cross end transfer,just like local parameter transfer.2. Integer and float are variable length serialization.3. The serialized data size is smaller than JSON text to utf8 and the native serialization method (var2bytes ()).GUS is especially suitable for the serialization of structured small dat transfer in multiplayer games.You can call GUS._test() to view the data size comparison after serialization in these three way.How to use:1. Modify the configuration definition constants at the beginning of the script as required.2. Pass variable which without Object and Eid into GUS.to_bytes() and gets the serialized data for sending through any network peer.3. After the remote network peer obtains the serialized data, passe it into GUS.to_var () to get the same variable as before serialization.Additional: The obtained serialized data can be passed into GUS.get_ pretty_ json_text(), a beautified JSON text will be return, which is for printing and display when debugging.Be careful:1. The configuration definitions of cross end applications should keep the same.2. Array and Dictionary should not contain Object or RID.3. Because of implementing by GDScript, although the serialized data size is better, it will cost lot of time when serialization and deserialization large array(both Array and PoolArray), you should avoid to use GUS in time sensitive case.TODO:1. Write GUS 2.0 applicable for godot4 X .2. Write as C++ addons to solve the problem of low efficiency of large array serialization.
GUS - Godot Universal Serializer - Godot的通用序列化器 - V1.03
中文文档 <- 点击这里。
A Godot's universal serializer for size optimization.
Support all data types except Object and RID in Godot 3.x.
Feature:
- Without losing type information. Need not type detection and forced typce conversion in Cross end transfer,just like local parameter transfer.
- Integer and float are variable length serialization.
- The serialized data size is smaller than JSON text to utf8 and the native serialization method (var2bytes ()).GUS is especially suitable for the serialization of structured small dat transfer in multiplayer games.You can call GUS._test() to view the data size comparison after serialization in these three way.
How to use:
Modify the configuration definition constants at the beginning of the script as required.
Pass variable which without Object and Eid into GUS.to_bytes() and gets the serialized data for sending through any network peer.
After the remote network peer obtains the serialized data, passe it into GUS.to_var () to get the same variable as before serialization.
Additional: The obtained serialized data can be passed into GUS.get_ pretty_ json_text(), a beautified JSON text will be return, which is for printing and display when debugging.
Be careful:
- The configuration definitions of cross end applications should keep the same.
- Array and Dictionary should not contain Object or RID.
- Because of implementing by GDScript, although the serialized data size is better, it will cost lot of time when serialization and deserialization large array(both Array and PoolArray), you should avoid to use GUS in time sensitive case.
TODO:
- Write GUS 2.0 applicable for godot4 X .
- Write as C++ addons to solve the problem of low efficiency of large array serialization.
Edit history:
January 21, 2022: Daylily-Zeleen - [email protected] - v1. 03:
Fix empty Dictionary deserialize error.January 21, 2022: Daylily-Zeleen - [email protected] - v1. 03:
In order to setting default value by string facilitatly in some special specific occasions, I made some change as below:- Modify and add identification code for Boolean.
- Modify identification code for Boolean Array and Dictionary.
For example, the default values of GUS encoded binary fields which stored in the database can be set as '[]', '{}', 'T' or 't', 'F' or 'f', which mean that empty Array, empty Dictionary, True and False .
January 19, 2022: Daylily-Zeleen - [email protected] - v1. 02:
- Fix empty Array deserialize error.
- Fix empty Dictionary deserialize error.
- Optimize empty pool arrays serialized size.
January 19, 2022: Daylily-Zeleen - [email protected] - v1. 01:
- Add type detection assert to GUS.to_bytes() for debugging purposes.
- Add 'null' and 'bool' into GUS._test().
- Add "How to use".
- Add descriptions of common methods and test methods.
- Optimize the text for push_error() when deserialize(GUS.to_var()) faild.
January 18, 2022: Daylily-Zeleen - [email protected] - v1. 0:
Initial submit.
A Godot's universal serializer for size optimization
Feature:
1. Without losing type information. Need not type detection and
forced typce conversion in Cross end transfer,just like local parameter transfer.
2. Integer and float are variable length serialization.
3. The serialized data size is smaller than JSON text to utf8 and the native serialization method (var2bytes ()).GUS is especially suitable for the serialization of structured small dat transfer in multiplayer games.You can call GUS._test() to view the data size comparison after serialization in these three way.
How to use:
1. Modify the configuration definition constants at the beginning of the script as required.
2. Pass variable which without Object and Eid into GUS.to_bytes() and gets the serialized data for sending through any network peer.
3. After the remote network peer obtains the serialized data, passe it into GUS.to_var () to get the same variable as before serialization.
Additional: The obtained serialized data can be passed into GUS.get_ pretty_ json_text(), a beautified JSON text will be return, which is for printing and display when debugging.
Be careful:
1. The configuration definitions of cross end applications should keep the same.
2. Array and Dictionary should not contain Object or RID.
3. Because of implementing by GDScript, although the serialized data size is better, it will cost lot of time when serialization and deserialization large array(both Array and PoolArray), you should avoid to use GUS in time sensitive case.
TODO:
1. Write GUS 2.0 applicable for godot4 X .
2. Write as C++ addons to solve the problem of low efficiency of large array serialization.
Reviews
Quick Information
A Godot's universal serializer for size optimizationFeature:1. Without losing type information. Need not type detection andforced typce conversion in Cross end transfer,just like local parameter transfer.2. Integer and float are variable length serialization.3. The serialized data size is smaller than JSON text to utf8 and the native serialization method (var2bytes ()).GUS is especially suitable for the serialization of structured small dat transfer in multiplayer games.You can call GUS._test() to view the data size comparison after serialization in these three way.How to use:1. Modify the configuration definition constants at the beginning of the script as required.2. Pass variable which without Object and Eid into GUS.to_bytes() and gets the serialized data for sending through any network peer.3. After the remote network peer obtains the serialized data, passe it into GUS.to_var () to get the same variable as before serialization.Additional: The obtained serialized data can be passed into GUS.get_ pretty_ json_text(), a beautified JSON text will be return, which is for printing and display when debugging.Be careful:1. The configuration definitions of cross end applications should keep the same.2. Array and Dictionary should not contain Object or RID.3. Because of implementing by GDScript, although the serialized data size is better, it will cost lot of time when serialization and deserialization large array(both Array and PoolArray), you should avoid to use GUS in time sensitive case.TODO:1. Write GUS 2.0 applicable for godot4 X .2. Write as C++ addons to solve the problem of low efficiency of large array serialization.