A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 24

Thread: [F8]Dev frame rate different from browser?

  1. #1
    Senior Member
    Join Date
    Jul 2006
    Posts
    150

    [F8]Dev frame rate different from browser?

    I've been working hard for weeks then I finally tested my game on a browser. I tried many different publish settings but I can't get the speed I see in the dev version (CTRL+ENTER). My game is just 400x300, tiled bitmap screen, maybe 30-40 mcs, 10 visible usually at a time. I don't scale anywhere.

    In dev I can get 45 FPS or more, but testing on various browsers it only goes around 35 FPS or less. Is this a normal occurance? Should I trust what I'm seeing in the browser and dev for that speed?

    Thanks!

  2. #2
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    It is completely normal. Flash movies have always been slower in the browser.

  3. #3
    Senior Member
    Join Date
    Jul 2006
    Posts
    150
    Does it make a difference if the bitmaps are GIF or PNG? There's something I'm doing wrong because Heli Attack has a lot more stuff going on than I do.

  4. #4
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    As to the browser slow down issue, I've posted a good link in the knowledge base which will help clear things up for you.

    Bitmap wise, you're only going to get a performance decrease using png's which are alpha blended ( ie, 24bit pngs ).

    Also it's pointless comparing a game to another one in terms of speed / objects ( Like the recent thread comparing a demo to Fancy Pants ), how it's actually coded has a big impact. iopred has probably done a lot of things differently internally to how you've done them, so it's just comparing apples and oranges.

    Squize.
    Last edited by Squize; 11-25-2006 at 02:57 PM.

  5. #5
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    - cache as bitmaps (if you have vectors)
    - scollable tile engine
    - bitmap data (no flash vectors)
    - smal screensize (aka on 640*480+)
    - no flash gradients
    ...
    just to name some

  6. #6
    Senior Member
    Join Date
    Jul 2006
    Posts
    150
    Thanks all. Squize can you post a link to that article, I'm not sure where to find that.

  7. #7
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    Knowledge base sticky at the top of this forum mate, second post in.

    Squize.

  8. #8

  9. #9
    Senior Member
    Join Date
    Sep 2004
    Posts
    633
    For internet explorer if you use wmode = "transparent" when you embed your movie it will run at exact same speed as in a standalone player. It's as simple as that.

    You can forget about all the other nonsense. This works every time unless you have something really fishy going on in your code.

  10. #10
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    But that breaks Flash games for FireFox, so either you have to have two versions, alienate a large percentage of your users, or preferably not use it

    Squize.

  11. #11
    Senior Member
    Join Date
    Sep 2004
    Posts
    633
    You don't need to use transparent mode for Firefox. It all depends how you embed it.
    So they will still get the same game they'd normally get, but there is no need to penalize IE users when there is a way to give them full frame rates.

    Or you need to be careful about your interface. Key presses sometimes don't work in Firefox when using transparent mode, so if you can use mouse for everything.

    But, check this out in Firefox http://www.deusx.com/football

    Transparent mode is used for both, and you can control the keeper with keys even in firefox, but you can't use space key to curve the ball in firefox ( worth checking why exactly that is )

  12. #12
    Senior Member
    Join Date
    Jul 2006
    Posts
    150
    The wmode trick works great for my game on IE, it's perfect now. Wmode in Firefox doesn't seem to do anything, but it didn't look like it was broken either. Keys worked fine. Is there a way for Firefox to get near full frame rates too?

    Edit: Nevermind Firefox keys were broken, I put the WMODE tag in the wrong place. But the speed was perfect.

  13. #13
    Senior Member Ray Beez's Avatar
    Join Date
    Jun 2000
    Posts
    2,793
    weird. WMODE with FireFox is supposed to make it SLOWER.

  14. #14
    Script kiddie VENGEANCE MX's Avatar
    Join Date
    Jun 2004
    Location
    England
    Posts
    2,590
    Adobe open-sourced 130,000 lines of the Flash Player's source code (ie, the AVM - ActionScript Virtual Machine) for the Mozilla foundation recently (biggest donation they've ever received). I have high hopes that this wmode bug will be history when the next public release of Firefox comes out.
    http://www.birchlabs.co.uk/
    You know you want to.

  15. #15
    Senior Member
    Join Date
    Jul 2006
    Posts
    150
    I Googled lots of info on wmode for Firefox, it seems it can't be fixed. You can do a onKeyDown/onKeyUp instead but that doesn't work well with games. This was a real buzz kill for me. If there is a work around please let me know.

    This is like when I was making Java applets, everything was cool until I found out that you could not control frame rates properly in Windows because System.currentTimeMillis() was off. An obvious problem never fixed for so long.

  16. #16
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    firefox will be interesting for me with v3+ because right now its quite a mess (ram, performance). If I remember right v3 will be from the ground up renewed as alot of their libraries & code is from the old netscape days and isn´t up to date anymore.

  17. #17
    Script kiddie VENGEANCE MX's Avatar
    Join Date
    Jun 2004
    Location
    England
    Posts
    2,590
    I've used Firefox 3.0a (you can download WIP versions from their server), wasn't too impressed.
    http://www.birchlabs.co.uk/
    You know you want to.

  18. #18
    Senior Member
    Join Date
    Jul 2006
    Posts
    150
    Does anyone recommend a good frame rate for an all bitmap game? Is 45 FPS too much to hope for? Or better yet what is the frame rate of Heli Attack? I'm kinda using that as my inspiration

  19. #19
    Script kiddie VENGEANCE MX's Avatar
    Join Date
    Jun 2004
    Location
    England
    Posts
    2,590
    Here's a scale of framerates:

    11 fps - consistent speed on PCs and Macs
    12 fps - half speed that eyes normally see motion at; basically double-framed professional animation, also default framerate in Flash for this reason
    16 fps - speed at which eye can perceive things as a constant motion rather than a series of separate frames; minimum acceptable speed for a game to play at
    21 fps - consistent speed on PCs and Macs
    24 fps - speed at which eyes normally see motion at; used in professional animation, best if you want to show organic movement fluidly
    31 fps - smooth, consistent speed on PCs and Macs; used in the vast majority of Flash games, and also about the highest speed you can reasonably expect the Flash Player to keep up
    50 fps - framerate of PAL television broadcasts
    60 fps - framerate of NTSC television broadcasts
    120 fps - maximum framerate in Flash, only usually used in speed experiments

    Generally you lose about 10 fps from playing something in the browser, so for browser versions of games, developers tend to raise the framerate.

    In Firefox, after a few seconds of the game running, the framerate will permanently decrease by 7 fps (and nobody's quite sure why).
    http://www.birchlabs.co.uk/
    You know you want to.

  20. #20
    Senior Member
    Join Date
    Jul 2006
    Posts
    150
    Thanks, yes 31 is the magic number. Too bad I made so much animation already. There should be a guide that's called "before you start trying to make a game in Flash you should know this". Or maybe I just didn't spot it here.

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