playMaker

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

rainexplorer

  • Junior Playmaker
  • **
  • Posts: 65
Performance issue, How to load all sprite at Starting/First
« on: December 15, 2017, 09: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: 7615
    • jinxtergames
Re: Performance issue, How to load all sprite at Starting/First
« Reply #1 on: December 15, 2017, 09: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: 65
Re: Performance issue, How to load all sprite at Starting/First
« Reply #2 on: December 19, 2017, 12:24:55 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?

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, 02:57:20 AM by rainexplorer »

rainexplorer

  • Junior Playmaker
  • **
  • Posts: 65
Re: Performance issue, How to load all sprite at Starting/First
« Reply #3 on: December 19, 2017, 09: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, 09:10:37 AM by rainexplorer »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Performance issue, How to load all sprite at Starting/First
« Reply #4 on: December 20, 2017, 01:52:35 AM »
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