Blender Game Engine Notes
Notes for Blender Game Engine to help me remember things. Some of these might be helpful for others. These notes are for an outdated version of Blender Game Engine.
Convert a .GIF file into a video file with FFMPEG
Blender uses video files for animated textures, here is a terminal command to convert a .GIF file into a video file using FFMPEG (this might not be the best way to do it, but seems to work for me at least.)
ffmpeg -i "animated_gif.gif" -r 60 video_texture.avi
Change the 60 to whatever framerate your project is using.
[ Youtube tutorial to add video texture via python ]
[ Monster’s Dynamic Texture Runtime ]
[ Information about Blender Game Engine’s Video Texture Module ] - [ Archive.org ]
Collision detection isn’t working
If working with collisions, remember to set the involved objects to Actor in the physics tab.
Copying logic bricks to another object
Select the object to receive the logic bricks first, then select the object with the desired logic bricks. Press the spacebar, then search for “Copy Logic Bricks to Selected.” This does not copy properties.
Remember to make use of Logic States
They are very helpful, especially with finicky properties, and help to keep the logic setup a bit more clean.
Respecting Blender’s GNU GPL licensing while still being able to set boundaries for yourself when sharing projects
Blender is GNU GPL software, this applies to the game launcher as well. The GNU GPL licensing does not apply to .blend files unless you explicitly publish them as GNU GPL. To respect the license while still being able to establish any boundaries you may have, you will need to create a launcher to boot the .blend file, rather than have the .blend file compiled directly within the launcher (this is what the “Save as Blender Game Engine Runtime” does.) As long as your .blend files are not packed into the actual launcher itself, you can establish any permissions for your .blend files that you would like. However, the launcher must always be freely available without paywalls, so you will need to upload it somewhere accessible if you plan to limit access to your project. This is to protect Blender’s ability to be free software.
[ More information about Blender Game Engine’s licensing can be read here ] - [ Archive.org ]
A launcher can be easily created using logic bricks via the Game actuator (I keep the .blend files within an assets folder.) Be aware though that launching a .blend file this way does not work within Blender itself, you will need to export it as a runtime first.
You are free to distribute your project however you wish, but you must have an up-to-date version of your project’s launcher available freely and accessibly. You can replace any .blends with placeholder .blends (such as a message stating where to acquire the complete project.) You can also utilize the free launcher to distribute a demo for your project. Having the .blend files separate from the launcher also makes updates easier (no need to recompile unless you need to update the launcher itself.)
Basically: All software built with the Blender Game Engine (the launcher / game binary) must respect the GNU GPL, but your assets (.blend files) do not (as long as they are not compiled directly into the launcher / game binary.) As long as your .blend files are not a part of the launcher / game binary itself, you may establish any license / boundaries you wish for your project (the .blend files.)
If you intend to release your Blender Game Engine project as GNU GPL, be sure that any assets you are using are compatible with the GNU GPL license.
Any code utilizing Blender’s Python API must respect the GNU GPL. So if your project has limited access and utilizes python code scripts, be sure that the scripts are available freely and accessible as well (you can bundle them in a scripts folder alongside the launcher.)
[ BGArmor, a (no longer updated) Blender Game launcher that uses the MIT license (however python code and any other GNU GPL components must still respect the GNU GPL.) ]
Newer versions of Blender Game Engine
There are multiple forks of Blender Game Engine that utilize a more recent version of Blender:
[ Armory3D ]
[ UPBGE ]
Disable blurry textures
Blender Game Engine’s mipmap settings are separate from Blender’s viewport settings, so if you wish to disable mipmaps, you will need to do that separately. This bit of code will disable mipmaps, it only needs to run once at the start of each .blend file.
from bge import render
render.setMipmapping(0)
If you want to be sure mipmaps are enabled instead, then set the 0 to a 1.
[ More information about Blender Game Engine’s Rasterizer Module ] - [ Archive.org ]
[ Return to Software Index ]