Ready Fire Aim

As I’ve announced in the Discord server, I will start writing updates on the weekends as part of my “package” of efficiency improvements for Galantrix. At the same time, I won’t write a weekly update on the weeks I send the email to the mailing list; I’ll be instead consolidating the weekly reports with the monthly emails. I’m not getting tired of updates. I’m just trying to better manage my time and energy levels so I can spend energy developing the game itself.

Speaking of energy levels, this was a high energy, high productivity week - even though I actually never exceeded 7 hours/day in front of the computer. Extensive research on work and productivity shows that an excessive number of hours eventually leads to extremely low productivity, the so-called “negative productivity”. I think this is what happened 2-3 weeks ago when I struggled mightily with my writing tasks. I was simply too tired.

With better time management and increased focus on leisure, I was able to get more done! I plan to release the first playtest build next week, but I could actually release it today. The tutorial (essentially the only content available in this playtest) is ready for testing, and I also took the opportunity to completely rewrite the UI scaling code so I can create pretty UIs in the future. I’ll use my remaining time to add P2 features to the playtest build, so people have a better experience.

You might be asking yourself, “Why did he need to rewrite the UI scaling code”? Put simply, I didn’t know what I was doing when I started coding it several weeks ago. So I adopted, like in most of my early development, the “Ready, Fire, Aim!” philosophy in order to make progress!

To make things worse, UI development is one of Godot’s soft spots; it’s production-ready, but it’s a royal pain in the ass to work with its UI toolkit. Small things can be a grind to implement as you work through its Object-oriented, node-based CSS-like approach. It takes a while to get a good grasp of how to use it properly, and, in my opinion, it is missing key features offered by a UI language such as CSS. You can create fairly complex UIs with it (Godot itself is a Godot game made with its UI toolkit), but everything is a lot more work than you’d expect.

This said, I was able to use it to get my simple scenarios implemented a few weeks ago. However, the game UI suffered from the same problems Web Developers deal with daily: the UI works on a certain aspect ratio and resolutions but can look odd in others. Fixing these little problems was time-consuming and tedious. Was there a better way?

The answer is yes. The Godot documentation can be spartan at times, and on a second read of the UI docs, I got the impression that they don’t want you to use the full toolkit like I was using unless you’re creating an application rather than a game. Instead, they prefer the time-honored approach of designing the UI for a single resolution and then using linear scaling so the UI can expand/shrink like a texture. Most 2D games do this for the game graphics, but I never thought they would want me to use it for the UI after creating such a rich and complex toolkit.

Scaling the UI is generally okay because nobody cares if the UI text is slightly blurry around the edges. But I won’t just render the entire game to a fixed resolution and scale all graphics, game, and UI this way; a lot of text-heavy games do that, and in my opinion, it looks terrible because the slightly blurry text is hard to read at regular font sizes. You see many visual novels doing it, but I consider it an unacceptable technical solution for Galantrix games.

My solution was to use linear scaling solely for the UI while the rest of the game renders at the screen’s native resolution. It works perfectly for the UI because I use somewhat large fonts there. It took me just a day to rework all the UI using this approach! The menus are still ugly because they are unstyled (in other words, using Godot’s awful-looking default theme). But I set myself up for future success: 1) Menus are now much easier to develop because they are created against a single resolution, 2) They are much easier to style later, and 3) No more unexpected issues in odd resolutions and aspect ratios. A true win-win if I’ve ever seen one.