Skip to content
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

Please add support export Godot Game to Android can with resource pck file. #27224

Closed
lefay1982 opened this issue Mar 19, 2019 · 13 comments
Closed

Comments

@lefay1982
Copy link

lefay1982 commented Mar 19, 2019

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

myGame.exe
myGame.pck

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?

@akien-mga
Copy link
Member

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.

@Calinou
Copy link
Member

Calinou commented Apr 3, 2019

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).

@lefay1982
Copy link
Author

@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.

@sprite-1
Copy link

@lefay1982 you can export the PCK directly using this button

image

@Calinou
Copy link
Member

Calinou commented Apr 8, 2020

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.

@Filippopotamus
Copy link

Filippopotamus commented Jun 9, 2020

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.

@Calinou

This comment has been minimized.

@Filippopotamus
Copy link

Filippopotamus commented Jun 9, 2020

@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

@bruvzg
Copy link
Member

bruvzg commented Jun 9, 2020

There are opened proposals for the similar features: godotengine/godot-proposals#946 and godotengine/godot-proposals#947

@Calinou
Copy link
Member

Calinou commented Jun 9, 2020

@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.

@thanwah
Copy link

thanwah commented Jun 10, 2020

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!

@Filippopotamus
Copy link

@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)

@divshekhar
Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants