playMaker

Author Topic: Performance issue, How to load all sprite at Starting/First  (Read 338 times)

rainexplorer

  • Junior Playmaker
  • **
  • Posts: 61
    • View Profile
Performance issue, How to load all sprite at Starting/First
« on: December 15, 2017, 07:09:13 AM »
Hi,

it seems my game face performance issue, the problems like below :

a) in first screen/Main Menu  i have 25 buttons, when i click one of them then they need around 5-7 second to load, but this just first time only.

b) after 2nd screen opened, if i back to main menu, it just need around 1 sec to open, so the issue only appear at first time open the game....

Note:  i have 7 sprite files, because so many images that can't accommodated in 1 sprite, so i think because i have so many sprite files..

i dont know if this issue related to playmaker, but  any idea to load all sprites at first time ? (maybe we can tell user to wait by progress bar)

Thanks in Advance

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 3512
    • View Profile
    • jinxtergames
Re: Performance issue, How to load all sprite at Starting/First
« Reply #1 on: December 15, 2017, 07:47:46 AM »
Hi,
This is probably a unity issue.
And probably on the 2nd screen that has a bigger loading time.

What are the sizes of your sprites? do you use compression?
how are you loading them?
When you click on them how are loading the new scene?

Also try to look in the unity forums/answers for performance issues.

are you using Single sprite images or multiple?

rainexplorer

  • Junior Playmaker
  • **
  • Posts: 61
    • View Profile
Re: Performance issue, How to load all sprite at Starting/First
« Reply #2 on: December 18, 2017, 10:24:55 PM »
Hi,
This is probably a unity issue.
And probably on the 2nd screen that has a bigger loading time.

What are the sizes of your sprites? do you use compression?
how are you loading them?
When you click on them how are loading the new scene?

Also try to look in the unity forums/answers for performance issues.

are you using Single sprite images or multiple?

Hi,
it's single sprite,
the size of each sprite are 2048x2048 pixels,
total are 7 sprite files where each has average 500Kb,
every sprite has average size of 100x150 pixels,

How are you loading them?
i have 26 alphabets, where i place 2 object category ( sprite and sound ) for every alphabets, so total of Array will be 2 x 26 = 52 Array (not including another array for program control)...
in one array, maximum sprite to insert are 5 sprites, example like below :



Do you use compression?
i'm not sure, it's using default from TexturePacker = RGBA8888

How are loading the new scene?
it will open new scene by detect alphabet number from previous scene, then getting sprite and sound from array then loaded to current scene (3d objects), however, i've cut all flow and leaving only 1 state, but it still slow...

any idea ?


nb: i still contact TexturePacker but still no response, someone has also give tips to reduce Sprite's size from 2048x2048 to 1024x1024...
« Last Edit: December 19, 2017, 12:57:20 AM by rainexplorer »

rainexplorer

  • Junior Playmaker
  • **
  • Posts: 61
    • View Profile
Re: Performance issue, How to load all sprite at Starting/First
« Reply #3 on: December 19, 2017, 07:08:14 AM »
Update===

i have change all images in sprite using RGBA4444 (16 bit) as suggestion from TexturePacker, but it still same....

maybe this slow because i use too many array with spite & sound inside it ?

below i attach playmaker flow :


here, it get alphabet number then set front image of card...


here, it prepare for back card image, depend of how many images are available...


here, it set sound for each back card...
« Last Edit: December 19, 2017, 07:10:37 AM by rainexplorer »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13432
  • Official Playmaker Support
    • View Profile
Re: Performance issue, How to load all sprite at Starting/First
« Reply #4 on: December 19, 2017, 11:52:35 PM »
Hi,

 you need profile your game and check where the lag comes from.

 also, for memoery consumption, it;'s a lot more than what you think:

2048x2048 pixels means in memory  is not the same as what your OS will tell you. Check out for that sprite the inspector preview it will tell you the size Unity has it under.

 Bye,

 Jean