My game takes minutes to load. Need help

Hi. I made a facial animation sometime ago which I’m trying to recover and improve. I started from a textured .vrml file, imported it to Blender and added an armature with key sensors to make some facial expresions.
The weird thing is that the animation takes almost 3 minutes to load.
Looking the TaskMannager during loading, it uses up to 64 MB of RAM memory, but if I minimize and maximize it, it only uses up to 8MB. Also, the .exe file takes all the unused CPU (even when it is loaded and running), but if I open other applications that need CPU, it reduces the CPU ussage but still works ok.
I made this question sometime ago and have some answers that speeded the loading time but I still think that 3 minutes is too much time. Any ideas or directions will be greatly wellcomed. Many thanks.

Is this in the game engine? If not, you posted in the wrong forum.

I’m using Blender’s game engine if that’s the question. The loading delay problem occurs both if I preview the interactive animation in Blender and if I save runtime and execute it separately.

whats the poly count?

It’s an scanned human face, with 10815 vertices and 20255 faces. The armature has 32 bones. It uses a jpeg file as texture source.

Yes…The 20255 faces and 32 bones might explain your problem…just maybe…

I bet that (high polys) could be the problem, depending on the speed of your computer how blender reacts to ipos in the game engine. I’m not sure whether they’re very cpu-intensive. I have a game with (i think, can’t check right now) 11k verts, but the physics settings are essentially zero, its just a big gallery to link to other games.

yea, check out the new topology tools, and make a low poly version of the face.
A 1000 poly mesh is somewhat pushing it.

Are there any textures involved in this? If so, what size are they?

My guess is that it’s the armature causing the slowdown. 20,000 faces shouldn’t take 3 minutes to load.

You can try this to find out where the problem is: Make a new .blend with only the face in it. Take out the armature and any textures, and press [P] to see how long it takes to load. If it still takes three minutes, then the problem is the model, and you should do what Mmph! said.

If it loads quicker without the armature and textures, then try it once with only the model and the armature, then try it again with only the model and the textures. You should be able to see which of the three is causing the long load time and address that.

(Of course, it could also be a combination of two or all factors…)

Textures are UV mapped from a 2048x2048 jpeg file. I’ll try what you suggest and post results. Thanks.

Ok, I’ve tested all posibilities. The conclusion is that the problem is in the number of polys plus texture. I’ve tried only with the armature (plus textured eyes, teeth and mouth) and it takes 2 - 3 seconds to load. If I run the “game” with only the textured face it takes about 3 minutes to load (same as before), and if I run the game with only the face untextured ( with the same poly count) it takes about half a minute to load.
I really should have tried this before asking (I’m feeling too silly now :o). But I thought the engine could make it as the vrml model takes only seconds to load in Cortona for example, and blender deals with the model perfectly well.
So it seems the only solution is to decimate the model. It’s going to be like a pain in the neck to fit textures to the new polys …
Many thanks for your quick answers and suggestions.

your texture is twice too big, stick with 1024x1024 I’d suggest .tga files :wink:

Don’t feel silly. How could you have possibly know the face count and texture handling limitations of Blender’s game engine? They’re not really written down anywhere obvious (probably since there is no real solid number to go by).

Besides that, most people don’t think the way I do (I haven’t always thought that way either… I had to learn it through experience like anyone else). Here’s a simple set of rules I’ve come to use for basic debugging on programming and performance problems:

  • Identify the problem.
  • Identify the factors involved.
  • Isolate the factor or factors causing the problem.
  • Resolve the problem by addressing the specific cause.Isolating the problem factor is sometimes difficult. If the problem is with something small in a larger project, try building a small mock-up of that specific part. Getting it to work correctly is much easier when you don’t have all the distracting clutter of the other code and objects. Once you’ve gotten it to work correctly on its own, it is usually a simple thing to re-integrate the working piece.

Almost all problems involve more than one factor, and if you’re not sure which factor is causing the problem, separate them and observe them one at a time. This will show you exactly which factor is causing the undesired effect (or, in the case of multiple problems, exactly how much negative effect each factor is having).

The largest causes of long load time are

  • large textures
  • large .wav sound files
  • high face count or object count
  • complex armaturesThe largest causes of slow framerates are
  • poor OpenGL support (make sure you have the newest driver for your card from the manufacturer, not from Microsoft or the OSS community)
  • lots of physics
  • large or wrongly sized textures (always use dimensions that are powers of 2, generally keep dimensions to a max of 1024x1024)
  • face count
  • complex armatures
  • code errors (check the console window for error reports)
  • duplication and unnecessary firing of logic bricksI hope that helps you out. That info is not really written down anywhere else that I know of, so I thought I’d share it for your benefit.

Decimate really isn’t the best option. I suggest that you either use the original model as a basis to draw the new model from, or look into the new topology tools that Mmph! was talking about (I don’t know much about those, so I’m sorry I can’t point you in the right direction).

WOW! just thanks. I’m sure your post will help lot of users not just me as it gives lots of interesting clues. I’m going to try and isolate the problem a little more. If I find the solution I’ll post it. Again, many thanks.