playMaker

Author Topic: Performance issue, 4 seconds delay when move to another scene  (Read 1879 times)

rainexplorer

  • Junior Playmaker
  • **
  • Posts: 65
Performance issue, 4 seconds delay when move to another scene
« on: November 20, 2017, 09:57:21 PM »
Hi,

i have 2 scenes (A & B), in my unity editor from (A) to (B) taken 0.8 second, but from (B) to (A) take 1.2 second

but after build to APK and test at Real Device (Android lollipop 5.1 with 2GB RAM & CPU Quad Core 1 GHz) ==> from (A) to (B) take 0.9 second BUT from (B) to (A) take very long (4.5 second)

i'm using "Load Scene" state with "Single Mode" and below are the B's FSM :



Note 1: Why so big, it's switch logic, i dont know unless coding to reduce these path...
Note 2: The Green PATH is where we go to another scene....

what's wrong ? are because of too many EVENT PATH in my FSM ?

and how to fix this ?

Thanks in advance...
« Last Edit: November 21, 2017, 12:34:17 AM by rainexplorer »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Performance issue, 4 seconds delay when move to another scene
« Reply #1 on: November 21, 2017, 02:00:11 PM »
Hi,
The picture is unclear, but i do think you could reduce the transitions a lot probably by using arrays.

The loading issue lies probably  in (A) as (B) is already loaded and it is loading (A)

But to find the issue, we need more information.

Maybe you can make a video showing you Fsm/States/Actions
Or if you want i can have a look into your project using Collaborate or upload the project and Pm me a link.

rainexplorer

  • Junior Playmaker
  • **
  • Posts: 65
Re: Performance issue, 4 seconds delay when move to another scene
« Reply #2 on: November 21, 2017, 08:08:31 PM »
okay  :D

PM sent...
thanks
« Last Edit: November 22, 2017, 01:28:20 AM by rainexplorer »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Performance issue, 4 seconds delay when move to another scene
« Reply #3 on: November 22, 2017, 05:27:25 AM »
Hi,
I actually mend to pm if you want me to test the project, i think it is better to share the video here so others can help also.
sharing a project is more delicate so i do not recommend to share in public.

Anyway on 1:10 you have a transition for each button and then use 'Ugui Get Selected game Object'.

You can remove them all and have only one transition (button_Letters for example)
it will still get the selected button.
Then the button names i would set to 0 for a, 1 for b 2 for c and so on.

Then @ 3:00

Make 2 arrays, one for letters and one for animals. like this :



place you sprites in the array (element 0 = a and corresponding animal)

Then in the 1st state, remove the string switch and the transitions.

Then place a convert string to int and place the 'nama_tombol' variable there.
Store the int (name it index for example)

Then use 'array get' and place the Letter array and  int variable (index)
and store the value
Do the same for the animals.

Then use swap sprite with the letter value and animal value

on the next part i am not sure why you have the string switches on Next Alphabet and Next Alphabet 2 (previous) but for this you can again use the int and store this as last button into an int, instead of Get Last Event.

This will make your fsm a lot smaller and easier to read later on if you need to debug.

i hope you can follow a bit :)


But i do not think it will change the loading time much...
There might be issues with large images/sprites
or many single images instead of sliced images.
or a lot of images loaded immediately or some other issues but i can't tell by only looking at the video.

rainexplorer

  • Junior Playmaker
  • **
  • Posts: 65
Re: Performance issue, 4 seconds delay when move to another scene
« Reply #4 on: November 22, 2017, 05:01:11 PM »
Hi, thanks  :D

i'll try...

rainexplorer

  • Junior Playmaker
  • **
  • Posts: 65
Re: Performance issue, 4 seconds delay when move to another scene
« Reply #5 on: November 22, 2017, 08:28:22 PM »
this seems not related to playmaker, but i still find out...

btw,

my screen only cost 29 pass call...



are this also make some impacts to performance ?
« Last Edit: November 22, 2017, 10:42:33 PM by rainexplorer »