Told you it was good. So now you have bookmarked that page, printed off a few helper charts and worked out your physic logic you want to make sure when testing it not only works on the device in your hand but others who will inevitably download. I will talk about testing in my next post but what it really showed to me is just how important it is to not be lazy with your coding. I wouldn't say I was being lazy in the first instance but more a lack of understanding and this really came back to bite me. On newer devices such as the iPhone 4s (which I happen to have) it covers up all kind of sins and for that matter the Corona simulator isn't that reliable. So when testing on iPhone 3GS, for example, all kind of weird and wonderful things happen that I personally couldn't replicate.
I wouldn't be exaggerating if I said I rewrote the code of Astavoid a dozen times. This became hugely time consuming and while the concept of the game and most of the screens were finished I probably spent a very long two months on optimisation and performance issues. I would highly recommend you start by having a read of the performance and optimization tips described in this article. This got rid of some of the basic errors I was making.
In addition, to this was the concept of memory leaks and where to find them, again this article was incredibly helpful. Half the challenge of course is in finding the memory leaks and performance spikes. I didn't really get on with compiling out to Xcode simulator and using instruments as I found it too cumbersome. Instead I use a few community scripts and tools. The ones I would recommend are:
These tools were very helpful in at least identifying issues. The following links were things to try to eradicate them:
- Corona Optimisation Tips
- Faster garbage collection with corona
- Code optimization and memory leak prevention
- FPSmemory profiler swfprofiler ported corona
- Potential serious memory leaking issue
- Proper group cleaning in corona script download
- Group cleaning script updated to 1 1
Finally, the biggest stabilisation effort I got was from dropping my FPS (frames per second) from 60 down to 30. I had originally drawn 250 animations for the rocket but found that on the older devices the extra texture memory used up and the amount of computations needed was making it struggle. So I dropped the frame rate, minimised my spritesheets and followed the optimisation techniques described and I found I had a smooth action game, that worked across multi device and operating systems.
Hope this helps.
Astavoid is available on Google Play and iTunes
0 comments:
Post a Comment