Runtime freezes when opening a new file

I have a demo for a game that I’m working on, and although general feedback has been positive, some have complained about the same bug: the game freezes at a point where it’s supposed to switch from one blend to another. It has happened randomly to both people with and without Blender installed, so I have no clue what might be causing this problem.

In the demo folder you can find all the blend files, it’s available for its download here:

For those who download the files, this freezing bug happens at the very start of the demo, when switching from “01.INTRO.blend” to “02.TUTORIAL.blend”. It was developed on BGE 2.79b, and although most of the work was done in Logic Bricks there are a couple of Python scripts going on for 2D filters and other stuff.

Any thoughts would be greatly appreciated, thank you all for your time!

assuming you use bricks to load? if so make sure people run your game with admin rights.

Edit:
Admin right don’t work, after showering it crashes indeed on loading next part.

Edit2:
in upbge 0.2.5 it runs fine.

Thanks for the updates!! Yes, they tried the admin thing but it didn’t work either for them. Do you think there’s a way to fix this so that players don’t have to download UPBGE? Maybe exporting the runtime in UPBGE would make it?

i asume that the users who are crashing are amd users, i know that i’m using amd and i can never use the command to restart my game, it does crash as well. The only work around is not loading or restarting but rebuilding your game to use libload instead. It’s a loading mechanism that works for amd users and any other, you can then just load in blends during gameplay, but this means you need to write your own mechanic for it. if intrested i got a loading screen in my resources you can look at.

1 Like

I wasn’t able to produce a freezing bug, unless the long loading screen is the mentioned freezing. I didn’t notice any console errors for your executable either, but that might be because I have NVIDIA drivers rather then AMD. If you’re curious, you can launch your executable with its console/terminal, similar to Blender’s console, by launching your executable via the commandline.

start TheZebraManDEMO.exe -c

Place this commandline script the same folder as your executable and give it whichever script name that you want, as long as the file extension is either .cmd or .bat. Additionally, if in the future you get crashes either in Blender or for your exported executable, here’s a guide on how to create and view logs for those crashes.

Edit

Tested with Blender 2.79b, UPBGE 0.25b & your exported Blender 2.79b executable without any dips in performance or console errors.

1 Like

I can assume that the hang is due to the load on the engine itself - when people play the game, locations, enemies are added to the game scene (which will then be destroyed by the player) and when loading a new level of the game, this weight of objects in the game scene leads to a dead hang, I would advise you to clear game scenes from objects when passing a game level, this will make it easier to load a new blend file, and check if you are loading a new level, the sensor that starts the download should be in one-time operation and not in pulse mode - otherwise it tries to start a new blend file again and again. if this doesn’t help, take Mr. Cotaks’ advice and add a library loading system to the game - it’s perfect for loading and unloading levels because you don’t keep anything in the start file except the player, enemies and bonuses (weapons, first aid kits, etc.)

1 Like

Thanks everybody for their help!! I checked this debug instructions, if I understood properly players have to download the “blender_debug_log.cmd” file and place it in the same folder where the executable is stored. I have a couple of questions:

  1. The line that needs to be renamed in the .cmd file, do I have to rename it as “%~dp0\TheZebraManDEMO” or “%~dp0\ %TheZebraManDEMO%”?
  2. Do players have to open this file, or just having it next to the executable will do it?
  3. Just to be sure, players don’t need to download “blender_debug_gpu.cmd”, right?

Thank you all very, very much for your help, and sorry about my lack of knowledge in this matter!

This: “%~dp0\TheZebraManDEMO”

Using %% are command variables that can be used, but are no way required at all if you don’t want to. Example of variables as a path:

set TheZebraManDEMO="D:\Projects\Blender\TheZebraManDEMO_Folder"
"%~dp0\%TheZebraManDEMO%"

The easiest method would be to place it near the executable, yes. :slightly_smiling_face:
But you’re not limited to only a same folder path if you don’t want to.

Not really. It’s mainly for checking if someone’s GPU supports what element, for example max lights. It also prints some low level (hardcore) data.

1 Like

Thank you very much for your help!! Your explanations really cleared it out for me. I think I’ve followed all the steps, but I’m not sure if I might be missing something.

blender_debug_log.cmd (845 Bytes)
This is the debug file. If anyone that has encountered the bug can download it, place it next to the executable, and try to play again to see if it works, I’d really appreciate it! Just want to make sure that it actually works before publishing it.

Thanks everybody for their help, this means a lot to me!

Someone got to test it but it didn’t work, he sent me the script file:

Color management: using fallback mode for management
BLT_lang_init: 'locale' data path for translations not found, continuing
Unknown argument: --debug
Unknown argument: --debug-cycles
Unknown argument: --python-expr
GL_VENDOR: ATI Technologies Inc.
GL_RENDERER: AMD Radeon(TM) Graphics
GL_VERSION:  4.6.14800 Compatibility Profile Context 22.5.2 30.0.21017.1000
Supported Extensions...
 GL_ARB_shader_objects supported?       yes.
 GL_ARB_vertex_shader supported?        yes.
 ----------Details----------
  Max uniform components.16384
  Max varying floats.128
  Max vertex texture units.32
  Max combined texture units.160

 GL_ARB_fragment_shader supported?      yes.
 ----------Details----------
  Max uniform components.16384

 GL_ARB_texture_cube_map supported?     yes.
 ----------Details----------
  Max cubemap size.16384

 GL_ARB_multitexture supported?         yes.
 ----------Details----------
  Max texture units available.  8

 GL_ARB_texture_env_combine supported?  yes.
 GL_ARB_texture_non_power_of_two supported  yes.
found bundled python: D:\Games\From Launcher ItchIo\the-zebra-man\DEMO TZM\ACTUAL DEMO\2.79\python
GL_VENDOR: ATI Technologies Inc.
GL_RENDERER: AMD Radeon(TM) Graphics
GL_VERSION:  4.6.14800 Compatibility Profile Context 22.5.2 30.0.21017.1000
Supported Extensions...
 GL_ARB_shader_objects supported?       yes.
 GL_ARB_vertex_shader supported?        yes.
 ----------Details----------
  Max uniform components.16384
  Max varying floats.128
  Max vertex texture units.32
  Max combined texture units.160

 GL_ARB_fragment_shader supported?      yes.
 ----------Details----------
  Max uniform components.16384

 GL_ARB_texture_cube_map supported?     yes.
 ----------Details----------
  Max cubemap size.16384

 GL_ARB_multitexture supported?         yes.
 ----------Details----------
  Max texture units available.  8

 GL_ARB_texture_env_combine supported?  yes.
 GL_ARB_texture_non_power_of_two supported  yes.
found bundled python: D:\Games\From Launcher ItchIo\the-zebra-man\DEMO TZM\ACTUAL DEMO\2.79\python
Warning, sensor "hearts not 0" has lost a link to a controller (link 1 of 3) from object "ZEBRA.002"
possible causes are partially appended objects or an error reading the file,logic may be incorrect
Warning, sensor "chainsaw False" has lost a link to a controller (link 1 of 4) from object "ZEBRA.002"
possible causes are partially appended objects or an error reading the file,logic may be incorrect
Python module can't be imported - object 'CubeTrack1.003', controller 'Python':
Python module can't be imported - object 'CubeTrack1', controller 'Python':
Added cam Camera.003
ImportError: No module named 'track_to_closest'
ImportError: No module named 'track_to_closest'

I don’t understand much, but it seems to be a problem with Python, is it? Thanks everybody for their help!

Sorry for the late reply. If no module is found, this could mean either you’re attempting to access a module from the previous blend from a new blend, or you’ve forgotten to export / copy the Python libraries + DLLs that come with Blender / UPBGE.

Thanks for your reply! In BGE 2.79b I don’t have so many exporting options:

Untitled

Maybe I have to manually copy some other files?

No, your export panel looks like it should.

  • Are any of your Python scripts located externally from your blend files?
  • Do the game players that are experiencing these problems have any security blocker on their computer that may be restricting Python scripts from loading/running?
  • Finally, while it’s very unlikely that this could be the cause of the issue, if you haven’t already, you might try exporting your runtime while having this User Preference setting in Blender enabled.

No from what I know, all scripts were written or imported into each blend file.

I’m not sure about it, might be the issue. Is there a specific feature that they have to disable?

I checked the file where I created the runtime and it was disabled, so I’m turning it on and exporting the whole thing again.

Thank you so much for your answers, I’ll update asap!!

Welp, everything is checked and the problem persists. I’m sure I must be missing something!

Have you tried exporting from UPBGE 0.25b? It’s based on Blender 2.79.7. It might also be an AMD only issue as Cotaks mentioned.

Nope I haven’t, but I think changing versions might cause trouble in some scripts, right? Or Python expressions are the same as Blender 2.79?

Except for:

  • Slightly different GLSL syntax.
  • bge.logic.libLoad() argument: async renamed to asynchronous.
  • bge.logic.keyboard.eventsbge.logic.keyboard.inputs
    • KX_INPUT_JUST_ACTIVATED.activated (etc. with other input selections)
  • Multitexture API and graphics removed, completely.
  • Fisheye API and graphics removed, completely.
  • A few other API changes I may have forget or am unaware of.

– Not many API changes - it’s still built on legacy source after all.


Logic Bricks are the other hand are known to break sometimes when appending a BGE blend to a UPBGE 0.2x blend. Blends saved in UPBGE 0.2x versions are not reverse compatible with BGE, unfortunately…