Closed lefay1982 closed 4 years ago
To clarify, you ask for an export option that would give an .apk without the game data, and a .pck next to it that should be loaded at runtime by the APK, as done for desktop exports? I don't know if that's doable on Android given the limitations of the filesystem and installation process.
What use cases do you have in mind for this? APK Expansion makes it possible to upload large applications to Google Play.
For the record, the PCK file is embedded in the APK (try opening it with an archive manager like 7-zip).
@Calinou I want to pack my script and resource to one file. and can encrypt them. so someone hack to obtain it is very hard.
@lefay1982 you can export the PCK directly using this button
Closing, as exporting to Android already creates a PCK file. It just happens to be embedded inside the APK, so you don't see it on your filesystem directly.
This is a valid use case. We've cloned Godot source and modified the android export to allow godot to run as a view inside of an existing Android app. We compiled the godot .aar module and added it to our Android project and exported the .pck from godot to be consumed by our godot module. However, it is extremely slow to load (16 seconds to load assets), meanwhile an .apk exported directly from godot loads in 0.3 seconds. Why is that? I've decompiled the .apk and didn't see an .pck file inside, instead all of the resources were inside of the assets
folder with project.binary
in there.
Note that we did the same for iOS (changed ios export template, compiled godot into a .a
static library in a way where godot can be loaded as a view inside of an existing ios app and loaded the project .pck file), and it loads almost instantly. So now we are trying to figure out why loading resources from a .pck on Android takes so long.
@Filippopotamus If you need this feature, please open a proposal on the Godot proposals repository as this is where feature proposals are now tracked.
Edit: There are already proposals for this, see @bruvzg's comment.
@Calinou will do. In the meantime, off the top of your head, can you think of any reason why loading from .pck on android is so slow while on ios is basically instant? On android I am manually injecting --main-pack packfile.pck
in the list of commandline args
There are opened proposals for the similar features: https://github.com/godotengine/godot-proposals/issues/946 and https://github.com/godotengine/godot-proposals/issues/947
@Filippopotamus I don't know why exactly. Maybe it's extracting the PCK from the APK every time a file is loaded from the PCK's virtual filesystem? That seems quite unlikely still.
Hi @Filippopotamus, I'm also interested in this use case and why you're seeing slow loading times. Do you mind linking to a pull request or some other diff of what you're trying so that I can try to investigate the performance issue? Thanks!
@thanwah sure thing. I've invited you to a GodotTest
project repo as well as to a clone of Godot where I made some changes (which GodotTest uses)
Hi @Filippopotamus @thanwah, I also ran across the same problem. Would love to know how exactly are you able to run .pck in apk. Do you mind adding me as a contributor to your test project? Thanks!
Godot version: 3.1 stable
OS/device including version: Android, IOS
Issue description: Please add support export Godot Game to Android can with resource pck file, like windows export
godot can export project to pck file format , and can load pck by load_resource_pack(). Can Godot add a feature: export to Android apk with pck file one click?