XNA Game Studio Express: разработка casual games для PC и Xbox 360
Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.
-
Upload
johanna-lawerence -
Category
Documents
-
view
229 -
download
1
Transcript of Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.
![Page 1: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/1.jpg)
Developing Games for Windows Phone 7 with XNA Game Studio 4.0
Your Name Here
![Page 2: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/2.jpg)
A different kind of phone
Designed for life in motion
So you don’t miss a moment
SMART DESIGNWindows 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
![Page 3: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/3.jpg)
Windows Phone Games Hub
![Page 4: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/4.jpg)
LIVE is Bringing Gaming Services
Windows Phone will extend the Xbox LIVE brand beyond the console for the first timeWindows 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
![Page 5: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/5.jpg)
Powerful
Portable
Productive
![Page 6: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/6.jpg)
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
![Page 7: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/7.jpg)
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
![Page 8: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/8.jpg)
Powerful
![Page 9: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/9.jpg)
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
![Page 10: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/10.jpg)
Frameworks designed
for performance
Addressing Performance Head-on
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
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
![Page 11: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/11.jpg)
Productive
![Page 12: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/12.jpg)
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
![Page 13: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/13.jpg)
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!
![Page 14: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/14.jpg)
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
/// <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>protected override void Update(GameTime gameTime){
// Allows the game to exitif (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>protected override void Draw(GameTime gameTime){
GraphicsDevice.Clear(Color.CornflowerBlue);
// TODO: Add your drawing code here
base.Draw(gameTime);}
XNA Framework Game Loop ExampleStart Simple and Customize!
![Page 15: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/15.jpg)
GraphicsLet’s Get Visual, Visual!
![Page 16: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/16.jpg)
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
![Page 17: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/17.jpg)
Five Configurable Effects
Plus hardware accelerated 2D sprite drawing
BasicEffect SkinnedEffect EnvironmentMapEffectAlphaTestEffectDualTextureEffect
![Page 18: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/18.jpg)
BasicEffect
BasicEffect SkinnedEffect EnvironmentMapEffectAlphaTestEffectDualTextureEffect
• 0-3 directional lights
• Blinn-Phong shading
• Optional texture
• Optional fog
• Optional vertex color
Vertex Cost Pixel Cost
No lighting 5 1
One vertex light 40 1
Three vertex lights 60 1
Three pixel lights 18 50
+ Texture +1 +2
+ Fog +4 +2
![Page 19: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/19.jpg)
DualTextureEffect
BasicEffect SkinnedEffect EnvironmentMapEffectAlphaTestEffectDualTextureEffect
• 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 Cost
Pixel Cost
Two Textures 7 6
+ Fog +4 +2
![Page 20: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/20.jpg)
AlphaTestEffect
BasicEffect SkinnedEffect EnvironmentMapEffectAlphaTestEffectDualTextureEffect
• 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 Cost Pixel Cost
<, <=, >=, >
6 6
==, != 6 10
+ Fog +4 +2
![Page 21: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/21.jpg)
SkinnedEffect
BasicEffect SkinnedEffect EnvironmentMapEffectAlphaTestEffectDualTextureEffect
• 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 Cost
Pixel Cost
One vertex light 55 4
Three vertex lights 75 4
Three pixel lights 33 51
+ Two bones +7 +0
+ Four bones +13 +0
+ Fog +0 +2
![Page 22: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/22.jpg)
EnvironmentMapEffect
BasicEffect SkinnedEffect EnvironmentMapEffectAlphaTestEffectDualTextureEffect
• 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 Cost
Pixel Cost
One light 32 6
Three lights
36 6
+ Fresnel +7 +0
+ Specular
+0 +2
+ Fog +0 +2
![Page 23: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/23.jpg)
System Support: Scaler & OrientationWrite 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 performanceTrade off performance for “crispness” & shade fewer pixels800x480 = 384,000 pixels, 480x320 = 153,600 pixels
Upsample an arbitrary back buffer to native device resolutionFar higher quality than bilinear filteringAllows for easier porting from other platforms
Scaling/Rotation comes for “free” from Hardware
![Page 24: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/24.jpg)
Portable
![Page 25: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/25.jpg)
XNA Framework designed to be cross platform
Smaller time investment & target more sockets
Project synchronization between platforms
Target Three Screens
![Page 26: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/26.jpg)
HiDef
Reach
XNA Framework Profiles
Create a clear development environmentTarget broadly or platform showcases
Designed for compatibility across screens/devicesThis profile includes Windows phone 7
Platform showcase featuresXbox 360/Windows Only
![Page 27: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/27.jpg)
Gamer Services
Better Known as Xbox LIVE!
![Page 28: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/28.jpg)
Gamer Services API
Framework API:Xbox LIVE Identity & Rewards
Single Identity(Gamertag) Achievements
Leaderboards Trial Mode
![Page 29: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/29.jpg)
Audio & Media
Can You Hear Me Now?
![Page 30: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/30.jpg)
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();}
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 }
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 SupportPlayback through headset
Capture through mic or headset
![Page 31: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/31.jpg)
Music Enumeration & Playback
Media – Music/Photos/Video
// Constructs a song from a URIUri mediaStreamUri = new Uri(webAddress);Song streamedSong = Song.FromUri(mediaStreamUri);
// Play the songMediaPlayer.Play(streamedSong);
URI Song Playback Example
// Get the JPEG image databyte[] 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
![Page 32: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/32.jpg)
Input / Touch
Interacting with games gets easier!
![Page 33: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/33.jpg)
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) { ... }}
Touch Input Handling
![Page 34: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/34.jpg)
SensorsUsing Silverlight and the XNA Framework
![Page 35: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/35.jpg)
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}
Accelerometer Example
VibrationManager rumbler = new VibrationManager();rumbler.Vibrate(TimeSpan.FromSeconds(2));
VibrationExample
![Page 36: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/36.jpg)
Demo
Build a game in minutes…
![Page 37: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/37.jpg)
Sum up Slide
Powerful
Productive
Portable
Great managed code games, working todayWindows Phone provides a powerful platform for gaming
Focus on being a game developer, not a plumberGreat tools make you more productive
Target more platforms easilyFocus on your game differences, not the technology
![Page 38: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/38.jpg)
Wrap Up / Q&A
Let’s get it started…
![Page 39: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/39.jpg)
Additional Resources
Lot’s of MVP’s and experts to help you get started!
XNA Creators Club @ http://creators.xna.com Team Blog @ http://blogs.msdn.com/xna/ Shawn Hargreaves @ http://blogs.msdn.com/shawnhar/ (Great Tech Info!)
Email: [email protected]
Blog: http://klucher.com Twitter: @mklucher
Peer Support @ http://forums.xna.com Blogs
Contact an expert !
![Page 40: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/40.jpg)
Questions?Thank you for your time!
![Page 41: Developing Games for Windows Phone 7 with XNA Game Studio 4.0 Your Name Here.](https://reader036.fdocuments.net/reader036/viewer/2022081505/551b0e57550346f70d8b5da9/html5/thumbnails/41.jpg)
© 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.