ikemen-engine / Ikemen-GO

An open-source fighting game engine that supports MUGEN resources.
https://ikemen-engine.github.io
Other
700 stars 124 forks source link

Zipped Characters Support #271

Open Amidweiz opened 3 years ago

Amidweiz commented 3 years ago

I'd noticed that with Ikemen that there isn't support for zipped characters anymore which mugen does have. Since this does save up space on disk by a significant amount if there are large rosters. This could potentially be expanded to support tar.gz, 7z, or RAR formats as well.

Zipped characters are also supported. Place the ZIP file in the chars/ directory. The syntax is as follows: zipname.zip:defname.def, stages/mybg.def For example, if you have newsuave.def in suave.zip, the syntax is: suave.zip:newsuave.def, stages/mybg.def If your def file has the same name as the zip file (eg. suave.def in suave.zip), you can just put the name of the zip file alone: suave.zip, stages/mybg.def

Windblade-GR01 commented 3 years ago

Some thing worries me about implementing this. This would cause a huge overhead on both boot time and resources used to extract the zip if animated portrait are used.

On HDDs the extraction of over 100 zips could be painfully slow depending on the compression used. It could last over 10 min depending on what process are using disk.

Amidweiz commented 3 years ago

That is true, I didn't think about animated portraits as well as said speed of HDD's since I upgraded my laptop with an SSD three years ago. Though when I was doing character collecting on my old HDD with my old laptop with 100+ characters it did take very long to load and that's without the zipped characters.

Windblade-GR01 commented 3 years ago

That said. It could work well on small rosters. So its still useful.

But because of the drawbacks implementing it will have low priority.

TacoDog311 commented 3 years ago

FYI, zipped files can be read in Go without actually extracting the files to the hard drive. This can be done by importing archive/zip and calling zip.OpenReader(zipfile) Here's a quick example which will read a superman.def file from superman.zip. Everything is read in memory without extracting the zip to the drive.

https://pastebin.com/8QQAwWFv