Why moai?
Before starting the development of Zodiac Legion, I had tried several ways of writing games, from programming a FPGA (it was a school project) to using high level languages on my TI-92 calculator, and complete frameworks.
I liked using a high level language, but reusing existing frameworks made it much easier to get things done in a timely manner. But it could also take quite a long time to circumvent the limitations of the engines, and waiting for other to fix bugs was not really an efficient way to move forward.
I also wanted an engine that would let me port easily from one platform to another.
So once I had decided to go 2D, I first tried working with Python, but distributing games made with it sounded like a pain.
Unity felt a bit "too heavy" (or obstrusive) for my needs. I have always preferred lighter frameworks. So I made some research, and I discovered moai. A few simple prototypes later, I had fallen in love with the engine, and lua.
Made with moai
At this time, there were several big indie developers using it, like Double Fine for Broken Age, the game that launched kickstarter games:
"We used Moai for the first time during our last Amnesia Fortnight," said Nathan Martz, tech director at Double Fine.
"We wanted to experiment with some 2d games and some mobile games, and Moai jumped out at us as a really simple, lightweight, quick to get into technology."
Crimson:Steam Pirates was developed by HareBrained Schemes (who later made Shadowrun Returns and BattleTech). You can read about the 12 weeks development of Crimson Steam Pirates with moai on gamasutra:
"The Crimson team at Harebrained Schemes is made up of 7 people at its peak, and we had a total development cycle of just 12 weeks. We were able to pull this off due to a few key things:
A clear creative vision Experienced developers and artists, 99% of the game was built in Lua script using an open source game development platform called Moai."
More recently, Klei has also chosen moai to develop Invisible Inc, the best (and only?) turn based infiltration game.
TLDR
I asked several other moai devs about why they had chosen moai, and here are their answers:
- It is open source, so you don't have to wait for someone else to fix the bugs that might be stopping you, and you can optimize whatever part of the engine you like. Moai is also free, and all you need to do is credit the engine, either in your splash screen, or in the credits. It also allows you to add features at the engine level.
- lua is awesome to work with. fast, lightweight, with a good C API. And the code written by other is very readable.
- It is easy to get into. You have very little setup to do before running.
- It is also natively made for 2D.
moai today
Rumors of moai's death have been greatly exaggerated: It is still actively maintained by its original creator, and several dedicated community members. A version 2.0 will be out "soon" and is currently in testing stage. It is a shame that the main site for moai is terribly outdated, though, which does not really help showing how active the (small) community is. So there is no reason not to try it if you want an efficient open source 2D engine.
The "only" drawback is its small userbase, and the resulting lack of something like the Unity Asset Store. There are also less tutorials, but the ones that exist should be enough to get you started, and moai ships with quite a lot of samples that can help you get started with a given feature.
It means moai is better suited to people who like to work close to the metal, and want the flexibility to make changes to the engine, or just have a look at it.
And if you still have questions about the way some function works, you can just read the sourcecode, which I have found very well organized and readable. Unlike what the former punchline would make you think ("moai, the mobile platform for pro developers"), it is very suited to PC gaming (Invisible Inc and Broken Age were first made for PC), and works very well even if you don't plan to make a living out of game development.
Where to get started?
The first step should be to get the binary: The historical home page of moai is not where you should look at. moaiforge is updated more often, and contains good resources on getting started with moai: 1.7.5 is the version you should download. This link should lead you to the windows and MacOSX binaries. For Linux, you'll have to download the source and build it yourself, which will be a bit more involved.
Just unzip the windows file, go to The rocket lobster tutorial. It should walk you through getting a lobster to send missiles.
Note that instead of adding moai to your system PATH, you can just copy moai.exe from moaisdk-windows-1.7.5bin to the unpacked rocket lobster folder, and create an empty lobster.lua file, and lobster.bat file with the following line:
moai.exe lobster.lua
And voila, you are set. Just write the content of the tutorial in lobster.lua and it would work. Alternatively, you can use the existing main.lua file, and put:
moai.exe main.lua
in lobster.bat if you don't want to rewrite it yourself.
Dive into moai
You should try the basic prop animation tutorial if you want to follow another tutorial. You can also read about moai basic features on the same site.
There is also a very nice serie about moai on this website. They are old, but they should still work with the latest version of moai.
To go deeper, I strongly recommend you to browse through moai samples. This allows you to edit them and immediately see the results with moai web host. They cover a lot of different topics.
There is a simple exemple of sprite animation for instance. You can also dig into your moai samples folder, and get the same samples: Its location is
moaisdk-windows-1.7.5\moaisdk-windows-1.7.5\sdk\moai\samples
You should also check moaisnippets which contains a lot of working exemples to guide you. You can then copy paste the exemples to moaifiddle.
moaifiddle allows you to write and execute code for moai online, like the moaiforge player abouve, so you can copy paste any of the exemples to modify it at your convenience, or start from a blank page, and test them online.
And if you need some help with lua, the main resources are the 5.1 Reference Manual and The book Programming in Lua, but the online version is for lua 5.0.
To get help about moai, you should browse moai forum, there is not much activity, but questions are answered pretty quickly, and the community is quite helpful.
If something is out of date or doesn't work, please send me a note here or on moai forum so that I update it.