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...


Beta Beater

The Google Developer Console is really very very good.
It's logically set out, and makes it super easy to run a Beta test.
I'm on the tenth iteration of the final draft, and think I've got to a point where I can actually promote the app to Production.
The latest revision changed the icon set, and removed a load more cruft, slimming the app down to just 12.14Mb. I could strip out the iOS icons and lose a few more bytes but the original aim way back when I started on this project was to build a simple game that could be deployed cross platform, so I think I'll try and maintain just one codebase... as I really should submit this to the iTunes store too, to close the project.