playMaker

Author Topic: Loading 100's of FSMs at same time  (Read 1161 times)

heavygunner

  • Sr. Member
  • ****
  • Posts: 344
Loading 100's of FSMs at same time
« on: November 23, 2018, 10:42:47 PM »
Hi !

Look at this time. This tile has different 10 materials for different colors. I added all materials to array and will add one fsm to this tile prefab. Get Random Material from Array and save it on "Current Material", then will set Current Material as this tile's material.

So, everytime scenes loads, it will apply different colors.

I will make one level with hundreds of tiles like this. Will my game on mobile will crash, if all hundreds of tiles run this FSM at same time?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Loading 100's of FSMs at same time
« Reply #1 on: November 24, 2018, 03:04:17 AM »
Hi,
Maybe its better to have one fsm to handle this with an array to loop thru each tile.

But i don't think it will crash.

Best is to make a test scene and make a build

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Loading 100's of FSMs at same time
« Reply #2 on: November 26, 2018, 02:07:29 AM »
Hi,

 it will not crash, but of course it depends what these fsm do, it's not the fsm the trouble, its the actions you use, some can be very expensive or take memory, but 100s is fine.

 however, you should definitly use a pooling system to avoid instanciating and instead simply enable, it will massively improve handling of such routines ( with or without PlayMaker). You need a pooling system that create the pool during editing, so that all your pool instances are already there when you open the scene.

 Bye,

 Jean