Presentation is loading. Please wait.

Presentation is loading. Please wait.

Adam Schaeffer Microsoft Corporation SESSION CODE: WPH307.

Similar presentations


Presentation on theme: "Adam Schaeffer Microsoft Corporation SESSION CODE: WPH307."— Presentation transcript:

1 Adam Schaeffer Microsoft Corporation SESSION CODE: WPH307

2 Windows Phone 7– A new beginning Xbox LIVE overview XNA Game Studio 4.0 Powerful, Productive, Portable XNA Framework Call to action and resources

3

4

5 Without Xbox LIVE You can still write and publish games for Windows Phone Create great games for marketplace http://developer.windowsphone.com We’re interested in your great games! wpgames@microsoft.com Find a publisher! Lots to choose from!

6 Consistent sets of hardware capabilities defined by Microsoft Resolution Touch Input CPU / GPU RAM Hardware keyboard is optional

7 Modern XAML/event-driven application UI framework Rapid creation of visually rich apps HTML/Javascript Mature, robust, widely deployed technology GAMES (and applications) APPLICATIONS (and games)

8 Powerful Productive Portable

9 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

10 Develop for Windows Phone 7 Series Simplified graphics API’s Visual Studio 2010 integration Enhanced audio support New configurable effects

11 Powerful

12 Uses the.NET platform Windows Phone 7 Managed code platform, no unsafe code XNA Game Studio 4.0 is C# exclusive 800+ managed code games on XBLA/XBLIG Windows games published through portals.NET/XNA is used for games today!

13 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

14

15 Productive

16 Productive development with.NET and 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

18 XNA Framework

19 The XNA Framework Game Loop is layered on top of the Silverlight Application object on Windows Phone 7 Provides the bulk of integration of API’s 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 You’ll want to choose the technology that works best for your scenarios

20 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

21 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

22 XNA Framework Game Loop Example System integration with Windows Phone 7 best practices 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 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); }

23 Graphics

24 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

25 New configurable effect classes on all platforms BasicEffect SkinnedEffect EnvironmentMapEffect DualTextureEffect AlphaTestEffect Custom effects not available on Windows Phone 7

26 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

27 Audio & Media

28 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();

29 URI Song Playback Example Retrieve Image Data Music Enumeration and Playback // 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); MediaLibrary media = new MediaLibrary(); // Get the JPEG image data Stream myJpegImage = ReadAndModifyPicture(somePicture); // Save texture to Media Library media.SavePicture("Awesome", myJpegImage); Picture Enumeration and 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

30 Input / Touch

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

32 Sensors

33 Accelerometer Example VibrationExample Leverage Platform Features on Windows Phone 7 Location Accelerometer Vibration Accelerometer accelerometer = new Accelerometer(); accelerometer.ReadingChanged += AccelerometerReadingChanged; accelerometer.Start(); VibrateController rumbler; rumbler.Start(TimeSpan.FromSeconds(2));

34

35 Xbox LIVE

36 Windows Phone 7 OS Xbox LIVE Gamer Services HTTPHTTP InvitesInvites Profile Achieve- ments Leader- boards Trial Mode PushPush AvatarsAvatars

37

38 Read a Player’s 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;

39 Award an Achievement // 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; }

40 Write to a Leaderboard // 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();

41 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); }

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

43

44 Portable

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

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

47

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

49 Call to Action Download the Windows Phone Developer Tools http://developer.windowsphone.com Create awesome games!

50 Hundreds of samples Lots of MVPs and experts to help you get started XNA Creators Club @ http://creators.xna.com http://creators.xna.com Team Blog @ http://blogs.msdn.com/xna/ http://blogs.msdn.com/xna/ Shawn Hargreaves @ http://blogs.msdn.com/shawnhar/ (Great Tech Info!) http://blogs.msdn.com/shawnhar/ Email: wpgames@microsoft.com On the web : http://developer.windowsphone.com http://developer.windowsphone.com Peer Support @ http://forums.xna.com http://forums.xna.com Blogs Contact Microsoft

51 Monday WPH202Deploying Windows Phone 7 with Exchange Server and SharePoint Server WPH301WP7: Deploy Microsoft Forefront Unified Access Gateway for Access Control to SharePoint, Exchange and more. Tuesday WPH302Overview of the Windows Phone 7 Application Platform WPH313Windows Phone 7 Architecture Deep Dive WPH304An In-Depth view at Building Applications for WP7 with Silverlight (Part 1) WPH305An In-Depth view at Building Applications for WP7 with Silverlight (Part 2) WPH306Developing Occasionally Connected Applications for Windows Phone 7

52 Wednesday WPH310Designing and Developing for the Rich Mobile Web WPH311Developing Mobile Code Today that will run on WP 7 Tomorrow WPH309Silverlight performance on Windows Phone WPH307Building Windows Phone Games with XNA WPH308Building a High Performance 3D Game for Windows Phone Thursday WPH303Understanding the Windows Phone 7 Development Tools WPH314Learn Windows Phone 7 Development by Creating a Robotic T-Shirt Cannon WPH312Understanding Marketplace and Making Money with WP7 Applications

53

54 * Restrictions apply please see contest rules for eligibility and restrictions. Contest rules are displayed in the Technical Learning Center at the WPH info counter.

55 Monday WPH301WP7: Deploy Microsoft Forefront Unified Access Gateway for Access Control to SharePoint, Exchange and more. WPH202Deploying Windows Phone 7 with Exchange Server and SharePoint Server Tuesday WPH203Overview of the Windows Phone 7 Application Platform WPH313Windows Phone 7 Architecture Deep Dive WPH304An In-Depth view at Building Applications for WP7 with Silverlight (Part 1) WPH305An In-Depth view at Building Applications for WP7 with Silverlight (Part 2) WPH306Developing Occasionally Connected Applications for Windows Phone 7

56 Wednesday WPH310Designing and Developing for the Rich Mobile Web WPH311Developing Mobile Code Today that will run on WP 7 Tomorrow WPH309Silverlight performance on Windows Phone WPH307Building Windows Phone Games with XNA WPH308Building a High Performance 3D Game for Windows Phone Thursday WPH303Understanding the Windows Phone 7 Development Tools WPH314Learn Windows Phone 7 Development by Creating a Robotic T-Shirt Cannon WPH312Understanding Marketplace and Making Money with WP7 Applications

57

58 www.microsoft.com/teched www.microsoft.com/learning http://microsoft.com/technet http://microsoft.com/msdn

59

60 Sign up for Tech·Ed 2011 and save $500 starting June 8 – June 31 st http://northamerica.msteched.com/registration You can also register at the North America 2011 kiosk located at registration Join us in Atlanta next year

61

62


Download ppt "Adam Schaeffer Microsoft Corporation SESSION CODE: WPH307."

Similar presentations


Ads by Google