development and debugging tools for windows phone 7 series
Download
Skip this Video
Download Presentation
Development and Debugging Tools for Windows Phone 7 Series

Loading in 2 Seconds...

play fullscreen
1 / 44

Development and Debugging Tools for Windows Phone 7 Series - PowerPoint PPT Presentation


  • 158 Views
  • Uploaded on

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.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Development and Debugging Tools for Windows Phone 7 Series' - keona


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
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
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
Who Might Want to Leave?

Game Developers

who have shipped an XNA XBLA title

People who are uninterested in Windows Phone 7 Series development

toolset
Toolset

Silverlight 3 (plus)

XNA

Visual Studio 2010

Visual Phone Developer Express

Single, integrated download

silverlight 3 plus
Silverlight 3 (Plus)

Silverlight 3 with some device-specific additions

Accelerometer

Touch

Location

xna framework 4 0
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
Visual Studio 2010
  • Full debugging support on the device
  • Lots of new goodness in Visual Studio 2010
visual studio net
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
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
Windows Phone 7 Series Emulator

Supports full application development

Reduces costs of test and development

Emulator, not a simulator

xna project system
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
XNA Content PipelineSimplify 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
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
slide15

.NET Tools

There are lots of great tools out there, both free and commercial

These are my “must-have” tools

net reflector
.NET Reflector

Explore, browse, and analyze .NET assemblies

Understand relationships between classes

Verify code obfuscation

ildasm
ildasm

MSIL disassembler

Useful for seeing what code is being generated at build time

visual studio team system profiler
Visual Studio Team System Profiler

Also known as F1 profiler

Performs code performance profiling, using sampling or instrumentation

sampling vs 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
CLR Profiler

Profiles managed memory usage

Invaluable for debugging game memory management

pix for windows
Pix for Windows

Graphics debugger

GPU performance investigation

Semi-transparent view into DirectX 3D

Shader debugging

Ships with DX SDK

fxcop
FxCop

Static code analysis tool

Integrated into Visual Studio

Analyzes compiled code

Not all rules will likely apply to games

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

Demo

Obfuscation

wait a minute
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?
debugging netcf titles
Debugging NetCF Titles

Profile onWindows

Develop onWindows

Deploy toDevice

Cross-Platform Solution

getting info from the device
Getting Info from the Device
  • Roll your own on-device tools
  • Visual information, from the game
  • Check out Ito’s debugging toolset
timing on the phone
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
slide29

Case Study

Heightmap Collision Sample

build and run on windows
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
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
sidebar netcf garbage collector
Sidebar: NetCF Garbage Collector
  • Mark and Sweep
  • Not generational
  • Halts all managed threads on the device
we re allocating during gameplay
We’re Allocating During Gameplay?!?
  • Let’s figure out where
  • Run the game on PC, under CLR Profiler
slide34

Demo

CLR Profiler

kill the collector
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 FPS != Good FPS
  • Constant + Low == still bad
  • Fire up the VSTS profiler, and figure out where we’re spending our time
slide37

Demo

VSTS Profiler

sidebar netcf jitter
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
there s the culprit
There’s the Culprit!
  • Make changes to fix the code
  • Run on the device again
  • FPS is good, ship it™!
wrapping it up
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
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
ad