BGE Runtime Filesize question?

Hello! I just curious about, is there any way to make runtimes smaller? because i just exported default cube as runtime and total filesize(including lib folder and other dll’s) about 65mb. tried with my current 3d simple platform project(all are gray non-textured models for now) its really simple but total filesize 72mb. Is there any way to import libraries and dll’s only which one we need? for example i was using blitz3d before bge and with a mid-size game was only ~15mb.

ps: using blender 2.58 and sorry for my english :slight_smile:

Most of that comes from the DLLs and bundling Python. I doubt Blitz3d needs Python (~20mb) or ffmpeg (~15mb). However, that being said, when I save the default cube scene as a runtime, mine is only ~52mb. So, I’m not sure what else you have with your runtime.

The runtime itself (the BlenderPlayer) is only around 11 MB, I think, and a default blend file’s only around 300 KB, so like Moguri says, the rest are libraries. While a BGE game might be a little large, it’s still not as bad as certain other engines (Unity and the UDK seem pretty large, I think).

blender 2.58 (32bit) runtime (total with lib and dll’s) 55,5mb
blender 2.58 (64bit) runtime (total with lib and dll’s) 64,6mb
Unity empty project ( for windows build) exactly 15,9 MB (16.773.120 bytes)

anyway, upx doesnt working for compress exe do we have any other option or we dont have any choices of this bigger package sizes? :slight_smile:

Well, not everything is strictly needed. For example, if you don’t use ffmpeg (I think this is mostly for video texture, but probably some audio stuff too), you can create a build without it (~15mb). BlendThumb.dll and BlendThumb64.dll aren’t needed, so you can delete those if they are there. You could also trim back the Python standard library, if you have any of these folders in your 2.58/python/lib folder, you can probably delete them (depending on what you’re doing with Python):

  • curses (used for command line guis; 32kb)
  • distutils (used for building Python C extensions)
  • idlelib (pretty sure this is used for IDLE)
  • json (used to parse and create json data; 56kb)
  • lib2to3 (used to convert Python 2 code to Python 3)
  • sqlite3 (used to interact with sqlite databases; 12kb + 443kb sqlite3.dll)
  • test (various test files for Python, you really don’t need this; 12.2mb)
  • tkinter (a Python gui library)
  • unittest (used for unittests, which you probably don’t need in a “release” build; 128kb)
  • urllib (used for connect to web services and such; 140kb)
  • xml (used to read/write XML data; 316kb)
  • xmlrp (I think this is remote procedure calls over XML; 88kb)

Then there are some large libs without folders:

  • ssl (Secure Socket Layer stuff, 19kb py file and a 1mb _ssl.pyd file)

The folders that I didn’t list a size for should already be empty (Blender doesn’t copy everything).

Trimming back the Python standard library out of my 32bit runtime (default cube scene), I get a total size of 39.2mb. Not a whole lot better, but I think that’s about as small as you’re going to get.

I’ve done what Moguri said in the past, I got my python lib from 23mb down to 6mb (make sure you remove all the .pyc files as well, a good way to tell what you can remove is by running your game completely then deleting every python file that doesn’t have a corresponding .pyc file).

In total, my game is 31mb including all the game data. It compresses down to 10mb as rar archive and 13mb as a zip archive.

Good point, thanks