A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: maximum stage and sprite size?

  1. #1
    Member
    Join Date
    Jun 2011
    Posts
    85

    Question maximum stage and sprite size?

    Hello folks,

    I'm making an action game and I'd like to know what should be the maximum size of the stage (mine is 660 x 500).

    Also I'd like to know how big a game-sprite should be. Currently my biggest sprites have a size of 128 x 128 and I read somewhere on the internet that you should not make it bigger because of performance issues.

    If you want to make e.g. big explosions with shockwaves even 128 x 128 does not look very big. What's the maximum size I can definitely use for sprites? I cannot find any real solution about this so I appreciate every hint I can get because this topic makes me a little bit nervous.

  2. #2
    Knowledgable n00b BlueGeek's Avatar
    Join Date
    Nov 2006
    Location
    New York City
    Posts
    137
    First, screen size:

    There are a couple issues to consider when making this sort of decision, but most can be boiled down to who your end user is and how they will receive the content. Are you deploying to a website? Standalone application? Fullscreen? Windowed? Are you willing to make a note that older systems may not be able to properly run this game?

    If you're running in a browser, remember! Flash is scalable! With the exception of any bitmap type data you have in your SWF (see: sprite size) the window dimensions you provide in the Flash application only really affect aspect ratio and default size (any website that hosts your game will likely override it's size in the embed/object tags) and will NOT change the file size of your export. Usually something in the 600 range is a good habit, although many large sites accept larger (for example: NewGrounds goes to 942x700).

    A standalone application is a little bit more involved and depends mainly on if you intend to run in fullscreen mode or not. For a windowed application, 1024x768 tends to be a decent resolution to assume that any modern computer has (going back to at least 2000) so take 50 to 100 pixels off of the height of that (for menu bars / start bar) and you can use any dimension in that range safely. Unfortunately stageWidth and stageHeight are READ-ONLY, so you can't have the user choose their resolution. Flash is a little more forgiving with it's restrictions on fullscreen applications. There are a TON of great tutorials on the web for this. In this case, you don't need to make your application run at the same resolution as the screen, you only need to pick one of several behaviors (for example: Scale up, Stretch, Center, etc). Each of these is VERY customizable through AS3.

    Now, sprite size:

    I've never heard of the 120x120 limit, but that sounds VERY restrictive. I use larger sprites all the time. Are we talking about the Flash Sprite object? Or imported bitmap data? Sprite objects don't have a very meaningful dimension property, just one that sort of affects the scale. Bitmaps do have a size limit, but it's not nearly that low. From Adobe's AS3 docs:

    In AIR 1.5 and Flash Player 10, the maximum size for a BitmapData object is 8,191 pixels in width or height, and the total number of pixels cannot exceed 16,777,215 pixels. (So, if a BitmapData object is 8,191 pixels wide, it can only be 2,048 pixels high.) In Flash Player 9 and earlier and AIR 1.1 and earlier, the limitation is 2,880 pixels in height and 2,880 in width.
    I have never had any performance issues that weren't in scale to the size of my bitmap. In other words: of course the larger the bitmap, the more CPU power is needed, but not more than you'd expect, and certainly not at any point such as 120x120.

    Choosing the right bitmap size is really just a matter of style. Smooth modern clear graphics? Or do you want retro 8/16-bit style blocky graphics? If you're going for the latter you can make your bitmaps tiny. There's no need to represent 1 pixel with 16 just to make the image 4 times larger, Flash will scale that up for you happily.

    Hope this helps,

    Sandy
    Last edited by BlueGeek; 10-31-2011 at 10:22 AM.
    "...there were only two good books in the hotel gift shop and I had written both of them."
    -Douglas Adams

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