playMaker

Author Topic: Performance question  (Read 3273 times)

Sjones

  • Full Member
  • ***
  • Posts: 203
Performance question
« on: September 15, 2012, 12:59:28 AM »
I have a question about playmaker and fsm, I am always trying to get the most performance out of a project and I was wondering what is the best way to optimise fsm's

The reason I ask is my main interaction fsm is rapidly growing with lots of states, events and variables.

my key point for me in performance is fps, memory size isnt such an issue.

so when compiling large fsm's is it best to have lots of small states with few actions in, if these are to run every second I would imagine large states would slow down frame rate. would this be  a fair statement?

I have a lot of duplicate states that do the same thing between different events (UI animations etc) for a fps focus would it be better to keep them as many states or use a a stored variable before and after the same events to give them a unique ID to select the correct exit event. I would imagine that this would help on memory (talking a few kb there probably but still, memory saving none the less) would having lots of states effect fps at all?

finally I have a lot of different named events, this is for easy tracking and understanding of what goes where for me, is there any benefit to re-using a small number of events throughout an fsm? I currently have 58 separate event names atm and probably going to grow.

also any other tips on generic fsm creation for performance improvement would be great.
« Last Edit: September 15, 2012, 01:03:10 AM by Sjones »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Performance question
« Reply #1 on: September 15, 2012, 04:13:17 AM »
Hi,

dont' worry about the numer of states or actions per state. This is not in my opinion a key aspect for performances.

 what really counts is what your actions are doing, that's the key. I have very big Fsm, with lost of events, lots of variables, taking to other fsm constantly, and it performs just fine.

what can really hurt your perfs are using unity features that should not be used during your game loop like finding objects, instantiating/destroying objects, bad physics set up, bad mesh and material optimizations, bad process ( whether you do it in playmaker or script doesn't matter, a bad algorythm is a bad algorythm).

Are you testing on the device or on the published version or within the editor?

It is known that performances within the editor should NOT be taken into account. Because so many editing scripts and tools are running to give feedback on what's happening, the perfs are ALWAYS poor compared to the published version. To cover this case, I have a special layout, with just the game windows, nothing else, not even the inspector, and I run there to see how it performs, this is the closest benchmark I can make before publishing.


 bye,

 Jean

Sjones

  • Full Member
  • ***
  • Posts: 203
Re: Performance question
« Reply #2 on: September 15, 2012, 04:56:32 AM »
thanks for the info, I havnt got any issues yet (did have one but fixed that) I am testing it as published I was just curios as I was afraid if I kept adding to this fsm that  performance would get sluggish and would have to re-do the game play code to optimise.

P.S.
A little unrelated but was a good point of another post on here when they had performance issues, I can easily mask stuttering for creating objects etc, the problem they had and I have a slight concern about now is sound (I havnt implemented any yet) but while I was on performance was wondering if there was a way to priorotise sound to make sure it always plays? increase a buffer? audio is something I have little knowledge of myself
« Last Edit: September 15, 2012, 04:59:07 AM by Sjones »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Performance question
« Reply #3 on: September 15, 2012, 08:42:08 AM »
Hi,

 Sound performance also have nothing to do with playmaker, but yes, it is a beast to master, and handling sound in a good and reliable way is something that takes time to master, and is a trial error process most of the time...

 Could you elaborate on your actual needs? then it would be a better base to propose solutions.

bye,

 Jean

Sjones

  • Full Member
  • ***
  • Posts: 203
Re: Performance question
« Reply #4 on: September 15, 2012, 08:53:43 AM »
thanks, atm I dont have any issues or needs, just gathering as much info as possible at the moment as I dont have access to a low power android device at the moment, will do in time but I want to avoid as much as possible as early as possible, and with reports of stuttering from sound due to heavy cpu usage I am a little concerned as I am constantly creating and destroying objects within the game itself, this itself is cpu heavy but occurs through menus etc so the player wont notice the frame drop if there is any, the only other sign of performance issue would be sound in this case.

trying to juggle all aspects of game making is hard and time consuming :P, will be looking into sound a lot more in the next week or two


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Performance question
« Reply #5 on: September 15, 2012, 08:58:51 AM »
Hi,

 indeed, making anything with Unity above a certain level of quality is time and energy consuming :)

 Sound is indeed an issue on mobile, as for creating and destroying, objects during your game play, I strongly advise you look into pool solutions like pool manager 2 ( because I have made playmaker actions to work is it for instance)

bye,

 Jean