RSS Feed IDS on YouTube IDS on Facebook IDS on YouTube

A few months ago, Justin and I began investigating ways to make our next game (in Unity3D) look great. We knew we wanted to stick with 2D art, but didn’t want to tacitly accept the “conventional” expectations associated with 2D art in games.

SpriteLamp

We discovered SpriteLamp, which essentially allows you to generate dynamic lighting on pixel art. It accomplishes this by producing normal maps, depth maps, and anisotropy maps for use in shaders. All you provide are 2-5 “lighting profiles” of what an object would look like lit from a specific direction (top, bottom, left, right, or front). This animation sort of sells itself:

A zombie lit with the help of SpriteLamp

Courtesy of the SpriteLamp Kickstarter

We encourage anyone interested to check out the Kickstarter or SnakeHillGames for more information. SpriteLamp was successfully funded, and we’ve received beta access. The tool, even in its beta state, is very usable, and has UI that is easy enough to understand for now:

The UI for SpriteLamp

The UI for SpriteLamp

Although we’re not artists, even we could see how exciting this would be to get working in Unity. SpriteLamp’s developer, Finn Morgan, said that a shader for Unity will be provided later, but we decided that we couldn’t wait, so we wrote it ourselves.

Continue reading … →

Imagine for a moment that you’ve just spent a year creating a game, fixed hundreds of bugs, and you finally release it. You’re worried about a lot of things: Will anyone play the game? Will they like it? Will there be any problems? As it turns out, the answer to that is usually yes to all three to some extent. But there will always be problems after launch.

For Minecart Madness, our launch issue was pretty worrisome: on first generation Windows Phone 7 devices, the game ran slowly. Very slowly. So slow that it was unplayable. So what happened?

When Windows Phone first launched in 2010 with such phones as the Samsung Focus, they were more than capable of running games at 30fps, but compared to the next generation (like the Nokia Lumia 800), the original models were slow. Approaching the launch of Minecart Madness, we did most of our testing on our day-to-day phones, which were not first generation Windows Phones.

Looking for Solutions

We immediately began searching for ways to speed up the game on those slower phones. The first thing to go involved the minecart’s headlamp – we use a second rendering pass to draw it with additive blending. Even after disabling that, at certain times we still saw slowdowns, so we chose to reduce the rendering size from the then-native 800×480 pixels.

Gameplay

In particular, whenever lots of track supports were on screen, we still saw slowdowns even with the headlamp blending disabled.

An across the board cut on pixels sounds drastic (and it is), but other possible solutions involved more re-architecting than we wanted to do. After all, every day that the problem persisted were potential lost players and negative reviews. With a bit of empirical testing, we determined that 60% size would allow the game to run fast enough and still look acceptable. Luckily, with XNA we were able to scale all rendering with a single parameter change.

low-quality

At 60% size, there’s a noticeable quality drop (though less so while playing), but everything is still readable.

So now we knew how to fix the problem, but we needed to figure out when to fix it. See, we wanted to fix the problem for older devices, while still providing the pretty visuals for newer phones.

Blacklisting

The most obvious solution was a blacklist of phones, and explicitly checking for the first generation devices. The downsides to this approach should be obvious: it’s easy to be too aggressive or not aggressive enough with the blacklist, and it comes with a maintenance cost of keeping it up to date. We turned away from this plan almost immediately.

Framerate Checking

Our next attempt focused around the fact that the first few seconds of every Minecart Madness run are the same – a flat track with 3 coins and a shield power-up. If the game doesn’t run at 30fps for the first second or two, then there’s no problem. It’s only when the player is trying to jump, dash, or navigating the randomly-generated track that it becomes painful to play.

By measuring the time between beginning to draw and ending (for XNA, SpriteBatch.Begin and SpriteBatch.End), we planned to check if a frame was taking “too long”. At 30fps, each frame should be 33.33ms, so we gave ourselves some breathing room and marked a frame as “slow” if it took longer than 37ms. Then, if we have more than 10 slow frames in a given time interval, we switch to the “low quality” mode outlined earlier in this article.

We thought that with this approach, we would be ready to publish the much-needed performance update. However, even when running on a first-generation Windows Phone, we were not falling back to low quality. Well, why not?

SpriteBatch.End

In most modern rendering APIs, a process called batching greatly improves performance. Rather than sending each drawing command to the GPU individually, the API will collect many calls together, until either rendering is ended, or the queue of command data surpasses an internal limit.

You might think that for XNA, SpriteBatch.End would be the call where rendering would actually occur. The documentation seems to agree with that reasoning. However, as it turned out, we were missing a lot of the processing time. To fully capture the time for a frame, we begin measuring at the beginning of Draw, and added an override for Game.EndDraw. By finishing our measurement here, we ensure that all rendering time is included. After making this change, the first-generation phones drop to low quality very quickly, providing a playable experience.

Handling Hiccups

We noticed that even on the newest Windows Phones, sometimes we would still fallback to low quality. Sometimes this was due to background processes on the phone, and sometimes it was due to the amount of rendering we were doing, such as the screenshot above when there are lots of track supports to draw.

To account for this, we reset back to high quality each time the player begins a new round. Then, if a fast phone just happens to have an unfortunate set of frames, next game it will switch back to looking crisp. Slower phones also reset to high quality, but as expected, they jump to low quality quickly for each round.

At this point, we finally had a runtime solution for detecting performance problems, and correcting on the fly to provide a great gaming experience for all of our players. We were able to push the update out only a week after the game launched, an impressive turnaround time in our opinion for such a complicated issue. Since we published this update, we haven’t had to touch this code and the complaints about the game being unplayable have completely dropped off.

Tradeoffs

As with any solution to a problem, there are wins and losses.  A solution is only worth shipping if the benefits outweigh the drawbacks, and there are always drawbacks.  The might be development time, test time, potential destabilization, or performance costs.  Our solution, while elegant in terms of total code change, is not perfect.  In Handling Hiccups, we talked about how we reset to high quality each round.

On the slower phones, the change to a low quality mode will trigger after 10 frames (1/3 second).  This initial slowness does not go undetected by all users.  When play-testing the fix on slow phones, players noticed that the game, right upon triggering a new run, will stutter.  Users almost unanimously agreed that this was a drastic improvement and a tolerable stutter on their phones.  Users became used to the stutter for at the beginning and adjusted accordingly.

Very few noticed the graphical quality reduction, interestingly.  We did.  A fast motion game, such as Minecart Madness, we have learned, has a benefit of masking low graphical quality.  We had discussions about lowering the quality of only specific parts of the game, such as the track, and maintaining high resolution for other graphics.  We concluded that change was not necessary.

Conclusions

We made a mistake.  This is a perfect example of development not being over after shipping.  Ultimately, it is not possible to test on every config.  Identifying your potential weaknesses and testing them early and often is crucial.  For Minecart Madness, gameplay enjoyment is heavily dependent on frame-by-frame performance.  We should have been looking for low performance devices.  Is your game a turn-based strategy game such as Civilization?  Testing on devices with different resolutions and DPI such that users can read all text and easily click on all buttons should be regular on the development cycle.

Moving forward, we know we will make mistakes.  We will likely miss bugs and have to send out day zero patches.  However, we hope that what we have learned from this simple oversight and our future projects will never ship preventing users from playing or enjoying our titles.  For our developer friends reading this, we understand that shipping a title and putting yourself out there requires confidence and resolution.  However, never be so confident in your work that you overlook simple bugs.  Testing may not be the most enjoyable activity when you could be playing your own game or adding new features, but it is crucial to do, end-to-end.

One year ago, we launched Minecart Madness for Windows Phone. While we’ve been busy working on a new project since then, we thought now would be a good time to look back and analyze how Minecart Madness has done.

Minecart Madness

Launch

Minecart Madness launched on October 24th, 2012, and the free version launched a few days later on November 1st. We delayed the free version because we wanted to link the player to the paid version (only once per session), and the store link is not resolved until an app is published. It turns out that linking the player to the paid version was not very useful. After all, why pay $1 for a game that you’re already playing for free? Mobile users are increasingly accepting of ads in free games, and our ads were already not very invasive.

We had issues at launch where the game ran terribly on some devices (we’ll cover the technical side of this in a separate post). While we managed to get the problem fixed with a quick turnaround, some damage was already done – we had a few early negative reviews because of this problem.

Ad Networks

Our stance on in-game ads is pretty simple – display and rotate them as often as possible, but never when it would interrupt or frustrate the player. In Minecart Madness, obstacles can appear from the left, top, and right sides of the screen, and the player needs to see the bottom of the screen to tell where they can land. As a result, our only options were to decrease the vertical height of the game, and add an ad in that space, or not display them while playing. The choice was obvious – we only display ads in menus, or between the player dying and starting again. There’s no doubt that this decreased our ad revenue, but so would angering your players, and we care more about the quality of the game than earning a few extra dollars.

Initially, we only used Microsoft’s PubCenter for ads. Despite a pretty good number of ad impressions, we didn’t make much from ad revenue. We discovered a great library called Ad Rotator that let us easily add additional ad networks. We published an update that added InnerActive, AdDuplex, and MobFox.

After testing the waters with these new ad networks, InnerActive was the clear winner, with a much higher revenue rate, and over 70% of our total ad revenue. We can only speculate how our revenue would change if we focused on InnerActive from the start, but for any future games we create with ads, they’ll definitely be our primary ad network.

inneractive

Downloads

Despite less-than-stellar ad revenue, we made this game because it was a game we wanted to play, and we hoped that others would want to play it too. During development, we decided that we would consider 1,000 downloads to be a minimum bar for success.  We were blown away with our download numbers. As of October 24, 2013, we have 1,691,754 downloads! Initially, our download trend matched what we expected – a large initial surge, followed by decreasing downloads per day. However, on two occasions we saw our downloads surge again. To our delight, our downloads have not dropped below 2,000 per day.

minecart-madness-downloads

The top ten countries that downloaded our game are, in descending order:

  1. Russia
  2. China
  3. Mexico
  4. Brazil
  5. Italy
  1. India
  2. United States
  3. Thailand
  4. France
  5. United Kingdom

Those ten countries combined account for 1.22 million downloads. In total, our game has been downloaded in 173 countries, many of which with only a few hundred downloads. However, every download counts, so it was great that we published our game in nearly all available countries.

Brazil is particularly interesting to see in the #4 spot. When we launched Minecart Madness, Brazil required a unique rating outside of the free ESRB and PEGI we obtained, so we did not publish in Brazil. At some point, Brazil began accepting ESRB or PEGI ratings, and after being informed by a Brazilian fan of Windows Phone, we finally published our game in Brazil in late February 2013. This explains one of the later surges in the download chart above. When downloads are compared by amount of time since publishing in a country, Brazil is nearly on par with Russia, so we heavily encourage other developers to release in Brazil.

Reviews

reviews

As already mentioned, we suffered from some initial negative reviews from the game being unplayable on some phones. However, after fixing that issue, we’ve recovered and are sitting at 4 star ratings in 7 of our top 10 countries. We’ve gotten a lot of feedback that Minecart Madness is a lot of fun, but there’s admittedly not much depth to it.

Before we released, we had a lot of grand designs for features to help with this, but we made (in our opinion) the right call to draw a line somewhere and just publish the game. The incentive for continued play could be higher with features such as leaderboards and daily challenges. We hoped to include some of these features in future updates, but we ultimately determined to shift focus to other projects. We still get numerous reviews regarding how addictive the game is, which we attribute to the procedurally generated levels, a differentiator we are particularly proud of. We will cover our strategy regarding responding to reviews in the Windows Phone ecosystem in a future post.

Conclusions

First of all, no matter how large or small the ecosystem for a platform may be, there will always be players. If you build something that you enjoy yourself, you will not be alone. Testing your game should feel like fun, an exploration of your own creation. Shipping is important and you will have to cut in order to pull it off. The journey of making a game does not end with shipping and, in many cases, it is only beginning. Seeing how your art effects players of different ages and backgrounds is exciting, but also humbling. We have learned from this experience and we continue to try to gain an understanding of what we can do better in the future.

We are increasingly appreciative of our players. There are nearly 1.7 million people who went into the store, looked for a game among thousands of deserving, enjoyable titles, and chose to install and play ours. That number increases by over 2,000 every day. While we are making our next game, people are still installing our current one, and that is something we will never forget. Thank you!

A big thanks to everyone who downloaded Minecart Madness. We’ve hit 1 million downloads on Windows Phone!

We’ve been pretty silent lately, mostly due to real life getting in the way, but we are working on some new stuff. With the news that XNA development has been halted, we’ve been looking into new alternatives. Right now we’re getting acquainted with Unity3D and hopefully we’ll be getting started on a new game soon.

Windows Phone users should be seeing an update for Minecart Madness soon. Details can be found on the changelog.