Solving some problems before publishing

I almost finished my first game. This is my first experience in programming and creating games. So I have questions that I would like to clarify before posting.

  1. Before the addition of the Admob extension, the game weighed 2 mb, but after the addition it began to weigh 9 mb. Is this normal or did I do something wrong?
  2. When building in apk, when I select arm7 and arm64 at the same time, the apk file starts to weigh 18 mb. Why it happens?
  3. Sometimes when testing a game on the phone, the game just closes. How can I understand why this is happening?
  4. The hash weight in the phone is 1.8 mb. What did I do wrong, that’s so much. Other games usually have less than 1 MB.
  5. I use “DefSave” to save the game. The game is only saved when I press exit. I made a save in the main script in the final function. (defsave.save_all()). But if you close the game through the home button on the phone, and then close the open applications, then the game does not save progress. How to implement save when closing the game without the exit button?

Not sure, but probably what can be expected from an ad network solutions as they are usually quite complex and large. In the case of Admob it depends on Google Play Services Ads:

Google Play Services is a pretty big library with a lot of stuff in it, but it’s possible to reduce the size somewhat by using a tool called ProGuard. ProGuard can strip out the unused things from a library. I now see that we don’t really have any documentation for ProGuard in Defold. You should be able to add the ProGuard file from builtins to your android.proguard_config setting in game.project. This ProGuard file will be used together with the ones provided from your dependencies.

The APK will include one engine for 32-bit CPUs and one for 64-bit CPUs. But given the size I take it this is a debug build and not a release build?

BUT more importantly you should use an AAB file when you upload to Google Play. The AAB file will include both versions of the engine, but the end-user will install an APK containing only the engine version matching the CPU of their device.

You need to read device logs: Debugging - game and system logs

What do you mean by “hash weight”?

You should be able to react to the FOCUS_LOST event and save when it happens. But you really shouldn’t depend on these kinds of system events to save your game. What if you save at repeated intervals or when important things happen in your game?

2 Likes

Here is my game has a cache weight of 1.9 mb, and another game has 8 kb and 816 kb.

I think Admob will download ads and metadata which will be stored in the cache.

I understood everything, thank you very much for your help.

1 Like