Each new platform presents challenges for game developers. Using middleware like Unity helps a lot, but each platform has its own way of doing things and Windows Phone 8 (WP8) is no different. In this blog post, I’ll talk about WP8 game development from the perspective of a programmer who is porting a Unity game (Stunt Star: The Hollywood Years) from iOS/Android. The final product can be found on the Windows Phone Store.
First of all, sign up for BizSpark. You can get free access to various Microsoft software you’ll need for for WP8 development, including Windows 8 and Visual Studio. If you are developing for iOS as well, you’ll probably be using a Mac of some sort, so I recommend dual booting using Apple’s Boot Camp.
If you are using Unity, there’s plenty of WP8 information available, starting with Unity’s own documentation. This MSDN article is pretty good as well, as it gives a lot of general info about the WP8 platform. Same goes for this PDF. This Unite 2013 video is good, as are some of the Building Windows Games with Unity event videos, but they might be getting a little out of date now. Microsoft’s documentation isn’t great, especially when you are searching for implementation details. I’m not sure what you can do about this, except to allow more time than usual when researching.
Make sure you read the App certification requirements for Windows Phone thoroughly during the planning phase and again towards the end of development to make sure you’ve got everything covered. The Windows Phone Store Test Kit helps in this process. There are a few things to look out for. Make sure you use the hardware back button and don’t have any in game back/cancel buttons. Have the app name, version number and technical support contact information in an easily discoverable location (for example, always visible in the credits). If your game has background music, make sure you have volume control for it. Toggles can only flip from on/off, not different states like kph/mph. This MSDN blog post is a good starting point.
Plan to make use of WP8 specific features, such as Live Tiles. You are much more likely to be featured if your game shows off the device/OS. Stunt Star uses a Secondary Live Tile to link to the Daily Challenge screen. The tile informs the user if a new challenge is available, and the back of the tile describes the current challenge.
If you use a textbox in your game (for example, to edit a Tweet string), be prepared to do some extra work as the WP8 keyboard doesn’t have a text field displaying what is being typed like iOS and Android. Also be careful of using the browser component, as it can use a fair bit of memory.
If you are using Unity and are using any plugins (you should be), make sure they are supported on WP8. We found that some plugins said they were supported, but they didn’t actually work. Check the Asset Store comments, the Unity forums and the plugin creator’s support channels. Also, some WP8 native libraries won’t work as Unity uses the older .Net 3.5, which often isn’t supported. Prime31’s plugins are pretty good and the store, ads and Essentials plugins are free for WP8 for a limited time.
Microsoft don’t supply any leaderboard/achievement system for non-Xbox Live games, so you’ll have to use your own or a third party one. We decided to use Parse, whose Unity Plugin didn’t work on WP8 at the time, so we had to use the REST API. The advantage to using the REST API is that is now works on any Unity platform.
Some .Net functions aren’t supported on WP8, but most the ones we needed have been replaced by Unity (see the UnityEngine.Windows namespace).
Be aware of the App memory limits for Windows Phone 8. You’ll want to use texture compression and DXT5 looks pretty good. I can't tell the difference between it and 16 bit for most textures, and it's half the size.
Microsoft Terminology Search webpage is pretty useful when localising standard platform terms.
Test on a number of devices. Take a look at AdDuplex’s Phone Statistics report to decide the important devices for you. Fillrate seems to be an issue on some phones, so higher spec phones with bigger screens might run your game slower than lower spec phones. Microsoft were able to provide us with some loaners, which helped a lot. The Windows Phone Australian Developer Community is useful for Australians.
Stunt Star did need some optimisation as Unity simply runs slower on WP8 than on other platforms, specifically script to native boundaries are slower in Windows. Reduce your script to Unity Engine calls as much as possible. Always performance test the Master configuration in Visual Studio and run without debugging, as there are significant performance differences when debugging and/or running non-Master builds.
Ensure you test thoroughly. Test switching in and out of your app by holding the back button to fast app switch. Pay particular attention to parts of your game that use social media or display modal dialogs.
Test having poor and no internet connection via the Simulation Dashboard in Visual Studio. Test losing internet connection at every step of social integration and in any other feature that uses the internet.
Test changing the device’s region. Some regions, for example France, uses “,” for decimal point and some, such as the US, uses “.”.
You can submit beta builds to the Window Phone Store, which is crucial for testing IAP. Unfortunately there was no way to copy all the metadata from the beta to the release version of the game within the Windows Phone Dev Center.
Overall, WP8 simply isn’t as well supported or documented as iOS/Android, but it is still a pretty good platform to develop for. Get to know the ecosystem, research and plan, make use of WP8 unique features and test thoroughly.
- Paul (@pbaker05)
Update: Stunt Star has been featured in the Windows Phone Store in a number of countries, including the Indie Game Spotlight.