Back when I sent out the first beta copy to MrPineapple I've been relentlessly making the engine as effecient as I can (memory is another matter!). It worked by disabling the group of events that cause disposable effects, destroying the currently dispatched bulk of disposable effects and by stopping high-quality rotations and scaling if the FPS dipped 5 frames below the target.
Now! This is the pickle! To ensure it ran smoothly I let players select the FPS they wanted. Daft idea huh. They were 50, 55 and 60fps. But that's poor because it unbalances gameplay between speeds.
From playing around with what I could of the recent HWA beta I realised that the game is smooth without it so I'm removing the FPS option and making it a constant 60. But! To ensure that constant 60fps I'm adding (well, replacing) an option to choose if you want the FPS balancing system off, loose or tight.
So here's a pic! Top row are pictures with everything set to lowest settings/effects, bottom is the game at full.
Some pictures may have much difference but the performance change certainly is. Low settings runs smooth on my ancient Pentium 3 system, High runs smooth on my 2ghz C2D. Oh and the water wavey effect is quite subtle in game and almost impossible to see in the pics!
Low mode also completely shuts off the particle system which handles stuff like dripping water, bits that move throughout water (planktonish), shiny dots on the surface of water, insects that gather around light sources, explosion debris, trails, explosion shiny bits, bubbles, water currents and fans. Necessary effects (like the flame trail on the bomb) is limited to appear for 1 frame before being destroyed.
Here's an idea i had whilst making my last game. With loads of particles flying about normally the event editor would have to handle the maths behind repositioning them. The Hardware acceleration build doesn't affect that as far as I know.
So what I decided to do was move halve of them upon 1 frame then move the other half upon the 2nd frame and so on. Of course this halves their speed so I just made them move twice as many pixels per update.
If you can do that for everything that moves you can basically half the amount of processing your moving objects need. But obviously there are some things you don't want to do that for like your main character.
Another thing I tried was deleting objects in sections of the level that is impossible to go back to. For my Turrican fangame this helped quit a bit because there could be hundreds of enemies left behind if you don't kill them. Comment edited by AndyUK on 3/17/2009
That's not a bad idea actually. Think I'll stick that into the low quality mode for some particles.
I guess you could also have it set to only move particles if one of their flags is on. And every frame it toggles half their flags. So long as its uniform it might work.
Thats the same problem I've had with bigger level games - what to do with inactive enemies. I found the best way was to give them an on/off state and once the player is so many pixels away from an enemy it turns itself off, physics and all.
And thanks for the testing requests guys but I'm okay for now! I'll need a bunch to test it from start to finish when its done though, to cast a fresh set of eyes over something me and Piney have seen a billion times over.