Some big issues with memory optimisation

Hello,

We are working on a game named Small Planets. You can read the specifics on that page : http://small.planets.free.fr/
We are currently facing some huge memory usage issues. The game needs around 500/600 Mo to run. What can we do to decrease that memory usage ?

Here’s a light demo with only one level : http://small.planets.free.fr/demo.zip. It uses up to 250 Mo of memory…

Any help appreciated :slight_smile:

Can’t help but really nice looking demo… only 7fps on my PC though (Athlon XP 2400+)

Hmm…nice demo, good artwork. At first I get about 40-50 fps, but for some reason the logic skyrockets from 13% to 60%, in which the fps drop down to 9%. Also, I couldn’t get any of the characters to move, I’m guessing I will need a joystick for it though.

I think the reason you’re getting such a high Mo useage, is because of all the logic on each character, and all the python scripts. I really suggest making things more simple, because otherwise you will be stuck with a high Mo useage, and a low fps.

Although I must say…this truely is pushing the game engine to its limits.

Nice demo, i couldn’t quite work out what the purpose or all the keys were but heh :p. 60 fps here.

Edit: I was able to move the characters, the keys are all scattered across the keyboard, though. It remained at 60 fps all the time for me. It’s not pushing the engine to it’s limit’s, but users computers.

500 Mo!!!
Change the game engine!! Maybe Ogre3D and his tools? Blender exports “well” to ogre.
Seriously!
Your team looks “good and motivated”.
Try to find some coders?

Beautiful scenery :slight_smile: But I don’t have a joystick, and the key configuration is obviously made to be mapped and not to be used directly…

You should specify that the game requires the pygame library (well, it’s said in the “installation” file, but I didn’t saw this first). This is probably the problem Facemania encountered.

I don’t know much about memory usage, though. I noticed you are using a lot of key sensors, you could group them into one sensor with “all key” and get the list of currently pressed keys in your script. This could reduce the logic usage a little, but I don’t know if this is related to memory (probably more to CPU load).

Just in case, Blendenzo gave some guidelines to reduce logic load in this thread : http://blenderartists.org/forum/showthread.php?t=98665&page=2

This thread might help too.
http://blenderartists.org/forum/showthread.php?t=99237

I finally finished downloading your game.

When the game starts up I get about 15 fps. A few seconds later, blender slows down so bad it crashes and gives me an error message.

Alas, I don’t think that there are any “categorical” answers to be offered about memory usage.

Basically, all virtual-memory computers strive to give every application the illusion that they have “unlimited” memory available to them. They try to pull-off that trick by keeping “recently-used” chunks of “memory” in physical RAM while allowing “not-recently-used” chunks to migrate to the swap-file. This works fine as long as the set of “recently-used pages” (geek term: the working-set) remains comparatively small vs. the total amount of “memory,” and if that working-set also remains (over time) fairly stable.

Look very carefully at what data your program (“game”) is trying to load into “memory” and at what point it is doing so. Any reference to a <<thing>> will cause that <<thing>> to be loaded. Even if your program (“game”) never refers to that <<thing>> again, the entire <<thing>> still got loaded. Virtual-memory systems can definitely “become constipated,” and the result (as in real life :rolleyes: ) … even if it resolves itself over time (ahem) … is painful and uncomfortable and definitely ‘to be avoided.’

At first I get 60 fps, then the fps drops to 5. I didn’t really get why the fps is somewhat good at start and the suddenly drops? Does blender fire up the logics and stuff a few secs after the game has started? Wonder why the logic bricks are slow anyway…

My comp specs to provide some benchmarking ;): GeForce 6600, AMD XP 3000+, 512MB RAM, 2x80GB hd

Ran the game on Ubuntu Linux, Blender 2.44 official build.

I get a lot of error messages.
File “initScene”, line 14, in ?
AttributeError: Uanble to find requested actuator

then it complains about files in /var/lib/python-support/python2.4 so I guess that has more to do with my computer.

Check so all scripts work, otherwise it will go slow. Also check so you only have what is absolutely necessary in a script connected to an always-sensor.

And I must say, it looks lovley.

If you have lots of error, or no control, you probably don’t have pygame installed.
Get it here : http://www.pygame.org/download.shtml
Choose the one corresponding to your python environment (I have 2.5, maybe 2.4 can work too).

Always 60 FPS (even while moving) with an Athlon 64 2 GHz, 1 GB RAM, nvidia 7600 GT.