The Armor Games website will be down for maintenance on Monday 10/7/2024
starting at 10:00 AM Pacific time. We apologize for the inconvenience.

ForumsProgramming ForumOptimization

4 5085
akunu
offline
akunu
35 posts
Nomad

Hello! I'd like to take a moment to talk about one of the most important and easily overlooked topics in game creation: optimization.

what is optimization? Well...

In computer science, program optimization or software optimization is the process of modifying a software system to make some aspect of it work more efficiently or use fewer resources.[1] In general, a computer program may be optimized so that it executes more rapidly, or is capable of operating with less memory storage or other resources, or draw less power. (Wikipedia)

To put it simply, optimization meansmaking your game run better, faster, and easier. For beginners,it doesn't seem important because most of what they make is SUPER simple and doesn't take that much to run,but once they get later in development, suddenly they see that those simple techniques aren't so great. The framerate drops and load times skyrocket.

Why is this?
Basically, every time flash runs a new frame, it has to erase everything on screen and re-draw it. Again and again and again. If your game runs at 30fps, it has to re-draw everything 30times Each second. ****! thats a lot of drawing.

How can we fix this?
More than often, in flash games we use MovieClips for everything. BAD IDEA. If used correctly movieclips can be powerful and fast, but usually are used wrong. The best way to ensure a faster runtime is to use bitmaps. When I talk about bitmaps, I mean image bitmaps like .png's and .jpg's.

Here's a fact of life: Bitmaps are faster. Accept it. Embrace it. Love it.


The bottomline
Anything that can be made into a bitmap, make it into it. Bad code and oversized mp3's can also make for a slow game, but unfortunately, only you can figure out ways to fix these.
  • 4 Replies
akunu
offline
akunu
35 posts
Nomad

A last quick note
I always recommend new game frameworks like flixel and flashpunk to beginners. These come pre-optimized and are SUPER fast.

akunu
offline
akunu
35 posts
Nomad

Why are bitmaps faster?
Im sorry,I forgot to include this D:. Remember how I said flash has to re-draw everything alot? well, to draw a simple movieclip, flash has to calculate each and every point (or Vector)in that image, THEN draw it. EACH AND EVERY FRAME. Bitmaps, however, do not need this and flash only has to pluck it from the library and throw it on the stage. Make sense?

gaboloth
offline
gaboloth
1,612 posts
Peasant

Uh, ok, so I gotta use bitmaps. But, can you explain me what flixel is?

akunu
offline
akunu
35 posts
Nomad

Uh, ok, so I gotta use bitmaps. But, can you explain me what flixel is?

Flixel is a prebuilt as3 library that makes making games super easy.
In the words of the flixel website:
Flixel is a free Flash Actionscript library created by Adam Saltsman which is distilled from a variety of Flash games that he has worked on over the last couple years. It's primary function is to provide some useful base classes for creating 2D Flash games that developers can extend to make their own game objects.
Showing 1-4 of 4