Blender 3D: Noob to Pro/Making exe

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

This tutorial will show you how to make an executable for your game made in Blender.

Note: The methods listed in the "Windows" and "GNU/Linux or Mac OS X" sections work only for the operating system you are on when you create the file. To make it cross platform, use the "BlenderPlayer" method.

Contents

[edit] Windows

First create a folder that will hold all your game information. Name it something meaningful, like "Yo Frankie!".

The folder must contain four files that you can copy from your blender installation directory.(under windows it should be "C:\Program Files\Blender Foundation\Blender") They are:

  1. SDL.dll
  2. python24.dll (Or other relevant python file; python25.dll, python26.dll etc)
  3. pthreadVC2.dll
  4. zlib.dll

(sometimes you will need the following also...

  1. avformat-51.dll
  2. avutil-49.dll
  3. avcodec-51.dll

They are in the same folder.)

Not quite a Noob Note: If you are using the latest version of Blender you WILL need the following files)

I am running windows xp media edition and blender 2.46, here is a full list of files i needed:

  1. avcodec-51.dll
  2. avformat-52.dll
  3. avutil-49.dll
  4. libfaac-0.dll
  5. libfaad-0.dll
  6. libmp3lame-0.dll
  7. libx264-59.dll
  8. pthreadVC2.dll
  9. python25.dll
  10. SDL.dll
  11. swscale-0.dll
  12. vcomp90.dll
  13. xvidcore.dll
  14. zlib.dll

On Blender 2.48a (Windows XP Media Center 2002, SP3), these .manifest files are also required:

  1. blender.exe.manifest
  2. blenderplayer.exe.manifest
  3. Microsoft.VC90.CRT.manifest
  4. Microsoft.VC90.OpenMP.manifest

Now open blender with the game that you have created and open the file menu. Click on Save Game as Runtime and then save to the new folder that you have created and rename the file yourgamename.exe,

and then you can run the game!

[edit] Making A Screensaver (Windows Only)

  1. First, save your runtime (that's the .exe addressed above.) via File->Save Game as Runtime. ("Save Runtime" in older versions)
  2. Now, go to your .exe game and rename it .scr - for instance, if your game was NotMyGame.exe, rename it to NotMyGame.scr. You can now right click to Install it, and then use it as your regular screensaver by applying it as you would any other screensaver (right click on desktop, properties... You know the drill.)

Just a helpful idea; when distributing my games, I often include a real awesome screen saver so that when Person A walks into Person B's room and sees that amazing thing going, they decide that they want my game. Just a note, though; screensavers are not games, and so they should not accept input. At most, they should be videos showing what your game does. If you just rename your regular game as a .scr, it will be remarkably boring, because your game needs input and screensavers do not.

[edit] GNU/Linux or Mac OS X

Open blender with the game that you have created and open the file menu. Click on Save Game as Runtime and then save to the new folder that you have created and rename the file yourgamename...

and then you can run the game!

[edit] BlenderPlayer

The methods shown above only create an executable for your operating system. Well, BlenderPlayer can fix that.

  1. Make a new folder to store all your game data.
  2. Then save your .blend file into the directory.
  3. You can skip this step and the next step if you do not want a Windows version. For the Windows users, copy blenderplayer.exe to the new folder from a Windows copy of Blender. Then copy all your DLL files for Blender as mentioned for Windows to the folder.
  4. Next you have to make an MS-DOS batch file (for *NIX users, this is the shell script equivalent). In a simple text editor, in CR-LF mode if available (Notepad is always in this mode, and NOT a word processor!), copy and paste this text:
    blenderplayer.exe yourgamename.blend
    Save it as YourGameName-Windows.bat in your game folder.
  5. You can skip this step if you do not want a *NIX (basically Mac OS X and GNU/Linux) port. For GNU/Linux (at least), make a shell script. (A shell script is the *NIX term for a batch file.) In a simple text editor, in LF mode (unfortunately Notepad can't be used), copy and paste this text:
    #!/bin/bash
    blenderplayer yourgamename.blend

    Save the file as YourGameName-UNIX.sh in your game folder. Note that due to the nature of these systems, BlenderPlayer will need to be pre-installed.
  6. Write a readme for your program. This is again best done with a simple text editor like Notepad or gedit, but it does not matter which mode it is in. You should include the name of the game, a description, perhaps a walkthrough or hints, and if you made a *NIX port, mention that it requires BlenderPlayer, available with Blender.