A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Sprite Sheet vs Individual Files, need somene who know what he's talking about

  1. #1
    Junior Member
    Join Date
    Oct 2008
    Posts
    9

    resolved Sprite Sheet vs Individual Files, need somene who know what he's talking about

    Seriously, I searched the whole internet for an answer for the following question, and people dump their worthless, redundant opinions:

    What is the the best choice between keeping an animation in individual frames/files (png) or a sprite sheet (one next to another)?


    ...Sprite sheet kills some asynchronism since its one damn file, but the bitmapdata width and height limit how many frames i can work with plus i export from 3d max as individual files and its a ***** to make a sprite sheet of >20 frames.


    I am using bitmapdata and know as 3.0 and the fp10 to the bone speak with your highest intellect roll.

  2. #2
    When you know are. Son of Bryce's Avatar
    Join Date
    Aug 2002
    Location
    Los Angeles
    Posts
    838
    There are some posts at the Touch My Pixel blog about this exact question. The conclusion was that it was way better to use a sprite sheet rather than individual files, sprite sheets are faster and take up less memory.

    Caching Animation Frames VS Spritesheets

  3. #3
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    try gluit or any other sprite sheet making program. there are a lot of em.
    in my opinion sprite sheets will considerably reduce the size of your .swf.
    if image size is your concern then just use multiple sheets.
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  4. #4
    Funkalicious TOdorus's Avatar
    Join Date
    Nov 2006
    Location
    Nijmegen, Netherlands
    Posts
    697
    http://board.flashkit.com/board/showthread.php?t=780658

    Conclusion
    A bitmapdata contains the actual picture and some extra methods and properties. I get the impression that this overhead is actually bigger then the picture it can contain, but I haven't tested that. This means that less bitmapdata's containing bigger pictures take less memory then a lot of bitmapdata's containing smaller pictures. In other words: spritesheets win.

    Btw, FP10 hasn't really got a memory limit on cached bitmapdata's as fas as I can tell. I even tried pushing up to 700mb into it.

    @Son of Bryce
    They really are faster too? Both use copypixel() to draw, so I can't imagine that a copypixel on a "bigger" bitmapdata is faster than one on a "smaller" bitmapdata.

  5. #5
    Senior Member Pazil's Avatar
    Join Date
    Sep 2006
    Location
    Ontario, Canada
    Posts
    913
    @TOdorus, I think that Son of Bryce was referring to the runtime speed of the files. One large bitmapData can scroll very fast, which is faster than swapping actual bitmapData's.
    WIP-ZOMBIES

    I love vegetarians! More meat for the rest of us!

  6. #6
    Funkalicious TOdorus's Avatar
    Join Date
    Nov 2006
    Location
    Nijmegen, Netherlands
    Posts
    697
    We're talking about bitmaps and the scrollrect method? I prefer to have one bitmap which bitmapdata I update through fillrect() and copypixels(), so I couldn't see any difference in speed. As I understand: less objects to draw means less times to update the screen.

  7. #7
    Senior Member Pazil's Avatar
    Join Date
    Sep 2006
    Location
    Ontario, Canada
    Posts
    913
    Ah! I just snapped on! I now get the graphical pipeline we're talking about...I was thinking about using the default Sprites/Bitmaps etc. stuff.

    In that case, there really isn't a speed increase, unless the amount of memory the .swf is taking up becomes a problem...

    P.
    WIP-ZOMBIES

    I love vegetarians! More meat for the rest of us!

  8. #8
    Junior Member
    Join Date
    Oct 2008
    Posts
    9

    resolved

    i am satisfied with the replies, thanx, but there IS a limit for bitmapdata and I WILL split into individual frames after i load it, then blitter with the current frame of the animation.

    I know that a bitmapdata contains more information than just the pixel matrix color but ram memory isn't really a problem for computers anymore...its cheap and affordable now

    I will make some tests to see exactly how much % is added with individual frames than the sprite sheet.

    thanx for the name of the sprite sheet maker, will tickle it for the rest of the day
    thanx guys for the help

  9. #9
    Funkalicious TOdorus's Avatar
    Join Date
    Nov 2006
    Location
    Nijmegen, Netherlands
    Posts
    697
    Quote Originally Posted by Discipol View Post
    I know that a bitmapdata contains more information than just the pixel matrix color but ram memory isn't really a problem for computers anymore...its cheap and affordable now
    There are some buts there though. XP can only use up to 1gb of ram, so using a lot of it for just a browsergame can hog the system. Another thing is, that people won't trust it, if they see their memory usage skyrocket. This all doesn't really matter if you're just making the game for the sake of the game, but if you're making this game to be played by a lot of people, you might take that into consideration.

    I'm also interested what proportion of memory usage by spritesheets you'll find and what the actual limit for bitmapdata of fp10 is.

  10. #10
    Junior Member
    Join Date
    Oct 2008
    Posts
    9
    @Todorus: check this out http://www.bit-101.com/blog/?p=1426

  11. #11
    Funkalicious TOdorus's Avatar
    Join Date
    Nov 2006
    Location
    Nijmegen, Netherlands
    Posts
    697
    Didn't know it worked like that in 10, nice to know. I was actually talking about the limit on memory usage of all bitmapdata's, not the size limit of one bitmapdata. fp9 wouldn't let you create new bitmapdata's if it exceeded a certain limit.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center