-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android does an ugly copy of all assets #3465
Comments
I keep these files files.zip on assets, and then simply unpack the archive. I'm using the version comparison through sharedpreferense. Unpacking takes a few seconds and happens only if you delete the destination folder, or a new version of apk. Can I license my code as a LGPLv2 and help you if nrz apologize to me. |
Well this isn't really fixable for following reasons:
@1, feel free to implement it for irrlicht I'm quite sure those guys will accept your patch. Edit1: |
|
Okay, implemented a first prototype with the AAssetManager_* functions: https://github.com/est31/minetest/tree/asset_loader It works: you can connect to singleplayer and network games. But it has one problem: it is very slow. Most likely that's because every single file is decompressed. Now I even wonder whether we should perhaps even keep an asset copy. But still, the way we currently do it is very ugly. We should store the stuff into an app-local folder, and we should use a better algorithm for checking whether something changed. Currently we don't update if the file changed, so that people have to delete the folder, and we do check every file on start, even though it causes an observable overhead. |
I once again an excuse to see my code. He's very fast. Checks only version of the game. If the version apk changed, then it will be Unpacking again. |
est31: I remember some thing about assets on android. For what I remember reading a file from it involves decompressing whole assets till that file is found. Maybe that's why it's so slow to you. |
My next try will be obb :) |
Currently, the Android copies all assets to the storage so that it is "inside" a directory. This however is totally ugly, as now there are two copies of the same files, using up highly constrained memory. Combined with bug #3464, the asset is stored three times on the disk! Also, it creates an overhead when starting the app, because the stuff has to get copied every time. And, it is bad when multiple forks of minetest are installed on the same device: they overwrite each other, and cause conflicts.
This bug is related to #2097.
I see two ways to fix this bug:
One would also have to think something to get it work for development builds, perhaps there we can ship the obb with the apks assets and copy it to the place on startup (I know, irony xD, but this is only for development so no big issue).
android/asset_manager.h
. Very tedious to implement, as for implementing it we have to replace the current direct way of loading stuff with our functions. A short cut would be to use hacks like this.The text was updated successfully, but these errors were encountered: