Page 1 of 2 12 LastLast
Results 1 to 20 of 21

Thread: Tutorial: Using a blank runtime to avoid potential GPL concerns

  1. #1
    Member blendenzo's Avatar
    Join Date
    Apr 2006
    Location
    Michigan, USA
    Posts
    2,702

    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!
    Last edited by blendenzo; 04-May-07 at 09:28.
    "From somewhere, a transmission..."
    Game Engine tutorials: TutorialsForBlender3D - blendenzo.com - blending-online
    My Projects: Escape the Room - Brought2Life - UpRight - Solomon's Treasure - Sokoban - Marble Labyrinth



  2. #2
    Member Stu_Flowers's Avatar
    Join Date
    Dec 2006
    Location
    Oregon
    Posts
    526
    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...
    Old MGP (Monkey Game Project) Website: --HERE--



  3. #3
    Member Octopus4's Avatar
    Join Date
    Jun 2005
    Location
    Jordan
    Posts
    4,531
    thanks blendenzo
    i have created something in the same topic before here
    http://www.khayma.com/cgwoods/3dlab/fmt3dguru6.htm
    iOS Developer, Game Developer & Blender Artist
    www.deyaeldeen.com



  4. #4
    Member alienkid10's Avatar
    Join Date
    Jan 2008
    Location
    blender
    Posts
    1,111
    Originally Posted by blenderenzo
    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.
    what about the .dlls?



  5. #5
    Member blendenzo's Avatar
    Join Date
    Apr 2006
    Location
    Michigan, USA
    Posts
    2,702
    Originally Posted by alienkid10 View Post
    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.)
    "From somewhere, a transmission..."
    Game Engine tutorials: TutorialsForBlender3D - blendenzo.com - blending-online
    My Projects: Escape the Room - Brought2Life - UpRight - Solomon's Treasure - Sokoban - Marble Labyrinth



  6. #6
    Member Lostinspace's Avatar
    Join Date
    Feb 2007
    Location
    United States
    Posts
    406
    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!
    The people who are crazy enough to think they can change the world, are the ones who do.



  7. #7
    Member The Red Hand's Avatar
    Join Date
    Aug 2007
    Location
    Oak Ridge, TN
    Posts
    1,184
    Amazing! Great Idea. I will definitely use this!



  8. #8
    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
    Last edited by Tictoon; 26-Apr-08 at 11:28.



  9. #9
    Member Octopus4's Avatar
    Join Date
    Jun 2005
    Location
    Jordan
    Posts
    4,531
    i like using marco's app to run games .
    http://blenderartists.org/forum/showthread.php?t=106655
    iOS Developer, Game Developer & Blender Artist
    www.deyaeldeen.com



  10. #10
    Member oblenob's Avatar
    Join Date
    May 2007
    Location
    Scotland - U.K
    Posts
    711
    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.
    VirtualAnvil --> HERE

    ""I am a PC and I like life without walls."
    In a life without walls, where do you put Windows and Gates?"



  11. #11
    Member alienkid10's Avatar
    Join Date
    Jan 2008
    Location
    blender
    Posts
    1,111
    how do I veiw hdden files?



  12. #12
    Member blendenzo's Avatar
    Join Date
    Apr 2006
    Location
    Michigan, USA
    Posts
    2,702
    Originally Posted by alienkid10 View Post
    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.
    "From somewhere, a transmission..."
    Game Engine tutorials: TutorialsForBlender3D - blendenzo.com - blending-online
    My Projects: Escape the Room - Brought2Life - UpRight - Solomon's Treasure - Sokoban - Marble Labyrinth



  13. #13
    Member oblenob's Avatar
    Join Date
    May 2007
    Location
    Scotland - U.K
    Posts
    711
    that is the one.
    VirtualAnvil --> HERE

    ""I am a PC and I like life without walls."
    In a life without walls, where do you put Windows and Gates?"



  14. #14
    blendenzo, I guess you didn't see this thread.

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



  15. #15
    I really need help now.. this doesnt work with 2.46!!
    Don't mind me, I'm Ticcentric!



  16. #16
    Member The Red Hand's Avatar
    Join Date
    Aug 2007
    Location
    Oak Ridge, TN
    Posts
    1,184
    C-106 Delta, BPPlayer has not been released yet, and this is a pretty genius alternative.



  17. #17
    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



  18. #18
    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:

    Code:
    @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.



  19. #19
    Member blendenzo's Avatar
    Join Date
    Apr 2006
    Location
    Michigan, USA
    Posts
    2,702
    Originally Posted by B3D00 View Post
    Very good alternative.. Well, not the best. (UNLESS YOU DONT USE WINDOWS!) Because not everybody has blender.
    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.
    "From somewhere, a transmission..."
    Game Engine tutorials: TutorialsForBlender3D - blendenzo.com - blending-online
    My Projects: Escape the Room - Brought2Life - UpRight - Solomon's Treasure - Sokoban - Marble Labyrinth



  20. #20
    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?
    Don't mind me, I'm Ticcentric!



Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •