Game Design Game Development Geek / Technical

Freshly Squeezed Progress Report: Mac Port Just About Finished

In last week’s report, I was figuring out how to bundle the Toy Factory Fixer binaries and dependencies for the Mac desktop port.

And the work continued.

Sprint 65: Ports

Planned and Complete (er, I thought):

  • Create Mac port

Well, it mostly continued. It was a very unproductive week, as I only managed to put in a total of 2.5 hours of game development.

I think part of the reason for the lack of hours was that I was pretty much finished with the work, and then I had trouble finding someone to help me verify that everything worked properly on a machine that wasn’t mine.

I had to change the install path of the SDL2-related libraries so that they reference “@executable_path/../Frameworks” although I annoyingly can’t set it using the configure script because it expects an absolute path.

So basically I had to do a two-step process for each library: run “configure –prefix=[install path] && make && make install”, then use the install_name_tool to change it.

And since the SDL2_image, SDL2_mixer, and SDL2_ttf libraries also refer to the SDL2 library, I had to change each of their paths to that library, too.

Once I had the libraries setup correctly, then it was a matter of telling Xcode to bundle the libraries. Ideally I could get CMake configured to do it for me, but for now I found that I can add the libraries manually to the “Frameworks, Libraries, and Embedded Content” section, AND I can get it to handle embedding and signing for me.

Toy Factory Fixer Mac Port

And as far as I can tell in my testing, it works!

The problem is, I didn’t know if it would run properly on a machine that didn’t have my development libraries installed, or even if it would run on a Mac due to the app not being signed properly for it.

Well, it turns out that as I write this, someone was able to verify that the game runs on their machine. So, good!

Unfortunately, there was no music and some sound effects were missing. So, not as good.

My best guess is that while in the previous week I was able to fix the libSDL2_mixer dependency on libvorbis so that it can provide support for loading and playing OGG files, the library still depended on using the system-installed libvorbis to actually do so at runtime.

And I don’t bundle libvorbis, so it is essentially missing on someone else’s computer if they don’t have it installed, which means no OGG support in my game again.

As far as I can tell, I don’t have this same issue with the Linux version. When I check the dependencies on my game’s binary and on my SDL2_mixer library, I don’t see libvorbis mentioned, but then again, I don’t see it mentioned in the dependencies on my Mac either.

So either something weird is going on with the Mac port, which might be as simple as needing to bundle libvorbis or some other dependency, or something is wrong with my Linux port as well that I didn’t detect in my own testing.

If someone is running into something similar, I will throw out that I recently learned about libSDL_sound, which uses a lot of single-header libraries and should not run into this problem. I am not sure if I want to switch from SDL2_mixer to SDL_sound, though.

Anyway, the Mac port is done in that it runs and you can play the game, but it isn’t done in that somehow I need to make sure it plays music properly, which I only just discovered wasn’t working.

After I fix this issue, I’ll port Toytles: Leaf Raking next.

Thanks for reading!

Want to learn when I release updates to Toytles: Leaf Raking, Toy Factory Fixer, or about future Freshly Squeezed games I am creating? Sign up for the GBGames Curiosities newsletter, and get the 19-page, full color PDF of the Toy Factory Fixer Player’s Guide for free!

One reply on “Freshly Squeezed Progress Report: Mac Port Just About Finished”

Comments are closed.