Exporting with different game quality (for different devices)

Godot Version

3.5.1

Question

I am developing a game that needs to function on several different devices.
If possibly i would like to increase the asset quality on devices with enough power for it.

The basic idea is to switch out certain scenes in the game depending on build parameters, so as an example on PC a simple background scene with an image would be exchanged with another scene containing a 4k textured background with extra particle effects.

Currently i have attempted a few different approaches and have hit a few snags:

  1. A script that loads the correct scene on _ready() → Loading screens do not work, since the sub-scenes are loaded after the game is shown, leading to a few moments freeze when starting the game.
  2. Pre-loading the correct scenes into a buffer using a custom loader system, and loading empty scenes into cache for the “missing” resources → Very finicky. Works, but requires manually defining/hardcoding which scenes belong to which quality setting in a separate file.
  3. Similar to method “1” but instead of actually loading the scenes the script only used to store the paths to the different quality version of the scenes. A separate script is then run before export to modify the scene files directly → Error-prone, and troublesome to test.

So my question is, if anyone has a good idea how to solve this. Preferably a way that works in Godot 3, however a Godot 4 specific solution would also be fine.

Do you mean at runtime or when exporting the project?

If it’s when exporting a project you can use feature tags to decide which assets to load. You can fine-tune which scenes/resources/assets to export or you could write a EditorExportPlugin to have more control over it.

1 Like

I do indeed mean when exporting the project.

I think you are correct that an EditorExportPlugin might be used to achieve the desired behavior.
Maybe a combination of add_file and skip could be used to remap the wanted scenes onto the paths of the dependency.

Do you know if EditorExportPlugins is usable when exporting a project through the command line? (Godot headless server build)

I’ve not tested it but I think it should work