playMaker

Author Topic: slow FSM  (Read 1606 times)

elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
slow FSM
« on: October 20, 2017, 05:34:55 AM »
Hi,

I have some logic in my FSMs to instantiate and then update the values on some 2d objects. They instantiate at the start of the app into a scrollrect, and then only values are updated when that specific view is pushed. It seems very slow however, I can tell because the animation which is played when other view is poped off stack laggs for 1-2 seconds.

Are FSMs ran frame by frame, in terms of actions or is there a way to put the FSM into a coroutine or something? Worst case scenario I will have to redo the whole logic in code instead but if there is a way to make this smoother then I would prefer that.
« Last Edit: October 20, 2017, 06:09:22 AM by elusiven »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: slow FSM
« Reply #1 on: October 23, 2017, 05:22:23 AM »
Hi,

 a 1-2 sec delay is definitly very bad, and I doubt this is due to PlayMaker, if this is at the start of your game, this is likely due to assets decompressions like sounds, or big textures or meshes.

 I would isolate what you think is the problem and test ( without any graphics, mesh and sounds, etc, just the logic), How many items do you have in your scrollrect?

Bye,

 Jean

elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
Re: slow FSM
« Reply #2 on: October 23, 2017, 07:35:47 AM »
Probably about 36-40 items. I ran it through profiler but I can only see the XML actions in playmaker, is handling xml that slow? I attached some screenshots.

https://imgur.com/a/2oPv9
« Last Edit: October 23, 2017, 07:51:08 AM by elusiven »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: slow FSM
« Reply #3 on: October 26, 2017, 02:15:14 AM »
Hi,

 It depends what are these actions and what you do with them. I'll need more details.

 Typically, if you save xml as string, it takes times, this is possibly what's happening here. I have worked on games with xml at the core of level constructions and user data and it works very well, 100,000 lines of xml definition for levels, loaded on mobile device. But during the game I never convert xml to string or anything like that I always work with memory references.

Bye,

 Jean