A Flash Developer Resource Site

Results 1 to 15 of 15

Thread: [RESOLVED] Why is my game slowing dooooowwwwn

  1. #1
    talk to the hand! Never_land:('s Avatar
    Join Date
    Nov 2007
    Location
    your mother's bedroom
    Posts
    490

    resolved [RESOLVED] Why is my game slowing dooooowwwwn

    here's the beta of my game
    http://board.flashkit.com/board/showthread.php?t=790260
    direct link: http://insaneangel-fernando.devianta...BETA-121657073
    I just noticed that the after some use the game starts to slow down,
    I made sure of using only one enterframe, deleting all particles, and optimized the code all I could.

    can anyone help me identify this problem, or delete the garbage collector or wathever it is that creates this unknown lag.

    the lag can be noticed in the opening of each level, you play or leave the thing open for a while and Boom sudden lag.

    I wasn't going to show the game to anyone till it was complete but this is critical for me.
    Last edited by Never_land:(; 05-06-2009 at 04:35 PM.

  2. #2
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,928
    I'm not sure what to suggest mate. I would say it's where you're not killing things off correctly after you've created them, but if you're sure it's not that then I really don't know.

    10 meg or so ? Man that's a big piece of music, love the title screen effects though.

    Squize.

  3. #3
    talk to the hand! Never_land:('s Avatar
    Join Date
    Nov 2007
    Location
    your mother's bedroom
    Posts
    490
    no it has 4 different tracks
    I'm still banging my head against the wall, looking what the problem might be, nothing produces a trace when deleted so it has to be something else.
    thanks

  4. #4
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,928
    Creating lots of big bitmaps and not disposing them correctly ?

    Squize.

  5. #5
    Funkalicious TOdorus's Avatar
    Join Date
    Nov 2006
    Location
    Nijmegen, Netherlands
    Posts
    697
    Quote Originally Posted by Squize View Post
    Creating lots of big bitmaps and not disposing them correctly ?

    Squize.
    Don't think so, that would show up in the memory usage. Can't say that the game uses That much.

    On startup I got this:

    TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@7db2b51 to flash.display.MovieClip.
    at magnetiZR_fla::Symbol7_14/
    ()

  6. #6
    Member
    Join Date
    Feb 2009
    Location
    Paris
    Posts
    79
    Are you using object pooling ? It helped me to speed up my shmup a lot.

  7. #7
    talk to the hand! Never_land:('s Avatar
    Join Date
    Nov 2007
    Location
    your mother's bedroom
    Posts
    490
    the background is tween animated I think I found where the problem concentrates, it has something to do with the shooting of the ink.
    The game only slows down if you shoot, the thing I still don't understand is that I created all the shooting particles(200) inside a MC at the start of the game and then control them individually,

    This is how I make them

    var launcher:Array=new Array();
    var launcher_a:Array=new Array();
    var launcher_b:Array=new Array();
    var launcher_c:Array=new Array();
    var launcher_d:Array=new Array();
    var changer:int=0;
    var bolt_maker:MovieClip=new MovieClip();
    for (i=0; i<200; i++) {
    bolt_maker=new bolt_obj;
    bolt_maker.visible=false;
    bolt_pool.addChild(bolt_maker);
    launcher.push(bolt_maker);
    bolt_maker.y=shooter.y;*/
    switch (changer) {
    case 0 :
    launcher_a.push(bolt_maker);
    changer=1;
    break;
    case 1 :
    launcher_b.push(bolt_maker);
    changer=2;
    break;
    case 2 :
    launcher_c.push(bolt_maker);
    changer=3;
    break;
    case 3 :
    launcher_d.push(bolt_maker);
    changer=0;
    break;
    }
    }
    This is how I launch them
    if (fire) {
    launch=false;
    if (lead+1<7) {
    lead++;
    if (activated_a) {
    launcher_a[lead].rotation=shooter1.rotation;
    launcher_a[lead].x=shooter1.x;
    launcher_a[lead].y=shooter1.y;
    launcher_a[lead].gotoAndStop(int(Math.random()*31)+1);
    launcher_a[lead].transform.colorTransform=color1;
    launcher_a[lead].visible=true;
    launcher_a[lead].id=1;
    shooter1.animator.play();
    if (shooter1.currentFrame<37) {
    shooter1.gotoAndPlay(38);
    }
    }
    if (activated_b) {
    launcher_b[lead].rotation=shooter2.rotation;
    launcher_b[lead].x=shooter2.x;
    launcher_b[lead].y=shooter2.y;
    launcher_b[lead].gotoAndStop(int(Math.random()*31)+1);
    launcher_b[lead].transform.colorTransform=color2;
    launcher_b[lead].visible=true;
    launcher_b[lead].id=2;
    shooter2.animator.play();
    if (shooter2.currentFrame<37) {
    shooter2.gotoAndPlay(38);
    }
    }
    if (activated_c) {
    launcher_c[lead].rotation=shooter3.rotation;
    launcher_c[lead].x=shooter3.x;
    launcher_c[lead].y=shooter3.y;
    launcher_c[lead].gotoAndStop(int(Math.random()*31)+1);
    launcher_c[lead].transform.colorTransform=color3;
    launcher_c[lead].visible=true;
    launcher_c[lead].id=3;
    shooter3.animator.play();
    if (shooter3.currentFrame<37) {
    shooter3.gotoAndPlay(38);
    }
    }
    if (activated_d) {
    launcher_d[lead].rotation=shooter4.rotation;
    launcher_d[lead].x=shooter4.x;
    launcher_d[lead].y=shooter4.y;

    launcher_d[lead].gotoAndStop(int(Math.random()*31)+1);
    launcher_d[lead].transform.colorTransform=color4;
    launcher_d[lead].visible=true;
    launcher_d[lead].id=4;
    shooter4.animator.play();
    if (shooter4.currentFrame<37) {
    shooter4.gotoAndPlay(38);
    }
    }
    } else {
    fire=false;
    }
    }
    The rest is my magnetic algorithm.

    This is how the game looks like in frames

  8. #8
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,140
    holy shmoly guacamole. I have never seen a time line like that before.
    lather yourself up with soap - soap arcade

  9. #9
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,928
    That's a sequencer rather than a timeline.

    "Don't think so, that would show up in the memory usage."

    True, I was just grasping at straws.

    Squize.

  10. #10
    talk to the hand! Never_land:('s Avatar
    Join Date
    Nov 2007
    Location
    your mother's bedroom
    Posts
    490
    fixed it, it was a stupid glow filter gone wrong.

  11. #11
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,379
    Game never slowed down when shooting ink, but comes to almost a complete stop on level intros.
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

  12. #12
    Now tell me whos watchin...... samvillian's Avatar
    Join Date
    Feb 2007
    Location
    Where do you live?
    Posts
    539
    Quote Originally Posted by mr_malee View Post
    holy shmoly guacamole. I have never seen a time line like that before.
    hahahahahahahahha

    That's exactly what was going through my head when I saw that pic lol. My eyes expanded 50x its size. Seriously though.... theres gotta be a more efficient way to organize that. like movieclips...


    This smiley about sums it up.
    If the only tool you have is a hammer, you tend to see every problem as a nail.

    Xbox 360 Modding Controller PS3 Mod Paint Spray LED Case

  13. #13
    talk to the hand! Never_land:('s Avatar
    Join Date
    Nov 2007
    Location
    your mother's bedroom
    Posts
    490
    come on it can't be that disorganized, I named most of the layers.
    "leap a loop" looks very similar and work fine

    "Game never slowed down when shooting ink, but comes to almost a complete stop on level intros."
    you need to shoot ink for it to start to slow down.
    Last edited by Never_land:(; 05-07-2009 at 12:33 AM. Reason: imba is in inside your soul overrating everything

  14. #14
    talk to the hand! Never_land:('s Avatar
    Join Date
    Nov 2007
    Location
    your mother's bedroom
    Posts
    490
    now my biggest issue is level design T_T, anyone has an idea pm me.
    the game also has portal magnets, color changing magnets.
    I do have a bunch of levels designed, if someone comes up with a beter idea I'd rather use the better idea.

    good night
    Last edited by Never_land:(; 05-07-2009 at 01:57 AM. Reason: I AM YOUR WORST NIGHTMARE

  15. #15
    talk to the hand! Never_land:('s Avatar
    Join Date
    Nov 2007
    Location
    your mother's bedroom
    Posts
    490
    yeah forget last post.

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