Some questions...

I have some questions regarding the Corona SDK and some general game dev. questions:

  1. What makes a game to lag,to many .png files,complicated functions,big .png files,etc?

  2. While using the storyboard,can I place all my images in the “enterScene” 

  3. Can we modify the engine?

  4. What functions should I call in order that all the other running applications on the user’s phone to close

  5. How can we refresh and free up the memory,improover performance and save the battery?

  1. In my experience the amount of png files does not affect the framerate of the game but the size of the file (images only) will . Genrally what makes a  game lag is the amount and complexity of code the device has to process, for example placing a lot of code which requires calculations within an enterframe function would almost definitely make the game lag.

2)Yes, although its not recomended.

3)Not Corona sadly, you can only modify “open-source” game engines, although its pretty difficult so you might need a lil more practice before you start modding engines!

4)You cant do that, sorry even when coding native im pretty sure theres no apple api for that …

5)If we could, we would.

@86lemonade68 gave  you some pretty solid answers, but I want to expand on them.

1.  There are many factors that can cause your game’s performance to fall off.  Taking up too much memory, doing too much in tight loops or enterFrame listeners.  Image size does create problems on multiple fronts.  First, big images take up large amounts of memory.  For instance a 1024x1024 image uses 4 megabytes of memory.  A 2048x2048 image uses 16mb (It’s 4 times the size)  and a 4096x4096 image is a whopping 64mb.  Given your app may only be able to get 64-128mb for its usage, it doesn’t take long for big images to overtake your available memory.  This is why Corona SDK supports dynamic image selection.  If you need a big image to support a Retina iPad’s resolution, it generally has the memory to handle your needs.  But that same image would cripple an iPhone 4.  By allowing you to have a 2x resolution file and a 4x resolution file, Corona can pick the image that’s the best fit for the screen keeping memory usage somewhat in check.   Also using large images and scaling them down to smaller screens takes up processing time.

  1. While you can certainly load your images in enterScene, you will never see any scene transitions take place.  Storyboard and Composer assume you will create the scene in createScene() so that we can position it hidden from view and then transition it on screen prior to enterScene() triggering.  If you don’t  care about transitioning the scenes, then you can.  There may need to be at least one thing created in createScene.

3.  For the most part, no.  Corona Labs does occasionally release some of it’s pure-lua modules as Open source on hour github account.  An example of this is Widgets, Storyboard is now open source, since we are moving everyone to Composer.  Widgets is the only module that is current, most of the opensource items are things we have replaced and let the community who has been using the older libraries to maintain them themselves.

  1. No.  That’s beyond the scope of any application outside of Apple and Google’s direct control.  They of course have the power to write apps that can do that, however they don’t give developers that power.  I don’t know about Android but in low memory situation, Apple will begin shutting down apps that have been backgrounded.

5.  You should write your app with plans to free up memory you’re no longer using.  You can set an event to notify you when you get a low memory warning and then flush things using a lot of memory, like purging your old storyboard scenes, etc.  But you are limited to what your app is doing.

Rob

  1. In my experience the amount of png files does not affect the framerate of the game but the size of the file (images only) will . Genrally what makes a  game lag is the amount and complexity of code the device has to process, for example placing a lot of code which requires calculations within an enterframe function would almost definitely make the game lag.

2)Yes, although its not recomended.

3)Not Corona sadly, you can only modify “open-source” game engines, although its pretty difficult so you might need a lil more practice before you start modding engines!

4)You cant do that, sorry even when coding native im pretty sure theres no apple api for that …

5)If we could, we would.

@86lemonade68 gave  you some pretty solid answers, but I want to expand on them.

1.  There are many factors that can cause your game’s performance to fall off.  Taking up too much memory, doing too much in tight loops or enterFrame listeners.  Image size does create problems on multiple fronts.  First, big images take up large amounts of memory.  For instance a 1024x1024 image uses 4 megabytes of memory.  A 2048x2048 image uses 16mb (It’s 4 times the size)  and a 4096x4096 image is a whopping 64mb.  Given your app may only be able to get 64-128mb for its usage, it doesn’t take long for big images to overtake your available memory.  This is why Corona SDK supports dynamic image selection.  If you need a big image to support a Retina iPad’s resolution, it generally has the memory to handle your needs.  But that same image would cripple an iPhone 4.  By allowing you to have a 2x resolution file and a 4x resolution file, Corona can pick the image that’s the best fit for the screen keeping memory usage somewhat in check.   Also using large images and scaling them down to smaller screens takes up processing time.

  1. While you can certainly load your images in enterScene, you will never see any scene transitions take place.  Storyboard and Composer assume you will create the scene in createScene() so that we can position it hidden from view and then transition it on screen prior to enterScene() triggering.  If you don’t  care about transitioning the scenes, then you can.  There may need to be at least one thing created in createScene.

3.  For the most part, no.  Corona Labs does occasionally release some of it’s pure-lua modules as Open source on hour github account.  An example of this is Widgets, Storyboard is now open source, since we are moving everyone to Composer.  Widgets is the only module that is current, most of the opensource items are things we have replaced and let the community who has been using the older libraries to maintain them themselves.

  1. No.  That’s beyond the scope of any application outside of Apple and Google’s direct control.  They of course have the power to write apps that can do that, however they don’t give developers that power.  I don’t know about Android but in low memory situation, Apple will begin shutting down apps that have been backgrounded.

5.  You should write your app with plans to free up memory you’re no longer using.  You can set an event to notify you when you get a low memory warning and then flush things using a lot of memory, like purging your old storyboard scenes, etc.  But you are limited to what your app is doing.

Rob