Fighting the first-launch wait
TECH
Oct 6–9Sometime in this period
TECH
I now pre-bake the shapes of the sea, the harbour and the shop and ship them with the game. Opening the harbour went from 4.0 seconds to 0.08 seconds, and the 1.15-second hitch when entering the shop is gone.
Launching behind the logo (Mac version): a small launcher app plays the logo video first while Godot starts up behind it. The game window stays transparent until it’s ready. The first launch shows a long 23-second logo; after that, a short 6.3-second one.
I also tried playing the logo inside Godot while building things in the background, but the building all ran together in the very next frame (about 190 items at roughly 70 ms each) and couldn’t be split up. So I settled on a separate app, outside the game, that plays the video.
Oct 7
TECH
Shader pre-baking: rendering is now baked when the game is exported, cutting about 18 seconds off the first launch (Oct 7). An export that hasn’t been baked counts as a failure.
Oct 9
TECH
Install an exported build and launch it for the first time, and it takes about 21 seconds to become playable (Oct 9, measured on a Mac mini). Profiling showed that about 13.6 seconds of that is “the first frame that draws the diving scene”. That’s where all the building of the water, light and fish rendering (shaders) piles up.
From the second launch on, it’s ready about 1.5 seconds after starting (Oct 9, measured on the same Mac mini).
Oct 10
TECH
I measured again with the exported demo on a MacBook (Apple M2), and the first launch took about 47 seconds to get ready (Oct 10). The “about 21 seconds” from Oct 9 turned out to be a Mac mini (Apple M6) number only. The third and fourth launches took about 7 seconds.
Worse, on that first launch the logo video ended before the game was ready, so it looked frozen on the last frame. The launcher waits for both the end of the video and the game being ready before switching to the game window.
Oct 11
TECH
The first launch now starts in fullscreen instead of a window (Oct 11). On Retina displays like the MacBook’s, the window shrank to half size when switching from the logo to the game. Until then, all Mac testing had been on a Mac mini without a Retina display, so nobody had seen this bug. I fixed the mistake in how the window size was matched, and confirmed on the MacBook (M2) that in both fullscreen and windowed mode the game takes over in the same place and at the same size as the logo.