SamuKata
vrengames
vrengames

patreon


A Few Frustrating Days

It's not often that I spend days working on a problem and come away without something interesting to show off, but that's exactly what's happening today. At the very least I can share my experiences and what I've been trying recently.

 A few days ago I committed to fixing a problem that had cropped up for the Android version of Lab Rats 2. The problem was that the build process to produce the .apk file consistently failed. After some testing I narrowed the cause down to the number of files in the game passing a 2^16 threshold and I was able to build a version with a reduced number of face images. This obviously isn't a great long term solution.

After some more digging and testing I've found the crux of the problem: Android .apk files are fundamentally just organised .zip files (You can check this for yourself: rename any .apk file to a .zip and you should be able to open it!). The .zip format Android implements only supports up to 65,536 individual files, which was causing it to fail while building. This explains why the problem was linked to file count, but was not resolved by changing the file structure of LR2.

The simplest solution would be to split all of the LR2 images into separate archive files, but Ren'py doesn't actually produce archive files for it's android builds because it assumes the files are already going to be compressed when the .apk is produced. My most promising solution right now is to produce all of the image archives for the PC version, then build the android version and include those directly. If that doesn't work I may have to include all of the images in .zip files and unzip them the first time LR2 is run. This would increase the initial start time of LR2 (but only on the first run), increase the amount of device space it would need, and would still require some extra work to avoid hitting other limitations of the android file system.

Right now I think I'm going to take a break from the android problem for a few days and let my brain reset. I need to write some new events for v0.31 and the release date is quickly approaching! At worst the Android version for v0.31 will include a smaller suite of faces than the PC version for the near future.

Comments

so like a sprite sheet then

Sirlanceabit

If there are too many files, just group similar images into a single image file, and then load the big image, crop/copy what you need and display it. It may also increase the game's loading speed on non solid state storage devices. Spinning disk hard drives hate loading lots of small files. It may be hard to implement, and there are memory considerations also, but it may be a solution.

Horsie

I think you're right, you need to take a little respite from this problem and focus on another important issue.

VitAnyaNaked

Part of the*

Yellowcake Uranium

I wonder if you could unzip as part off he install instead of part of the first run?

Yellowcake Uranium

I don't play on ANdroid, but I do know that plenty of apps out there do a download from the web to bypass this limit. I didn't realize that this was why though until you went into the details!

AlistairChiss


More Creators