Development and Debugging Tools for Windows Phone 7 Series
description
Transcript of Development and Debugging Tools for Windows Phone 7 Series
![Page 1: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/1.jpg)
Development and Debugging Tools for Windows Phone 7 Series
Cullen WatersSoftware Development Engineer II
Advanced Technology Group, Microsoft Corporation
![Page 2: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/2.jpg)
Who Should Stay for This Talk?
Game Developersworking on other mobile platforms
interested in branching out to mobileFolks who have not used XNA professionally
![Page 3: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/3.jpg)
Who Might Want to Leave?
who have shipped an XNA XBLA title
People who are uninterested in Windows Phone 7 Series development
Game Developers
![Page 4: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/4.jpg)
Overview
![Page 5: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/5.jpg)
Toolset
Silverlight 3 (plus)
XNA
Visual Studio 2010
Visual Phone Developer Express
Single, integrated download
![Page 6: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/6.jpg)
Silverlight 3 (Plus)
Silverlight 3 with some device-specific additionsAccelerometerTouchLocation
![Page 7: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/7.jpg)
XNA Framework 4.0
A new version of XNAFull 3D support on the deviceAPIs similar to those we know and love from Windows and Xbox 360
![Page 8: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/8.jpg)
Visual Studio 2010
Full debugging support on the device Lots of new goodness in
Visual Studio 2010
![Page 9: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/9.jpg)
Visual Studio & .NET
Productive development with .NET & C# High performance IDE Intellisense makes coding faster Integrated build/deploy/debug experience MSBuild engine for build automation
![Page 10: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/10.jpg)
Visual Phone Developer Express
New Express SKU for Visual Studio 2010
Supports Silverlight and XNA development
Full device debugging support
![Page 11: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/11.jpg)
Windows Phone 7 Series Emulator
Supports full application development
Reduces costs of test and development
Emulator, not a simulator
![Page 12: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/12.jpg)
XNA Project System
C# is the only language for XNA development for Windows Phone 7 Series
All code files are organized into .csproj project files
.csproj is an MSBuild-based project system
![Page 13: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/13.jpg)
XNA Content PipelineSimplify Your Content Usage!
Provides build-time modification of source content
Customizable, extensible
Runs only on Windows
Full .NET supportp/invokeManaged C++, VB.Net, IronPython, and so on
![Page 14: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/14.jpg)
Content Pipeline Project Changes
Makes for easier parallel development of art and code
Content pipeline is extremely extensible, so integration with existing tools is possible
Content projects no longer appear as child projects of the game project
![Page 15: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/15.jpg)
.NET ToolsThere are lots of great tools out there, both free and commercialThese are my “must-have” tools
![Page 16: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/16.jpg)
Explore, browse, and analyze .NET assemblies
Understand relationships between classes
Verify code obfuscation
.NET Reflector
![Page 17: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/17.jpg)
MSIL disassemblerUseful for seeing what code is being generated at build time
ildasm
![Page 18: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/18.jpg)
Also known as F1 profiler Performs code performance profiling,
using sampling or instrumentation
Visual Studio Team System Profiler
![Page 19: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/19.jpg)
Sampling vs. Instrumentation
Sampling takes samples at regular intervals Generally better for initial investigation
Instrumentation inserts probes into the code Use for more targeted profiling
![Page 20: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/20.jpg)
Profiles managed memory usage Invaluable for debugging game memory management
CLR Profiler
![Page 21: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/21.jpg)
Pix for Windows
Graphics debugger
GPU performance investigation
Semi-transparent view into DirectX 3D
Shader debugging
Ships with DX SDK
![Page 22: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/22.jpg)
FxCop
Static code analysis tool
Integrated into Visual Studio
Analyzes compiled code
Not all rules will likely apply to games
![Page 23: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/23.jpg)
Code Obfuscation
All un-obfuscated code is open source Dotfuscator Community Edition
bundled with Visual Studio
![Page 24: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/24.jpg)
DemoObfuscation
![Page 25: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/25.jpg)
Wait a Minute!
Most of those tools are Windows tools I’m developing a game for Windows Phone 7
Series! How do those tools apply to development for
Windows Phone 7 Series?
![Page 26: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/26.jpg)
Debugging NetCF Titles
Cross-Platform Solution
Develop onWindows
Profile onWindows
Deploy toDevice
![Page 27: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/27.jpg)
Getting Info from the Device
Roll your own on-device tools Visual information, from the game Check out Ito’s debugging toolset
![Page 28: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/28.jpg)
Timing on the Phone
No high-precision timer ≈ 1 ms resolution How do you get accurate timings from that?
Capture multiple frames of data and calculate an average
Multiple 0 or 1 values, averaged over a bunch of frames, gives you a pretty accurate result
FPS component from Shawn Hargreaves
![Page 29: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/29.jpg)
Case StudyHeightmap Collision Sample
![Page 30: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/30.jpg)
Build and Run on Windows
Frame rate is good Iteration time is wonderful Life is good, ship it™!
![Page 31: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/31.jpg)
But Then We Run on a NetCF Device
Frame rate is poor Gameplay is affected by unpredictable stalls What’s going on? Most likely cause: Garbage collections
![Page 32: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/32.jpg)
Sidebar: NetCF Garbage Collector
Mark and Sweep Not generational Halts all managed threads on the device
![Page 33: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/33.jpg)
We’re Allocating During Gameplay?!?
Let’s figure out where Run the game on PC, under CLR Profiler
![Page 34: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/34.jpg)
DemoCLR Profiler
![Page 35: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/35.jpg)
Kill the Collector!
Remove allocations during gameplay Pre-allocate Be careful of hidden allocators
How could this be easier? Run it again on the device,
and we get constant frame rate
![Page 36: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/36.jpg)
Constant FPS != Good FPS
Constant + Low == still bad Fire up the VSTS profiler, and figure out
where we’re spending our time
![Page 37: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/37.jpg)
DemoVSTS Profiler
![Page 38: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/38.jpg)
Sidebar: NetCF Jitter
Non-optimizing jitter Primarily designed for application development
Apps bound by I/O, not by CPU/GPU High latency toleration
No inlining
![Page 39: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/39.jpg)
There’s the Culprit!
Make changes to fix the code Run on the device again FPS is good, ship it™!
![Page 40: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/40.jpg)
Summary
![Page 41: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/41.jpg)
Wrapping It Up
Use Windows to your advantage Keep your game running on the target platform Design with the target platform in mind
![Page 42: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/42.jpg)
Additional Resources
http://MicrosoftGamefest.com http://blogs.msdn.com/ShawnHar http://creators.xna.com http://www.red-gate.com CLR Profiler download page Ito's debugging tools
![Page 43: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/43.jpg)
Questions?
![Page 44: Development and Debugging Tools for Windows Phone 7 Series](https://reader036.fdocuments.in/reader036/viewer/2022062410/56816110550346895dd06b5b/html5/thumbnails/44.jpg)
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the
date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.