playMaker

Author Topic: FPS Optimisation  (Read 1901 times)

blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
FPS Optimisation
« on: August 21, 2014, 05:13:11 AM »
What is the best way to optimize FSM Process ?

i mean in my game, making a complete level, wich requires in a lot of differents events for story, using on trigger enter to lunch them, many enemies, how are calculating there own trajectories when they are offscreen, and bonuses how are doing simple rotation waiting that player comes to take them....

how can i simply make all these scripts not called as long as i don't need them ?

i seen a lot of possibilities, like global event " Become visible" and "Become Invisble", but i don't know how they are intendended to be use, also run FSm and Finnish FSM...

because i haver never been so far in programming, i'm actually confront the problem of FPS very low, caused by physic or other useless tasks.

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
Re: FPS Optimisation
« Reply #1 on: August 21, 2014, 05:44:52 PM »
I'm no expert on this by any means, so take the following with a few grains of salt:

From what I've experienced, you can have quite a lot of FSMs running without impacting performance. Of course, once you hit a certain numbers of FSMs you may start to notice a performance drop, but this depends on your FSMs and what actions they're running (and how often they're running those actions).

If you want to stop running certain FSMs on uneeded objects (and you're really sure you don't need them to be running when they're off screen/etc), you can use the "activate game object" action which quickly enables or disables game objects. If you disable an object, it makes it disappear and stops any FSMs on it from running. It's very similar to destroying the object, except you can activate it again later to bring it back!


blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
Re: FPS Optimisation
« Reply #2 on: August 22, 2014, 03:23:33 PM »
Yeah i had this kind of idea in mind, but i did not used it the right way...
because to activate desactivate it, i was using a trigger enter action...
and because it's desactivated, the trigger is also desactivated...

stupid idea lol

i add to think differently to reactivate them when they are near to be visible, but how ?