At some point you might want to get your game out to more people. You could just export it with the built-in Save As Game Engine Runtime plugin, however, there’s a new alternative since version 2.72 which is especially helpful if you’re looking into publishing to multiple platforms.
Take a look at its documentation page here.
It’s quite easy to use. When you activated the plugin by clicking the check mark, you’ll find its panel in the Render tab of the Properties panel. This is what it looks like in version 2.78:
The .blend file I’m looking at right now is at the root directory of my game project (the file that ultimately launches the game).
All paths beginning with // will have the current directory as the starting point.
The settings I used will yield this folder structure:
(BriZide is my game’s project folder, brizide_build is the folder I want my published versions to be in)
Let’s go through all the fields:
This is where the addon will place your “compiled” game. In my case, I set it to be outside of my project folder. If the folder doesn’t exist, it will be created. The addon will create folders for the configured platforms inside that folder.
This will be the name of your binary file (.exe/.app). It will also show up in the window title.
This is the path to your blenderplayer executable (e.g. blenderplayer.exe). As you can see, I didn’t set it to anything. I’m not using that option since I unchecked Publish Default Platform.
If you’re going to export to only one platform, feel free to set this one and leave Publish Default Platform checked.
I decided to publish the game to all platforms at once, leaving out the default option.
If you’re on Windows, check this option (otherwise games exported to Linux or macOS will not run without setting the executable file permissions). It will create a zip file of your game alongside the folder.
If you’re on Linux or macOS, it’s up to you whether you want to zip it up yourself or leave it to the addon.
Add folders and files to this list so they will be included in your published version. Don’t add your .blend here, only include things like readme.txt, folders for your textures/sounds and other assets. Make sure you added all necessary files, otherwise your game might not run properly due to missing files.
Replace the game files (from the asset paths list) every time you build. I’d keep it checked just to ensure that your published builds always have the up-to-date files.
As explained above, Publish Default Platform will use the blenderplayer from the Library path field.
I simply downloaded all current Blender versions (.zip archives, not the installers). I then extracted the folders from the archives to a folder called //lib (you can place that where you want, mine is arbitrarily in the game project folder).
(You’ll need to create a folder for the macOS build within your //lib folder, it doesn’t come with one.)
Click the plus icon several times.
Set the Platform Names according to your preferences.
For each platform entry, set the Player Path by locating a blenderplayer executable. You can either click on the folder icon next to the path field or type it out manually.
The macOS version needs a bit more attention again since the blenderplayer.app is basically a folder. I’d recommend to copy the path from your OS’s file manager or typing it manually in this case. Make sure your Player Path to the macOS version looks similar to this (no slash behind blenderplayer.app):
Click this button to create folders/archives containing the game with the executable of each platform you set up.
This should make publishing your game to several platforms much easier. If you have any questions, let me know.
Feel free to download my .blend here: https://github.com/Yethiel/BriZide/blob/master/brizide_build.blend
Make sure to activate the addon first.