Skip to content

Conversation

ItsLJcool
Copy link
Contributor

@ItsLJcool ItsLJcool commented Sep 4, 2025

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

@ItsLJcool
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
@ItsLJcool
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

@ItsLJcool
Copy link
Contributor Author

stupid fuckin hxvlc and VideoCutscene implementation

@ItsLJcool
Copy link
Contributor Author

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

@ItsLJcool
Copy link
Contributor Author

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

@ItsLJcool
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?

@ItsLJcool
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.
@ItsLJcool
Copy link
Contributor Author

Alr makred as ready now !!

unless I find another bug again lmao

@ItsLJcool
Copy link
Contributor Author

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

@ItsLJcool
Copy link
Contributor Author

from my quick testing it seems like it works

@ItsLJcool
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.

@NexIsDumb
Copy link
Member

is this 100% done?

@ItsLJcool
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
Copy link
Contributor Author

Since I guess im stupid and can't realize it LMAO uh, basically the .cnemod isn't a real thing anyomre. Instead if you have a compressed library named cnemod.zip or a is in the ALLOWED_ZIP_EXTENSIONS then it will load that instead of the folder.

Solves a BUNCH of issues I was having, and will actually not fucking die on other OS's LMAO

Now everything is done and fix, that was the last lose end.

@ItsLJcool ItsLJcool marked this pull request as draft September 15, 2025 12:46
@ItsLJcool
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!!!"

@ItsLJcool
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
@NexIsDumb
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?

@NexIsDumb
Copy link
Member

nvm, you're still saving the video

@ItsLJcool
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 :)

@ItsLJcool
Copy link
Contributor Author

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

@Raltyro
Copy link
Contributor

Raltyro commented Oct 4, 2025

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

@ItsLJcool
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.

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

Labels

status:accepted This has been solved successfully

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants