In my experience with the blender game engine, massive pre-load times and unstable executable files have crippled many of my projects. Am i doing something wrong here, or is this a BGE problem? Is there a way to better manage the files that go into your executable like in unity or other such game engines? It seems blender copies allot of files into the exe that go unused or are not properly compressed. Is their any way to fix this? Sorry this is such a broad topic, but I am just asking around to find things out that are not immediately obvious in the manual.
Basically, the initial loading time of you game will be proportional to the size of the blend file you created your executable from plus the amount of data it has linked from other blend files. If you’re cramming and linking every single asset into a single blend file, then your initial loading time is going to get pretty long pretty fast.
There are a couple ways you can handle this.
- Use multiple blend files by calling the startGame() method
- Load data as it’s needed using LibLoad()
Each has it’s advantages and disadvantages. startGame() is easy to use, but can be somewhat limiting as you can only use assets that are contained or linked in the target file at once. LibLoad() is much more versatile, but also a bit harder to use and still has some bugs you may run into.
EDIT: Forgot to mention you can put your assets in different scenes as well to improve load times. This will generally have the same benefits as startGame(), but all you assets will be in the same file and you can have multiple scenes active at the same time.
You can have a large blend file which loads quickly if very little is in the active layer of the current scene. If you then add your assets to the main scene one at a time instead of all in one tic, you can set up a loading bar to show the progress of the game setting up. Most players would rather sit through 20 seconds of that that “5 seconds of blender has stopped responding”.
Thanks for the help. I don’t want to seem like a twat, but i get massive load times on even tiny .exes with just a few total objects. Also, the blender executable don’t always want to work. I was at a junior programmer competition last year with a game i made in blender. It only worked on 60% of the judges computer. Sometimes it would take a few seconds to load, sometimes 3-5 minutes. These were decent computers, many were better then what i had made the .blend in. I am not trying to be difficult, but these issues have forced me to move to unity, which so far has given me much greater stability. So basically, what i am trying to say with this, is I tried your advice, but i still have issues. Is there any thing else you could think of that might help?
There are some other exe type packagers in the resources part of the forum…
It bothers me too, back in Blender 2.49b I could package a Blend and it’d work on any windows computer, but these days it’s a bit hit and miss. I’ve made games before for open classes (the principle and kids parents come to watch me teaching the class) and had them fail to run, it’s embarrassing.
You may have to make sure that all the dll files from the Blender fold are present in your exe folder. That was a problem in the past but maybe not now…
Make sure all textures are packed.
Make sure you packaged the file on teh same sort of operating system as the computer you’re going to use (I sometimes packaged them on the school computer to be sure).
thank you for the help, i am looking into other exe formats!
Smoking_mirror has a point, loading objects from another layer individually (daisy-chain loading) does help. If multiple objects have the same general texture, but different colors; you can usea grayscale texture and object colors (thus sharing materials). If objects can share the same mesh, do it. This lowers filesize. One large object is better than twenty smaller ones, so make land masses and levels from one object if you can. Groups are your friend; group linked objects so you just have to link groups. Grouped objects are faster, you can group all objects in a file and load them individually; blender handles groups as one object. If you have trouble with animations, try falsetto anims. Look through my threads and youtube channel to find them (and my OGA link). This is all the help I can give, my HD died yesterday and I’m re-installing everything.