playMaker

Author Topic: New Feature : Color code actions by their "cost"  (Read 1058 times)

QFGlenn

  • Playmaker Newbie
  • *
  • Posts: 30
    • View Profile
New Feature : Color code actions by their "cost"
« on: May 14, 2016, 04:20:51 PM »
Would be nice to know if an action I am considering is going to turn out to kill my framerate the way I use it before I build a whole system around it and playtest it.

Some actions are more costly to perform every frame, the color could change to let the programmer know how this will affect his state.

And maybe the backround can get more red or more green if in general the FSM was going to slow things down or run quickly.

I think that would be a really great improvement.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12344
  • Official Playmaker Support
    • View Profile
Re: New Feature : Color code actions by their "cost"
« Reply #1 on: May 26, 2016, 12:05:32 AM »
Hi,

 That's a good idea indeed. There are indeed some known Unity api or PlayMaker pai that should be used with care and in very specific contexts, but for this to be spreaded to all Actions, we would need some hard data from Unity guys themselves, which we haven't to this day.

Typically, avoid finding gameobjects by their names. Avoid creating and destroying objects and components.

 also, a good rule is to design first exactly what you need, until it works as expected, then you optimize, making use of the Unity profiler, pin point what could be a performance hit, and adress that only. If you take n baord optimization first, you'll corner yourself and waiste time for something that will anyway needs an optimization pass when done, no matter what :)

Bye,

 Jean


ergin

  • Junior Playmaker
  • **
  • Posts: 86
    • View Profile
Re: New Feature : Color code actions by their "cost"
« Reply #2 on: May 26, 2016, 02:41:49 AM »
Hello jean, thanks for the tips. I try to avoid finding gameobjects by their names but how can I avoid create and destroy when I spawn coins or enemies? Is it better to have a predefined level with many copies of objects or spawning them on runtime(especially for the mobile)?

Thanks.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12344
  • Official Playmaker Support
    • View Profile
Re: New Feature : Color code actions by their "cost"
« Reply #3 on: May 26, 2016, 04:25:31 AM »
Hi,

 For this, you'll need to use a "Pool" system. Plenty of very powerful systems to deal with this.

This one has playmaker support:

https://www.assetstore.unity3d.com/en/#!/content/1010

https://hutonggames.fogbugz.com/?W839

Bye,

 Jean

ergin

  • Junior Playmaker
  • **
  • Posts: 86
    • View Profile
Re: New Feature : Color code actions by their "cost"
« Reply #4 on: May 26, 2016, 07:35:21 AM »
Thanks.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3205
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: New Feature : Color code actions by their "cost"
« Reply #5 on: May 27, 2016, 08:53:47 AM »
In the future I'd like to build some kind of basic profiling info into the Playmaker Editor since it can be hard to map Unity Profiler info to PlayMaker states/actions. Something like ms/percentage time spent in each state/action. Maybe with user configurable color thresholds so you could spot choke points.

PlaymakerNOOB

  • Full Member
  • ***
  • Posts: 117
    • View Profile
Re: New Feature : Color code actions by their "cost"
« Reply #6 on: May 27, 2016, 06:03:35 PM »
Quote
with user configurable color thresholds so you could spot choke points.

Yes, that would be great.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12344
  • Official Playmaker Support
    • View Profile
Re: New Feature : Color code actions by their "cost"
« Reply #7 on: June 07, 2016, 12:40:04 AM »
In the future I'd like to build some kind of basic profiling info into the Playmaker Editor since it can be hard to map Unity Profiler info to PlayMaker states/actions. Something like ms/percentage time spent in each state/action. Maybe with user configurable color thresholds so you could spot choke points.

Hi Alex,

 Whoa, like a "HeatMap" of perfs across Fsms and Actions?!? Careful, you are going to take over the world with such feature!! :) that would be sooo helpfull!

one problem, typically is not on action or one fsm, it's t he sum of a series of prefab instances that added together creates a performance issue, if you can get a perf stat for each fsm, I think it should also combine as a post routine the cost of all instances of the same prefab, for example what's the cost of all enemies "A" or "B" overall.

Bye,

 Jean