playMaker

Author Topic: Detect if frame rate falls below specified level[SOLVED]  (Read 4180 times)

gecko

  • Junior Playmaker
  • **
  • Posts: 52
Detect if frame rate falls below specified level[SOLVED]
« on: March 16, 2013, 01:46:27 PM »
This would be a very helpful action for mobile games, since the devices have such a large range of performance. I'd like to create an FSM that disables certain things  (objects, particles, fog) if the frame rate falls below 25 for more than 1 or 2 seconds. I don't think there is an action currently that does this (please point me to it if I'm wrong). Thanks!
Dave
« Last Edit: May 14, 2013, 04:47:21 AM by jeanfabre »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Detect if frame rate falls below specified level
« Reply #1 on: March 16, 2013, 01:53:14 PM »
http://hutonggames.com/playmakerforum/index.php?topic=1763.0

Should be easy to setup a switch for when it gets too low.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

gecko

  • Junior Playmaker
  • **
  • Posts: 52
Re: Detect if frame rate falls below specified level
« Reply #2 on: March 16, 2013, 02:05:53 PM »
Thanks, I did look at that...but I confess I don't know how to set up that switch so it triggers another state if FPS falls below that value.

gecko

  • Junior Playmaker
  • **
  • Posts: 52
Re: Detect if frame rate falls below specified level
« Reply #3 on: March 16, 2013, 03:25:24 PM »
Read a bit more of the documentation :) So I have the switch set up, but it is triggered even when the FPS is above the "less than" threshold -- see screenshot. What am I doing wrong? (I put in the 2-sec wait to ensure that switch occurred after any slowness when starting to play the scene.) FPS is over 100, but it triggers the Disable event anyways. Thanks!
Dave

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Detect if frame rate falls below specified level
« Reply #4 on: March 16, 2013, 03:52:47 PM »
Save FPS (in Get FPS) into the "fps" variable instead of setting it to 0.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

gecko

  • Junior Playmaker
  • **
  • Posts: 52
Re: Detect if frame rate falls below specified level
« Reply #5 on: March 16, 2013, 04:46:56 PM »
Ah, thanks! I've done that, but it doesn't seem to change anything -- as soon as this state is triggered, it Finishes and goes to the disable state. So what am I still doing wrong?

thanks
Dave

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Detect if frame rate falls below specified level
« Reply #6 on: March 16, 2013, 05:54:27 PM »
It's not updating the variable before it does the next action which is checking to see if it is more than 25. Set the original value of the float to 100 instead of 0 (anything more than 25) and it won't blow through it.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

gecko

  • Junior Playmaker
  • **
  • Posts: 52
Re: Detect if frame rate falls below specified level
« Reply #7 on: March 16, 2013, 06:19:29 PM »
That did the trick. Thanks so much!
Dave