Tutorial - How to export games created with UPBGE (v0.3) using BPPlayer


**Important Update:

Hey colleages, Im doing a TWO addons (one for UPBGE 0.2.3, 0.2.4, 0.2.5 and another por UPBGE 0.3) for automate all this proccess, so this tutoria will be outdated.
The two addons are WORKING now but I need do some mores TESTS and OPTIMIZATIONS.
This are my first addons ** :grinning:

BPPlayer was created for C-106 Delta user. Thank you.


Motivation:

1 - Right now there is no tutorial about this.
2 - Im doing a aplication to encrypt blend file but just now is not as secure as BPPlayer.
Many thanks to the developer of BPPlayer and many thanks to de developers of UPBGE for your great work!.

I have used:

  • Version of UPBGE based in Blender 2.9: (UPBGE-EEVEE-Win64-2020-06-06) for creating the blend file. Link below.
    This maybe can be done with newest versions of UPBGE.
    Edit: Tested and working with UPBGE-0.30-windows7-x86_64. Link below.

  • BPPlayer version 1.07b. Link below.

  • A blend file made with UPBGE 0.3.

Im working on Windows but for Linux and Mac are similar.

Procedure:

first:

  • Decompress UPBGE in a folder (in this tutorial is “C:\TMP\TMP\UPBGE-EEVEE-Win64-2020-06-06”)
  • Decompress BPPlayer in a folder (in this tutorial is “C:\BPPlayer1.07b-win32\BPPlayer”).

Steps:

1 - Navigate to the BPPlayer folder and run BPPlayerGUI.exe. (BPPlayer.exe will only be your game launcher but through BPPlayerGUI.exe it generates the data.block)

2 - Go to the outside folder where is the UPBGE v_0.3 (in this tutorial is “C:\TMP\TMP\UPBGE-EEVEE-Win64-2020-06-06”) then copy and paste the folder. Then rename it (e.g MyGame)
Now the game folder is “C:\TMP\TMP\MyGame”.

The most important step:

3 - Click in “Import Custom Player” button of BPPlayerGUI. This is the most important step because with this we are saying to BPPlayer that the renderer is a blenderplayer based on EEVEE (in this case).
When you run BPPLayer inside of your game folder and appear the message “Incorrect versión of blenderpalyer” is because of you omited this step.
Navigate to your UPBGE v_0.3 folder and select blenderplayer.exe.

  • 3.1 Note: If you don´t select “Import Custom Player” then your game says this:
    3.1 - Invalid blenderplayer

4 - To select your blend file: click in the “Import Main Blend File” button and select your blend file.
To select the path to save the dat.block (the encrypted blend file) click in the button “Export Block Name”. Navigate to the folder of your game (“C:\TMP\TMP\MyGame” in this tutorial)

Is good idea save this config (custom player, blend file and block file selected). For that go to Files menu (top left corner of BPPlayerGUI) and select “Save AS (Config File)”. Then rename your config file in a propper maner.

5 - I sugest the format for the config file so:
(BPPlayer version)(UPBGE version)(blend file).ini. In this tutoria is “(BPPlayer_1.07)(UPBGE-EEVEE-Win64-2020-06-06)(myGame_v1.0).ini”
This makes things easier for you because when you make changes to the blend file then you go to Files menu and select “Open Config File” and then select the “Export” button. More easy because you don’t need select the custom player, blend file and the block path again.

6- Click in the “Export” button.

7 - Copy “BPPlayer.exe” and “data.block” to the game folder. You don’t need copy the “data.block” if you have previously selected the path of your “data.block” to point to your game folder in BPPlayerGUI.
In the game folder can be deleted “blender.exe” and other files that I don’t remember. Delete “blender.exe” only for now.

7.1 - Note: BPPlayer.exe is copied from the path where you have decopress the BPPlayer 1.07b when was downloaded.

8 - Run BPPlayer.exe and Enjoy!!!

Links:

BPPlayer 1.07b:

UPBGE 0.3 (UPBGE-EEVEE-Win64-2020-06-06) Used in this tutorial:

UPBGE 0.3 (UPBGE-0.30-windows7-x86_64), also tested and works:

4 Likes

Thanks, people have been asking about it at discord server for a while,

As I wrote above, Im doing a addon for automate all this proccess, so this tutoria will be outdated. I did some test and I know that is possible. In one or two days can be ready.
Stay tuned.

2 Likes

This is cool, Man!

As I updated it above., Im doing a TWO addons (one for UPBGE 0.2.3, 0.2.4, 0.2.5 and another por UPBGE 0.3)

1 Like

I have a question:
You have a idea of why if a script of your game have the “import bpy” then the compiled version fail with the error: “No module named bpy” or some similar.

I have this problem in the compiled version of this addons.

External Python libraries cannot import BPY modules (unless you have the raw BPY source). You need Blender to run first, then import BPY from that application. If you don’t want Blender to actually open you can simply run it via the command-line w/ headless mode.

So, it is not a problem of missing modules (folders) in the compiled version (I mean the files exported with my addon that Im developing)?

It’s hard to tell. The BPPlayer was originally created for BGE/UPBGE 0.2x - UPBGE 0.3x didn’t exist at that time so it’s possible some additional libraries need to be updated or included.

BPPlayer is not the problem because this program only encrypt and decrypt the blend file. I am sure of this.
My addons are based in the oddon “Save game as runtime” but without the process of linking the blenderplayer with the blend file.
I added the automatization of encryption utilizing BPPlayer.

in UPBGE 0.2.X you don’t have access to bpy library when you use blenderplayer. In 0.3+ you can use it even with blenderplayer

I have used the “import bpy” in UBGE 0.2.x then I press the P key end the game run without problems.
But a game exported dont run because of this import.
This is some strange because I understand that the Standalone Player uses the blenderplayer.


Edit:
Just now I realized that Im wrong.
Pressing the P key is the same thar press the Start button in “Embedded Player” (in the Render tab). Then the game run fine.
Pressin the “Start” ´button in the “Standalone Player” is the same as use the blenderplayer and the game DON’T run well because of the “import bpy” in a scrip.

BPY works in the embedded player occasionally because it is run in Blender and has access to its BPY libraries. The Standalone player does not run in Blender, which means BPY cannot be accessed in the Blenderplayer in legacy versions.

1 Like

I have compiled sucessfull a blend called “NINJA SLICE2.blend” which was done with UPBGE 0.3 that uses bpy.
This is very good: that bpy can be used in UPBGE 0.3. yay!

In this blend, you can slice objects using your left mouse button in a way interactive.
Thanks for the autor.

Original post with blend file:

Was impossible upload the compiled version.

2 Likes

yeah in 3x bpy is usable in game

in use viewport mode so is openXR

(vr !)

1 Like

Today I implemented a MD5 check sum in my new addons for the BPlayer executable file because if you have a fake BPPlayer in your computer then your blends can be stealed.

For example,
The MD5check sum of the BPPlayer.exe (version 1.07b for Windows) is
7d239ace45664c480b618b8b242db641.

And the file size of this version is
3494527

Before talking about the problems I’ve had in development, I want to tell that the addon for UPBGE 0.3 is almost ready and this are the screenshots of the version for UPBGE 0.3.x.

(The version for UPBGE 0.2.x is scheduled for next week.)

Does anyone know how to fix what says "undocumented operator"

I have tried to make the interface clear, with all the necessary options and intuitive to use.

What do you think?

1 Like

Does anyone know if this addon should or can be published on the official Blender page or not due to the fact that it has to be related to an "alternate" development to Blender (i.e. UPBGE) ?

If you talk with @lordloki_reloaded, you might be able get your add-on officially incorporated with the rest of the BGE add-ons that ship with UPBGE: https://github.com/UPBGE/blender-addons

And no, Blender doesn’t support UPBGE officially unfortunately.

2 Likes

The Windows version of the addon already works for UPBGE 0.3.x that are based on Blender 2.8.x, Blender 2.9.x and Blender 3.0

I am actively working on these addons. I have had to read more than I imagined. But there is little left.

Today I am going to debug the addon on Linux.