thewierdnut / endless-mobile

Space exploration, trading, and combat game.
https://endless-sky.github.io/
GNU General Public License v3.0
93 stars 7 forks source link

unable to import large plugins #35

Closed thewierdnut closed 1 year ago

thewierdnut commented 1 year ago

Is there an existing issue for this?

Describe the bug

app crashes when loading a large plugin

Steps to Reproduce

Try to import a large plugin, such as the large freight plugin. The app crashes.

Expected Behavior

successful import

Screenshots

No response

Link to save file

No response

Device type

na

Game Version

latest master

Additional Information

The O/S is killing the app because it runs out of memory. This will probably vary from device to device. This is probably occurring because the java code and the c++ code copy the file contents into memory before processing it. The api needs to be modified to stream the file over instead of passing it all at once.

Pseudomyrmex commented 1 year ago

I still have this problem even with the newest version. Everything above roughly 60MB crashes the game. For example Galactic War (137MB) or "A galaxy far far away" (687MB).

thewierdnut commented 1 year ago

Can you link those two plugins?

Pseudomyrmex commented 1 year ago

Sure, no problem

https://github.com/1010todd/Galactic-War

https://www.moddb.com/mods/endless-sky-a-galaxy-far-far-away/news/the-consistency-update-v04-alpha

thewierdnut commented 1 year ago

Is this crashing the game on startup, or when it is loading the plugin?

Also, what is the exact version of the game you have installed?

Pseudomyrmex commented 1 year ago

It crashes as soon as I select the zip file which contains the mod. I made sure the data is freshly packed and has no more subfolders then necessary.

I am currently using version 0.9.16.1-30 of the apk, running on Android 12, SD 888+

thewierdnut commented 1 year ago

By "crash", do you mean "The game exits", or "there is a black screen, and the game doesn't come back"

Pseudomyrmex commented 1 year ago

The game exits right back to the homescreen.

thewierdnut commented 1 year ago

My device was able to unzip both the "Galactic-War" and "A galaxy far far away" plugins successfully. However, each of these plugins has (separate) issues.

The "Galactic-War" plugin that I downloaded from its github release page does not have a nested folder within its zip file, and instead contains all the plugin folders in its root directory. The plugin loader does not expect that. My device unzipped the plugin, but after a restart, the plugin was still not visible. Once I modified the plugin zip, it loaded and played correctly. I have created bug #41 to address this.

The "A galaxy far far away" plugin unzipped properly, although the app showed a black screen for several minutes while it was unzipping. Once I restarted though, the game was unable to load, even in Reduced Graphics mode. The problem here is that the plugin is simply too big. Once all the graphics are uncompressed and loaded, it is an additional 3.3 gig of data on top of the 2 gig the base game already requires. At this point, my 6 gig device was unable to finish loading the game before the operating system shut it down for using too much memory. I have created request #40 to address this.

At this point, I am unable to reproduce the described symptom of the game exiting after selecting the plugin. The next step would be to get an adb log dump if you know how to retrieve it.

Also, how much ram does your device have?

Pseudomyrmex commented 1 year ago

I feared it would be device specific.

Also I nested the galactic war plugin to the required form, but still no luck. Maybe the RAM management of my device is too aggressive although I can't find a way to change that.

My device has 16 GB of RAM and over 250GB of free storage.

I will try to create an adb log as soon as possible, I got all tools installed but never tried this specific task.

thewierdnut commented 1 year ago

hm... presumably you should be able to load them, but lets fix the crashing issue first.

Pseudomyrmex commented 1 year ago

The newest debug version of the app is able to load both mods with no problem other then a short black screen. Now I just have to figure out why this version is so horribly pixelated...

thewierdnut commented 1 year ago

Do you have "Reduced graphics" turned on under Preferences->Settings->Performance?

It is supposed to turn on automatically when it detects less than 4 gig of ram, but maybe its broken (or the operating system is lying to it)

Pseudomyrmex commented 1 year ago

Ah, yes that's it. Sorry for that.

I will still create a log dump so we know what the problem was.

thewierdnut commented 1 year ago

Actually, don't bother. Release 30 doesn't have the large zipfile fix, so you definitely would have run into that.

Pseudomyrmex commented 1 year ago

Ok, I figured because the bug was closed it is already integrated in the new release. Sorry for the trouble and thanks for the help. But at least I learned how to create log files for the next time I run into bugs. :)

thewierdnut commented 1 year ago

On a mostly unrelated note, I just pushed a new build that should fix the defaulted Reduced graphics mode as well.