View Full Version : What is better? Movieclip or Bitmap
HMPoweredMan
November 14th, 2008, 12:58 PM
I have a container that i fill with over 100 different 16x16 tiles.
I was wondering what would be better on performance. Having the conainer contain 16x16 movieclips, or 16x16 Bitmaps.
I currently am using the bitmap method, but my computer is higher end and I don't notice the difference. I'm assuming Bitmaps would be better.
ALSO
Is there a way to mask the tiles that aren't on the screen?
BeerOclock
November 14th, 2008, 01:29 PM
I suspect bitmaps would be faster, because a movieclip would need to contain the bitmap anyway.
Why not try both methods and test the speed of each? Id be interested to hear the results.
For masking the tiles not on the screen, you could set them to visible=false. But again, I dont know if Flash has some optimization of its own so maybe thats not necessary. Try a few methods and use some calls to getTimer(); to see what runs faster.
oldmanwinter
November 14th, 2008, 06:01 PM
I have a container that i fill with over 100 different 16x16 tiles.
I was wondering what would be better on performance. Having the conainer contain 16x16 movieclips, or 16x16 Bitmaps.
I currently am using the bitmap method, but my computer is higher end and I don't notice the difference. I'm assuming Bitmaps would be better.
ALSO
Is there a way to mask the tiles that aren't on the screen?
I'm not an expert but I think that when using vector graphics (the movieclips you're using are drawn with the tools in flash?), the users computer figures out how to redraw those graphics every frame, so for people with crappy computers i'd imagine there would be a noticeable difference in performance. Though again, I don't know for sure and i'm just speculating!
Judging from your avatar I'm assuming this is for a game, so i'd say go with bitmaps if it isn't too much trouble. As for masking tiles not on screen... in my games i usually have a "screen" bitmap, as big as the stage, and i think that when you use copypixels and you're drawing pixels in a spot that's out of the bounds of your target bitmap flash automatically stops drawing them (though again, i haven't tested that out fully so i could be wrong!)
babeler
November 14th, 2008, 06:52 PM
About the "screen", it's maybe better to have all your contents inside a Sprite (like if it was a layer), and then have a "screen" shape big as you like, that you use as the mask for the container Sprite.
About the tiles, it depends on the use you have for them. Do they move? Are they interactive? Because if they're not, it's better to draw them all inside one single Bitmap (and this way oldmanwinter's "screen" bitmap works swiftly). Otherwise, anyway, oldmanwinter is right: lots of bitmaps are better than lots of MovieClips, usually (less CPU, more RAM).
babeler
November 14th, 2008, 06:58 PM
P.S. nice game :) (kyleshawadventure I mean)
GrndMasterFlash
November 14th, 2008, 07:08 PM
really, the tile should be a graphic, of the bitmap, cause that way the bitmap only needs to be drawn once, and if you wanted to control all the graphics with script you could place them all inside 1 MC
HMPoweredMan
November 14th, 2008, 10:20 PM
Thanks guys. I decided I am using bitmaps and I've tried it on my friends computer that it used to run ****ty on, now it runs a lot better
If you guys could try it and tell me how it runs, that would be awesome
NEW version
http://www.thekyleshawadventure.com/KSA/BETA.html
OLD version
http://www.thekyleshawadventure.com/KSA/KSA.html
babeler
November 15th, 2008, 04:49 AM
In spite of me being back on an old computer (siiiiiiiigh my Dell Precision M90 just broke it's videocard :(), both versions work quite swiftly for me. If you're really curious to test it, you might insert an FPS counter to check actual framerate.
Anyway, if you needed the tiles for the backgrounds and such, Bitmaps are surely a lot better
levelup2
November 18th, 2008, 11:33 AM
I am glad to read it here.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.