MEKAI Games Devlog

Optimizing loading times in Godot

A practical Godot performance workflow: measure first, profile CPU and VRAM, reduce startup work, load scenes in the background, cache shared assets, and test exported builds.

ยท MEKAI Games

Boss warning screen from Rock, Paper, Scissors, SHOOT!

Measure the pause before changing code

Record cold startup, warm startup and the transition that feels slow. Test an exported release build on the weakest supported machine. Editor timings include editor overhead and can hide packaging or import problems.

Use Godot's Profiler for script and frame work, the Visual Profiler for rendering, Monitors for node and memory trends, and the Video RAM panel to find the heaviest textures. Optimize the measured bottleneck, not the largest-looking folder.

  • Timestamp each loading phase with Time.get_ticks_msec().
  • Record total nodes and resources after each scene change.
  • Compare the first transition with repeated transitions.
  • Test Windows and macOS exports separately.

Keep the first scene small

The initial scene should contain only what is needed to show a responsive first frame. Do not instantiate every opponent, shop card, animation and audio track before the player can interact.

Load definitions cheaply, then request heavy scenes and media shortly before they are needed. Shared fonts, interface textures and audio buses can remain cached; encounter-specific art can follow the run.

Use ResourceLoader for background work

ResourceLoader.load_threaded_request queues a resource for background loading. Poll load_threaded_get_status to display progress, and call load_threaded_get only after the status reports completion. Calling get too early can still block the main thread.

Queue the next encounter or shop while the current result animation is playing. The loading work then happens during time the design already owns instead of adding a new pause.

A boss encounter with layered hand-drawn art and interface assets
Encounter-specific art can be requested before the transition instead of loading the full cast at startup.

Reduce the resource cost

Import images at the maximum size actually displayed, enable appropriate texture compression and avoid shipping duplicate source exports. Stream long music, but preload short sound effects that must respond instantly.

Reuse packed scenes and shared Resources. Repeated load calls can benefit from Godot's resource cache, while copying the same texture into several paths prevents reuse and increases download size.

  • Use descriptive, stable asset paths to avoid duplicates.
  • Remove unused frames and oversized transparent margins.
  • Separate high-resolution marketing art from runtime art.
  • Verify import settings after moving or replacing files.

Check stutter separately from loading

A fast scene load can still hitch when a material or effect is drawn for the first time. Watch pipeline compilation monitors and reproduce the first appearance of each effect on a clean machine.

Do not move arbitrary engine calls to a Thread. Godot documents which APIs are thread-safe, and creating threads just in time has its own cost. Prefer ResourceLoader for resource loading, then profile again after every change.

Sources and further reading

Play on Steam