Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

Fixed / Refactored SysZip to actually work, and store compressed entries without uncompressing an entire zip#761

Open
ItsLJcool wants to merge 29 commits intoCodenameCrew:main from
ItsLJcool:fixing-zip-mods
Open

Fixed / Refactored SysZip to actually work, and store compressed entries without uncompressing an entire zip #761
ItsLJcool wants to merge 29 commits intoCodenameCrew:main from
ItsLJcool:fixing-zip-mods

Conversation

@ItsLJcool
Copy link
Contributor

@ItsLJcool ItsLJcool commented Sep 4, 2025
edited
Loading

Refactored SysZip so that now it properly reads each Entry and saves only required information to unzip any Entry in the zip.
It no longer extends Reader since it's a custom implementation of unzipping by yours truely.

This commit also added a CoolUtil function for using the haxe.Timer.stamp() function to quickly see how long it takes for code to run.
Calling it once will start the timer, and call it again to finish the debug output. It also does fancy tracing. 👀

Edit:
This also adds a "cnemod" folder, this is how it can be loaded:
./mods/ModFolder/cnemod.zip or instead of .zip it can be a valid extension in ALLOWED_ZIP_EXTENSIONS

Copy link
Contributor Author

There is an issue with streamed audio it seems like

@FuroYT FuroYT added the status:accepted This has been solved successfully label Sep 4, 2025
Copy link
Contributor Author

Seems the streamed audio bug was fixed, though now I found an issue with videos not loading properly so debugging that

Copy link
Contributor Author

stupid fuckin hxvlc and VideoCutscene implementation

Copy link
Contributor Author

there is still an issue with how videos are loaded so need to find a way to fix it...

Copy link
Contributor Author

just fixed it by implementing what VideoCutscene did because it actually works amazing lmao

Copy link
Contributor Author

After some testing it seems all the issues have been fixed.

The only issue that can occur is if the Mod owner doesn't change their Flags.VIDEO_EXT when trying to load other video extensions, causing it to not be detected in ZipFolderLibrary but easy to figure out probably?

Copy link
Contributor Author

ok adding a feature in rq that pre-caches each video in the mod because unzipping loading time takes a hot sec, and videos easily get desynced

...Library.
Since videos have to be decompressed and be saved as a file anyways this reduces the time to do that, and what not.
Copy link
Contributor Author

Alr makred as ready now !!

unless I find another bug again lmao

Copy link
Contributor Author

ughghghghghghhhhhh unready now, someone test zip mods with addons, and the new Flag I added to support custom zip extensions

Copy link
Contributor Author

from my quick testing it seems like it works

Copy link
Contributor Author

Ok this branch is ready to merge. The Streamed Audio bug just seems to be a mod specific issue, and happens rarely often on that mod.

Copy link
Member

is this 100% done?

Copy link
Contributor Author

is this 100% done?

Doing final checks and it made me realize a flaw in how I wanted to load the .cnemod but fixing it right now

@ItsLJcool ItsLJcool marked this pull request as draft September 15, 2025 12:46
Copy link
Contributor Author

ughhh need to fix literally every function that generates a script and search libraries to check instead of relying on openFL's Assets exists function

because compressed Libraries aren't folders, and are encrypted. So Assets.exists goes "huh not a folder, not valid!!!"

Copy link
Contributor Author

NVM I was loading the mod wrong LMAO

@ItsLJcool ItsLJcool marked this pull request as ready for review September 15, 2025 13:03
Copy link
Member

im just curious but if not even videos wont be uncompressed, i dont think the .temp folder would be needed anymore maybe?

Copy link
Member

nvm, you're still saving the video

Copy link
Contributor Author

im just curious but if not even videos wont be uncompressed, i dont think the .temp folder would be needed anymore maybe?

Well no because of like Haxe limitation and just to be safe, we are extracting videos into .temp so it can decode the MP4 directly instead of unziping the video everytime we want to play it, which

  1. Increases Lag
  2. More time to decode
  3. Storing the entire video in RAM

So it's just more Haxe friendly :)

Copy link
Contributor Author

I will keep merging the branches cuz I am currently using this fork for a mod rn LMAO

Copy link
Member

Raltyro commented Oct 4, 2025
edited
Loading

I was about to merge this since zips are basically fucked in cne but does videos works at all

Copy link
Contributor Author

I was about to merge this since zips are basically fucked in cne but does videos works at all

Yes this was a major issue I had to find an issue to fix lmao.

There was a class that depended on like the asset path returning [ZIP] and the path directly after, but with this commit that was removed and actually plays video cutscenes properly without having to check if the path contains a string, and will just use the method for getting the bytes directly from the ZipFolderLibrary, meaning it will check .temp/ for the video, and also has saftey checks to remove any video files with the same name but not in the same folder.

It also precaches all the videos in your .temp/ folder automatically but there really isn't a way to toggle it off yet, but there is code that supports it.

ZipFolderLibrary will only load videos based off of your Flags.VIDEO_EXT so if you don't change it in your mod / ini it won't properly load the video, but this only affects mods that don't care to think about the Flags class at all, when they really should and not fuck with things that might brick their mod.

You can read this on why it was done this way

Everything is really good to go, im still updating the repo and testing the Zip folder shit on a Pillar Funkin' dev mod build, but I also occasinally test zipping other mods to ensure nothing goes wrong.

Copy link
Contributor Author

ts never being merged
lj sadge

Copy link
Contributor Author

Been testing with new mods, Bergabash, Dustin', SAU (from Zoro) works fine, there is a slight issue though??

MultiFramesCollection or something along the lines gave an error, then crashed when playing some Dustin' songs when I switched mods..? I think it might actually be a Dustin' issue cuz it doesn't occur in the normal build itself, though not too sure.

Copy link
Member

Raltyro commented Nov 16, 2025

MultiFramesCollection crashes happens in normal cne too though only when switching mods, also sorry lj for not responding

Copy link
Contributor

MRK2009 commented Nov 26, 2025

IT GOT CONFLICTED, BRUH!!!

Copy link
Contributor Author

So I think this is Merge worthy now, the only issues with this PR is the ones we can't solve without having dedicated workflows for Compressed Libraries.

Issues:

  1. Accessing items in a directory in the Zip file requires you to decompress the folder and get the contents of the folder (each item inside is compressed)
  2. Creating new files is impossible with Compressed Libraries inside the mod, so things like Autosaving, creating new files, modifying files, etc. cannot occur in Compressed Libraries.
  3. Loading the Compressed Library for the first time takes ~1s per 1GiB (non-conclusive)
  4. Anything related to FileSystem, File, etc won't work inside Compressed Libraries.

So we should advise mods that want to use Compressed Libraries to either account for these issues, or just don't use it.
This will be useful for addons, or big mods that would benefit from being compressed.

I tested out some mods but the results aren't really helpful, besides it verifying it properly decompresses files and doesn't bloat ram.

Since most mods didn't consider it being in a read-only state it's hard to gauge what is breaking and what is expected to be broken.

Copy link
Contributor Author

Also it will take longer if the mod has a lot of videos to decompress, it will auto-decompress every video in the ./videos/ folder because it takes longer to decompress in runtime

Copy link
Contributor

MRK2009 commented Feb 9, 2026

Okay now it's not conflicted, phew.

@FuroYT FuroYT added the status:planned This is planned to happen label Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

status:accepted This has been solved successfully status:planned This is planned to happen

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /