Meanwhile, during the pandemic

I’ve not been able to concentrate on a real development goal very successfully. I’m not sure what it is, I actually have less time these days since the pandemic hit, even though working from home since March means I have those commuting hours back. It’s weird.

And the other thing is I keep losing focus. I have one game I tried getting running on the iPhone and was unsuccessful so I switched gears. I’ve looked at a couple of projects where there’s an iOS Xcode project file so I figure I’d just fire them up, but they don’t work so I figure I’d get them fixed up, but then I started to come to the conclusion on both that maybe iOS support was never finished, which makes the concept a lot more work all of a sudden.

One cool thing I did get working was a port of Disasteroids 3D to the Mac. This is a freeware game written in 2000 by Thom Wetzel. I’ve actually mentioned him before, he wrote the Bitmap Font Builder I used on the DOOM iOS port and I’ve met him before at QuakeCon. Anyway, Disasteroids 3D was a freeware and open source (or at least source available) game he wrote as an exercise to learn about OpenGL and DirectX. The source has always been available but he recently put it on GitHub which gave me the inclination to convert it to SDL (swapping that out for the DirectX parts) and got it running on the Mac.

So that’s kinda cool.

Earlier today someone emailed me asking about the Wolfenstein 3-D iOS port. They had error messages about broken symbols with StoreKit. I wasn’t sure what they did but I figure adding StoreKit back would fix it. Then I realized what’s happening is that the app wasn’t compiling because the “com.idsoftware.wolf3d” bundle identifier was already taken which isn’t an issue except that Xcode tries to register it for in-app purchases, which it can’t since that ID is taken, and removing the in-app purchases entitlement removes StoreKit. The game has in-app purchases to facilitate the purchase of the Spear of Destiny levels but that’s not really needed anymore (the link to the levels is in the code if you want to download them.) Why this wasn’t an issue before and it is now I don’t know other than something in Xcode must have changed.

When I started this project the goal was to make as few changes as possible so that id might use the pull request to fix the game on the App Store. But since that hasn’t happened and probably won’t, I went in and neutered the code needing StoreKit but then I ran into another issue, one that’s been nagging me forever.

When the game launches it does this “Assert” code to make sure a value isn’t something wrong and it bails if it is. You can get around it by just commenting out the assert but then, some of the time, it launches you in a weird spot in the level and you’re stuck in a wall or outside the bounds of the map or something. The heck of it is I wasn’t sure what caused it or what fixes it. It clearly worked on my phone at one point in time.

Anyway this sent me down a weird rabbit hole during QuakeCon 2020 of all things (the one where it’s all at home) but basically, a Wolfenstein 3-D level consists of a section that tells the game where the walls are, a section that tells where the objects are, including the player starting point, and a third of “objects”, whatever that is. The second and third sections (“planes” in the code) weren’t loading correctly, which is why the player would spawn in weird spots. Long story short, some code that populated an array of offsets of where to look in the level file for the three sections/planes was failing. Why it’s failing now and not consistently before I don’t know (could be something about iOS or Xcode changed) but after spending hours hunting this section down and then having a bizarre epiphany on how to fix it, which worked. So after being bothered by this issue for a few years now I’ve gone in and fixed it. Finally.