[In this interview, Trendy Entertainment talks with GameSetWatch contributor John Polson about adapting its popular tower defense game Dungeon Defenders for the Xperia Play/Android, making a title that can use both touch and game pad controls, and more.]

Trendy Entertainment's tower-defense action-RPG Dungeon Defenders has been on a multiplatform invasion since last year. Dungeon Defenders: First Wave released for iOS and Android last December, and Dungeon Defenders: Second Wave released for Xperia Play four months later. The switch from a touch interface to dedicated game pads seemed successful enough; Trendy recently announced Dungeon Defenders will now invade XBLA, PSN, and PC this summer.

While the developer prepares for its major console and PC debut later this year, the team was happy to reflect on its experience developing for Xperia Play, touted by many as a hardcore smartphone gaming device.

It's been almost a month since the Xperia Play launched in the U.S., and the Sony Ericsson device with slide-down PlayStation controls is already attracting some big support. Xperia Play's timed exclusive of multimillion-unit seller Minecraft: Pocket Edition is one such supporter, which sister site IndieGames recently offered an E3 hands-on preview for.

Like Minecraft: Pocket Edition, Dungeon Defenders: Second Wave is also currently exclusive to Xperia Play. Since the latter is already complete, Trendy Entertainment seemed an excellent candidate to speak about developing on the Play, sharing the mobile's strengths and weaknesses while critically comparing it to other devices. Development director Jeremy Stieglitz weighs in on all this and more in the discussion that follows.

What have you learned about making a game for both touch and game-pad controls?

From Trendy's standpoint, the key thing has been to provide unique control methods and graphical user interfaces for touch versus gamepad. In fact, Dungeon Defenders: Second Wave supports three different control schemes: tap-to-move, which works best on tablets and large-screen devices; virtual gamepad, which works best on touch-only cell-phone sized devices; and physical gamepad input, which is currently exclusive to the Xperia Play.

What we've found from implementing these various methods is that while they all drive the same mechanics, they require very different user interfaces and also need specific hacks (or "tweaks") for each method. For example, the virtual gamepad mode supports a "chase camera," but it needs massive auto-aiming and auto-rotating towards what we "guess" is the user's intended target because there's only "one virtual stick". Whereas the dual touch-pad sticks on the Xperia Play allow us to support true dual-stick shooter behavior in chase camera mode without the need for such hand-holding. In the same way, we were able to eliminate most of the on-screen icons when playing in gamepad mode, getting the player's HUD closer to its original console state.

At any time in the game, you can slide the Play's gamepad in or out, and the game's control scheme will immediately and automatically switch. Of course, Google just introduced a Gamepad/external-input-device API in their recent Honeycomb 3.1 update, so we're going to be taking advantage of that shortly, as well.

What can you say about implementing a mobile game for Android to work across very different hardware?

There were three interesting challenges to surmount. The first was compressed-texture formats, of which there are four primary ones in use across the spectrum of Android devices -- DXT, PVR, ATI, and ETC. Supporting these (and we have yet to add support for ETC) required modifying Unreal Engine 3's production pipeline to recompress the content in each format, though I believe Epic Games has this on their end now.

The second challenge was content delivery: to get hundreds of megabytes of high-end game content onto the device of every user who downloads our game, given Android Market's application-size limit. For this, we used Amazon Cloud and a custom downloader front-end to our application. Delivering such content via the cloud, of course, also has significant costs, but we had to eat it to make it happen.

Finally, of course, is the issue of performance/capability differences across the wide-range of Android devices. Amusingly enough, even among the Open GL ES 2.0 graphics specification, there are some subtle differences in functionality and stability of operations.

But primarily, to scale across the range of hardware performance levels, we went the PC route and provided more options to the end-user: they can scale down the effective game resolution, turn off various graphical effects, and even whole subsystems such as audio, to reduce the load on their phones.

At the present time, I believe this is the best approach for high-end games on Android: users will have their preference of what they want on their phone, whether it's prettier graphics or a faster frame rate. Because of the wide range of hardware, it's rather impossible to achieve a one-size-fits-all approach as a developer might on iOS.

Android is similar to the PC market in that respect and as higher-end games like Dungeon Defenders are introduced to the Market, perhaps it is time for Android "minimum specifications" listings (or better filtering options) to become more common, or an overall "system rating" like Windows Vista/7 provides.

Of course, dealing with a fixed platform like the Xperia Play is a blessing, as with Dungeon Defenders: Second Wave, we were able to specifically optimize the game's code & content for that particular hardware.

What have you learned about programming multiplayer games on Android devices and for the Play?

We utilized GameSpy for our multiplayer matchmaking, and Unreal Engine 3's client/server model for the gameplay networking. Those abstracted systems pretty much eliminated the differences between devices and even whole platforms (iOS and PC use the same essential GameSpy functionality, enabling cross-platform play).

There were some caveats, though. One is that on a lot of devices, it seems the networking hardware is not up to the challenge of rapidly sending and receiving a lot of data simultaneously, and it can cause intermittent stalling on lower-end devices. Secondly, players who are using a cell-phone data connection should never be allowed to "Host" games. Additionally, voice chat in a mobile multiplayer game is sadly still not viable, though it's getting better with each new hardware iteration and we might add it in a future update.

Finally, because we pause game execution when it's backgrounded (i.e. if you get a call or minimize the game to read a text), that will disconnect you from a multiplayer game if you take too long. That's an unfortunate thing, but the alternative would have been to consume the user's battery life and system performance by continuing to update the backgrounded game, which is even less desirable.

Dungeon Defenders: Second Wave on the Xperia Play uses the same matchmaking system as the general Android version (with the benefit of Play users being able enjoy a new online competitive game suite called "Dungeon Defenders Arena"), but as Sony's cross-platform strategies for PlayStation Network become more apparent, perhaps we will be able to link it into that as well.

Regarding performance, how does the Play's version of Dungeon Defenders stack up to other versions? What changes had to be made, and how did you implement them?

The Xperia Play has a 1 GHz Snapdragon SoC with the Adreno 205 GPU, which is mid-to-high-range in the spectrum of Android devices. It's a single-core processor, so that means we had to be more careful about our usage of threads than in the dual-core versions of the game: every calculation would cost us directly in overall framerate. Qualcomm has some great GPU and CPU profiling tools, so we optimized some of the pertinent areas of game and engine code which were originally designed for multi-threading, and we became a bit more prudent about how we utilized Android OS calls.

On the GPU side of things, we found our vertex counts were rather high for the Adreno 205 (which were originally derived from PC/console media), so we went through mesh & scene optimization processes. We also worked to eliminate all uses of alpha-kill pixel shader operations, as certain mobile graphics processors does NOT like these. We did find that the Adreno 205 had fast pixel shading, so we could run at full resolution without becoming fill-rate limited.

Once we went through these processes, performance on the Xperia Play actually exceeded the original version's performance on many Android devices and was clearly worth the effort. In our game at least, the Xperia Play performs on-par with iPhone 4, and I would say that the tools we had to discretely analyze its performance made the process of getting there much easier than we've found on other platforms and devices.

How did Dungeon Defenders change from iOS to Play in terms of accommodating hardcore mobile gamers?

[We added] a gameplay mode targeted towards the hardcore crowd: a Multiplayer-Online-Battle-Arena mode called "Dungeon Defenders Arena." Putting the Arena mode in the general Android/iOS version of the game would have been overwhelming to many casual gamers, because in order to effectively compete in it, you gotta grind. But we felt that especially with the Xperia Play, that's what our players are looking for: a hardcore experience of character building that can be punishing, but ultimately so-very-rewarding.

As the Xperia Play takes off, we plan to support these players by releasing more-challenging missions and modes as well as improved competitive play.

While the digital pad seems to be praised, the analog thumbpads haven't been so. Do you feel this is a hardware flaw or some other quirk? What has been your experiences with the analog sticks?

I would guess that Sony-Ericsson designed the analog pads to minimize the possibility of physical breakage: moving nubs or tilting sticks would have a high probability of getting smashed the way many people treat their phones. We actually have been able to get very accurate and natural results from the Analog Touchpads. There are definitely some magic-numbers involved in taking the raw points of input and translating them into an "analog stick" -1 to +1 range that feels intuitive. But once we tweaked it and created our little formula, we felt it was natural to use and felt like a great solution for a gaming phone.

What suggestions have you been given to market to the Android Market and PlayStation Store?

PlayStation Store is a new system that we've not yet worked with: as far as I can guess, it's a store for PS One titles and games developed with PlayStation Suite, a platform agnostic framework for mobile games.

It'll be interesting to see how that plays out as a complement to Android Market on such devices, but over time it could be significant; one of the essential challenges for smaller mobile developers is getting your title noticed in the massive clutter of Android Market (or for that matter, iOS) applications. A smaller pool of quality-controlled, certified games presented to the consumer has a certain attraction, from both a developer and consumer standpoint. As PlayStation Store's cross-platform reach becomes more definitive, it's something that Trendy is going to be devoting resources to, as our essential studio strategy is to support all platforms with our titles.