×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    16

    Exclamation Game restart is slow

    hi everyone,

    I'm relatively new to J2ME Gaming.these days I'm developing a war game using NetBeans 6.1 with game designer and I'm using Nokia N73 mobile to test it.in the first execution it runs smoothly.but when I restart the game it slows up.in the restart I have called the constructor.for images I have used PNG 8bit images.the total size of the jar file is 130KB.I have created 5 tiledlayers separately to Floor,sky,trees,obstacles and water.i have also created 2 sprites for soldier and enemy with 3 sequence for each sprite.

    I red some threads which are related to memory optimization but I didn't get a solution.can you please help me about this matter?

    Thank You.

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Game restart is slow

    If it is different the first time, then you need to look at what the code does differently. Presumably, you load the same images each time? What about... information you store in RMS? That's usually the difference between the first execution.

    Cheers,
    Graham.

  3. #3
    Registered User
    Join Date
    Jan 2009
    Posts
    16

    Re: Game restart is slow

    Still I'm not using Record Stores.I'm using only images.the issue is I don't know how to free up my memory when i restart my game.I think that's where I have gone wrong.

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Game restart is slow

    What do you mean by "restart"? You mean, you exit the game completely (back to the application manager), then run it again?

  5. #5
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Game restart is slow

    You're sure it isnt running in background ?

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Game restart is slow

    Quote Originally Posted by damithark View Post
    hi everyone,

    I'm relatively new to J2ME Gaming.these days I'm developing a war game using NetBeans 6.1 with game designer and I'm using Nokia N73 mobile to test it.in the first execution it runs smoothly.but when I restart the game it slows up.in the restart I have called the constructor.for images I have used PNG 8bit images.the total size of the jar file is 130KB.I have created 5 tiledlayers separately to Floor,sky,trees,obstacles and water.i have also created 2 sprites for soldier and enemy with 3 sequence for each sprite.

    I red some threads which are related to memory optimization but I didn't get a solution.can you please help me about this matter?

    Thank You.
    Hi,
    Are you exiting the game completely or just by going main menu and then you are trying to play the game..without exiting the same...

    Then make sure that you are unloading all the images those are not required at that specific time.Can you tell one more thing is that do you have the game code in a single class or in different classes.Then also you can check threads too,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Registered User
    Join Date
    Jan 2009
    Posts
    16

    Re: Game restart is slow

    Hi,
    I mean without exiting the MIDlet I want to replay the game from the start.when I do that,it gets slower.I'm using 2 threads.in my game,I only have one level.so I'm only having MIDlet and One canvas class.

    How do I unload the images?....Do I have to set the references to Null?.....

  8. #8
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: Game restart is slow

    Quote Originally Posted by damithark View Post
    Hi,
    I mean without exiting the MIDlet I want to replay the game from the start.when I do that,it gets slower.I'm using 2 threads.in my game,I only have one level.so I'm only having MIDlet and One canvas class.

    How do I unload the images?....Do I have to set the references to Null?.....
    Since you have a canvas and a midlet...then taking two threads does not sounds me good...explain..

    how you are working with the two threads?

    yeah you have to just set the image null and your image is gone..
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  9. #9
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Game restart is slow

    If your game becomes slow, your problem is unlikely to be images or memory. Memory doesn't become slower.

    Are you attempting to stop and restart threads? My guess is that you are starting more and more threads, and not stopping them.

    A game requires at most one thread. Create one thread when the application starts, and don't let it end until the application is terminating.

    Programmers tend to be very attracted to multi-threading, and to underestimate seriously how complicated it is.

    I posted some tips on developing mobile Java games here and here.

    Cheers,
    Graham.

  10. #10
    Registered User
    Join Date
    Jan 2009
    Posts
    16

    Thumbs up Re: Game restart is slow

    Hi Graham,

    I got the problem.in the restart command,I haven't stopped the thread.it's running perfectly now.have to thank raj too.looking forward for your help.

    Cheers.
    Damitha.

Similar Threads

  1. Anrufen Online - Massive Multiplayer Symbian Online Game
    By zdrawde in forum News and Announcements
    Replies: 10
    Last Post: 2009-08-10, 07:06
  2. Game performance runs very slow in real phone
    By achap in forum Mobile Java Tools & SDKs
    Replies: 4
    Last Post: 2009-02-23, 15:12
  3. Great game Wappo
    By geonofear in forum News and Announcements
    Replies: 2
    Last Post: 2007-01-03, 12:00
  4. Game Working very Slow
    By anupamcins in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2005-04-28, 14:57
  5. 3595 or 30 series emulator doesn't restart game!
    By khabi in forum Mobile Java General
    Replies: 0
    Last Post: 2003-06-09, 12:18

Posting Permissions

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