Tutorial: Using a blank runtime to avoid potential GPL concerns

Runtimes are great, but not everyone wants to deal with the hotly debated GPL issue. Of course, you can always release your game .blends separately and run the blenderplayer on them, but launching your game from a 1kb Windows .bat file seems rather unprofessional. Well, here’s the solution you’ve been waiting for, and it was staring you in the face all this time.

Making “blank.blend”
To make your blank runtime, you’ll need a blank .blend file. Open Blender and delete the default cube. Since this .blend will be displaying until your game loads, you may want to add a nice little “loading…” splashscreen in front of the camera, but that’s not necessary. Also, set your Game Frame Settings in this file, because the rest of the game will inherit these settings from it.

Now select the camera and go to the Logic Panel [F4]. Set up this simple Logic:

Put the name of your first game file in the Game actuator. (Use the relative path. If your Game was in the top directory, and you had a sub-folder called “DataFiles”, then put “DataFiles/myGame.blend” where myGame.blend is the name of your .blend file.) Make a runtime and run it. Your game now runs from a runtime while remaining separate from the BlenderPlayer!

A couple of tips:

  • You don’t have to leave your game files named “.blend”. You can change the suffix to whatever you want. So you could call it “First.lev” or “menu.dat” or whatever you want, and Blender will still open it.
  • It is more professional to put your main runtime in a top folder and arrange your resources in sub-folders. This makes it easy for the player to identify the runtime without sifting through tons of meaningless files.Linux and Mac Benefits (fixes external file problems)
    Blender regularly looks for resources in the wrong folder on Linux and OS X systems (I believe it looks in the user’s home directory on Linux). This makes it difficult to distribute your games to friends if your resources aren’t all packed in one neat file. For example, the Sokoban project I’m currently working on with Clean3D will feature external map files. It’s hard to read maps when Blender is looking in the wrong directory.

When you make a runtime and execute it in Linux (I will have Clean3D test Mac later), the BlenderPlayer looks for external resources in the directory where the runtime resides. Problem solved. (And here I was thinking I’d have to write some long complicated script to accomplish such a simple task.)

Enjoy your new-found freedoms!

Very nice. I tried using that method around 3 years ago and didn’t have success. I didn’t try very hard though either. Anyways, thank you for your time and effort.

I appreciate all the demos you release. You joined in April 2006, and I thought you were one of those 2002 people from the start. I know, I know, I joined in December. But I’ve been blending for about 4-5 years. I’ve learned a ton from you and you deserve some credit!!

~~Stu

P.S. – I’ll stop being a suck-up now… :smiley:

thanks blendenzo
i have created something in the same topic before here

what about the .dlls?

Because of the way that Windows works, you cannot put the .dll files in any directory of your game folder other than the directory where the main runtime is located.

Several games released on this forum have had all game files in a single directory, sometimes with more than 50 files in that one directory, only one of them being the main runtime. I meant that the game designer should put all files that do not need to be in the top level directory in sub-folders in order to avoid (as much as possible) confusing the player.

Of course, anyone who knows C could put their game file and .dlls in a lower directory and then write a quick little executable file to put in the top directory that would simply make a system call to run the main runtime file. (That is, if you are that concerned about having only one file in the top level directory.)

Awesome blendenzo! I have been using your .bat technique recently but I was wondering what I was going to do if I wanted to export for Mac or Linux. Thanks for this!

Amazing! Great Idea. I will definitely use this!

I tried using C to open blank.exe, which is in folder dll’s so my cmd line looks like this:

C:\MazeR\dll’s\blank.exe

but whenever I run it the game opens and closes instantly.

I checked the blank.exe file, it runs fine when I run it directly, what in the world is the problemmm?? abd how do I solve it/? plz help me!

edit: there is also another way thatyou can do it without using C, you can just make all the .dll files hidden, I made a copy of my original game folder(the whole thing) and I was able to do it. not hard at all

i like using marco’s app to run games :slight_smile: .
http://blenderartists.org/forum/showthread.php?t=106655

A little thing for folks who prefer not to have .DLL files in the main folder is to right click them and select properties and from there check the ‘hidden’ box. The files will still be there but to anyone who does not have hidden files shown the folder will seem empty.

how do I veiw hdden files?

I’m not sure if I remember this exactly (I’ve been using Linux for over a year now), but I believe you go to “View >> Preferences” in Windows Explorer or My Computer. Then you go to the Folder Options and find the option that says “Show Hidden Files” and select it.

One of the Windows user will be able to correct me if I’m wrong.

that is the one.

blendenzo, I guess you didn’t see this thread.

BPPlayer handles all your problems (that were stated above) in one shot.

I really need help now… this doesnt work with 2.46!!

C-106 Delta, BPPlayer has not been released yet, and this is a pretty genius alternative.

C-106 Delta, BPPlayer has not been released yet, and this is a pretty genius alternative.
Agreed. It’s a great alternative.

AKA: the release date was pushed back a few weeks and my post is old. =P

Very good alternative… Well, not the best. (UNLESS YOU DONT USE WINDOWS!) Because not everybody has blender. There’s a program for converting .bat files into .exes. I uploaded it:
Link

Now, for creating your .bat file, use a code like this one:

@echo off

:: Rename DataFiles to the folder you want to use, main.dat to your main game file.
:: Rename blenderplayer.exe to engine.dat
:: Enjoy!

:: Change this to whatever you want to display in the console. don't remove the echo.
:: (unless you don't care about printing a start message).
ECHO My Game Console
ECHO Loading...

ren engine.dat blenderplayer.exe
blenderplayer.exe DataFiles/main.dat
ren blenderplayer.exe ren engine.dat

ECHO Quit
ECHO
ECHO
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.
REM This makes the bat slower so the player can see when the promp prints "Quit", and makes the file bigger.

I repeated that REM command so the player could see when the prompt prints “print” (REM commands make batch files slower.), and for making the file bigger… So when you compile it to an exe, it seems a bit more professional.

Don’t forget to make an icon file! The best resulting resolution is 32x32 (The most commonly used).

If they use another operative system, you can make a script that runs on that one instead of a batch file!

I hope this helps someone.

I think you misunderstood something while reading my tutorial. The player does not need to have Blender installed in order to play the game using my method.

im still wondering why this has stopped working on my 2.46 and its really really hard to take a screenshot becasue it quits immediatly, are there any problems I might be having?