You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for writing the specifications.
I'm playing with a personal project of mine: it's a Sim City 2000 file editor (demo: https://sc2k-save-editor.pages.dev/).
My goal is to be able to open, edit and save any sc2 file but I'm struggling at the saving part. It seems the compression algorithm doesn't compress some parts. Details are below:
Summary
Something missing in the compression algorithm.
Tested on FLARANCE.sc2 MISC chunk, appearing in June property tax
Details
I’m trying to uncompress and compress data for FLARANCE city, especially the MISC chunk.
I wrote a unit test to compress the uncompressed data and assert the result should be identical, but it’s failing.
So I took another close look at this, and it maybe appears that there seems to be cases where single bytes may not be compressed. Compressing them does not appear to matter to the game though, as it'll happily decompress them.
I'll try to see if I can figure out what exactly is going on, and how the algorithm signals this.
Hi there,
Thanks for writing the specifications.
I'm playing with a personal project of mine: it's a Sim City 2000 file editor (demo: https://sc2k-save-editor.pages.dev/).
My goal is to be able to open, edit and save any sc2 file but I'm struggling at the saving part. It seems the compression algorithm doesn't compress some parts. Details are below:
Summary
Details
I’m trying to uncompress and compress data for FLARANCE city, especially the MISC chunk.
I wrote a unit test to compress the uncompressed data and assert the result should be identical, but it’s failing.
Tests results details
I only investigated the first case and I could find the following:
[1, 234 ,234]
[1, 1, 129, 134]
[3, 1, 234, 234]
.Which doesn’t match the specifications (and the consequent algorithm):
[1, 234 ,234]
is a series of 2 tuples:[1]
which would be compressed as[1, 1]
(1 + n byte version)[234, 234]
which would be compressed as[129, 234]
(2 byte version)Any help would be appreciated, thanks!
The text was updated successfully, but these errors were encountered: