In my first look at Ansca’s Corona SDK, I mentioned several features that Corona offers where Adobe AIR is currently lacking. These were compelling enough for me to rewrite my tablet game, Gridshock HD, with Corona for the iPad version. That said, it wasn’t all sunshine, lollipops, and rainbows. Some of Corona’s core APIs and functionality can feel a bit half baked in places. Let me share some of the places that seem, to me, in most need of some love.
Platform API Support
In Corona, there are a number of features that are currently only supported on iOS. Among the most compelling features, I noticed that In-App Purchase and OpenFeint are both marked iOS-only, and there are some others too. In particular, OpenFeint’s leaderboards and achievements are a big reason for why I chose Corona for Gridshock HD on iPad. I know that players demand OpenFeint and/or Game Center, and I simply cannot use either in AIR right now. As great as it is to see OpenFeint available in Corona, I’m not a big fan of runtime-included features that aren’t cross-platform.
On the other hand, the ability to extend Corona with native code would be awesome, just like it would be awesome to have the same thing in AIR. If native extensions existed, the power would be in my hands to choose whether I want to (or am even able to) implement a feature on a specific platform. The development effort for robust extension APIs is, of course, a big task, and I understand that a young platform like Corona might want to include a few high-demand third-party features out of the box before they get around to more daunting things.
Regardless, I’m sure that there are constantly feature requests for Corona to include an API for <insert personal favorite library here>. If native extensions were available, individual developers would be free to add two very valuable types of functionality:
Highly specialized features that few other developers need.
Features that might be coming the future, but there’s an immediate need that cannot wait.
With those out of the way, Ansca can focus on core APIs that work well across all supported platforms and that are useful to the largest majority of their customers—making everyone happier. In addition to native extension support in the runtime, a place to share (or maybe even sell) extensions would be ideal so that folks like me, who never want to touch Objective-C, can look through what others have already built.
In the simulator, what you see on your PC may not be what you see on the device. Sometimes, that’s impossible to fix, since some features just can’t work on desktops (Although, I’d like to see more console output that basically says, “you called function X correctly, but it cannot be used in the simulator. Please test on device”). Sometimes, though, the simulator can do things that device builds cannot. In my opinion, that’s much worse. For instance, I saw multi-line text working in the Windows simulator, but discovered that an iOS build only displayed a single line. With simulators, it’s best not to get my hopes up.
The Mac version of the simulator has skins for iPhone and iPad. It makes sense, on one hand, because the Windows version can’t output iOS builds due to Apple’s stupid rules. However, I can’t be the only Corona developer who codes on Windows and builds on Mac. Even if it requires extra notification that I can’t build for iOS, those skins would be super helpful. Alternatively, I would like to be able to add completely custom device skins. In the latter case, all I really care about is specifying a custom screen resolution for the device. If I can get 320×480 or 640×960, then I simply don’t care if the skin looks like an iPhone or not.
Finally, the console output for runtime errors in the simulator always seems to get cut off. On Windows, at least. I can’t remember off-hand if the Corona Terminal on Mac has the same problem. Anyway, I can live without a debugger, but then the stack trace must be as detailed as possible when that’s the case. Half missing information could be the difference in finding an error in seconds versus finding an error four hours later. I’m sure you can guess which I’d prefer.
Lua’s standard library is probably as stark and barebones as you can get. Basically, it provides some math functions, some string functions, and a few functions that turn a table (usually called an object in other languages) into an array by adding and removing from numeric keys. Some of the most basic things I’ve come to expect from a standard library just aren’t there. For instance, how often do you call
indexOf() on arrays? I do it all the time, and I was forced to write my own version in Lua. It may not be optimal, and I’d rather use something that a dedicated person or team has vetted better than I could with my time constraints.
On one hand, the small standard library makes sense. The language itself is tiny, and that’s a big advantage. On the other hand, I wonder if the wheel has been reinvented tens of thousands of times by various Lua developers. From what I can tell, there isn’t one true community-supported standard library out there, like I would have expected. Maybe I missed it. Honestly, though, I get the impression that most people throw the Lua interpreter into their C++ games and write super short scripts that don’t need much supporting utility code. Anything complex just goes in the C++ layer.
Moreover, if Ansca wants to support any kind of open source community, a standard library declared from on high will nip a couple of potential problems in the bud. Since I’ve yet to see any Lua code that uses some sort of namespacing, name collision is pretty much inevitable. Likewise, duplicate functionality will be rampant as everyone includes their own flavor of the missing core library. For anyone that wants to mix and match third-party libraries, that’s going to be a mess of headaches. As Corona-targeted libraries get more complex, the chances of this happening grow exponentially.
Choose the Best Tool for the Job
I enjoyed porting Gridshock HD to Corona. I learned a new language that I hope to develop with again in the future, and I was able to take advantage of features that aren’t available to me in my usual environments. It has given me some inspiration and expectations that I intend to take back with me to Flash. I might be a little more harsh on Adobe’s runtimes when I give feedback now, but any criticism I make will be because I want to see Flash Player and AIR continue to be the best at what I use them for.
Am I now a Corona developer? I’m certainly not leaving Flash behind. However, I’ll be keeping an eye on Corona to see where it ends up. I don’t have current plans for more Corona games, but I may change my mind if certain features are compelling enough, or if I decide that I haven’t played with Lua enough lately. We’ll see. It’s another useful tool to have at my disposal. I’m very glad that I spent some time learning to use it.