Journal

Godot 4 Migration: Getting Started

Posted by:

Godot 4 Migration: Getting Started

This post is the first in a series that covers our migration from Godot 3 to Godot 4.

If you’ve been following Patreon closely, you’ve probably seen our post on converting the Last Dream Fishing Arcade from Godot 3 to Godot 4. Inspired by our success, we decided to convert Last Dream 2 (in its entirety) to Godot 4 as well. This is an ongoing project, and is much bigger than it may at first appear.

Let’s start with the basics. It’s become something of a meme to say “just change your game engine”, so at this point most people are aware that such migrations are a huge undertaking. Godot provides a tool to upgrade projects from 3 to 4, but there’s still a massive amount of work to do after the fact, as they cover here:

https://docs.godotengine.org/en/stable/tutorials/migrating/upgrading_to_godot_4.html

In the end, we decided that Last Dream 2 would benefit from the upgraded performance of Godot 4, as well as its focus on more modern graphics platforms. So that’s the “why”. Let’s now start to cover the “how”. All screenshots shown from here on in are taken from Godot 4, after running the “upgrade” tool on Last Dream 2.

Looks like even the title screen is broken. In addition to the weird “double” menus, the window is the wrong size (although it’s hard to tell from this screenshot). The menus were fixed by manually re-importing the “9-patch” style menu background. The window size was caused by a bug in the import tool that fails to carry over the window scaling option due to Godot changing what that option is called. Both were easy to fix.

The Game Options menu (shown above) was also broken, and at first glance this looks like a complete non-starter. Basically, there are a few things that affect all “menu” scenes in our game:

● As mentioned earlier, the 9 Patch menu backgrounds failed to import properly.

● You can no longer save font-specific data at a high level –each control needs things like Font Size specified manually. (Fonts also look slightly different in Godot 4 even with the same settings that they had in 3.)

● There are some layout options that no longer exist. (There was a way to “nudge” labels a few pixels in any direction; that’s gone now.)

Due to the nature of these problems, we decided to manually fix all menus by hand. This can take a few hours per menu, but it ensures that we don’t miss anything. Here’s a screenshot after fixing 80% of the issues in this menu:

Ok, that wasn’t so bad. Let’s look at a Location Map:

Oh dear. This is not going to be easy, is it?