Progress Report on GearHead Caramel, or How I Spent My Summer Vacation (in the Hospital)

Pyrrho of Ellis probably had more broken bones than any other Greek philosopher.

At the beginning of June I had a tragic yet Clouseauesque walking accident which led to a double compound fracture of the right arm. Thanks to this, I got to spend summer in an air conditioned hospital room and everybody brought me snacks. I watched a lot of cartoons. I got some cool new scars. Technically I’m now a cyborg; next year I’ll have surgery again to remove the metal plates holding my forearm together.

Anyhow, I’ve also been refactoring GearHead Caramel to replace all the blocking loops in various parts of the program to a single unblocking loop plus a stack-based widgets UI. As you might expect ripping every loop out of the game and replacing it with a subtly different loop is a time consuming endeavor. However, I think it will be worth it. The new system is simpler, runs smoother, and opens up new possibilities. The next couple of releases are probably going to be marked as debug releases because I’m certain that there are going to be subtle bugs that I missed while testing stuff by myself. Until I’m fairly certain that things are stable, these will be released as a public beta branch on Steam and a separate download on Itch.

Side note: on the same day I broke my ulna and radius, the Samsung service center discovered that the motherboard on my laptop was cracked. It really wasn’t a good day. I am typing this blog post on a Raspberry Pi 5, which is a surprisingly capable desktop computer. It’s also a good machine to test whether or not my changes improve GHC’s performance. So far the results look promising.

One area where I expect subtle bugs is in cutscenes. If you’ve played the game you might be asking “what cutscenes?!”, but bear with me. With the previous blocking game loop, a text alert or an NPC monologue would start instantly and block execution until it was finished. This enabled a sequence of text/monologues/animation with code doing stuff in between. With the new unblocking game loop, text alerts and NPC monologues are instead scheduled in an alert queue and will happen when they happen. Code that previously would have run after the text/monologue/whatever will now appear to run before the text/monologue/whatever.

For instance, if a lancemate announces “I’m quitting the team!” (a monologue alert) and then disappears from the map (an instantaneous action), if I don’t rearrange the code then the NPC will disappear from the map milliseconds before they announce their intention to leave. Which might not be a big deal in this case but could cause big problems in other cases. Maybe. The new alerts have callback functions so I can attach code to exact moments in the sequence of events. The trouble will be making sure I’ve located all the places I need to do that.

TLDR for players: I’m making changes that should improve the speed and reliability of GHC. Once they’re completed.

TLDR for fellow gamedevs and Python enthusiasts: If you want to see the changes, they are in the “unblocking” branch on GitHub. Campaign save files from previous versions, once loaded into the unblocking version, can’t be read by previous versions anymore. Proceed with caution.

Leave a Reply

Your email address will not be published.