playMaker

Author Topic: Which is the most efficient and cost-effective?  (Read 2483 times)

Red

  • Hero Member
  • *****
  • Posts: 563
Which is the most efficient and cost-effective?
« on: October 11, 2012, 10:29:48 AM »
So, i've come to a question which i have yet to answer and it's about updating information to a GUI system.

mainly, I'm hoping to make this system as efficient as possible but without soaking up too many system resources.

I have three different options that are available to me.

first would be to use the "get/set fsm" actions with a "every frame" update... second would be a constant loop... third would be a loop with the "next frame event" action... fourth would be to add in a wait element that updates every X milliseconds...

so, which would be the most efficient and cost-effective way of doing this?

I'm thinking that the Every-frame and Next frame event would be the cleanest since it's firing off every frame but would that not start chugging if there are a lot of actions and FSMs firing off at the same time? the "wait" element would be the most cost-effective i'd think but getting the timing down would be tricky and if the timing is not fast enough, there would be a noticeable amount of lag i'd wager... and the constantly looping set would be the fastest but probably slow the system down...

If you can help me figure out which is the best approach for this, i'd be grateful.

This is for those of us using NGUI and other non-Playmaker-native scripts.

Sjones

  • Full Member
  • ***
  • Posts: 203
Re: Which is the most efficient and cost-effective?
« Reply #1 on: October 11, 2012, 11:23:46 AM »
the loop wont work, it will never get onto the next frame (unless its not a true loop) the other 2 are the same as each other and the last one may help or it may give you lag spikes when it does that specific code, then again if you set it so other code runs in between this then this last option may be best.

if you are not updating it constantly and only at specific times (HP goes down when damaged) then update only when you need and not every frame
« Last Edit: October 11, 2012, 11:25:59 AM by Sjones »