CL19: Development and Debugging Tools for Windows Phone 7 Series

CL19: Development and Debugging Tools for Windows Phone 7 Series

Development and Debugging Tools for Windows Phone 7 Series Cullen Waters Software Development Engineer II Advanced Technology Group, Microsoft Corporation Who Should Stay for This Talk?

Game Developers working on other mobile platforms interested in branching out to mobile Folks who have not used

XNA professionally Who Might Want to Leave? Game Developers who have shipped an XNA XBLA title

People who are uninterested in Windows Phone 7 Series development Overview

Toolset Silverlight 3 (plus) XNA Visual Studio 2010 Visual Phone Developer Express Single, integrated download

Silverlight 3 (Plus) Silverlight 3 with some device-specific additions Accelerometer Touch Location

XNA Framework 4.0 A new version of XNA Full 3D support on the device APIs similar to those we know and love from

Windows and Xbox 360 Visual Studio 2010 Full debugging support on the device Lots of new goodness in Visual Studio 2010

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 Visual Phone Developer Express

New Express SKU for Visual Studio 2010 Supports Silverlight and XNA development Full device debugging support Windows Phone 7 Series Emulator

Supports full application development Reduces costs of test and development Emulator, not a simulator 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 XNA Content Pipeline Simplify Your Content Usage!

Provides build-time modification of source content Customizable, extensible Runs only on Windows Full .NET support p/invoke Managed C++, VB.Net, IronPython,

and so on 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 .NET Tools There are lots of great tools out there, both free and commercial

These are my must-have tools .NET Reflector Explore, browse, and analyze .NET assemblies Understand relationships between classes

Verify code obfuscation ildasm MSIL disassembler Useful for seeing what code is being generated at bu

Visual Studio Team System Profiler Also known as F1 profiler Performs code performance profiling, using sampling or instrumentation

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

CLR Profiler Profiles managed memory usage Invaluable for debugging game memory management Pix for Windows Graphics debugger

GPU performance investigation Semi-transparent view into DirectX 3D Shader debugging Ships with DX SDK FxCop

Static code analysis tool Integrated into Visual Studio Analyzes compiled code Not all rules will likely apply to games

Code Obfuscation All un-obfuscated code is open source Dotfuscator Community Edition bundled with Visual Studio Demo Obfuscation

Wait a Minute! Most of those tools are Windows tools Im developing a game for Windows Phone 7 Series! How do those tools apply to development for Windows Phone 7 Series?

Debugging NetCF Titles Profile on Windows Develop on Deploy to

Windows Device Cross-Platform Solution Getting Info from the Device

Roll your own on-device tools Visual information, from the game Check out Itos debugging toolset 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 Case Study Heightmap Collision Sample Build and Run on Windows Frame rate is good

Iteration time is wonderful Life is good, ship it! But Then We Run on a NetCF Device

Frame rate is poor Gameplay is affected by unpredictable stalls Whats going on? Most likely cause: Garbage collections

Sidebar: NetCF Garbage Collector Mark and Sweep Not generational Halts all managed threads on the device

Were Allocating During Gameplay?!? Lets figure out where Run the game on PC, under CLR Profiler Demo CLR Profiler

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 Constant FPS != Good FPS Constant + Low == still bad Fire up the VSTS profiler, and figure out where were spending our time

Demo VSTS Profiler 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 Theres the Culprit! Make changes to fix the code

Run on the device again FPS is good, ship it! Summary Wrapping It Up Use Windows to your advantage

Keep your game running on the target platform Design with the target platform in mind 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 Questions? 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.

Recently Viewed Presentations

  • 2018 NFHS BASEBALL RULES POWERPOINT National Federation of

    2018 NFHS BASEBALL RULES POWERPOINT National Federation of

    Sportsmanship — bench jockeying and celebrations. www.nfhs.org. Coaches, players, substitutes, attendants or other bench personnel shall not leave the dugout during a live ball for any unauthorized purposes. Points of Emphasis
  • Balancing Act: Planning for a Sustainable Wisconsin

    Balancing Act: Planning for a Sustainable Wisconsin

    Transportation Heating Manufacturing Health Consequences TIME Immediate/short-term (e.g., refinery explosion) Long-term (e.g., cancer) REVERSABILITY Temporary injury (e.g., skin burn from gasoline spill) Permanent disability (e.g., lung disease from coal plant emissions) CONTROLABILITY "Voluntary" (e.g., driving a car) "Involuntary" (e ...
  • Update in Outpatient Internal Medicine for the ...

    Update in Outpatient Internal Medicine for the ...

    Update in Outpatient Internal Medicine for the Outpatientalist: 2013 GEORGE D. COMERCI, JR., MD,FACP, DAAPM PROFESSOR OF INTERNAL MEDICINE CO-DIRECTOR: PROJECT ECHO PAIN HEADACHE CLINIC, UNM PAIN CONSULTATION AND TREATMENT CENTER * Origin of the Novel Avian Influenza A H7N9...
  • CSC148 Ramp-up - University of Toronto

    CSC148 Ramp-up - University of Toronto

    CSC148 Ramp-upFall 2015. Larry Zhang (Based on slides from Michael Kimmins) (Based on slides from Orion Buske) (based on notes by VelianPandeliev, Jonathan Taylor, Noah Lockwood, and software-carpentry.org)
  • ESTP Course Balance of Payments Introductory course Paris,

    ESTP Course Balance of Payments Introductory course Paris,

    1/ Exceptional financing brings together financial arrangements made by the authorities (or other sectors fostered by the authorities) of an economy to meet balance of payments needs. For more detailed see . BPM6, Appendix 1, paragraph A1.4. Eurostat
  • iMentor: Using Technology to Provide Personalized Support and

    iMentor: Using Technology to Provide Personalized Support and

    FAFSA verification Award letter review Supplementary loan applications Tuition payment plan set-up Orientation and placement test registration Housing applications Health insurance applications and waivers Unanticipated fees (orientation, housing, etc.)
  • Naval Weapons N205 - USNA

    Naval Weapons N205 - USNA

    Earth-Sun Geometry. The earth's axis is tilted at an angle of ~23.5° (why we have seasons) Boreal (N.H.) Winter Solstice (~21 Dec) Sun directly overhead Tropic of Capricorn
  • Chapter One - Pearson Education

    Chapter One - Pearson Education

    Programmed decisions. are routine decisions, made by lower-level personnel, that rely on predetermined courses of action. Nonprogrammed decisions. are decisions for which there are no ready-made solutions. The decision maker confronts a unique situation in which the solutions are novel.