You are on page 1of 55

http://blogs.msdn.

com/glengordon

Gamertag
Friends Achievements Merchandising Premium Placement

Windows Phone will extend the Xbox LIVE brand beyond the console for the first time
Windows Phone is the first step towards our vision of a ubiquitous gaming service Differentiates your title from the rest

To use the great features of Xbox LIVE

Without Xbox LIVE You can still write and publish games for Windows Phone

Find a publisher! Lots to choose from!


Were interested in your great games! wpgames@microsoft.com Create great games for marketplace http://developer.windowsphone.com

Consistent sets of hardware capabilities defined by Microsoft

Resolution Touch Input CPU / GPU RAM


Hardware keyboard is optional

Modern XAML/eventdriven application UI framework Rapid creation of visually rich apps HTML/Javascript Mature, robust, widely deployed technology

High performance game framework Rapid creation of multiscreen 2D and 3D games Rich content pipeline Mature, robust, widely adopted technology spanning Xbox, Windows, and Zune

APPLICATIONS
(and games)

GAMES
(and applications)

Powerful

Productive

Portable

Makes game development easier


XNA Framework provides robust APIs for games C#, .NET and Visual Studio tooling Solutions for game content processing Not an engine solution

Creating Games

XNA Game Studio 4.0

Develop for Windows Phone 7

Simplified graphics APIs New configurable effects

Visual Studio 2010 integration

Enhanced audio support

Windows Phone 7 Uses the .NET platform


Managed code platform, no unsafe code
XNA Game Studio 4.0 is C# exclusive

.NET/XNA is used for games today!


800+ managed code games on XBLA/XBLIG

wpgames@microsoft.com

Windows games published through portals

Frameworks Frameworks designed designed for performance for performance


No unnecessary garbage generation

for performance
Three + years of profiling and investment

XNA Framework Frameworks designed for designed gaming scenarios

Weve built for performance on Windows Phone 7

for performance

Commitment to Frameworks future designed of managed code

Math libraries optimized

Efficient APIs with tuned transitions to native code

Productive development with .NET and C# High performance IDE Intellisense makes coding faster Integrated build/deploy/debug experience MSBuild engine for build automation

Simplify Your Content Usage

The XNA Framework Game Loop is layered on top of the Silverlight Application object on Windows Phone 7
Provides the bulk of integration of APIs Most of the XNA Framework can be accessed from Silverlight applications Including Gamer Services (Xbox LIVE)

In this release some sharing/composition is not complete


Scenes using GraphicsDevice from XNA Framework and UIElements from Silverlight

Youll want to choose the technology that works best for your scenarios

Graphics
UI control heavy consider Silverlight Desire vector graphics in XAML

Media
Rich video support in application

Tooling
If you use Microsoft Blend in your pipeline

Graphics
Using 3D graphics Sprite heavy 2D applications should consider the XNA Framework Game Loop

Simulation/Drawing
Those who prefer a traditional update/ draw/present frame loop

Tooling
Those who want to use the XNA Framework Content Pipeline graphics types

Start simple and customize!


Traditional update/draw/ present frame loop
Core programming model consistent with previous releases Changes implemented yield better power performance on devices System integration with Windows Phone 7 best practices Translated to existing XNA Framework concepts
}

XNA Framework Game Loop Example

protected override void Update(GameTime gameTime) { // Allows the game to exit if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) this.Exit();
// TODO: Add your update logic here base.Update(gameTime); } protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); // TODO: Add your drawing code here base.Draw(gameTime);

Evolution of our existing immediate mode rendering API Simplifies for resource and render state management Feature segmentation between Reach/HiDef profiles Rendering primitives 2D and 3D

BasicEffect

SkinnedEffect

New configurable effect classes on all platforms

EnvironmentMapEffect DualTextureEffect AlphaTestEffect

Custom effects not available on Windows Phone 7

Scaler
Write your game without worrying about native resolution or orientation
Automatic rotation between portrait and landscape Touch automatically supports both scale and orientation changes

Scaler can drastically improve performance


Trade off performance for crispness and shade fewer pixels 800x480 = 384,000 pixels, 480x320 = 153,600 pixels

Upsample an arbitrary back buffer to native device resolution


Far higher quality than bilinear filtering Allows for easier porting from other platforms

Scaling/Rotation comes for free from Hardware

Audio Capture Example


public void EventDrivenCapture() { mic = Microphone.Default; buffer = new byte[mic.GetSampleSizeInBytes(mic.BufferDuration)]; mic.BufferReady += new EventHandler(OnBufferReady); DynamicPlayback = new DynamicSoundEffectInstance(mic.SampleRate, AudioChannels.Mono); } public void OnBufferReady(object sender, EventArgs args) { // Get the latest captured audio. int duration = mic.GetData(buffer); // Do some post-capture processing and playback. MakeMeSoundLikeARobot(buffer, duration); DynamicPlayback.SubmitBuffer(buffer); }

Audio Capture and Playback


Simple API to play back WAV data

Modify pitch, volume, pan audio


Ability to play synthesized/buffered audio Serialize captured data Provides more control over System.Media types on Windows Phone 7 Microphone/Bluetooth Support
Playback through headset Capture through mic or headset

Audio Playback Example

// Load a sound effect from a raw stream SoundEffect effect1 = SoundEffect.FromStream(GetStreamFromTheWeb("http://url.wav")); effect1.Play(); // Create dynamic audio on the fly byte[] fluteSound = GetFluteNote(); effect2 = new SoundEffect(fluteSound, SampleRate, AudioChannels.Stereo); SoundEffectInstance instance = effect2.CreateInstance(); instance.Pan = -1; instance.Pitch = 1.5f; instance.Play();

Music Enumeration and Playback Control and enumerate users media within a game Ability to play songs from URI/URL (i.e. music app) Picture Enumeration and Playback Supports photo picking/editing/publishing Video Playback

URI Song Playback Example


// Constructs a song from a URI Uri mediaStreamUri = new Uri("http://song.asx"); Song streamedSong = Song.FromUri("Song", mediaStreamUri); // Play the song MediaPlayer.Play(streamedSong);

Retrieve Image Data

MediaLibrary media = new MediaLibrary(); // Get the JPEG image data Stream myJpegImage = ReadAndModifyPicture(somePicture); // Save texture to Media Library media.SavePicture("Awesome", myJpegImage);

Uses standard video player API


Show/Hide controls

Cross Platform Input API


Xbox 360 Controllers (Xbox/Windows) Keyboard (Xbox/Windows/Windows Phone 7) Touch Input Handling
var touchCollection = TouchPanel.GetState();

Touch API
Available across platforms for portability (fewer #ifdefs) Multipoint on Windows Phone 7 and Windows Orientation and resolution aware

//...
foreach (var touchLocation in touchCollection) { if (touchLocation.State == TouchLocationState.Released) { //... } }

Developer can override

Leverage Platform Features on Windows Phone 7 Location Accelerometer Vibration

VibrationExample VibrateController rumbler; rumbler.Start(TimeSpan.FromSeconds(2));

Accelerometer Example Accelerometer accelerometer = new Accelerometer(); accelerometer.ReadingChanged += AccelerometerReadingChanged; accelerometer.Start();

Windows Phone 7 OS
HTTP Push

Xbox LIVE
Avatars Invites Gamer Services

Profile

Achieve- Leaderments boards

Trial Mode

Read a Players Profile // Profile access SignedInGamer gamer = Gamer.SignedInGamers[0]; // Get the player's GamerTag to display string gamerTag = gamer.Gamertag; // A SignedInGamer has a Profile GamerProfile profile = gamer.GetProfile(); // Get the player's current GamerScore int gamerScore = profile.GamerScore; // get the gamer picture (PNG file stream) Stream gamerPictureStream = profile.GamerPicture;

Award an Achievement

Real achieventments Real gamerscore Up to 20 awards, 200G total Dead simple API, deep game design

// Award an achievement SignedInGamer gamer = Gamer.SignedInGamers[0]; gamer.AwardAchievement("Attended TechEd 2010");

Read Achievements
// Get achievements AchievementCollection achievements = gamer.GetAchievements(); // walk through achievements foreach (Achievement a in achievements) { string name = a.Name; string description = a.Description; bool earned = a.IsEarned; int score = a.GamerScore; Stream icon = a.Picture; }

Write to a Leaderboard

Compete with Friends Score- or Timebased Fixed columns 10k blob data Pivot on gamer

// Create leaderboard identity with game mode 1 LeaderboardIdentity id = LeaderboardIdentity.Create(LeaderboardKey.BestScoreLifeTime, 1); // get the leaderboard writer from the signed in gamer LeaderboardWriter writer = gamer.LeaderboardWriter; // get the leaderboard entry for the identity LeaderboardEntry entry = writer.GetLeaderboard(id); // write new leaderboard data entry.Rating = 1000; entry.columns.SetValue("Outcome", LeaderboardOutcome.Win);

Read From a Leaderboard


// Read from leaderboard with page size of 10 LeaderboardReader reader = LeaderboardReader.Read(id, gamer, 10); foreach (LeaderboardEntry e in reader.Entries) { // score or time, as defined by identity. Rating determines rank. long rating = e.Rating; // read additional column data long wins = e.Columns.GetValueInt64("Wins"); Stream blob = e.Columns.GetValueStream("Blob"); } reader.PageDown();

Simple check Simulate for testing Send user to your Marketplace offer
Trial Mode
Guide.SimulateTrialMode = true; // if we are in trial mode, show a marketplace offering if (Guide.IsTrialMode) { PlayerIndex playerIndex = Gamer.SignedInGamers[0].PlayerIndex; Guide.ShowMarketplace(playerIndex); }

Currently supported through web service only Static pose rendered on LIVE back-end Download as a stream

http://avatar.xboxlive.com/avatar/Major%20Nelson/avatar-body.png

Game invites are handled through email Guide.ShowGameInvite() invokes platform picker UI Player chooses game invite recipients Friends see invitations in their games hub

XNA Framework designed to be cross platform Smaller time investment and target more sockets Project synchronization between platforms

Reach
HiDef

Designed for compatibility across screens/devices This profile includes Windows Phone 7 Platform showcase features Xbox 360/Windows Only

Summary
Powerful
Great managed code games, working today Windows Phone provides a powerful platform for gaming

Productive
Focus on being a game developer Great tools make you more productive

Portable
Target more platforms easily Focus on your game differences, not the technology

Call to Action
Download the Windows Phone Developer Tools http://developer.windowsphone.com

Create awesome games!

Additional Resources
http://forums.xna.com
Hundreds of samples Lots of MVPs and experts to help you get started

Peer Support @

Blogs
XNA Creators Club @ http://creators.xna.com Team Blog @ http://blogs.msdn.com/xna/ Shawn Hargreaves @ http://blogs.msdn.com/shawnhar/ (Great Tech Info!)

Contact Microsoft
Email: wpgames@microsoft.com On the web: http://developer.windowsphone.com

You might also like