Opening Standalone Player From Blender Works Now

Hey. So, this is a minor feature that I’m seeing, but it would seem that playing games via the standalone player from Blender works fine out-right now, which is absolutely great to see. I’m using it for Valchion, so if there are any path issues or anything for this, I think it’d present itself.

I’m finding it to be extremely useful right now, as memory usage climbs higher and higher when I play Valchion through Blender now, as I’m using GLSL mode. By using the external BlenderPlayer, memory gets returned when you exit the game, and Blender itself doesn’t appear to use any extra memory. Really great to see, again. Thanks to whichever developer(s) fixed this up!

I’ve noticed this testing other people’s files. I’m wondering if there is some serious lack of memory management going on regarding textures.

Maybe so. It never was a problem when I was using SingleTexture mode, so it might be that it’s there for every mode, and just arises in GLSL mode. It seems like Blender might keep the information from the game around after exiting it (it does seem like it loads faster on subsequent “goes”), but still must allocate extra memory.

For an actual fix, I think it should either it should allocate everything once and only release it if you open another blend file, or release the memory after you quit the BGE, even if you’re in the same blend file. The first is ideal, but it shouldn’t just keep allocating memory. It might be a problem with Blender itself more-so, though.

EDIT: A problem with this method that I found is that the standalone player automatically hides the console if you have it enabled (for Windows); you can make it show by going to the wm.py file in the 2.69\scripts\startup\bl_operators folder, and adding “-c” underneath the other arguments in the group that starts with args.extend([. It’s on line 1300.

EDIT 2: You’ll also find the standalone player doesn’t adhere to showing the framerate and profile, and the debug properties you have enabled. That’s coded in there, but it doesn’t work (it’s a bug). The proper WM.py entry should be like this, when combined with the “-c” from above:



args.extend([
            "-g", "show_framerate", "=", "%d" % gs.show_framerate_profile,
            "-g", "show_profile", "=", "%d" % gs.show_framerate_profile,
            "-g", "show_properties", "=", "%d" % gs.show_debug_properties,
            "-g", "ignore_deprecation_warnings", "=", "%d" % (not gs.use_deprecation_warnings),
            "-c"
            ])


This is in the “WM_OT_blenderplayer_start” class.