Skip to content

Godot: content and performance

Profiling, loading and freeing resources and nodes, asset import, data and saving, and localization. Renderers, shaders, materials and level of detail are in Rendering and shaders, and frame budgets and save-data versioning are in Game development.

Entries are sorted by score from 1 to 10 (criteria): 9โ€“10 start here or strongly recommended, 6โ€“8 recommended, 1โ€“5 further reading or conditional.

Adopted references

  • 7 General optimization tips (Godot docs): how to measure performance, find the bottleneck and optimise it, including CPU versus GPU bottlenecks.
  • 7 CPU optimization (Godot docs): CPU profilers, caches, the performance trade-offs of each scripting language, threads, the cost of large scene trees, and physics.
  • 6 Exporting packs, patches, and mods (Godot docs): delivering DLC, patches and mods as PCK or ZIP files, and the security risks of loading them.

Key rules

Profiling, loading and memory

  • 7 GODOT-26 Profile on every target platform during development, not only in the editor: run a debug export with Deploy with Remote Debug, and use the debugger's Profiler for script time, the Visual Profiler for CPU and GPU rendering time, and the Monitors for memory and object counts. The Profiler doesn't measure C# scripts, so profile C# code with JetBrains Rider and dotTrace or with Visual Studio. This applies GAMEDEV-12 and GFX-3. (Godot, Debugger panel, The Profiler, Overview of debugging tools: Deploy with Remote Debug, General optimization tips)
  • 7 GODOT-27 Preload only what a script always needs, and load levels and other large or optional content in the background with ResourceLoader.load_threaded_request(), behind a loading screen, because load() blocks the thread until the resource has loaded. Load imported assets only through load() or ResourceLoader, never FileAccess, which reads them in the editor but fails in the exported game. (Godot, Logic preferences: loading vs. preloading, Background loading, Import process)
  • 7 GODOT-28 Free nodes you no longer need with queue_free(): unlike RefCounted objects such as Resources, nodes aren't freed automatically, and remove_child() only takes a node out of the tree. Detaching a node to re-attach it later is fine while you keep a reference to it. Watch the orphan node count in the debugger's Monitors for nodes that leak. (Godot, Object, Node.queue_free, Node.remove_child, CPU optimization: SceneTree, Performance, orphan node count)

Asset import

  • 6 GODOT-29 Import 3D textures as VRAM Compressed with mipmaps, which Detect 3D sets automatically, and 2D textures, especially pixel art, as Lossless; if the project needs other settings, change the defaults project-wide in Project Settings > Import Defaults. VRAM compression usually cuts video memory use by a factor of 4 to 6, but shows noticeable artifacts in 2D. This applies GFX-13. (Godot, Importing images: compress mode, Detect 3D, Import process: changing default import parameters)
  • 6 GODOT-30 Change imported 3D models in the modelling tool where you can, then in the import settings, and make any other change in an inherited scene, because Godot re-imports the whole scene whenever the source file changes. (Godot, Import configuration, scene inheritance)

Data and saving

Localization

  • 7 GODOT-15 Localize with Godot's translation system: add CSV or gettext PO translations under Project Settings > Localization, look up text with tr() and tr_n() or a Control's automatic translation, fill named placeholders with String.format(), and switch languages with TranslationServer.set_locale(). This applies I18N-1, I18N-2 and I18N-3. Turn on pseudolocalization in the advanced Project Settings, under Internationalization, to find untranslated and overflowing text (I18N-14). (Godot, Internationalizing games, Localization using gettext, Pseudolocalization, TranslationServer)

How to enforce

Tools that check the key rules above automatically, in CI, the IDE or a commit hook. "Partly" means the tool covers only some of what the rule asks.

  • 5 GUT, Memory Management: GUT lists the orphan nodes each test leaves behind, and assert_no_new_orphans() fails a test that creates nodes it doesn't free. Partly checks GODOT-28.
  • 5 gdUnit4, Orphan nodes: counts the orphan nodes each test creates and reports them as warnings in the test report. Partly checks GODOT-28.