Android Export doesn't load many resources, game behaves completely differently

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By psear

I’ve made a game and tried exporting it, I imagine what I’ve encountered has been asked before but I’m lost. Everything is completely off, themes are messed up (making me think the tres files aren’t loading, even though I can see them under assets in the apk file), the ui is massively shrunk, nothing loads correctly and more or less everything in the game is broken. What could have gone wrong, and what are the steps to solving this?

:bust_in_silhouette: Reply From: psear

Just in case anyone finds this, I’ve solved it myself. In my game, a huge part of the setup involves reading a config file, which I initially had in res://. This file at times needs to be written to, and for files that need to be stored persistently we should use the path user://. That solved a huge amount of the issues.

Hi!
How do I make the path user: //.?
Could you make a video about it?

rafax3x | 2020-07-01 16:02

Sorry about the late reply. I can’t really make a video about it, but here is a short explanation:

var conf = ConfigFile.new()
conf.save("user://config.cfg")

It really is just changing the path. You don’t have to setup the path yourself, godot will save the data in a user folder (which is in a different place depending on operating system). The reason to do this is res:// will install in a read-only location when you export it, so to get around config files that need writing to, you put them in user://. You won’t see it in the res:// folder. Where the user:// path is located depends on the operating system, information here: Data paths — Godot Engine (3.0) documentation in English

psear | 2020-07-03 19:39