Diary #18 – A Comedy of Quirks and Errors

This diary entry is going to be a bit of an odd one – partly a rant, and partly just a retelling of an “adventure”. It’ll go into some technical details that most people probably don’t care too much about, but it’s one of those things I have to get off my chest.

So I had two main goals on Friday: get the Mac build properly signed and built, and then announce the release of 0.4.03. For any of you who have played on Mac before (or tried to, in the case of 0.4.1 – sorry!), you will have noticed that your computer wasn’t so happy about being asked to run unknown software. There’s a setting in system preferences to allow it that’s a bit hidden, and it’s enough of a hurdle that I’m sure it’s deterred some prospective players/testers.

You can get around this by signing and notarizing the app: basically, you shell out $99 USD for an Apple developer account, set up a certificate for signing the app, and submit it to an online system to scan it for any issues and approve it. Once you actually figure it out, I think it’s actually a pretty good system. The figuring out part is a roller coaster though. Like just about everything Apple, it’s designed to work really smoothly within its own ecosystem. If you’re just using xcode and uploading to the app store, I’m sure it’s pretty intuitive.

Instead, the build process consisted of exporting from Godot, getting a vague error message, putting it into a search engine that’s been getting less useful over the last few years, trying a fix, and repeating. In order, the fixes that worked (i.e. moved down the line and triggered a different error):
1. In the “name” field I just copy and paste the whole display name of the cert? Seems odd, but ok.
2. Downloading a separate “intermediate certificate” from Apple itself to make the first cert work.
3. Making a separate app-specific password to use my Apple ID for notarization.
4. Finding out I needed to make a different kind of certificate for notarization to work.
5. That cert needed a different intermediate cert from Apple.
(Keep in mind there were plenty of failed attempts mixed in as well, it was so much fun.)

So that finally worked, time to give it a quick test to make sure everything looks good… Wait, why is this button not doing anything? Somehow in the process of moving everything over from the Windows desktop to the MacBook with git, a couple of links between buttons and their targets disappeared, odd… Out of curiosity, I checked the 0.4.01 build… Shit. Turns out I distributed a broken Mac build, the game would load and then just not spawn trains. The last working build was 0.3.00 back in the end of March. Apologies to anyone that tried to play and give feedback, only to find nothing would happen.

Once I fixed the button issue, the non-spawning train big came up again, and it was just the most bizarre thing. Everything worked fine in the editor (which is where I was verifying things before exporting the build), but once I exported it the trains stopped spawning. Thankfully I could make a debug build that output the logs to the terminal, but the error message didn’t make sense – the train it was instantiating was a null reference? The train scene was specified in the TrainDispatcher node, it should have been right there!

As I slowly went mad trying to figure out why resources wouldn’t get exported to the final build, I also realized that MacOS builds are supported on Windows – I think it’s just iOS that isn’t supported. I had been building for Mac on my MacBook since I had to test there anyway, and might end up doing iOS if there’s enough demand, but I figured why not try building on Windows? Turns out, ignoring the code signing and notarization, it actually works. So I get to upload something at the end I guess, even if I didn’t fix the app getting blocked on Mac.

I was switching back and forth between computers (thanks ADHD!), and finally discovered the problem on Mac – a totally unrelated error with the load and save windows. When you setup the file dialog, you can pick a subdirectory – so I picked the “saves” directory. The issue is that Godot complains if the directory doesn’t exist (which it wouldn’t until you make your first save), and that “complaint” send to block the project from building. Crucially though, it doesn’t actually tell you that, and the export is perfectly happy to just use the older stale built components. That’s why the game seemingly ran, but couldn’t find the trains it was supposed to spawn. Once I got rid of the subdirectory, nearly everything worked.

There was one bug left now: the road tiles wouldn’t connect. It was another export-specific issue too, it worked just fine in the editor, but all of a sudden in the exported build the road code couldn’t find the node with the sprite to change. At this point though, I decided I’d rather publish an unnotarized working build than a buggy notarized build. So the work in the morning was in vain, at least partially. Yay.

Anyway, that write up went longer than expected. TL;DR: Tried to make the scary warnings go away on Mac, discovered that the game has been broken for a couple weeks, mostly sorted out now.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *