Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

I was just thinking of looking into writing something like this. Is there a way to extract a PNG (or whatever) from a XZip and decode it to a surface (if not I'll still have to look into writing my own version). Basically I want to download an encoded archive with licensed assets and load them into a game - you know, DLC...
I've got as far as downloading assets (un-encrypted) and creating sprites from them but encryption is vital when it comes to keeping to license terms so any assets need decoding - not something I can get GMS2 to do (without writing a PNG extension I guess which seems like re-creating the wheel)

Hi peardox,

Xzip can store any binary formats, including image files, but they would have to be briefly extracted to a temp location and then imported to GameMaker (the temp file could then be deleted).

A more straightforward way would be to use surfaces rather than sprites, then use the xzip_write function to store the image data directly within an archive. The xzip_read function can then fetch the image data without the need for extraction to a temp location first.

Both approaches have their pros and cons, so which is preferable simply depends on the demands of your project.

Temp file storage breaks license terms - particularly as there are undelete utilities.

Surfaces are not a solution here as a 4k x 4k RGBA takes up 67,108,864 bytes and GZ compression won't get that back to PNG sizes (only PNG will do that). 

Guess a decode buffer to surface extension is required...