Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

Results 1 to 4 of 4

Thread: Reduce lag in flash games.

  1. #1

    Reduce lag in flash games.

    I posted this here because it is more on the graphical side of game design.

    I recently created a game called PandaAttack. It was okay, everything worked well. However when I tried adding more features, it lagged. So I had to take them out.

    The question is, what are some techniques to reduce lag on a game? (or any flash movie in general)

    Bored!? Please rate these flash movies!

  2. #2
    well i suggest oop if you not already using it

    classes

    being able to create new objects and delete them is the best way i can think of it

    when ever you say thisfor example
    Code:
    test=new Array()
    when your done with you would say
    Code:
    delete test;
    flash doesnt really have any memory related functions so when you think of it the more memory you have the better, so its better to dynamically create objects on the run such as iterators etc... not everything in a game has to be dynamic though, like say

    Code:
    var lives:Number=5
    it has a set amount of memory it takes up. and since as2 doesnt really have data types (int, long, double, char,float) you just have to assume that its the highest amount of memory it can take up. hence why the flash player is so slow... as3 introduces these types i think* as uint,int,double,,etc...

    so you kind of have to work around that, also arrays take up alot of memory, so the bigger the array, the harder it is on you computers ram

    -yours

  3. #3
    Hey, thanks for the reply, but I can't see your codes!

    Bored!? Please rate these flash movies!

  4. #4
    Make sure you have as little code running in "onEnterFrame" functions as possible.

    Make all offscreen movieclips invisible, and delete movieclips that aren't going to be used anymore...

    Don't use semitransparency(eg: "_alpha = 66"), or use as little as you can manage.

    Don't use a bunch of movieclips if the same task could be completed with fewer.

    Made-up-but-probaby-true fact of the day: 99% of slowdowns in Flash are caused by graphical things.
    I created Trainyard and now I'm making more awful games.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012