Isn’t conditional fps already possible?
Since config.lua is where you set fps you can detect the system, platform, and model using system.getInfo(). Depending on what those checks return you could then conditionally set fps to 30 or 60.
Here’s a simple example config.lua that sets fps to 30 if an iOS older than 3.2 is detected:
local sysPlatform = system.getInfo("platformName")
local sysVersion = system.getInfo("platformVersion")
local subSysVersion = string.sub(sysVersion,1,3) --truncates system version so 3.2.1 becomes 3.2, etc.
if sysPlatform == "iPhone OS" and tonumber(subSysVersion) \< 3.2 then --if os version is iPhone and less than 3.2
sysAdjustedFPS = 30 --if os less than 3.2 it's an original iphone and os can't be updated. Use 30 fps
else sysAdjustedFPS = 60 --otherwise use 60 fps
end
application =
{
content =
{
fps = sysAdjustedFPS,
--Original scale for iPhone 3 native res.
width = 320,
height = 480,
scale = "letterBox",
},
}
My own issues with fps are related to how Corona handles physics. It seems that Corona’s implementation of Box2D is completely dependent on framerate, whereas it really should be completely independent.
If I set fps to 60 my game looks and feels great as long as it can maintain that rate. But there are times when it drops down to 40 fps or so and the game itself actually slows down. To prevent that all the physics properties, like gravity, need to be updated on the fly to compensate (totally impractical).
If you do the conditional fps adjustment above and need physics you’d need to have separate physics properties for each fps version, and test both to make sure they behaved identically (also practically impossible to achieve from personal experience).
If Corona’s physics was time-based instead of framerate-based you could simply set fps to 60 and be done. Even on a crappy iPod 2 making only 20 fps your app would behave identically. [import]uid: 9422 topic_id: 4330 reply_id: 36600[/import]