Player crashes when I use logic.startGame

Note, this only happens when in standalone player or an exported runtime. Embedded seems to work.

I have a menu blend file which includes a button that starts the game by loading another file.
I use the “startGame” command. I’ve also tried the logic brick.
This all worked fine until a couple of days ago.
Now any blend file I try to launch from this menu will simply close with no error message. The levels will play fine if I launch them from their own file, but will not launch from the menu. Nothing will.

I even made a new file called “loading.blend” which only startGame’s my level file - that works fine when I run it from that file. But when the menu tries to startGame loading.blend, the crash happens again.

In desperation, I started a whole new file and simply copied all the contents of the menu across, but evidently whatever the problem is came along with them, because the result was the same.

This is super perplexing. Does anyone know what might be going on? I’m hoping to release my game pretty soon, but as of now the game menu can’t launch any of the levels!

Could you share your crash logs? If you don’t know how to produce them, here’s a guide:

Even better if you could share your blends files so that people can debug them themselves.

Ok, so the debug output tells me this:

I0613 22:12:55.047662  1088 device.cpp:45] CUEW initialization succeeded
I0613 22:12:55.047662  1088 device.cpp:47] Found precompiled kernels
I0613 22:12:55.057663  1088 device.cpp:68] HIPEW initialization failed: Error opening HIP dynamic library
WARN (bke.anim_sys): E:\Development\blender-upbge-eevee\source\blender\blenkernel\intern\anim_sys.c:2949 animsys_calculate_nla: NLA Eval: Stopgap for active action on NLA Stack - no strips case
WARN (bke.anim_sys): E:\Development\blender-upbge-eevee\source\blender\blenkernel\intern\anim_sys.c:2949 animsys_calculate_nla: NLA Eval: Stopgap for active action on NLA Stack - no strips case
GL_VENDOR: NVIDIA Corporation
GL_RENDERER: NVIDIA GeForce RTX 3070/PCIe/SSE2
GL_VERSION: 4.5.0 NVIDIA 512.77
GL_SHADING_LANGUAGE_VERSION: 4.50 NVIDIA
Supported Extensions...
 GL_ARB_shader_objects supported?       yes.
 GL_ARB_geometry_shader4 supported?     yes.
 GL_ARB_vertex_shader supported?        yes.
 ----------Details----------
  Max uniform components.4096
  Max varying floats.124
  Max vertex texture units.32
  Max vertex attribs.16
  Max combined texture units.192

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

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

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

 GL_ARB_texture_env_combine supported?  yes.
 GL_ARB_draw_instanced supported?  yes.
Debug: Game Controller (XInput Controller) with index 0 initialized
Debug: Game Controller (XInput Controller) with index 0 closed
register_class(...):
Warning: 'NODE_MT_category_Vector Math' doesn't have an alpha-numeric suffix
register_class(...):
Warning: 'NODE_MT_category_Armature / Rig' doesn't have an alpha-numeric suffix
register_class(...):
Warning: 'NODE_MT_category_Bone Constraints' doesn't have an alpha-numeric suffix
register_class(...):
Warning: 'NODE_MT_category_Ray Casts' doesn't have an alpha-numeric suffix
Info: Saved "samuraiMenu.blend~"
[Logic Nodes][e[93mDEBUGe[0m] Removing Game Start Compile handler...
Switching to fully guarded memory allocator.
Blender 3.0.0
Build: 2021-12-03 19:17:12 Windows 
argv[0] = C:\Program Files\UPBGE-0.30-windows-x86_64\\blender
argv[1] = --debug
argv[2] = --debug-cycles
argv[3] = --python-expr
argv[4] = import bpy; bpy.ops.wm.sysinfo(filepath=r'C:\Users\user\AppData\Local\Temp\blender\debug_logs\blender_system_info.txt')
Read prefs: C:\Users\user\AppData\Roaming\UPBGE\Blender\3.0\config\userpref.blend
Read blend: C:\Users\user\3D Objects\samuraiMenu.blend
Saved session recovery to 'C:\Users\user\AppData\Local\Temp\quit.blend'

Blender quit
Press any key to exit . . .

If Blender quit, you should have gotten an exception violation error at the end of your crash logs.
Did you manually leave out any errors?

Nope, that’s the whole log.
Maybe there’s no exception because it’s the player that crashes, not blender itself?

I notice you’re using UPBGE 0.3.0 still. You might try using a experimental UPBGE version.
The latest is built on Blender 3.3 and relatively stable. Finally, is it possible you can share your blend files as I initially suggested above? It’s alright if you don’t want to, it just makes things a lot more difficult.

Where can I download the latest experimental build? That sounds promising.

I’m sorry, I’d rather not share my file as I’m going to be releasing this game commercially. I get that that’s a limitation for helping :confused:

At the download page, go to the experimental tab, then click the top orange, download button.

the upbge 0.3.0 as a whole is considered “experimental” and isnt recommended for production use.

id recommend using the logic brick rather than the python function. that seems to be a general troubleshooting step. another big reason starGame can fail (resulting in a crash) is if the path to the blend is wrong. be sure you fully extend the path.

Works in 0.33! Thanks dude :slight_smile: