ochadenas / cpudefense

A tower defense game for Android based on a microprocessor theme
MIT License
126 stars 9 forks source link

Game crashing when opening "Heroes" menu #112

Closed vincentmacri closed 3 months ago

vincentmacri commented 8 months ago

Recently the game started crashing when I tap "Heroes" before starting a level. I assume the save file somehow got corrupted. I am happy to provide a copy of my save file for debugging, but I don't know where the save file is located.

ochadenas commented 8 months ago

Well, the saved games are in the "shared preferences" directory, and in recent Android versions it has become very difficult to access these files. Actually, I don't know how to get this without a debugger (that's how I do this) or a rooted device.

Is this reproducible, or did it happen only once?

vincentmacri commented 8 months ago

It is reproducible, but I don't know what I did to get the game to this state where it crashes every time I try to open the heroes menu.

I was able to pull the shared preferences for the game, I've attached it. The original file name was prefs.xml.xml, but GitHub doesn't let me upload it with the .xml file extension.

prefs.xml.txt

vincentmacri commented 8 months ago

I should have noted this in my original issue: I can play levels of the game, the level select screen works, and my hero upgrades seem to still be in effect. Everything except the heroes menu seems to be working.

I did encounter another strange (graphical?) glitch at some point, but I cannot reproduce it. It was as if the game wasn't clearing the screen between frames. That glitch happened after this heroes menu bug already started happening, but it only happened once.

ochadenas commented 8 months ago

Thanks for the additional information. I still have no real idea about what causes the crash on the hero screen, but I think it's not related to the save game file. Sometimes the program fails to determine the dimensions of the screen, and Android doesn't like when one tries to draw on zero-sized bitmap; but that is only speculation. If ever you can figure out how to reproduce it, let me know ...

The other glitch you mentioned I have already noticed. If you move the viewport, it'll go away. I have not found this bug yet, but I'll try to solve this.

vincentmacri commented 8 months ago

After clearing the app storage and cache in system settings the game works again. So it seems to be somehow related to some kind of data that the game saves. I'll let you know if I ever manage to reproduce it.

10kids commented 7 months ago

I have the same issue. I suspect it's from collecting an unexpected cryptocoin limit. V1.32

ochadenas commented 7 months ago

At least one bug has been fixed: By mistake, the game calculated a negative number of cryptocoins, which effectively let it crash.

10kids commented 7 months ago

V1.33 does not have the problem.

ochadenas commented 3 months ago

Seems to have been fixed then. I'm closing the issue. Thanks for reporting!