Skip to main content

Made with Marmalade

Last night I nipped up to London to join the London Lua Group meet-up at the Marmalade offices.

The Marmalade team made us feel very welcome, and explained a bit about the platform.
Marmalade started as Ideaworks Game Studio, making games like Call of Duty: Black Ops Zombies, Lara Croft and the Guardian of Light and Backbreaker.
Their early work focussed on porting PS1 games like  Tony Hawks skater, and Final Fantasy to mobile platforms like Symbian and N-Gage.

The Marmalade SDK provides a route to cross platform deployment from a single code base, exporting to Windows 8, LG tvs, iOS, Mac, Android- which has so many different GPU's and screen sizes its much like building for multiple platforms.
Marmalade provides pre-compiled code for functions, and glues these together with native code, in a pure C platform abstraction layer. Quick builds on top providing a further Lua abstraction layer, tweaked for speed, and accessed through plugins for Xcode, and Visual Studio, or directly through a bundled IDE.
Traditionally Marmalade did not provide a complete toolchain, though there are exporters for Maya etc. It has chiefly been a tool for native coders, this prompted them to build Marmalade Quick: using Cocos2D-X, SQLite Box 2D and Lua, chosen as an easy to learn, fast scripting language.
At the lowest level Marmalade controls cameras accelerometers, adn other system level stuff, whilst  Quick sits on top and provides a Simple GUI project management tool - Quick Launchpad, and bundled IDE: Zerobrane. Quick has bindings from Lua to C++

Coding in Quick uses familiar structures, a director class controlling scenes, objects and libraries, with an event system for touch listeners, and physics handled by Box2D running underneath.
Whilst Lua handles garbage collection, it is advisable to add some additonal garbage collection on top to prevent things grinding to a halt.
Running the app provides a trace to a viewer, and outputs to simulator. The simulator can be controlled using accelerometer simulation, rotation etc..

Windows phone 8 doesn't support OpenGL, but DirectX, so the transcode works around this. Windows shaders are handled differently, but the end user doesn't have to worry.
Because of the pre-compiled components, it is deploy from Windows direct to iOS.

OpenQuick(free) on a github repo, contains the C++ and Lua source.
Using Marmalade (licenced) adds features like accelerometer, location and in app billing, Launchpad, - which provides the one click deploy, and debugging tools
The licenced version also deals with the fragmentation of android platform.
Whilst the Marmalade business model is based on annual licence of the SDK, the company do offer opportunties to revenue share on platforms that developers might not otherwise publish to, such as Korean app stores, or LG app store.

The team then demo'ed a game: 'Signal to the stars' app, which was made with Marmalade Quick, whilst Quick was being developed. It took 6 developers 2 months to build, it was the first app ever released on 4 game stores simultaneously.

It was interesting to see the approach to the build, and compare their overall architecture.
As with all Lua programs, the main.lua starts things off, in this case it pre loads assets (like sound) whilst it loads scenes,  which contain nodes, and subnodes. The sub nodes inherit from the the root node, so when porting to different platforms this handles the scaling.
The overall structure was logical, and reassuring familiar:
gameScene.lua, gameBG.lua, gameGrid.lua, gameHUD.lua, and finally resultScreen.luas. Scripts for each scene have setup and teardown, load sound, starts music, sets up animations, creates scene nodes, adds event listeners.
The use of excel to design the levels was a bit of a surprise, but completely logical, using conditional formatting to colour letters representing the tile contents, with a macro that converts the postions to numbers. These .csv output is saved as a text file which is imported into Lua.
A localisation file holds the constants, and makes translation and localisation to different versions.
Multi resolution and aspect ratio, and portrait/landscape support requires planning ahead, easier on iOS and fixed set of options, can be handled using a function :UI_SCALE.
Platform specific issues, android has a physical back-button, which requires an event listener.
No standard system dialog boxes on Blackberry 10, so skipped user inputs.
Different handling of In App Purchases, billing errors and restoring purchases.
Premium version for OEM (Argos tablet) no in app purchase.
Scoreloop support on Blackberry for cloud saving..

If you fancy having a go with Marmalade Quick, there is a 30 day trial, but also an offer for a free 1 Year Indie licence if you build a game with the trial version and submit it to the Blackberry World store.

Popular posts from this blog


Spine again - animating game assets

Laura Tallarday gave a neat demo of how to build an animation in Spine on the CoronaGeek Hangout, so I had a bash at chopping up an image and animating it.
The plan is to add some more sophisticated animations to the new game "Duck sized horse".. but as was discussed in the show adding a whole bunch of spine animated objects might hammer a mobile device... and as the aim is to have 100 tiny duck sized horses, I'd best choose another approach for them.

anyway here's a swaying viking...

Using Corona SDK

Corona Architecture Overview
Diagram showing the Corona SDK architecture -source Walter Lua - CEO Corona The development process. I built the game "Ninja Dinosaurs vs Pirate Robots" in a series of 4 development sprints. I used a familiar game format, the "Infinite Runner" to guide the overall structure, and built the game using the Agile development methodology and Simplicity principle: "simplicity: write the simplest code to do the job, do not provide hooks in your code for ‘future needs" - this prevents scope creep. Studies by Jones (2009) have shown that Agile is most effective with small teams. Agile focuses on swift iterative cycles creating instances of working code, which are constantly reviewed and guided by the end users rather than a rigid commitment to a fixed system architecture. It values working code over heavy documentation, as might be encountered in a more traditional waterfall development approach.
Game Summary. Whilst the game is an inf…