Marble Blast Rolls onto the iPhone
by Deborah M. Fike · 06/16/2009 (4:28 pm) · 13 comments
Marble Blast is a franchise that doesn't need introduction on this site. Ever since its initial release in 2002, people have been 'marbling it up' on PC, Mac, Linux, XBLA, online and yes, even Net Jet. Its simple gameplay (you are essentially a round sphere that can roll and jump) combined with a variety of power-ups and maps make it accessible to both the casual and hardcore gamer alike.
Naturally, GarageGames saw a fit with their classic IP and the iPhone, but with all the work we've got going on with Torque and InstantAction, we needed to find the right partner to help us make it happen. Enter Luma Arcade. Luma has been working with us over the past year and a half on various projects, not the least of which is the much anticipated car racer, Rev. With over 40 years of game development experience on their team, not to mention a great history in graphics and design, they were a perfect fit. Their gameplay video alone should give you an idea of what I mean:
Luke Lamothe, Technical Director of Luma Arcade, talked to me about creating Marble Blast Mobile, and the iPhone opportunity (and challenges) for this beloved game. Enjoy!
How did you integrate Marble Blast gameplay with iPhone tech?Well, it was pretty easy to decide that Marble Blast Mobile needed to be controlled with the accelerometer on the iPhone. Being able to roll the marble by tilting the device comes to mind. Unfortunately, it wasn't as easy as just saying "if the phone is tilted to the left, then roll the marble to the left." It took a heck of a lot of tweaking to get the marble feeling natural, while at the same time having to compensate for the lack of tactile feedback that a device such as the iPhone suffers from when compared to using a keyboard or a game pad.
In addition, since you are essentially moving your screen around as you control the marble, it doesn't make sense for the player to worry about lots of touch screen interactions at the same time...that is just going to get clumsy! To lessen the need for necessary touches when controlling the ball, we developed an auto-camera system that would follow the marble as it rolled around the levels with the accelerometer input. This ended up working out quite well and allows for you to play the game with only the accelerometer and single taps for jumping when necessary.
What tools did you use to create Marble Blast Mobile?Marble Blast Mobile was built using the iTGE engine. We chose iTGE because a) we are quite familiar with TGE from the work done on some of our previous titles, and b) Marble Blast is a GarageGames property. Also, as the existing games in the Marble Blast franchise were all written in some variation of a Torque engine, we wanted to keep to a technology that would allow us to reference the source from those games when working on this title.
In addition to iTGE, we used Torque Constructor for working on the levels. Each level started out as an existing Marble Blast level. Then, using Constructor, we made appropriate changes to optimize and pretty things up where possible.
We also used 3DSMAX and the DTS exporter plug-in for all of our DTS objects. Every DTS in Marble Blast Mobile was based on the corresponding one from Marble Blast Online, but each one had to be simplified for the iPhone hardware in terms of material, poly counts, special effects, and animations.
Adobe Photoshop was used by our artists to tweak all of the game textures. They needed to be resized to resolutions better suited for the iPhone. Alpha channels needed to be created for our specular mapping. And each texture needed to be manually tweaked (with some brand new textures created as well) since Marble Blast Mobile doesn't have all of those fancy shader effects like the online version does!
All of our sound effects (and the music) were ones that previous Marble Blast games used, but we used Audacity to convert them all to be 8kHz and mono in order to reduce the download size of the game as well as to save big time on the memory used by the application when running.
"Being able to roll the marble by tilting the device was important, but wasn't as easy as just saying 'if the phone is tilted to the left, then roll the marble to the left.' It took a heck of a lot of tweaking to get the marble feeling natural." - Luke Lamothe, Technical Director of Luma Arcade
What was your development process like?We decided to first get a version of the game running on PC, as iTGE compiles and runs fine there (due to its TGE roots), using Marble Blast Gold as a starting point. Once we got there, we needed to pull in the resources and functionality from Marble Blast Online, which was built using a version of TGEA, so it wasn't too hard to get the required information back into iTGE, but it wasn't 100% straightforward either. By the time that we had a "working" version on the PC, we had obtained our developer status from Apple and were able to get the game running on iPhones for testing.
Once on the actual hardware, we had to overcome the hurdles of performance and controls. The most important task was to get the controls working properly so that we could finalize the necessary changes to the level design for the iPhone. Concurrently, we had to find ways of increasing the performance so that the game was actually playable on the device, as we were averaging less than 10 fps on 2nd generation iPod Touches (which are the "fastest" iPhone-type devices on the market), with some of the more complex levels from Marble Blast Online running under 5 fps!
Altogether we had about 10 people contribute to the project, not including the QA people, with 4 of those being on the project pretty much full time for its duration (2 programmers and 2 artists for approximately 6 months). Generally, the work between the programmers was split between non-iPhone coding (i.e. menus, gameplay, sound, etc.) and iPhone-specific coding (input controls, graphics, performance, etc.), and the artists were split between 3D art (world and object meshes) and 2D art (menus, HUD, and textures). The additional people associated on the project worked on smaller programming, art, and design contributions. All in all, it took us about 5 months of work to reach what I would have called beta status for Marble Blast Mobile.
We are always testing our own work as we go along and try to not let any bugs or issues fester around to be dealt with later on in projects. Having said that, there were quite a few issues picked up by the excellent external QA team at VMC Game Labs that handled the majority of QA testing for us. They enabled us to concentrate on making Marble Blast Mobile better by fixing issues instead of having to look for them.
What technical hurdles did you overcome?DIF performance in iTGE: In a nutshell, DIF rendering in Torque engines places a huge strain on the CPU since it has to dynamically build up lists of polygons to render each frame based on the current visibility. Another source of large CPU strain is the many render and texture state changes that have to happen when each block of DIF polygons is rendered, especially due to the lightmap system in Torque which assigns a single lightmap texture to each surface (a surface is a group of polys on a brush that share the same normal... essentially all polys that make up a flat surface). This means that every single surface in a DIF needs to be rendered in a separate call with a separate lightmap setup. We found it was much better to pre-build large polygon lists for each DIF (a separate list for each unique texture used by that DIF) using a single super-lightmap that we would create, and then render each of these lists in a single shot with a single batch of render and texture state changes. This means rendering more polygons in general, but the hardware of today (even iPhone hardware) can handle that much easier than it could when the DIF system was written way back before graphics cards had any kind of TnL support. Changing to this system increased our performance on the iPhone between 50% and 200% depending on the level.
Trying to emulate the graphic quality of MBO on the iPhone: Since Marble Blast is an existing franchise that has some very successful iterations on the Xbox360 and on InstantAction, we knew that we would be judged visually based on what people had seen previously. Therefore, we needed to make Marble Blast Mobile look as close as possible to the latest and greatest version of the game, even though we were restricted not only in terms of what the iPhone hardware was capable of doing from a performance point of view, but also what the hardware (via OpenGL ES) would actually allow us to do. Since the iPhone doesn't allow shaders of any sort, obtaining the exact same look as MBO was not an option, but we still had to do our best to approximate it.
We identified the largest "wow" factors in Marble Blast Online to be the specular / normal mapping on the world, the real-time cubemap reflection on the marble, and the cool bloom / glow effects on things like the finish pad and checkpoints. Therefore we set out to emulate these effects as best we could.
OpenGL ES on the iPhone doesn't support specular lighting or normal maps (it does support the DOT3 blend mode, but we didn't want to go down that route...), so we came up with a method to "fake" the specular using a hotspot overlay and a specular map built into the alpha channel of each texture in the game that would allow us to specify "bumpiness" for the specular to reflect off of.
OpenGL ES on the iPhone also doesn't support any type of reflection maps (sphere maps or cube maps), so doing real-time reflections was out of the question, even if the iPhone *could* handle rendering the scene 6 additional times! So we had to dig into some old school tricks and write our own software sphere mapping solution that would generate the UVs necessary for a sphere map reflection, and then render a 2nd pass using those coordinates and a sphere map for the marble to give it some kind of reflection effect.
As for blooming, while it would have been possible to do some kind of post effect on the iPhone screen, we didn't bother to try anything out since we knew that it would be somewhat costly to the performance, and we didn't want to sacrifice any more to make the game look only marginally better.
Online Multiplayer: Currently, Marble Blast Mobile includes WiFi multiplayer between devices that are connected on the same LAN. The reason why it wasn't able to ship with Internet multiplayer support is because that isn't a trivial task to accomplish! The biggest problem that we ran into was that most NATs today won't allow communication in from an outside IP that it doesn't know about. That means that unless a player knows about these kinds of things and is on a WiFi connection where he has access to the NAT running on his IP and can tell it to allow traffic in, he won't be able to connect to other players as his NAT will block their attempts to talk to him and vice-versa. Thanks to some great help from Bill Hicks, the CTO of Pick up and Play (the makers of iFPS Online), we are currently working on a solution to this by making Marble Blast Mobile games "punch" their way through NATs, which seems to be working in our initial internal tests. We now need to test this properly and hopefully Internet multiplayer will be available in the not too distant future for owners of MBM!
Roughly 10 people (excluding QA) worked on Marble Blast Mobile, four of them full time. The beta was built in five months.
If you had to do it all again, what would you do differently?I'm not sure what we really could have changed. I think that we tackled the project about as best we could seeing as it was our first iPhone game, we were working with iTGE (which was in beta), and we had to spend nearly the first 2 months of development time without being able to test on an iPhone while we waited for our iPhone developer application to be processed and approved by Apple.
If anything, I guess I would have liked to have had the time to include more levels in the game, as well as swap out some of the levels that perhaps were not as well suited to the iPhone (both in terms of gameplay and hardware capabilities) for some others from the Marble Blast series that perhaps were. This ultimately was a side effect of having to start working on getting the levels into the game before we could properly test on the iPhone itself.
What can we expect to see next from Luma Arcade?Well, next will probably be us finally finishing off REV for InstantAction. It was in closed beta towards the end of last year on the site, but we decided to spend some time porting it to TGEA 1.8 from TGE 1.5. We're looking to have that back in beta shortly, and we are also working on 2 other iPhone games that are due to be released in the next few months as well (one using iTGE, and the other iTGB), so keep your eyes open :)
"We needed to make Marble Blast Mobile look as close as possible to the latest and greatest version of the game, even though we were restricted not only in terms of what the iPhone hardware was capable of doing from a performance point of view, but also what the hardware (via OpenGL ES) would actually allow us to do." - Luke Lamothe, Technical Director of Luma Arcade
Thanks, Luke, for both the interview and the many late nights I've been marbling it up on my iPhone. I don't know how I would have gotten through my last two plane rides without it! ^_^
For more stories like this, check out GarageGames' Developer Interview series.