Toffee Games is a mobile developer best known for its zombie-squashing vehicular action game Earn to Die. As work progresses on the sequel, the studio has embraced the benefits of using Marmalade’s cross-platform tools.
“This is our second project made with Marmalade, so we already solved all technical questions while developing the original,” says co-owner Ilya Kiryakin.
“Marmalade becomes better with each new version, and some workarounds we had to use for Earn to Die are no longer necessary. Our main challenges with Earn to Die 2 were mostly related to game design, whilst Marmalade just did technical side of the work for us.”
Key to Marmalade’s appeal was its ability to run games natively without compromising performance.
“Earn to Die 2 is a very dynamic game: lots of action happening on the screen at once, requiring lots of geometry and physics calculations,” Kiryakin explains. “With Marmalade we managed to make this all working smoothly, and even have acceptable performance on low-end and outdated devices.
“One of our main reasons for choosing Marmalade is that it allowed us to continue using development tools which we were experienced with. We are experienced in C++ using Windows and Visual Studio, and we were happy that with Marmalade we don’t need any other instruments to develop for mobile.”
Another reason was the ability to continue using Toffee Games’ own game engine developed in Action Script 3.
Basing Earn To Die on this engine would allow the team to easily port between mobile and Flash, as well as bring across the established level editor.
“Marmalade C++ provides great flexibility, which allowed us to port our AS3 engine without many adjustments,” says Kiryakin.
We focused on game design. Marmalade did the technical side of the work for us.
Ilya Kiryakin, Toffee Games
Marmalade’s compatibility extends to other tools as well. The Toffee team was able to use Adobe Flash to design its graphics assets, including a special custom built tool that renders Flash graphics as bitmap atlases.
The team also developed a system to render hierarchical animated image structures with OpenGL, using Marmalade’s IwGx module.
“This took a lot of effort,” Kiryakin recalls, “but as a result we can now export all contents of multiple flash files, including animations, to a compact format and have it available in our game in just a few clicks.
“We also designed our GUI in Flash, and used the same approach to export it to the game. Marmalade is flexible enough to allow customised rendering by accessing OpenGL almost directly.”
That’s not to say development has been perfectly smooth. There are always challenges to overcome, and Kiryakin is keen to help fellow Marmalade devs avoid them.
“Pay attention to Marmalade’s default memory heaps,” he says. “Our main working heap is just 16MB in size. For loading huge texture atlases during the game start-up we use a separate heap. After all atlases are loaded, we destroy this heap, so it doesn’t consume memory while the application is running.
“Also we made sure the size of this separate heap depends on the device’s screen resolution, and hence on the size of assets being loaded. This approach helped us to make sure that the game will use minimally necessary amount of RAM across various devices.”
For new Marmalade developers, the Toffee Games co-owner points to the various example games supplied with the tool, which range from small applications showing basic functionality to a simple karting game.
“Start to learn Marmalade from checking example projects, and deploying it to your mobile device,” he says.
“These examples can provide some good overview of how Marmalade works. This is also a pleasant experience to see how you can deploy your application to mobile device from Microsoft Visual Studio in just a few clicks and a couple of minutes.”