1 / 41

Developing Games for Windows Phone 7 with XNA Game Studio 4.0

Developing Games for Windows Phone 7 with XNA Game Studio 4.0. Your Name Here. 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. A different kind of phone. INTEGRATED EXPERIENCES.

peta
Télécharger la présentation

Developing Games for Windows Phone 7 with XNA Game Studio 4.0

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. 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 A differentkind of phone INTEGRATED EXPERIENCES Windows Phone 7 Series organizes the web and applications to simplify what you do everyday So you don’t miss a moment Designed for life in motion FOR DEVELOPERS A single, cohesive API set and platform

  3. Windows Phone Games Hub

  4. LIVE is Bringing Gaming Services Windows Phone will extend the Xbox LIVE brand beyond the console for the first time Identity Friends • Windows Phone is the first step towards our vision of a ubiquitous gaming service Achievements Merchandising Premium Placement Premium placement helps your titles stand out and avoid the race to the bottom

  5. Powerful Portable Productive

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

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

  8. Powerful

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

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

  11. Productive

  12. 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

  13. Content Pipeline • Simplify Your Content Usage! 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

  14. XNA Framework Game Loop Start Simple and Customize! XNA Framework Game Loop Example • ///<summary> • ///Allows the game to run logic such as updating the world, • ///checking for collisions, gathering input, and playing audio. • ///</summary> • ///<param name="gameTime">Provides a snapshot of timing values.</param> • protectedoverridevoid Update(GameTimegameTime) • { • // 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); • } • ///<summary> • ///This is called when the game should draw itself. • ///</summary> • ///<param name="gameTime">Provides a snapshot of timing values.</param> • protectedoverridevoid Draw(GameTimegameTime) • { • GraphicsDevice.Clear(Color.CornflowerBlue); • // TODO: Add your drawing code here • base.Draw(gameTime); • } 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 Translated to existing XNA Framework concepts

  15. Graphics Let’s Get Visual, Visual!

  16. Graphics Overview Evolution of our existing immediate mode rendering API Simplifies for resource and render state management Feature segmentation between “Reach”/“HiDef” profiles Rendering primitives 2D & 3D

  17. Five Configurable Effects BasicEffect DualTextureEffect AlphaTestEffect SkinnedEffect EnvironmentMapEffect Plus hardware accelerated 2D sprite drawing

  18. BasicEffect BasicEffect DualTextureEffect AlphaTestEffect SkinnedEffect EnvironmentMapEffect • 0-3 directional lights • Blinn-Phong shading • Optional texture • Optional fog • Optional vertex color

  19. DualTextureEffect BasicEffect DualTextureEffect AlphaTestEffect SkinnedEffect EnvironmentMapEffect • For lightmaps, detail textures, decals • Blends two textures • Separate texture coordinates • Modulate 2X combine mode (A*B*2) • Good visuals at low pixel cost

  20. AlphaTestEffect BasicEffect DualTextureEffect AlphaTestEffect SkinnedEffect EnvironmentMapEffect • 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

  21. SkinnedEffect BasicEffect DualTextureEffect AlphaTestEffect SkinnedEffect EnvironmentMapEffect • 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

  22. EnvironmentMapEffect BasicEffect DualTextureEffect AlphaTestEffect SkinnedEffect EnvironmentMapEffect • 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

  23. System Support: Scaler & Orientation Write your game without worrying about native resolution or orientation Automatic rotation between portrait and landscapeTouch automatically supports both scale and orientation changes Scaler can drastically improve performance Trade off performance for “crispness” & shade fewer pixels800x480 = 384,000 pixels, 480x320 = 153,600 pixels Upsample an arbitrary back buffer to native device resolution Far higher quality than bilinear filteringAllows for easier porting from other platforms Scaling/Rotation comes for “free” from Hardware

  24. Portable

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

  26. 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 Reach Platform showcase features Xbox 360/Windows Only HiDef

  27. Gamer Services Better Known as Xbox LIVE!

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

  29. Audio & Media Can You Hear Me Now?

  30. Audio Audio Capture 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, EventArgsargs) { // 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 & 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 Audio Playback Example 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(); } Microphone/Bluetooth Support Playback through headset Capture through mic or headset

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

  32. Input / Touch Interacting with games gets easier!

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

  34. Sensors Using Silverlight and the XNA Framework

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

  36. Build a game in minutes…

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

  38. Wrap Up / Q&A Let’s get it started…

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

  40. Questions? Thank you for your time!

More Related