Components are pre-defined behaviours that can be further customized with Python. You can find the python scripts at the core/com directory.
Exporting the game¶
Unfortunately the UPBGE team only provides standalone releases for Windows, therefore we have limited support to exporting games to Windows only. If you’re using a different platform or want to try exporting to Linux or MacOS refer to the Behind the scenes section.
You can select the output folder where your game will be exported. You can either use a relative path (to your project folder) or an absolute path. The folder will be automatically created if it doesn’t exist. We recommend using the “release” folder on your project directory.
- Copy Engine: If selected, the BlenderPlayer and Python (~80Mb) will be copied to output folder. The copy will take a while, you can consult the progress on the Blender Terminal. Only necessary the first build or if selecting the
- Rebuild: Will delete the output directory if exists before copying files.
Like saving as a compressed file, exporting will clean the output directory of unwanted files.
Behind the scenes¶
If you decompress the package this addon comes in you will find yet another package called “data.zip” in the addon folder. This package contains the data this addon will use. This data is copied in the
DATAFILES folder when enabling the addon. Usually at
You can access the “AppData\Roaming” directory using the “%appdata%” command in your file browser path (Windows Only)
If you want to make sure, you can use
bpy.utils.user_resource('DATAFILES') on you UPBGE’s Python Console to get your actual path.
There you will find two folders:
- Template: Files on this folder will be copied when calling the
New Game Projectoperator.
- Launcher: It includes executables for the launcher for each OS. The launcher is a program that will execute the following command
cd data/; ./../engine/blenderplayer.exe main.blend. More complex launchers may be used in the future, for example launchers using the “config.txt” file.
For more information about the original launcher click here.
project.json file contains data about the game that is not included in any
.blend file as well as data that needs to be passed between the engine (BGE) and the Blender (BPY).
project/core folder there is the Python API (Core) and any extra files it needs.
The launcher and the addon will automatically add the
project/core/com folder of your project, containing components, to the PYTHONPATH.
To export manually you need to copy a compatible version of UPBGE’s BlenderPlayer in your output
engine/ folder and create a luncher for it that does the same than this one for your platform.
If you’ve cloned this addon, you can create the “CommunityAddon.zip” and the “data.zip” file by executing
make.py. The same will be automatically done when committing, which will also call
git add -A. You can disable this behavior on the
.git/hooks/pre-commit file of your repository.