×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    35

    Game takes a long time to load.....

    hi,

    The issue is ,my game takes a along time to load.

    When the "play" menu is selected, the game initializes the "Game canvas" class. Inside the "Gamecanvas" constructor i'm initializing 7 different image arrays. each array is used to perform different animations (MIDP 1).
    I checked the image capacity , it is around 1kb or 2kb for each image some images are 700b.
    [I'm using different canvases for different screens (e.g. menus is in one canvas and game is is one canvas , splash screen is in one canvas etc.) so i have to initialize images related to each canvas one by one when it's initializing . Not all the images at once.]

    Initializing arrays... is it the correct way or is there any other better ways ?

    (Note: actually i took the jar file of a game and extracted the images and tried to recreate the same game for learning purposes, functional wise the game is OK. But the loading time between my game and the original game is huge.)
    The original game's time is 5s and my one is 45s .


    Also note that after loading the game it runs smoothly. Only the loading time is the problem.

    I have written all the info which might be helpful. Someone please help me.

    Thanx in advance :-)

  2. #2
    Registered User
    Join Date
    Nov 2007
    Posts
    22

    Re: Game takes a long time to load.....

    Is your business logic running in the main thread?

  3. #3
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Game takes a long time to load.....

    2 random tips:

    * try collapsing each image array in 1 single image, and then work with Graphics setClip() to draw only current animation frame (so, reimplementing Sprite animation support). It shouldn't be that difficult, and you can find some implementation already made searching the web.

    * try some sort of image preloading: for example, when the user is on menu, you can begin loading some/all the game images, so that when he starts the game, wait time will be reduced.

    Pit

  4. #4
    Registered User
    Join Date
    Apr 2007
    Posts
    35

    Re: Game takes a long time to load.....

    Both of u thanx for replying , i searched for what jappit told. And came across this link.So i'm posting it just in case anyone need it.

    http://devlinslab.blogspot.com/2007/...ying-only.html

    but did not try it yet. Will try and let u know.
    (Still i'm working on joining the images and coding)

  5. #5
    Registered User
    Join Date
    Apr 2007
    Posts
    35

    Re: Game takes a long time to load.....

    Thanx jappit :-) ur tip number 1 was very helpful. it made a huge difference. It reduced the loading time by 3 times (from 45s to 15s)
    Thanx again !

Similar Threads

  1. Game directly to Game Folder
    By JPurd in forum Mobile Java General
    Replies: 4
    Last Post: 2008-04-15, 20:34
  2. Game / Socket Issues
    By Ryushi in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2008-01-01, 17:30
  3. Conection - how long time it takes?
    By koperak in forum Bluetooth Technology
    Replies: 2
    Last Post: 2002-12-18, 10:48
  4. Querying the status over a long time crashes the connector application
    By tuender in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2002-07-25, 05:28
  5. SMS time stamp format with time zone parameter?
    By turunhe in forum General Messaging
    Replies: 1
    Last Post: 2002-06-11, 07:00

Posting Permissions

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