Physics performance lag in Corona.243

Hi,

A game I’m building relies on the physics engine. I have maybe 40 objects on the screen at once, but they’re mostly static. When you touch one, it becomes dynamic, and it falls.

Anyway, I had optimized it to run at 60fps for the iPhone 3GS, and it was running beautifully on a Galaxy S phone, as well as the iPad. However, when I compiled it in the latest version, there are very noticeable frame drops during playback, and the objects now have a “jerky” look as they fall.

I’m also doing more computations in an enterframe handler, but seeing that it runs smoothly in the previous version, and now it doesn’t in the new one, I’m not really certain what the cause is.

Anyone from Ansca here have any insight into this?

Thanks [import]uid: 4454 topic_id: 4317 reply_id: 304317[/import]

I notice a loss of performance too in the physics engine. don’t know what it is. But it would be nice if the physics engine was independent from framerate. We started a post about it. [import]uid: 8192 topic_id: 4317 reply_id: 13537[/import]

I scaled my physics down and it made a huge difference much better performance gain.

Default is 30 i set it to 100 so 100 px = 1 m

you can use

  
physics.setScale(100)  
  

Did this after reading this,
http://www.box2d.org/forum/viewtopic.php?f=8&t=2740

and watching this
http://www.kerp.net/box2d/displaylesson.php?chapter=1&lesson=8

Hope this helps you. [import]uid: 8192 topic_id: 4317 reply_id: 13739[/import]