Moai SDK has been in the news lately and I’ve had a few people ask me what I think about it for game development — mainly as an alternative to Corona SDK.
Right on the Moai website (in the FAQ section if you want to look it up) the designers of that framework say who Moai is right for, and who it’s not right for…
Moai is designed for experienced game developers… Moai SDK is not ideal for people just getting started in game development.
I wrote my first game (unpublished, but still fun for me and my siblings) in 1984 using AppleSoft BASIC. Within a few years after that I was writing commercial games in 65C02/65C816 assembly language. In recent years I’ve created iOS games that are in the App Store.
While I know I’ll always have a lot to learn, I think I’d be put into the “experienced game developer” category pretty easily. But it still took me too long to get the Moai SDK samples up and running.
And coming from Corona SDK I was disappointed to see that doing something as simple as getting an image on the screen took so much code:
-- create a viewport viewport = MOAIViewport.new () viewport:setSize ( 320, 480 ) viewport:setScale ( 320, 480 ) -- create a layer and sets its viewport layer = MOAILayer2D.new () layer:setViewport ( viewport ) -- push the layer onto the render stack MOAISim.pushRenderPass ( layer ) -- create a deck representing a single textured quad gfxQuad = MOAIGfxQuad2D.new () gfxQuad:setTexture ( ‘test.png’ ) -- load an image to use as the quad’s texture gfxQuad:setRect ( -64, -64, 64, 64 ) -- set the dimensions of the quad -- create a prop and initialize it prop = MOAIProp2D.new () prop :setDeck (gfxQuad) -- add the prop to the layer layer:insertProp ( prop )
Are you freaking kidding me? The same thing in Corona would be done like this:
prop = display.newImage("test.png")
That’s it. In fact, that one line of code is a valid Corona SDK program. You could compile that and install it on your iPad. That’s the beauty of Corona SDK – you can get up and running so quickly.
So why would anyone in their right mind choose to go with Moai?
The Feel of Velvet Handcuffs
First, let me say that you already know I’m going to be making a case for Moai, but in the coming paragraphs I don’t want you to think I’m “badmouthing” Corona SDK. I’m not. I love that framework and my next game is using it. But I will be making comparisons between the two and [spoiler alert] Corona SDK will come out wanting. 🙂
Ansca Mobile has a plan with Corona SDK to which I’m not privy, but if you look at how they work I think when ease-of-use “butts heads” with power, power takes a back seat. You can get great mileage out of keeping your feature-set simpler rather than more complex. Less tech support, fewer frustrated users, etc.
Sidebar: I think that’s my main reason for hating Eclipse and that genre of IDE — could they intentionally make a busier interface with more options? I don’t think so. The thing that 1% of developers use does NOT have to be front and center. Bah!
So while actual development in Corona is very fast, at some point you’re going to run into a roadblock. Maybe you want to put iAds in your app. Or you want to get/set pixels of an image. Whatever it is, if Corona SDK doesn’t offer that capability, you’re stuck. You have to change the way your app works.
Moai SDK, on the other hand, is open source. You can download the actual source code for the SDK and make changes to it. Yes, you have to know C++ and be a programmer geek for that, but it’s still possible to do. You aren’t stuck with whatever someone else said is good enough.
But still, even with the limitations of Corona SDK and the open source of Moai SDK, look at the code difference between the two. That has to count for something.
Yeah, it does. I’m a BIG believer in rapid development. Because at the end of the day, I don’t want to program, I want to make a game!
However, there is a solution to the “open, but still complex” problem with Moai…
RapaNui to the Rescue?
The guys who make Moai are smart. They’ve created a foundation that’s powerful enough to handle just about anything. And they’ve done it in such a way that there are no handcuffs. They assume a game developer/studio will decide to use Moai and then write routines that make the development faster.
A company in the UK, YMobe, has created a “wrapper” for Moai SDK called RapaNui which does just that. And it’s open source like Moai SDK (both are free to use, you just have to attribute them in your app).
Using RapaNui and Moai SDK this is how you put an image on the screen:
prop = RNFactory.createImage("test.png")
Just like Corona SDK, RapaNui does it with one line — because behind the scenes it’s dealing with the multiple lines of Moai we saw above.
So you get the simplicity of Corona SDK, but you can “drop down” into raw Moai whenever you want. If RapaNui doesn’t handle something, you’re not stuck, you can do it with Lua and the Moai SDK. And, of course, if Moai can’t do it, you can actually make changes to the SDK (yes, that’s not going to be a reasonable option for a lot of people, but still available).
So why did I put a question mark at the end of the previous heading?
Because while I’ve gotten some parts of RapaNui to work, it seems like I’m doing more “fiddling with things” than actual coding. I was never able to get the samples to work the way the README file explained, but I was able to get some of it working in a sample app I built.
The sky is brightening in the the east, but it ain’t dawn yet. 🙂
You’re Just Not All That Good, Jay
Sure, that could be the problem. I know there are people using Moai and RapaNui to create games right now. They’re smarter than me. Or they’ve spent more time fiddling with things.
Either way, it doesn’t matter because one way or the other the pieces will come together. Even when that happens I don’t expect Moai SDK + RapaNui to equal the ease-of-use of Corona SDK — but it will be more of a lure than it is today.
I created a tool that makes Corona SDK faster and easier to use (Corona Project Manager) and I’ve started work on something similar (but even more of a step up) for Moai SDK. I’m sure you’ll hear about it when it gets closer. 🙂
Until then, if you’re geeky and like hard-core programming, Moai SDK is something you’ll want to explore. But if you’re more of a beginner (or pressed for time) and just want to make a game, Corona SDK is probably better for you at this point.