playMaker

Author Topic: Activate/Deactivate game objects and garbage in profiler  (Read 10610 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Activate/Deactivate game objects and garbage in profiler
« Reply #15 on: February 13, 2017, 01:30:22 AM »
Hi,

I don't think it's possible no, but what you can do is go in the PlayMaker pref and turn off everything related to debugging, and also make a Unity layout that has no PlayMaker editor at all, nor the Unity Inspector, this is how you minimize Editor Impact.

But really, it's only when you profile when running from the device that you can see better what's going on ( while of course it still has a cost).

Bye,

 Jean

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Activate/Deactivate game objects and garbage in profiler
« Reply #16 on: February 14, 2017, 11:54:03 AM »
Hi, i have disabled all settings for debugging and no luck. It still logs Trigger events and Activating Game Objects and Scripts. No good. I making it very difficult to see what id performing well and not, a nightmare for a non development guy. Why cant this be sorted? has it been programmed that way?

Or is there a guide for testing performance of playmaker scripts outside of the Unity Editor? as im looking at guides constantly and nothing looks easy. I have really enjoyed using playmaker so far and now im going to spend ages just just finding out what each spike means in the profiler.

Nick
« Last Edit: February 14, 2017, 06:04:38 PM by coxy17 »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Activate/Deactivate game objects and garbage in profiler
« Reply #17 on: February 15, 2017, 01:53:59 AM »
Hi,

 can you paste the full logs entries? maybe they are inside actions, which means you simply have to comment them lines.

to test Performances outside Unity Editor, you must resort to the platform debugging tools themselves, so xCode for IOS for example.

Testing is really hard, don't think that it's easy task, cause it's not. So many layers of indirections between Unity, the compiler, and on top of that PlayMaker Framework which adds a level of complexity in testing is a beast to master for testing.

This is why it's important to monitor your development with the profiler often so that you detect for example such spikes as early as possible and you can then reflect on what happened since the last time you profiled and did not see these spikes.

To debug properly, you need to shut down whole features of your game, for example remove all enemies, all fancy effect, and have just your player, then add incrementally features, one after the other until you narrow down where the problem is.

Bye,

 Jean
Bye,

 Jean

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Activate/Deactivate game objects and garbage in profiler
« Reply #18 on: February 15, 2017, 08:39:11 AM »
Hi Jean

Thanks for this information, im not sure how to get a full log from the profiler, so for until i do i have created the largest screenshot i can of the overall view of the profiler at the spike of garbage collection (attached)

I'll look around to see if i can get a full log.

ive created a basic scene with a wait action, which then switches state to then deactivate the child objects and then returns after 3 seconds (real time) I don't use the wait action in my actual game it was just to see what happens in my test scene.

Each child object has a onTriggerEnter script on each start state of the FSM.

In a large scene in my game I have 100 of these activations and it creates 2 MB of garbage. So alot for just deactivating and activating script.

Nick
« Last Edit: February 15, 2017, 06:21:26 PM by coxy17 »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Activate/Deactivate game objects and garbage in profiler
« Reply #19 on: February 16, 2017, 12:42:48 AM »
Hi,

 the best ways are likely them:

http://answers.unity3d.com/questions/32368/how-do-i-profile-on-an-android-device.html

have you tried this?

Bye,

 Jean

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Activate/Deactivate game objects and garbage in profiler
« Reply #20 on: February 16, 2017, 02:04:20 PM »
Hi Jean

Yes i have tried those methods

I have used ADK to see the cpu and gpu but gives little information. I have built and ran a new project with only one scene (with my device plugged in) and ran a deep profile once more. Attached are the results. Seems it is still an issue when i get turn off everything to do with playmaker in the editor too.

Brief overview of the scene setup

Empty game object (FSM with OnTriggerEnter & Disable Children FSM's script)
    - Cube Object
         - Box Collider Trigger (FSM with OnTriggerEnter)
    - Cube Object
         - Box Collider Trigger (FSM with OnTriggerEnter)
    - Cube Object
         - Box Collider Trigger (FSM with OnTriggerEnter)
    - Cube Object
         - Box Collider Trigger (FSM with OnTriggerEnter)

Tested On Samsung J3 & Samsung Galaxy S6 devices

Nick
« Last Edit: February 18, 2017, 10:37:04 AM by coxy17 »

brucezhu2018

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Activate/Deactivate game objects and garbage in profiler
« Reply #21 on: February 17, 2017, 07:49:30 AM »
I have similar  issue  as well.

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Activate/Deactivate game objects and garbage in profiler
« Reply #22 on: February 18, 2017, 10:23:45 AM »
Hi brucezhu2018

What similar issue are you having? it would be good to know.

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: Activate/Deactivate game objects and garbage in profiler
« Reply #23 on: February 18, 2017, 05:29:22 PM »
So I had some issues before with profiler showing me huge numbers in this thread...

http://hutonggames.com/playmakerforum/index.php?topic=14224.0

During that research, I came across information on how to profile from your device into the unity editor to bypass all the editor overhead... and also how to use xcode instruments to profile as well...


Unity profiler
vid  "Profiler Overview for Beginners"...
https://youtu.be/tdGvsoASS3g

profiler from ios device
http://blog.collectivemass.com/2014/03/unity-profiler-ios/
(not sure this post says it but you have to have it connected by usb and wifi both if I remember right)

xcode intruments...
this video "Unite Europe 2016 - Optimizing Mobile Applications"...
https://youtu.be/j4YAY36xjwE

pointed me to this post...
https://blogs.unity3d.com/2016/02/01/profiling-with-instruments/
« Last Edit: February 18, 2017, 05:31:17 PM by HeathClose »

brucezhu2018

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Activate/Deactivate game objects and garbage in profiler
« Reply #24 on: February 19, 2017, 02:18:44 AM »
Hi coxy17, I do have the similar issue,but mine is made with physics2D, so you can refer to may post:http://hutonggames.com/playmakerforum/index.php?topic=14166.msg65816
My project is very simple 2D shooting game , for the problem mentioned above, I rebuild a new scene for the test:
I only build an spawn point to shoot bullet every second, the bullet is come from the core game kit pool boss, the bullet use the rigidbody2d and fsm, the bullet is triggered by the OnTriggerEnter2D event when hit the collider tagged with enemy then the bullet will despawn to the poolboss.
I have profile my project in android device, there are still some Gc Alloc  mainly locate in the physics2d.onTriggerEnter2D, but the unity profiler only show N/A object in the right panel when I am profiling on device, so I can not tract what is the exact reason for the garbage collection.

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Activate/Deactivate game objects and garbage in profiler
« Reply #25 on: February 20, 2017, 04:16:05 AM »
So I had some issues before with profiler showing me huge numbers in this thread...

http://hutonggames.com/playmakerforum/index.php?topic=14224.0

During that research, I came across information on how to profile from your device into the unity editor to bypass all the editor overhead... and also how to use xcode instruments to profile as well...


Unity profiler
vid  "Profiler Overview for Beginners"...
https://youtu.be/tdGvsoASS3g

profiler from ios device
http://blog.collectivemass.com/2014/03/unity-profiler-ios/
(not sure this post says it but you have to have it connected by usb and wifi both if I remember right)

xcode intruments...
this video "Unite Europe 2016 - Optimizing Mobile Applications"...
https://youtu.be/j4YAY36xjwE

pointed me to this post...
https://blogs.unity3d.com/2016/02/01/profiling-with-instruments/


Hey HeathClose, i'll take a look at the links you sent. Im currently testing on Android so hopefully there might be references to this unless the guides are just for IOS. I looked at your other thread and i can see that you still have OnTriggerEnter garbage being collected http://hutonggames.com/playmakerforum/index.php?action=dlattach;topic=14224.0;attach=10318;image was this still creating garbage outside of the Editor?


Hi coxy17, I do have the similar issue,but mine is made with physics2D, so you can refer to may post:http://hutonggames.com/playmakerforum/index.php?topic=14166.msg65816
My project is very simple 2D shooting game , for the problem mentioned above, I rebuild a new scene for the test:
I only build an spawn point to shoot bullet every second, the bullet is come from the core game kit pool boss, the bullet use the rigidbody2d and fsm, the bullet is triggered by the OnTriggerEnter2D event when hit the collider tagged with enemy then the bullet will despawn to the poolboss.
I have profile my project in android device, there are still some Gc Alloc  mainly locate in the physics2d.onTriggerEnter2D, but the unity profiler only show N/A object in the right panel when I am profiling on device, so I can not tract what is the exact reason for the garbage collection.

Hi brucezhu2018, it seems that we both cant track down the cause, mine also shows n/a when profiling on a device and the numbers are not massive in my screenshots but this is just for a sample scene and when i have 30 or so objects then this causes a massive spike. not good :(

So now the hunt still goes on.