Windows Phone: how to build a game

Slides:



Advertisements
Similar presentations
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Advertisements

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Välkommen till Sommarkollo Introduce XNA Game Studio Express Make A Game!
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Feature: Purchase Requisitions - Requester © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Interactivity Navigating a data model Working with large quantities of data Entry Editing and adding data User feedback and validation Presentation.
Multitenant Model Request/Response General Model.
Feature: Purchase Order Prepayments II © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Feature: OLE Notes Migration Utility
NEW WINDOWS PHONE “MANGO” APPLICATION PLATFORM SERVICES Chris blog.walshie.me SESSION CODE: WPH304 (c) 2011 Microsoft. All rights.
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
 Frank Savage Architect Microsoft Corporation.
Rob Miles Microsoft MVP University of Hull Fun Programming with Visual Studio.
Getting Started. XNA Game Studio 4.0 To download XNA Game Studio 4.0 itself, go to XNA Game.
demo Receive Inventory Export Parse and Normalize.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
demo Instance AInstance B Read “7” Write “8”

customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
Feature: Void Historical/Open Transaction Updates © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
projekt202 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

Build /24/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Build data-driven collection and list apps using XAML
A lap around DirectX game development tools
9/18/2018 7:26 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Возможности Excel 2010, о которых следует знать
Understanding Wi-Fi Direct in Windows 8
Windows Phone multitasking
Introduction to mobile app development Module 3 – Improving your App Studio app Lance McCarthy.
Title of Presentation 11/22/2018 3:34 PM
Architecting and integrating sensor drivers
Tooling and Diagnostics
Title of Presentation 12/2/2018 3:48 PM
Search: integrating into the Windows 8 search experience
Building responsive apps and sites with HTML5 web workers
Customizing WPA Trace Views
Getting started with Windows Azure
Windows Phone application performance and optimization
What’s new for Silverlight & XNA developers in Windows Phone Mango
Introducing Metro style device apps
Create experiences that span devices
Introduction to the new WPA user interface
Create rich, data-driven Web apps with ASP.NET 4.5 Web Forms
Silverlight Debugging
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
Build /4/ Diagnosing issues with Windows Phone 8.1 JavaScript apps using Visual Studio Andy Sterland Senior Program
Leveraging existing code in Metro style apps
PENSACOLA ENERGY WORK PLAN OCTOBER 10, 2016
Title of Presentation 5/12/ :53 PM
Шитманов Дархан Қаражанұлы Тарих пәнінің
The complete developer's guide to the SkyDrive API
Title of Presentation 5/24/2019 1:26 PM
5/24/2019 6:44 PM 1/8/18 Bell #10 In a world governed by the gods, is there any room for human will? Do human choices make a difference? EXPLAIN © 2007.
Title of Presentation 7/24/2019 8:53 PM
WCL425 App Compat for Nerds Chris Jackson.
Presentation transcript:

Windows Phone: how to build a game 9/15/2018 6:46 PM APP-791T Windows Phone: how to build a game Charles Cox Program Manager, ATG Microsoft Corporation © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista 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.

Agenda The Windows Phone Game Development Story Build a Game with XNA Game Studio Let’s Go Mango! What Now? You’ll leave with examples of how to Use XNA Game Studio to build a game Integrate XNA and Silverlight together

The Windows Phone Game Developer Story

Windows Phone for Games Powerful Hardware Premium Gaming Features Accelerated Development

Powerful Hardware V1 – Windows Phone OS 7.0 (Nov. 2010) WVGA 800x480, D3D11 API enabled GPU MSM8x55 CPU 1 GHz, 256 MB RAM, 8 GB flash 4x Touch/aGPS/Accel/Compass/Light/Proximity V2 – New Chassis Specification for OS 7.1 MSM7x30 / MSM8x55 CPU, 800 MHz or higher Optional gyro

Premium Gaming Features Xbox LIVE on Windows Phone Achievements & Leaderboards Avatars + Awards Downloadable content Cross-platform gaming: Full House Poker For Registered Developers

Accelerated Development Silverlight for event-driven, control-rich apps XNA Game Studio for games, simulation, and real-time graphics Using C#/VB.NET in VS2010 OS 7.1: XNA + Silverlight Interop

Let’s Build a Game with XNA Game Studio

The XNA Framework Game Loop

Introducing the XNA Content Pipeline Integrated into Visual Studio 2010 build process Incremental building of content, separate from code Built-in support for many standard types Extensible for your in-house formats

Simple Drawing in the XNA Framework protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); playerSprite = Content.Load<Texture2D>("player"); } protected override void Draw(GameTime gameTime) GraphicsDevice.Clear(Color.CornflowerBlue); spriteBatch.Begin(); spriteBatch.Draw(playerSprite, position, Color.White); spriteBatch.End(); base.Draw(gameTime);

2D Graphics in XNA Game Studio XNA Game Studio 2D is about “blitting” textures to the screen SpriteBatch Batched rendering of 2D: Alpha, Additive, Rotate, Flip, Scale SpriteFont Converts fonts to sprites, draw with SpriteBatch 2D primitives can be drawn using 3D calls If you are drawing complex 2D curves, consider Silverlight

3D Graphics in XNA Game Studio 3D graphics through D3D11 Five configurable effects… Lacks developer programmable shader support BasicEffect DualTextureEffect AlphaTestEffect EnvironmentMapEffect SkinnedEffect

Taking Input in the XNA Framework protected override void Initialize() { TouchPanel.EnabledGestures = GestureType.FreeDrag; } protected override void Update(GameTime gameTime) while (TouchPanel.IsGestureAvailable) GestureSample gesture = TouchPanel.ReadGesture(); if (gesture.GestureType == GestureType.FreeDrag) position += gesture.Delta;

Input: Touch, Accelerometer, More Gesture-based Touch through GestureSample Up to two touch points Full gesture list—drag, tap, pinch, etc. Raw Touch input through TouchPanel.GetState() Up to four touch points Accelerometer input through events In OS 7.1, optional gyro, Motion API

Adding a Bad Guy protected override void Update(GameTime gameTime) { enemyPosition.X -= enemySpeed; enemyPosition.Y += (float)Math.Sin(enemyPosition.X * enemySpeed / GraphicsDevice.Viewport.Width) * enemySpeed; if(Rectangle.Intersect( new Rectangle((int)position.X, (int)position.Y, playerSprite.Width, playerSprite.Height), new Rectangle((int)enemyPosition.X, (int)enemyPosition.Y, enemySprite.Width, enemySprite.Height)) != Rectangle.Empty) //Hit! OnCollisionSound(); enemyPosition = enemyStartPosition; }

Math for Logic, Collision, and Motion Built-in classes: Motion: Curve, Lerp, SmoothStep, CatmullRom, Hermite Transformation: Vector2/3/4, Point, Matrix, Quaternion Collision: BoundingBox/Sphere, Plane, Ray, Rectangle Includes .Intersects and .Contains methods And, don’t forget Random

Audio in Two Lines protected override void LoadContent() { explosionSound = Content.Load<SoundEffect>("explosion"); } private void OnCollisionSound() explosionSound.Play();

Audio the Simple Way SoundEffect / SoundEffectInstance Load WAV files (PCM, ADPCM) or from raw PCM buffer SoundEffect fire and forget, SoundEffectInstance to keep/modify Can play up to 64 concurrent sounds Custom formats supported through ContentProcessor Music through MediaPlayer

Audio the Dynamic Way DynamicSoundEffectInstance Manages own internal queue of buffers Expensive, and 16-bit PCM only Consider dynamic for synthesized or data-sourced audio Most games will not need to use this, stick with SoundEffect

Going Mango

New Game Dev Features in Mango Framework Tools Ecosystem Fast App Switching XNA + Silverlight Background Agents Unified Motion API Live Camera Access SQL CE TCP/UDP Sockets CPU/Memory Profiler Iso. Storage Explorer Accel/Location Emulator 16 New Regions Marketplace Test Kit Integrated Ad SDK

Fast App Switching Resuming ... Fast app resume State preserved! running deactivated dormant activated State preserved! IsAppInstancePreserved == true Restore state! IsAppInstancePreserved == false Save State! tombstoned Tombstone the oldest app Phone resources detached Threads and timers suspended

XNA and Silverlight Integration Enables XNA Graphics in a Silverlight application Use the Silverlight application model Switch into XNA rendering mode Use UIElementRenderer to draw Silverlight controls on XNA Surface

Moving to the Silverlight + XNA Game Loop

Let’s Integrate XNA/SL demo Let’s Integrate XNA/SL

What Now?

Considerations as You Build Your Game… 90 MB memory limit for your game Garbage collector kicks off at every 1 MB of allocations More objects created/released = memory churn OS 7.1, generational GC better than OS 7.0, but stay vigilant Full collection still happens…just less frequently

Considerations as You Build Your Game… Easy to start with dynamic types (List<>, etc.), but trade-offs Consider fixed arrays for performance, watch your profiler Avoid LINQ (and its extension methods) Prefer value types to ref types Never fear: Classes in the XNA Math library are value types!

Performance and Memory Profiler New profiler in Windows Phone SDK 7.1 Memory mode to find allocations Performance mode to find CPU spikes Available even on Express!

Marketplace Opportunities $99/yr fee to develop/submit on physical devices, free on emulator Free apps, can use Microsoft Advertising SDK with XNA Up to 100 for free, $19.99 per submission after Paid apps, can charge from $0.99 to $499.99 Submissions free, 70/30 split

What About Xbox LIVE? If represented, contact Xbox LIVE through your publisher If not, many publishers are available, one is MS Studios Send info about your company and portfolio first, no cold pitching mobilegames@microsoft.com

More Resources… Start with samples at App Hub Full games to pull apart Technique samples to add to your games White papers and tutorials for even more http://create.msdn.com/gamedevelopment

thank you Feedback and questions http://forums.dev.windows.com Session feedback http://bldw.in/SessionFeedback

9/15/2018 6:46 PM © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista 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. © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista 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.