playMaker

Author Topic: Running more than one FSM Update per frame  (Read 2368 times)

bbangerter

  • Playmaker Newbie
  • *
  • Posts: 5
Running more than one FSM Update per frame
« on: August 30, 2016, 12:43:28 PM »
We have our code working with play maker to run a combat simulation for units in our game, but now we'd like a means to run through the FSM as quickly as possible for collecting statistics on a large number of battles in as short a time as possible.

Is there a way to run multiple PlayMakerFSM.Update calls in a single frame? Currently our simulation runs are limited by the frame rate and PlayMaker state switches on the per frame basis. If we could transition through several states per frame this would allow us to use our existing code behaviors, while not having to render or deal with other unity updates between each state change - which should result in a net decrease in time needed to run our fast simulations.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Running more than one FSM Update per frame
« Reply #1 on: August 31, 2016, 04:06:21 AM »
Hi,

 Good case here.

PlayMaker doesn't switched per frame, it switched when a transition is called and this can happen multiple times per frame within the same fsm.

Maybe we could use a real fsm as a case to experiment with this? so can you details exactly what needs to be ran and processed multiple times per frame?

bye,

 Jean



bbangerter

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Running more than one FSM Update per frame
« Reply #2 on: August 31, 2016, 12:57:53 PM »
Ah, I see what I've missed. I've got a yield return in some of my states, so they won't end till the following frame. Being new on an existing project is hard sometimes  ;)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Running more than one FSM Update per frame
« Reply #3 on: September 05, 2016, 04:37:35 AM »
Hi,
 
Cool, I am glad you are moving forward on this. Indeed the learning curve for Unity, scripting and PlayMaker requires endurance :) Solving problems like that is the daily routine!

Bye,

 Jean