Laggy problem here

williamt2706williamt2706 Member, PRO Posts: 85
edited September 2012 in Working with GS (Mac)
Hi everyone,

My first game is release a two weeks ago, and it has some serious laggy problem.
So i decided to make an urgent update to reduce the memory usage such as uncheck preload art, change timer to "self.time", match the size of the image and the actor, and destroy the actor when it left the scene. When i tested it on ipod 3gen ( i always use this to test my game, because if it goes smoothly on older device, it will done better on newer device as i think), and it goes smoothly runs at 50-60 fps, and i decided to submit to apple and update my game. And the update is available today, and i installed it on my ipod (4gen), and the laggy is still there! a lot better performance than the first version by the way, but the laggy is not gone for good.

And i totally ran out of idea how to makes this game runs smoother. Any advice?
screenshot from my game:

image

The ninja size is 128x176, and i know it will consume 128x256 of ram. And it can be spawned 3-5 ninja at the same time. Is the laggy problem come from the amount of the ninja spawned? But the most critical part is when i pause and unpause the game, the ninja spawned just dissapear after i unpause the game like it has left the scene. And i don't want to sacrifce the image quality to improve performance if possible.

Comments

  • williamt2706williamt2706 Member, PRO Posts: 85
    anyone?
  • mELTINGsKYsTUDIOSmELTINGsKYsTUDIOS Member Posts: 158
    edited September 2012
    Its hard to tell from the info you have given. Do you use a lot of timers? Timers tend to slow things down, or constrains. And it sounds like your pause is messing with the destroy rule... maybe the timer for it keeps running?
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited September 2012
    When your game is laggy it means your code is not efficient. This can't be boiled down as writing good code takes a through understanding of logic and how to refine techniques. Just because code structure you write works doesn't mean it's efficient.
  • williamt2706williamt2706 Member, PRO Posts: 85
    @mELTINGsKYsTUDIOS
    Sorry my bad english.
    Nope, i had change timer to self.time, all of it.
    And only a few constrain attribute, maybe just 4 or 5 line. But i had tons of global attribute.

    @FryingBaconStudios
    Thx, i'll try to experiment some combination to make it simpler.
    By the way, when i tested it on device, the game engine consume 25-30mb of memory. Is it normal?
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Lag would be reflected by the FPS rate which should be over fifty for good performance.
  • williamt2706williamt2706 Member, PRO Posts: 85
    @FryingBaconStudios
    That's it, it runs perfectly within 50-60 fps on my 3rd gen ipod when i tested it. But it's laggy after i installed it on my device. I've remove all running background task, and it's still the same. I wonder why . .
Sign In or Register to comment.