Skip to content

Add support of files that use implode compression algorythm#37

Open
a-sakharov wants to merge 1 commit intoeagleflo:masterfrom
a-sakharov:master
Open

Add support of files that use implode compression algorythm#37
a-sakharov wants to merge 1 commit intoeagleflo:masterfrom
a-sakharov:master

Conversation

@a-sakharov
Copy link
Copy Markdown

Diablo2 use imploded mpq data. This small patch allow to use this lib with Diablo 2 resources.

@eagleflo
Copy link
Copy Markdown
Owner

eagleflo commented Apr 7, 2026

Thanks for the contribution! This looks like a worthwhile addition.

I have mixed feelings about taking in a dependency wrapping C++ code, as previously mpyq has been pure Python. I'm tempted to try to recreate dclimplode in pure Python.

@a-sakharov
Copy link
Copy Markdown
Author

@eagleflo
You are bz2 and zlib, their python code also just a bindings for native code libs, despite being part of standard python library. And this is for a reason: python code really slow in such tasks.
Do you want to avoid c-code in dependencies because of potential security issues or just to keep repository pure? Compatibility isn't an issue, this lib successfully tested at linux and windows, so should work almost everywhere.

@eagleflo
Copy link
Copy Markdown
Owner

eagleflo commented Apr 9, 2026

The standard library wrapping C libraries is quite different from third-party modules containing native code. Not having to build anything is a huge simplification.

mpyq.py is as of now a single standalone Python file with zero dependencies; there is power in such simplicity. I think simplicity the main benefit of using mpyq over other alternatives. I believe that is why Blizzard and Google DeepMind ended up using it.

Python code being slower than native for extracting MPQ files wasn't a problem 15 years ago when I first wrote this, and certainly isn't now with much faster computers. MPQ is an ancient format and the compression algorithms it uses are even more ancient, dating back to late 80s.

Writing a pure Python alternative for PKWare DCL could still be a fun exercise. The patent expired in 2010: https://patents.google.com/patent/US5051745A/en. https://github.com/ladislav-zezula/StormLib/blob/master/src/pklib/explode.c is a reference for how StormLib does it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants