Page 1 of 4

Ideas for Optimization - Windows Mobile

PostPosted: Wed Sep 02, 2009 1:25 am
by OmniArts
For optimizing a game for Windows Mobile.. please read on

General
-----------
-Activation Regions
-Lowest Sound quality - 11025 Hz
-Keep view movement to the minimum -- don't make the player its parent
-Keep your Code Clean!!
-Beware of collisions!! They will lag your game

Images
-----------
-Decrease the size of each image
-Slice Images up in GIMP or PS
-Try not to overlap Environment Images

Animations
---------------
The amount of frames you have in your animations really isnt a problem (I have 2000 frames in my game) but make sure you keep your images small.
If you want to get your images smaller try decreasing the color depth!

Bee-Ants Tricks
---------------
Turn off activation out of vision.
Avoid mega cloning usage (clone more than 500)
Use narrower view
Use multifunction actor
Avoid too much of collision usage
Use midi for the music


Any more suggestions would be helpful.

Re: Ideas for Optimization

PostPosted: Wed Sep 02, 2009 2:54 am
by Chai
For background picture, .JPG is better than .GIF
Resize the picture as small as possible.

Re: Ideas for Optimization

PostPosted: Wed Sep 02, 2009 12:08 pm
by cforall
:D
If you use .PNG, try to use png optimization tools like PngOptimizer/PNGOUTWin...
most of these tools use diferent algorithm , so use 2 or more tools to make your image smaller~

Re: Ideas for Optimization

PostPosted: Wed Sep 02, 2009 1:20 pm
by Hblade
cforall -
You dont realy need a PNG Optimizer, simply use the gimp, click save ass, then of course png, then you have all of these selections. Uncheck them all, and an image thats, say 640 X 480 will be like, less then 1 KB

Re: Ideas for Optimization

PostPosted: Wed Sep 02, 2009 2:45 pm
by OmniArts
oh really? Damn I should be switching to Gimp :)
Our character images are around 80 x 80 and currently 4~5kb, but I will give this a try!

Re: Ideas for Optimization

PostPosted: Wed Sep 02, 2009 3:12 pm
by Hblade
Ok. Heres an example
tran screen.png

With transparrency - 50-KB
Here's one without transparrency
trans2.png
trans2.png (985 Bytes) Viewed 4014 times

It's less then 1 KB

Re: Ideas for Optimization

PostPosted: Thu Sep 03, 2009 1:21 am
by cforall
Hblade wrote:Ok. Heres an example
tran screen.png

With transparrency - 50-KB
Here's one without transparrency
trans2.png

It's less then 1 KB

OK :mrgreen: :mrgreen: :mrgreen:
I just never heard this before,
I will try,
Thx~

Re: Ideas for Optimization

PostPosted: Thu Sep 03, 2009 2:19 am
by Hblade
Ok :D Glad to help. I'd say this is probably one of the top 3 ways to imporove Game performance

Re: Ideas for Optimization

PostPosted: Thu Sep 03, 2009 3:43 am
by OmniArts
well, I have used gimp, compression level 9 and unchecked all the boxes, but my image is still 2.7kb
Anything im doing wrong?

Re: Ideas for Optimization

PostPosted: Thu Sep 03, 2009 3:49 am
by Hblade
Hmm, that is strange, your not doing anything wrong either. Well, I guess thats about as optimized as its gonna get :D

Re: Ideas for Optimization

PostPosted: Thu Sep 03, 2009 6:55 am
by cforall
:D Guys...I run a test with dwarf_attack10020.png to check the compression ratio... :D

1.
Firstly I use PngOptimizer to optimize (2790 bytes -> 2533 bytes) (90%)
and then I use PNGOUTWin to Optimize (2533 bytes -> 2497 bytes) (98%)
2.
Firstly I use PNGOUTWin to optimize (2790 bytes -> 2714 bytes) (97%)
and then I use PngOptimizer to optimize (2714 bytes -> 2533 bytes) (93%)
again I use PNGOUTWin to optimize (2533 bytes -> 2497 bytes) (98%)

I find many articles about "Gimp vs PhotoShop"
so I think Gimp may be good at image editing~but not good at image compression...

Re: Ideas for Optimization

PostPosted: Thu Sep 03, 2009 7:42 am
by OmniArts
ah, finally. In Photoshop i "saved for web" and unchecked all the boxes, saved it as png-8 and selected 16 colors (i know that it's small but it really doesn't degrade it too much because of the images size)

But behold.. 926 bytes :)
Now I'm hoping I can get the script working properly in Photoshop so I don't have to this for every image lol

Re: Ideas for Optimization

PostPosted: Thu Sep 03, 2009 2:31 pm
by Hblade
Now that its 16 bit try again in Gimp it'll probably be like 30 bytes xD

Re: Ideas for Optimization

PostPosted: Thu Sep 03, 2009 4:54 pm
by OmniArts
I just got the image down too 800 bytes, thats decent for me.
Well just to update on my optimization progress.. the game is working wonders now, the image compression helped a little, but what really got the game running fine was the removal of our collision barrier (which kept u inside the arena) So I need to think hard on a work-around for this!

Re: Ideas for Optimization

PostPosted: Thu Sep 03, 2009 5:04 pm
by Hblade
Theres another way to stay inside the arena. ok, what ever key moves your character, say... left, you'd say, if (x>areana.x) { x = x - 4; } this would make the character move left ONLY when he's in the arena, when he reaches the arena's X he stops moving :D