Any noticeable difference in performance between standard sdk and game edition?

I am making a simple ball game using standard sdk and it runs ok on my iPhone 4. Tested it on an iPhone 3G and it is very sluggish. The game has one background graphic that is 137kb and 12 balls that are 8kb each. My code moves one ball then checks for collisions with all other balls. I have read optimising guide and used all locals.

I am wondering if I can improve performance or if corona not able to make this run on iPhone 3G.

Any tips for further optimising or ways to test where the bottlenecks are much appreciated.

Thanks

Paul [import]uid: 7863 topic_id: 2285 reply_id: 302285[/import]

Hi Paul,

can you provide the source? 12 balls and a background isn’t much and something like this would run on my Ipod Touch 2nd Gen smoothly. I know that the 3G has a little less power but also should run fine I think.

Michael

http://www.whiteskygames.com
http://www.twitter.com/mhartlef [import]uid: 5712 topic_id: 2285 reply_id: 6902[/import]

Hi Michael

I have emailed you the source. Thank you for looking at this.

Paul [import]uid: 7863 topic_id: 2285 reply_id: 6904[/import]

Hi Paul, where did you send it to?

mike (at) fantomgl.com

When I get it I will have a look tommorow. Will head to bed now. [import]uid: 5712 topic_id: 2285 reply_id: 6911[/import]

Mike, I did originally email it to an email address on the whois records for one of your domains but after your post I emailed it to the email address you included in the post. Did you get it?

Thanks

Paul [import]uid: 7863 topic_id: 2285 reply_id: 6950[/import]

Hi Paul,

I send you the corrected source. Let me know how it works out.

Michael [import]uid: 5712 topic_id: 2285 reply_id: 6957[/import]

Michael is a true star! The game works really well now thanks to the amends by Michael.

Many thanks Michael

Paul [import]uid: 7863 topic_id: 2285 reply_id: 6979[/import]

Can you share the problem, and how the amends were able to improve speed.

Thanks

carlos [import]uid: 24 topic_id: 2285 reply_id: 6981[/import]

thanks michael for helping out.

carlos [import]uid: 24 topic_id: 2285 reply_id: 6982[/import]

I believe the main culprit was me leaving print statements in my code so if this is true it is definitely worth noting this on your optimisation page as the performance improved from totally unplayable to completely fine on iPhone 3G

Michael may want to confirm this and elaborate more. [import]uid: 7863 topic_id: 2285 reply_id: 6986[/import]

Thanks guys for the flowers. Like Paul said, his print statements for debugging info were bringing the framerate of the device really down. Espercially as he did it twice at every frame.

Another thing, but maybe not such a big improvement was changing the calls to math functions into a local function call. Pauls code does some quite intensive math there and I believe that is always a point of optimization. then there was a small thing where I changed some multiplications to be done once before a formular and then used the result later to be subtracted. In his version he did the same multiplication several times in a frame.

Generally the physics involved in the code could be redone with the game edition and might run even smoother then.

I am really curious about this game.

Cheers
Michael [import]uid: 5712 topic_id: 2285 reply_id: 6995[/import]

The development environment I use to make my living with (until I get going on Corona, heheheh) has something like this in the language:

#if DebugBuild then MsgBox "You're in the IDE" #endif

When the project is actually built, nothing inside the #'s is included, so debug stuff doesn’t go into the compiled app. That means you don’t have to comment out all your debug statements before doing a build.

If there’s nothing like that in Corona now, maybe that would be a handy addition.

Jay (J. A. Whye)
[import]uid: 9440 topic_id: 2285 reply_id: 7004[/import]

Yes, that is what I showed to Paul. You can determine if you are in the simulator (check the platform) and then react on this. [import]uid: 5712 topic_id: 2285 reply_id: 7017[/import]

I’ve added code that displays a brief message when I have print statements active. An easy way to turn off all print statements is this:

print = function() end  

I’ve created some conditional print code that I will clean up and share.

-Tom [import]uid: 7559 topic_id: 2285 reply_id: 7037[/import]

Thanks Tom - yes please do share once you have cleaned it up.

Paul [import]uid: 7863 topic_id: 2285 reply_id: 7067[/import]