Monday, May 3, 2010

Control Configuration and Abstraction



The #1 thing that I've learned since shipping Replica Island is that users want configurable controls.  I mean, I might have guessed that some devices would have one sort of controller and not another, but I didn't anticipate the number of people who prefer a specific control configuration even when others are available.  Users with trackballs and directional pads asked for configurable keyboard settings, and when I added orientation sensor-based movement for devices without other controls (I'm looking at you, Xperia), many users who could already play the game chose to switch to tilt controls too.  I've made four updates so far and all of them have had to do with the input system; in the first three I added more and more configuration options, and in the most recent (v1.3) I rewrote the core input framework to improve non-standard control configurations.

When I started writing Replica Island, the only device available was the G1.  About half way through development I switched to an HTC Magic, and at the very end of development I switched to a Nexus One. The game was entirely designed around HTC's trackball-on-the-right design.  Fairly late in development, devices sporting directional pads (like the Motorola Cliq, and more importantly, the Droid) started to hit the market, so I added some support for d-pad controls.  I didn't really think anybody was going to use the keyboard to play, so I only added a few key-based controls to support the ODROID.

The input system started out like this:


MotionEvents from touch and trackball motion, as well as KeyEvents, were passed to the InputSystem (via the GameThread, for reasons I'd rather not discuss), which recorded them in some internal structures.  The goal here was to abstract the Android events from the game interface.  The game wants to be able to say things like "is the jump button pressed," or "was the jump button just pressed since the last frame," or "how long has it been since the last time the button was pressed."  It's a query-based interface, rather than the message-based interface that the Android framework provides.  So the initial role of the InputSystem was to record Android events so that they could be queried in the future.

The trackball was tricky to get right.  I want to allow the player to flick the trackball in a direction and have the character get an impulse in that direction scaled by the magnitude of the flick.  But the Android motion events come in at a fixed frequency and fixed magnitude, so in order to build a vector describing recent motion, I needed to maintain some history between motion events.  My first implementation, which survived for the entire course of development, was to cache a history of 10 motion events and calculate the average direction of motion across all of them to find the flick direction and magnitude.  After a specific timeout had passed with no new events, the cache was cleared and averaging would begin again with the next event.

This worked ok as a way to calculate a motion vector, but it had problems.  The biggest issue was that there was no way for a user to move slowly; even if the user rolled the ball slowly (thus causing motion events to come less frequently), as long as he rolled fast enough to make the internal event timeout, the events would get averaged together and would come out looking the same as a fast flick.  So users who tried to move with precision or in small steps often found themselves rocketing across the level.

When I went to add d-pad support, I just treated the pad as a different source of motion events.  I treated each keydown as a roll of a specific magnitude in a specific direction, and fed that into the same cache system I used for motion events.  This worked, sort of: it allowed me to pipe the directional pad through the trackball interface (which connected directly to the game) pretty easily, but it didn't feel good.  The problem with this approach was that directional pad events don't need any averaging; in fact, you want exactly the most recent state to be represented, as the player can release a key at any time (the trackball, unlike other kinds of input, never goes "up", and thus required a history).  So directional pad support in Replica Island, in the first few versions, sucked.

Add in configurable control options and very quickly my simple G1-centric input system grew into a mess that didn't work very well.  So, for the most recent version, I rewrote the whole thing.  Now the structure looks like this:


The main change here is to separate input recording (necessary for querying) from game-specific filtering and control configuration switching.  The InputSystem is now generic; it just records input events from the keyboard, touch panel, orientation sensor, and trackball, and provides an interface for the current state (as defined by the most recently received events) to be queried.  A new system, InputGameInterface, reads the hardware state from InputSystem, applies heuristics and filters, and presents fake buttons for the game to use.  This way the game can ask for the "directional pad" and get input from a trackball, orientation sensor, keyboard, directional pad, or whatever, already filtered and normalized.  I put all of the filtering code for the trackball into this class, and I can now pass directional pad input directly to the game without tying it to the trackball.

Speaking of the trackball, I changed my approach to filtering.  Now I accumulate trackball events that occur within a very short cutoff, and average them after a slightly longer cutoff.  Instead of turning the trackball input "off" after a fixed duration, I make it decay until it reaches zero.  This lets the user make small, precise movements, and still get a big motion from a large flick (as in the latter case, events occur in rapid succession and accumulate).  This method also gave me an obvious spot to stick a sensitivity factor for the trackball, which several users of devices with optical trackpads (HTC Desire, Samsung Moment, etc) had requested.

The new system probably needs a bit more tuning, but I played the game through with it and it feels pretty good.  The code is about 100x cleaner now, and InputSystem is something that others can easily reuse without any other dependencies.

Sunday, April 11, 2010

Design Post-Mortem: Three Mistakes

While I'm pretty happy with Replica Island, releasing it has definitely been a learning experience.  Some of the design choices Genki and I made were good, others were ok, and a few were bad.  Today I'm going to talk about three mistakes I made in the design of this game.

Mistake #1: This particular jump.


Turns out that a lot of players die right here.  Heck, I have the metrics to prove it.  This is sort of a difficult jump because you have to make it across a wide pit and then land in a very small space near the top of the screen.  This jump started out a little easier, but it got harder when I compressed the vertical size of this level to deal with some camera problems.  The real problem here, though, is the distance.  It turns out that this is the first spot in the game where you are required to use second-order flying skills to reach the other side.

Just what is that skill?  Well, it turns out that some players never realize that they can stay aloft for longer if they let momentum rather than fuel carry them forward.  If you press the jump button and get your speed up in the air, you can release the jump button and stay aloft until gravity overtakes you and you begin to fall.  At that point you can hit the jump button again to combat gravity and maintain your altitude.  You can't do this forever because you'll eventually run out of fuel, but using this method you can jump much greater distances than if you just hold the jump button down constantly.
The real problem is that I never teach players how to fly that way explicitly.  There is lots of tutorial levels designed to make sure you can fly, but it turns out that only the most basic flying skills are required to get passed those sections.  This area is the first in which you cannot progress unless you've figured out how to use the more complex flight mechanics, and people get stuck here.

What can I do about it?  Probably this area itself is fine; a better tutorial on this particular skill is probably in order.

Mistake #2: The Case of the Robot Spewing Spawner


When I made the robot spawners, I though it would be a funny easter egg if you could possess them.  Part of the plan was to allow the possession orb to possess any machine, and I thought possessing the spawners would be a little hidden reward for users that experiment.  The problem is, I added this functionality before we understood how the robot puzzles were going to work; in the final game, it's trivially easy to possess a spawner, and most users are confused rather than elated.  Even worse, being able to possess a spawner sometimes gets in the way of possessing a robot, which is pretty annoying.  I realized that this might be a problem before we released the game, but I left it alone because I thought it was funny.  Now there are multiple videos about it.  Pretty undeniable proof that I messed this up.

What should I do about it?  I should probably turn the easter egg off or at least find a way to make it much harder to find.

Mistake #3: The impossible puzzle.


You have no idea how many people have e-mailed me about this puzzle.  It's clearly the most difficult part of the game for a huge number of users.

In the first version of the game, this section was missing the red spikes due to a bug in the level data, which made this puzzle even more confusing.  But even after fixing that, I continue to get several e-mails a day asking about this part.

If you don't want this puzzle spoiled for you, stop reading now.

OK, I warned you.  The solution here is to use the Possession Orb to grab the robot and run him into the button.  Pretty simple, I thought; the real challenge in this puzzle's original form was actually just maneuvering the Orb through the spikes before it dissipates (in an update I added a gem to this level, so the Orb survives for longer).  But it turns out that users weren't even figuring out that they could use the Possession Orb here, even though they've seen this pattern several times in slightly different contexts earlier in the game.

I finally realized what the real failure is here: players don't realize that the Orb can fly.  The tutorial says something like, "tilt the phone to control the orb," but if you never try tilting it up, you'll never learn that the Orb can fly.  I think that players also forget that the Orb is in their arsenal, but they'd probably figure that out eventually.  Not expecting it to be able to fly means that many don't even try it.  This is a fundamental teaching failure on my part and makes this puzzle a whole lot harder than it was intended to be.

What can I do about it?  Well, as a first step, the tutorial level should force you to send the ball up at some point.  After that though, the game needs to reenforce the fact that the Orb can fly, so I'll probably need to modify some levels to encourage that behavior.

The great thing about this is, I can fix the problems and send out an update and see if my fixes were successful.  And if not I'll try again.  Traditional video games have never had this sort of ability to iterate interactively with the audience, and I'm really learning a lot from it.

Friday, April 9, 2010

Replica Island: One Month On

As of today, Replica Island has been available on Android Market for exactly one month.  I thought this would be a good time to see how it's been doing.

Turns out it's doing pretty well!  It's holding steady at 4.5 stars and it just passed 250,000 installs.  There have been a few bugs; I've made a few updates, and there are a few more fixes in the works.  But most users have been extremely positive about the game.

I've been diligently recording my install numbers from the Android Market Publisher site all month so that I can produce this graph.

Before I talk about the graph, let me tell you a little bit about my launch plan.

Replica Island is a series of experiments.  I'm trying to learn how games should be made for Android, and part of that process is learning how they should be marketed.  So as part of the experiment, I made the following launch plan:
  • First ten days: no PR, no announcements, nothing.  Just upload it and see what happens.
  • Day 10: send out press releases, upload YouTube video, post on blog.
  • When installs start to slow, prepare a second round of press releases, this time for a different audience.
My marketing budget for this project is $0.00.  I know basically nothing about marketing, and I sometimes think that Nicholai, my PR guy, was dropped on his head as a child.  This plan reflected my need to spend no money and have basically no method of marketing other than trying to get the word out to blogs and news sites.

The first week I made no announcements in order to track the quality of organic growth.  Turns out organic growth was steady and apparently fairly constant; Replica Island was downloaded about 18k times in that first week.  

On 3/18/10 I uploaded the first update.  This update fixed a few bugs and added tilt-based controls.

On 3/19/10 Nicholai sent out press releases to a bunch of Android blogs and a few non-Android gaming blogs.  The total number of blogs targeted was small, maybe five or six.  Of those, AndroidGuys.com was the first to respond (and their report remains one of the most detailed).  A bunch of other blogs copied and pasted the AndroidGuys report (I swear 99% of blogs nowadays are basically retweets of other people).  There was an immediate increase in daily downloads.

On 3/22/10 Gizmodo posted the YouTube video and wrote a nearly content free report (though they still managed to work in an anti-iPhone reference, as if part of their editorial goal is to promote fanboyism).  Apparently a lot of people read Gizmodo, as downloads spiked on that day and then continued at increased volume.  Also, the retweeting of the Gizmodo article guaranteed that the first several pages of search results for "Replica Island" were all different sites referring to the same two articles.

On 3/30/10 Replica Island was added to the list of Featured Apps in Android Market (full disclosure: I'm a Google employee but was not involved in the decision to feature this game).  You can see the effect of being featured in the graph; downloads per day shot way up, and have remained high.  Featuring makes apps really visible!

Since app downloads haven't slowed down yet, I haven't implemented the next part of the plan, which is a second round of press releases aimed at different blogs.  I hear that Nicholai has some crazy scheme up his sleeve, but as long as it costs $0.00, I'm fine with it.

So, here's my takeaway from this first month on Market:
  • Users want games in traditional genres.  Replica Island gets a lot of love from users just for being a recognizable game genre.
  • Updates don't seem to really affect downloads.  Some developers have complained that mixing uploads and new releases in "Just In" allows unscrupulous developers to ship superfluous updates just to increase their visibility, but my data doesn't show any particular advantage to being in Just In.  I think that list moves too quickly.
  • Organic growth can work, but even the tiniest bit of marketing goes a long way.  Getting the word out to blogs, even with a simple web site or press release, is huge.  Those people who are expecting direct-to-consumer digital distribution to be the end of marketing are sorely mistaken.
  • The YouTube video we made was almost an afterthought, but it's been reproduced in more blogs than any of our screenshots or promotional text.  YouTube will definitely be a big part of our next push.
  • Nicholai went to all the trouble to make a press kit, and write press releases, as described in the excellent Care and Feeding of the Press, but 99% of blogs just copied and pasted the summary text we put on the front page.  I think less than 10% of the blogs that posted about the game actually tried playing it.
  • Development and marketing on a budget of $0.00 totally works!
So that's all for now.  I'll report back when the data reveals some new pattern.  Thanks much to everybody who is playing, and to all of the blogs who covered the game, even those that just copied their text from somebody else.

Thursday, April 8, 2010

Monday, March 29, 2010

Replica Island User Comments Are Hilarious

Update: Blogger apparently isn't advanced enough to deal with images reliably. I moved them to a regular web site.


So Replica Island has been out for about three weeks now, and today it reached 85,000 installs, which is pretty cool.

Lots of users have been nice enough to leave feedback, too.  Most of the feedback is overwhelmingly positive, which is fantastic--there's nothing better than knowing that something you made is bringing other people pleasure.  And even the negative comments can be useful; I've identified several bugs and high-value features thanks to the suggestions of users posting on the Market page.

Here's a few of the comments that really made my day.

Flattery will get you everywhere.  I'm preparing a fix as we speak!



That's some high praise right there.

Thanks!

Then there are the useless comments.  These are comments that, typically, contain so little information or are so undecipherable that they don't tell me (or a perspective user) anything useful about the game.  These are mostly comments like, "doesn't work" or "I'm stuck."


First the shift key and now this!


Wait, which is it?  Man, how would you rate a game that you liked?


Thanks for the bug report!  I'll get right on that, uh, wait, what did you say happened again?


Perhaps you missed the text at the very beginning of the game that explained how to move?  It's pretty complicated, I know: "roll the trackball" or "press the d-pad."  I mean, come on, give me a break, right?


Harsh!  Wait, are you saying that the effort is only worth 2 stars, or that the game is so bad that it only warrants 2 stars because we put a lot of effort into it.  Wait, what are you saying again?


Your feedback has ensured a higher standard of quality for our next app!


Thanks, but maybe you meant to post on the Zenonia page?

Then there are the hilarious comments.  Sometimes they are sort of innocent, like this one.


Sorry to let you down Etan, but I'm not sure exactly where that expectation came from, as this is our first game and all.  Also, maybe you could have added "mediocre" or "run-of-the-mill" in there somewhere--I'm sure there's some way to fit in another few words meaning "average."


See, this is almost a useful comment!  There really aren't any cutscenes in the game (well, there's one, but I won't spoil it), but there is a lot of dialog--maybe that's what you meant?  I'm not sure how to make the game faster and slower at the same time, though.

There were a bunch of comments with a common theme that I couldn't figure out.


Uh-oh, that sounds like a bad bug!


How could this happen?  I tested the Droid extensively!


Oh no!  This sounds like a real problem!

I was so confused about what these posters were trying to tell me.  Is there some horrible bug in my game that prevents moving forward?  How can that be?  And if that's the case, how come only 4 people out of 1000 have reported it?  I've played the game on the Hero, I know that it works fine.

Finally, one final post from a user with this problem suddenly made it clear what was happening.  This post has since been removed by its author, but it lives on forever in the databases of services like AppBrain.


If you've played Replica Island, you might remember the intro sequence.  In it, a character (Wanda) runs through a few short credits, finds the broken Android robot, and says a few words.  Then the game changes to the first level, in which Dr. Kabochanomizu teaches you how to play.  That intro sequence takes, on average, 48 seconds (I know because I have user data from 85k users telling me so).  During that period, you can't control the game.  These users are people who booted the game up and closed it again in less than 48 seconds, and then went back to Android Market and wrote a review.

I actually figured this out before Patricia came along and made it clear, so in the 1.1 update I released about two weeks ago I added a little flashing "Please Wait" message to this part of the game.  Still a few folks (like our friend Patricia here) didn't figure it out and gave up in less than 48 seconds.

I guess I don't have anything to say to people who give an app less than one minute to be awesome.  It might be nice if Market displayed the amount of time each user had the app installed before writing a review.



Ah, the good old backhanded complement!  However, this poster is mistaken: I never claimed that the game would get 50 fps on the Droid.  I said it would get 50 fps on the G1, which it does during normal play (it can drop to about 30 in complex scenes).  No game draws faster than 30 fps on the Droid (or Nexus One) because those devices are fill limited.  Sorry about your luck, Mario, but your device is going to be 30 fps for all games forever.  It's still a pretty cool phone, though.



Do you see this!?  THIS is how you write useful feedback!  Both points of feedback are great, particularly the suggestion box.  I am totally going to add that in the next update.  Glad she liked the game, too.

The funniest comment so far, however, wasn't posted on Android Market.  The user was so incensed at the game that he visited the Replica Island web site and sent e-mail to Nicholai, my PR guy.
By the way, your game sucks big donkey balls. I have spent a Good amount if time playing only to find I am at a part I can't pass. I would tell you what part of this stupid game it is from but I can't go to a reference point. I have also ran into several game glitches and I just can't believe you would publish such a piece of shit. Fuck you.
This is so awesome.  Mr. Russell Hall, whoever you are, you totally made my day.  Hopefully one day you'll figure out wherever it is that you are stuck and continue putting a good amount of time into my donkey-ball-sucking-game.  Seriously, this was the first comment to really make me laugh out loud.  Thanks.

Tuesday, March 23, 2010

Design Post-Mortem: The Possession Orb

Rather than write a big long post-mortem of how developing Replica Island went, I'm thinking about writing smaller articles that focus on a single element of development.  Just because the game has shipped does not mean that development is over, and I'm sure that I have much more to learn now than I did before the game shipped.  And speaking of the game's release, it's tearing up the charts, thanks to Nicholai and his crack team of PR ninjas (ok, he doesn't really have any PR ninjas).  This article, despite being ultra thin on details, seems to have reached a lot of users.  I'll post more details soon.

Ok, so for this first Design Post-Mortem, I thought I would talk about the evolution of the Possession Orb.  The Possession Orb is a special projectile that the Android robot can fire out of his body.  It has the power to possess machines, and running it into, say, an enemy robot will let you control that robot.  The Orb is controlled by tilting the phone, and you can extend its life time by collecting red gems.

The Possession Orb did not originally start out as an orb.  And actually, it didn't originally have anything to do with possession either.

My original design for the Possession Orb was called the Player Ghost.  The idea was that the player could drop the ghost somewhere in the game world, and after a few seconds it would begin to replay the player's recent movement.  At any time the player could click a button and instantly teleport back to the ghost's current location--it was like a way for the player to undo a few seconds of movement.  The ghost, I figured, could also press buttons, so there could be timing challenges involving hitting buttons with the player's body and then again a few seconds later with the ghost.

I got this idea from a crazy Nintendo Entertainment System game called Lot Lot.  Lot Lot is a puzzle game in which two cursors move across a board filled with balls.  One cursor is under the player's direct control, and the second cursor is following the path of the first, but about two seconds delayed.  When the player's cursor is over a grid square that has balls in it, the player can press a button to swap those balls for the ones in the square pointed to by the second cursor.  So game play consists of thinking about where you want the two cursors to be, drawing a path that you know will be correct two seconds into the future, and then hitting the button at the right time to shift balls to the edge of the board before they fill up.  It's very difficult to understand at first but once it clicks the game play is crazy.  Here's a video of Lot Lot in action:



So, my idea was that the Player Ghost would be like Lot Lot's second cursor: a replay of the player's recent movement that could still affect the game world.

Here's some early design sketches I made about this idea:



Sounds cool, right?  I thought it would be cool if you could snap back to the ghost's location too.



I liked this idea, but when I ran it by Genki, my partner in crime, he was skeptical.  He thought that puzzles would be hard to design and that users would have a hard time understanding the mechanic.  But I wanted to try it out so I went ahead and implemented it anyway.

Functionally, the Player Ghost worked exactly as I had imagined.  It wasn't hard to implement and it actually looked pretty cool.  But it quickly became clear that Genki was right: the concept made no sense and designing puzzles was really hard.  It was clear that puzzles were going to require a bunch of different objects just so that the ghost could work (e.g. doors that close immediately after you pass through them, rather than after a fixed duration), which lowered the quality of the idea significantly.  And it was confusing as heck; I wasn't confident that even with supporting game objects the idea would ever really make sense to users.

Genki suggested that instead of the player leaving the ghost behind, the ghost should leave the player behind.  This idea made a lot more sense, but I wasn't sure how to make puzzles out of it.  Eventually we realized that possession is a cool mechanic that the ghost could be useful for (rather than just depressing buttons), and that tilt controls might be a fun way to add diversity to the input system.  Tilt controls implied flying, so the ghost was freed from gravity.  And at that point, it didn't make any sense for it to look like the Android robot any more, so we changed it into an orb (collisions with the background were more believable this way too).

Once we hit on the mechanic a lot of potential avenues for game design immediately presented themselves, which was a good indicator that the idea had more legs than its original version.  Actually, I think that this mechanic is quite under-used in Replica Island.  There's a lot more that we could have done with it, and actually tested with it, that didn't make it into the final game (try running the Possession Orb into a turret, for example).  Maybe this is something to experiment with in a future update.

Saturday, March 20, 2010

Replica Island Released!

I released Replica Island almost two weeks ago, just before I gave a talk about Android game development at the Game Developers Conference.  Here's the quick details:

Here's a QR Code you can scan to bring the game up in Market:

And here's a quick trailer video:


Whew, glad to get that stuff out of the way.

You might be wondering why I am posting this now instead of two weeks ago.  Well, I wanted to run an experiment.  I wanted to see what the game would do on Android Market with zero promotion.  So other than mentioning the game in my talk, I've not advertised Replica Island anywhere or done anything (other than a quick update to address control concerns) to make it particularly visible.  I wanted to see what would happen if I just left it alone for a while.

So after 10 days on Market, I'm sitting at about 18k installs and 4 out of 5 stars.  Not bad!  By comparing the data I get from the Market Publisher site to the data coming back via my own reporting system, I can tell that about 15% of users choose to opt-out of the anonymous metrics reporting system.  Which is great--I have tons of data from users who are cool with me having it.

As of today I've had Nicholai, my PR guy, turn on the PR faucet.  He's going crazy with press releases and other promotional tools.  The next experiment is to see what happens to my download growth rate once Nicholai has worked his magic.  Once that experiment has produced enough data, I'll post about it here.

I've also rewritten a lot of my data visualization tools to deal with the huge amount of data I am getting from users.  I'll write a post about the new system I am using to visualize the player death data next.

In the mean time, check the game out and let me know what you think!