Add support for PlM (Oodle Mermaid) compressed save files#11
Open
jstop01 wants to merge 2 commits intoiebb:masterfrom
Open
Add support for PlM (Oodle Mermaid) compressed save files#11jstop01 wants to merge 2 commits intoiebb:masterfrom
jstop01 wants to merge 2 commits intoiebb:masterfrom
Conversation
Palworld v0.6+ changed the save file compression from PlZ (zlib) to PlM (Oodle Mermaid). This caused all file imports to fail with "Is it really a Palworld Save?" on both palworld.tf and local builds. Changes: - Detect PlM magic bytes and decompress using Oodle (ooz-wasm) - Add custom oozLoader.js to bypass Emscripten/webpack incompatibility - Update uesave-rs to upstream (trumank/uesave-rs) for serialization fixes - Rewrite rust/src/lib.rs to use new SaveReader API with proper error handling - Preserve raw JSON from deserialize to avoid type coercion on save - PlM saves are written back as PlZ (zlib) since Oodle compression is not available in ooz-wasm (Palworld reads both formats) - Add topLevelAwait webpack experiment and Node.js module fallbacks - Handle missing git repo gracefully in config-overrides.js Fixes iebb#8, iebb#9, iebb#10 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The tree editor (vanilla-jsoneditor) converts string values like "1234" to integers and LosslessNumber objects to arrays/objects, breaking serde deserialization on save. Add preserveTypes() that recursively compares original and edited property trees, restoring original types (string, LosslessNumber) when the tree editor mangles them. Uses rawJson from initial deserialize as the type-correct reference. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Palworld v0.6+ changed the save file compression format from PlZ (zlib) to PlM (Oodle Mermaid). This broke all file imports on palworld.tf, causing the
"Is it really a Palworld Save?"error for every drag-and-drop attempt.This PR adds full support for the new PlM format while maintaining backward compatibility with older PlZ saves.
Fixes #8, #9, #10
What Changed
PlM (Oodle) Decompression Support (
src/libs/save.js)PlZvsPlM)Custom Oodle WASM Loader (
src/libs/oozLoader.js)ooz-wasmnpm package uses Emscripten, which is incompatible with webpack/CRA's module resolution (new URL('./', import.meta.url)fails)public/ooz.wasmand exposes theKraken_Decompressfunctiona.a=emscripten_resize_heap,a.b=emscripten_memcpy_jsUpdated uesave-rs (
rust/Cargo.toml,rust/src/lib.rs)iebb/uesave-rs(pinned at Jan 2024) to upstreamtrumank/uesave-rswhich includes:PackageVersion::Newserialization (the old version panicked on write for v0.6+ saves)rust/src/lib.rsto use the newSaveReaderAPI witherror_to_raw(true)for resilient parsingpanic!()to properResult<T, JsValue>error handling (no more "unreachable" WASM errors)deserialize()now accepts&[u8]directly instead of a customBufferJS typesrc/libs/uesave/(built withwasm-pack build rust --target web)Raw JSON Preservation (
src/libs/save.js,src/components/RawEditor.js)deserialize()is now preserved and passed through towriteFile()"1234"to integers1234, which would cause serde deserialization errors on saveLosslessJSON.stringify(gvas)if rawJson is not availableWebpack Configuration (
config-overrides.js)topLevelAwait: trueexperiment for async WASM initializationmodule,path,fs,url,crypto) for browser buildsgit rev-parsein try/catch so the build works outside of git reposBinary Files
public/ooz.wasmooz-wasmnpm package)public/uesave_wasm_bg.wasmsrc/libs/uesave/uesave_wasm_bg.wasmHow to Rebuild
Test Plan
.savfile (Save button).jsonfile.savcan be loaded back into the editor.savworks in Palworld (needs game testing)🤖 Generated with Claude Code