Presentation is loading. Please wait.

Presentation is loading. Please wait.

Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.

Similar presentations


Presentation on theme: "Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here."— Presentation transcript:

1 Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here

2 Agenda Windows Phone 7– A new beginning… Xbox LIVE overview Announcing XNA Game Studio 4.0 Powerful, Productive, Portable… Lap around the XNA Framework Call to action & resources

3 A different kind of phone Designed for life in motion So you don’t miss a moment SMART DESIGN Windows Phone 7 Series has a smart design that focuses on what is most important to you and works the way you would want INTEGRATED EXPERIENCES Windows Phone 7 Series organizes the web and applications to simplify what you do everyday FOR DEVELOPERS A single, cohesive API set and platform

4 Windows Phone Games Hub

5 LIVE is Bringing Gaming Services 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 Premium placement helps your titles stand out and avoid the race to the bottom Identity Friends Achievements Merchandising Premium Placement

6 Windows Phone 7 Hardware Spec Consistent sets of hardware capabilities defined by Microsoft Same resolution Same touch input Processor / GPU RAM Optional keyboard

7 Cloud Services Developer ToolsPlatform Technology Location Service Notification Service Development Platform

8 User Experience Frameworks Modern XAML/event-driven application UI framework Rapid creation of visually rich apps HTML/Javascript Mature, robust, widely deployed technology High performance game framework Rapid creation of multi- screen 2D and 3D games Rich content pipeline Mature, robust, widely adopted technology spanning Xbox, Windows, and Zune GAMES (and apps) APPLICATIONS (and games)

9 PowerfulPortableProductive

10 XNA Game Studio Creating Games Makes game development easier XNA Framework provides robust APIs for games C#,.NET & Visual Studio tooling Solutions for game content processing Not an engine solution

11 XNA Game Studio 4.0 Develop games for Windows Phone 7 Series Simplified graphics API’s Visual Studio 2010 integration Enhanced audio support New configurable effects

12

13 Managed Code for Game Development Uses the.NET platform Windows Phone 7 Series Managed code only, no unsafe or native code XNA Game Studio 4.0 is C# exclusive 800+ managed code games on XBLA/XBLIG Windows games published through portals such as Steam.NET is being used for games today

14 Frameworks designed for performance Addressing Performance Head-on Frameworks designed for performance XNA Framework designed for gaming scenarios Commitment to future of managed code No unnecessary garbage generation Math libraries optimized Efficient APIs with tuned transitions to native code Three+ years of profiling and investment We’ve built for performance on Windows Phone 7 Series

15

16 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

17 Manage assets in Visual Studio Importers for common game data formats Optimize data into binary format for efficient loading Fully extensible XNA Framework/Game Loop not required Content projects external in XNA Game Studio 4.0 Content Pipeline Simplify Your Content Usage!

18 XNA Framework Game Loop System integration with Windows phone 7 Translated to existing XNA Framework concepts Traditional update/draw/present frame loop Core programming model consistent with previous releases Changes implemented yield better power performance on devices /// /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// /// Provides a snapshot of timing values. 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); } /// /// This is called when the game should draw itself. /// /// Provides a snapshot of timing values. protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); // TODO: Add your drawing code here base.Draw(gameTime); } /// /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// /// Provides a snapshot of timing values. 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); } /// /// This is called when the game should draw itself. /// /// Provides a snapshot of timing values. protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); // TODO: Add your drawing code here base.Draw(gameTime); } XNA Framework Game Loop Example

19 Let’s Get Visual, Visual!

20 Graphics Overview

21 Configurable Effects New configurable effect classes on all platforms BasicEffect SkinnedEffect EnvironmentMapEffect DualTextureEffect AlphaTestEffect Custom effects not available on Windows phone 7

22 Five Configurable Effects Plus hardware accelerated 2D sprite drawing BasicEffectSkinnedEffectEnvironmentMapEffectAlphaTestEffectDualTextureEffect

23 BasicEffect SkinnedEffectEnvironmentMapEffectAlphaTestEffectDualTextureEffect 0-3 directional lights Blinn-Phong shading Optional texture Optional fog Optional vertex color Vertex CostPixel Cost No lighting51 One vertex light401 Three vertex lights601 Three pixel lights1850 + Texture+1+2 + Fog+4+2

24 DualTextureEffect BasicEffectSkinnedEffectEnvironmentMapEffectAlphaTestEffectDualTextureEffect For lightmaps, detail textures, decals Blends two textures Separate texture coordinates Modulate 2X combine mode (A*B*2) Good visuals at low pixel cost Vertex CostPixel Cost Two Textures76 + Fog+4+2

25 AlphaTestEffect BasicEffectSkinnedEffectEnvironmentMapEffectAlphaTestEffectDualTextureEffect For billboards and imposters Adds alpha test operations (pixel kill) Standard blending is free with all effects Only need alpha test if you want to disable depth/stencil writes Vertex CostPixel Cost =, >66 ==, !=610 + Fog+4+2

26 SkinnedEffect BasicEffectSkinnedEffectEnvironmentMapEffectAlphaTestEffectDualTextureEffect For animated models and instancing Game code animates bones on CPU Vertex skinning performed by GPU Up to 72 bones One, two, or four weights per vertex Vertex CostPixel Cost One vertex light554 Three vertex lights754 Three pixel lights3351 + Two bones+7+0 + Four bones+13+0 + Fog+0+2

27 EnvironmentMapEffect BasicEffectSkinnedEffectEnvironmentMapEffectAlphaTestEffectDualTextureEffect Oooh, shiny! Diffuse texture + cube environment map Cheap way to fake many complex lights Fresnel term simulates behavior when light reaches a surface and some reflects, some penetrates Vertex CostPixel Cost One light326 Three lights366 + Fresnel+7+0 + Specular+0+2 + Fog+0+2

28 BasicEffectSkinnedEffectEnvironmentMapEffectDualTextureEffectAlphaTestEffect World, View, ProjectionYes DiffuseColorYes AlphaYes FogOptional Vertex colorOptionalNo Optional Diffuse lightingOptionalRequired No Specular lightingOptionalRequiredNo PreferPerPixelLightingOptional No TextureOptionalRequired Additional properties WeightsPerVertex, SetBoneTransforms EnvironmentMap, EnvironmentMapAmount, EnvironmentMapSpecular, FresnelFactor Texture2AlphaFunction, ReferenceAlpha

29 System Support: Scaler & Orientation 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” & 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

30

31 XNA Framework designed to be cross platform Smaller time investment & target more sockets Project synchronization between platforms Target Three Screens

32 HiDef Reach XNA Framework Profiles Create a clear development environment Target broadly or platform showcases Designed for compatibility across screens/devices This profile includes Windows phone 7 Platform showcase features Xbox 360/Windows Only

33 Simplifying Game Development

34 Better Known as Xbox LIVE!

35 Gamer Services API Framework API: Xbox LIVE Identity & Rewards Single Identity (Gamertag) Achievements Leaderboards Trial Mode

36 Can You Hear Me Now?

37 Audio public SimpleSingleBufferSoundEffect()` { effect = new SoundEffect (“ding.wav”); // Play a “Fire and Forget” instance. effect.Play(); // Create 2D instances and play them. // You could also call Apply3D to 3D position the instances. SoundEffectInstance instance1 = effect.CreateInstance(); SoundEffectInstance instance2 = effect.CreateInstance(); instance1.Play(); instance2.Play(); } public SimpleSingleBufferSoundEffect()` { effect = new SoundEffect (“ding.wav”); // Play a “Fire and Forget” instance. effect.Play(); // Create 2D instances and play them. // You could also call Apply3D to 3D position the instances. SoundEffectInstance instance1 = effect.CreateInstance(); SoundEffectInstance instance2 = effect.CreateInstance(); instance1.Play(); instance2.Play(); } Audio Playback Example public EventDrivenCapture() { mic = Microphone.Default; mic.BufferDuration = TimeSpan.FromMilliseconds(100); bufferDuration = mic.BufferDuration; 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. mic.GetData(buffer, out duration); // Do some post-capture processing on it. MakeMeSoundLikeARobot(buffer, duration); DynamicPlayback.SubmitBuffer(Buffer); // Save the audio or whatever } public EventDrivenCapture() { mic = Microphone.Default; mic.BufferDuration = TimeSpan.FromMilliseconds(100); bufferDuration = mic.BufferDuration; 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. mic.GetData(buffer, out duration); // Do some post-capture processing on it. MakeMeSoundLikeARobot(buffer, duration); DynamicPlayback.SubmitBuffer(Buffer); // Save the audio or whatever } Audio Capture Example Audio Capture & 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 Series Microphone/Bluetooth Support Playback through headset Capture through mic or headset

38 Music Enumeration & Playback Media – Music/Photos/Video // Constructs a song from a URI Uri mediaStreamUri = new Uri(webAddress); Song streamedSong = Song.FromUri(mediaStreamUri); // Play the song MediaPlayer.Play(streamedSong); // Constructs a song from a URI Uri mediaStreamUri = new Uri(webAddress); Song streamedSong = Song.FromUri(mediaStreamUri); // Play the song MediaPlayer.Play(streamedSong); URI Song Playback Example // Get the JPEG image data byte[] modifiedJpegData = ReadAndModifyJpegFromStream(image); // Save texture to Media Library Stream jpegStream = new MemoryStream(); awesomeTexture.SaveAsJpeg(jpegStream); MediaLibrary media = new MediaLibrary(); media.SavePicture(“Awesome”, jpegStream); // Get the JPEG image data byte[] modifiedJpegData = ReadAndModifyJpegFromStream(image); // Save texture to Media Library Stream jpegStream = new MemoryStream(); awesomeTexture.SaveAsJpeg(jpegStream); MediaLibrary media = new MediaLibrary(); media.SavePicture(“Awesome”, jpegStream); Retrieve Image Data Picture Enumeration & Playback Video Playback Control and enumerate users’ media within a game Ability to play songs from URI/URL (i.e. music app) Supports photo picking/editing/publishing Uses standard video player API Show/Hide controls

39 Interacting with games gets easier!

40 Cross Platform Input API Touch API Xbox 360 Controllers (Xbox/Windows) Keyboard (Xbox/Windows/Windows phone 7 Series) Available across platforms for portability (fewer #ifdefs) Four points on Windows phone 7 Series and Windows Orientation and resolution aware Developer can override Input Overview var touchCollection = TouchPanel.GetState();... foreach (var touchLocation in touchCollection) { if (touchLocation.State == TouchLocationState.Released) {... } var touchCollection = TouchPanel.GetState();... foreach (var touchLocation in touchCollection) { if (touchLocation.State == TouchLocationState.Released) {... } Touch Input Handling

41 Using Silverlight and the XNA Framework

42 Sensor Overview Leverage Platform Features on Windows phone 7 Series Location Accelerometer Vibration AccelerometerSensor accelerometer = GetAccelerometer(); accelerometer.DataChanged += (source, args) => { // access x, y, z, and timestamp information // from args.Value } AccelerometerSensor accelerometer = GetAccelerometer(); accelerometer.DataChanged += (source, args) => { // access x, y, z, and timestamp information // from args.Value } Accelerometer Example VibrationManager rumbler = new VibrationManager(); rumbler.Vibrate(TimeSpan.FromSeconds(2)); VibrationManager rumbler = new VibrationManager(); rumbler.Vibrate(TimeSpan.FromSeconds(2)); VibrationExample

43 Demo  Build a game in minutes…

44 Using Silverlight and the XNA Framework

45 45 The XNA Framework Game Loop is layered on top of the Silverlight Application object on Windows phone 7 Series Provides the bulk of integration seen previously 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, nor will be for XNA GS 4.0 Scenes using GraphicsDevice from XNA Framework and UIElements from Silverlight You’ll want to choose the technology that works best for your scenarios Bridging the Gap

46 46 Graphics UI control heavy consider Silverlight Leverages vector graphics in XAML Silverlight is your only choice Media Rich video support consider Silverlight Tooling If you leverage Microsoft Blend in your pipeline, Silverlight is your only choice Leveraging the Right Technology

47 47 Graphics For 3D graphics your only choice is the XNA Framework Game Loop Sprite heavy 2D applications should consider the XNA Framework Game Loop Simulation/Drawing Those who prefer a traditional update/draw/present frame loop should leverage the XNA Framework Game Loop Tooling Those who want to leverage the XNA Framework Content Pipeline graphics types Leveraging the Right Technology

48 Sum up Slide Powerful Productive Portable Great managed code games, working today Windows Phone provides a powerful platform for gaming Focus on being a game developer, not a plumber Great tools make you more productive Target more platforms easily Focus on your game differences, not the technology

49 Let’s get it started…

50 Additional Resources Lot’s of MVP’s and experts to help you get started! XNA Creators Club @ http://creators.xna.com http://creators.xna.com Team Blog @ http://blogs.msdn.com/x na/ http://blogs.msdn.com/x na/ Shawn Hargreaves @ http://blogs.msdn.com/s hawnhar/ (Great Tech Info!) http://blogs.msdn.com/s hawnhar/ Email: mklucher@microsoft.co m Blog: http://klucher.com Twitter: @mklucher mklucher@microsoft.co m http://klucher.com @mklucher Peer Support @ http://forums.xna.com http://forums.xna.com Blogs Contact an expert !

51 Thank you for your time!

52


Download ppt "Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here."

Similar presentations


Ads by Google