It’s been a little while since I’ve posted here, but I’ve been moving towards making a demo for a game that I’ve started a ways back, and I ran into an issue when generating a game executable on a Mac. Going by some of the previous posts here, it’s been an issue for a little bit, but I haven’t found anything that pointed me in the right direction to fix it.
So, here’s a workaround and a “fix”…
Create a shell script that executes blenderplayer from within the generated .app. Example:
#/bin/bash #location of the blenderplayer file cd ./game.app/Contents/MacOS/ #assuming game.blend is on the same level as and external to the .app ./blenderplayer ../../../game.blend
Place it in the same directory as the .app and run it.
When blender runs the app, it runs the “game.blend” included in game.app/Contents/Resources. This is why games that reference an external file for startup fail, since the relative link is assuming that it’s being run from it’s location at build time, instead of the location within the .app (which is a directory structure within itself).
So, when linking to your actual blend file containing your game relatively, add three extra hops up in the relative reference to the directory with your game to account for that location change. Your exported game should then run.
Hope this helps!