LibDataPacker #39
imPDA
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I am currently developing LibDataPacker, a tool that can compress data of any shape into a string and back. Initially designed for my own purposes, I found it to be quite effective and decided to expand its use cases and tailor it to others' needs as well. :)
In short, you declare a data structure, a schema, and a base for encoding (custom base64 by default). The tool converts the data into a binary string first, then into a base64 string. This can significantly reduce the string size, making almost any data transferable via in-game links. I’ve also created an example for Wizard's Wardrobe to demonstrate its capabilities.
"data" is a table containing all the data transferred via the link (I copied some functions from WW).
"unpackedData" is the data after unpacking the string, added to verify that it matches the original data.
The default preview link string takes 221 characters, like this:
|H1:wwp:175525h141627k103982k194779b194714k194739h104023b103928p103927p103927p1947676000000000000008775640000000000000024165039089024330046331023678040158061507061519024595023236023231103564078092082000000000000000000000000000nil|h[Empty]|h
The string generated by LibDataPacker takes only 139 characters for the same amount of data.
This addon can be helpful in various scenarios:
I’m curious if the current maintainers find this interesting. Would you like to use it and implement it yourselves, or should I contribute directly?
Repo. You can install it and interact with examples via Zgoo. Open
/zgoo LibDataPacker.examples
list and executerun()
method of any example.P.S. The preview sometimes behaves oddly. For example, it shows I have Sugar Skulls food, but the link preview displays Solitude Salmon-Millet Soup instead. This indicates an error in the encoding/decoding or lookup table creation process. This part can be simplified significantly.
Beta Was this translation helpful? Give feedback.
All reactions