Top Banner
GAMES DEVELOPMENT Lucian Tomuta Chief Engineer LUMIA APP LABS #7
21

LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

Jan 12, 2015

Download

Technology

Nokia Developer

Microsoft Windows Phone 8 offers native code support that enables development and porting of high-performance games. This training-lab webinar will give you an overview of Windows Phone 8 capabilities that support complex games development. It also will introduce available tools and frameworks that increase developer productivity and will demonstrate a hands-on approach to games development with the Windows Phone SDK 8. By leveraging frameworks such as the Microsoft Direct3D API and support for popular physics and rendering engines, you can now create games with native performance as well as use your own or third-party engines and middleware for games development for Windows Phone 8 users.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

GAMES DEVELOPMENT

Lucian Tomuta Chief Engineer

LUMIA APP LABS #7

Page 2: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.

What’s new on Windows Phone 8? How do I write my game?

AGENDA

Page 3: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.

- New and improved hardware - XNA replaced by a new Windows Phone game platform:

- Maintains XNA compatibility - Reduce the cost to target Windows Phone

- Allow use of native code (C++) - Share a large set of APIs with Windows 8

- Power of Direct3D (native or with XAML) - Improved monetisation

WHAT’S NEW?

Page 4: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.

- Qualcomm Snapdragon S4 - 1.5 GHz / 1 GHz - Adreno 225 / Adreno 305 - 768x1280 / 480x800 pixels - 1 GB (512 MB) - NFC, sensors, 4G …

http://developer.nokia.com/Devices

Page 5: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.

GAME ENGINES

Unity

Havok

Cocos2D

Marmalade

Wwise

Scaleform

FMOD

Ogre

Page 6: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.

C++ only Access to the new Windows Phone 8 APIs

• Windows Runtime APIs, COM and Win32 style APIs • Which APIs can I call? http://tinyurl.com/WP8APIQS

Reuse your C++ code • Statically linked or a DLL

Supports activation and app lifecycle • CoreApplication, CoreWindow, CoreDispatcher

DIRECT3D APP MODEL

Page 7: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.

XAML app model extended C++ code reuse

• Your own or other C++ libraries • Call COM / Win32 style APIs from within Windows runtime components

Full access to the new Windows 8 shared API surface • Windows phone runtime APIs, COM and Win32 style APIs

Direct3D composition • Render into a XAML scene from C++/Direct3D • 2 new XAML elements

XAML APP MODEL

Page 8: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.

DrawingSurface • Place anywhere • Draw to it from C++/Direct3D • Automatic composition with other

XAML elements • Uses a Direct3D swap chain

XAML + DIRECT3D

Page 9: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.

DrawingSurfaceBackgroundGrid • The root element of the xaml page • You render to the from

C++/Direct3D • Does not use a Direct3D swap chain • Performs better • Grid children are rendered on top

XAML + DIRECT3D

Page 10: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.

XAML app • You need access to live tiles, notifications, background agents, XAML UI,…

Direct3D app • You need the absolute best performance • You don’t need what the XAML app gives you

How hard is it to switch? • It is very straightforward

XAML OR DIRECT3D APP ?

Page 11: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.

API: Direct3D 11.1 Hardware capabilities: feature level 9.3 Subset of Windows 8

• No Windows Imaging Component (WIC) • No Direct2D or DWrite

Removed legacy features • No GDI • No D3DX • No fixed function • No runtime shader compilation

NATIVE DIRECT3D APPLICATION

DirectXTex: texture processing library http://codeplex.com/directxtex

DirectX Tool Kit http://codeplex.com/directxtk

Page 12: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.

Input • PointerPressed, PointerMoved,

PointerReleased • KeyDown, KeyUp,

CharacterRecieved, Show/Hide Onscreen Keyboard

INPUT & SENSORS

Windows.Devices.Sensors Accelerometer Gyrometer Orientation Compass Inclinometer Supports Polling and Events

Page 13: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.

XAudio2 Looping, 3D positioning, DSP effects, etc. Many at once In-memory PCM or ADPCM data IMFMediaEngine One at a time Compressed (MP3, WMA) Asynchronously streamed from the file system or URI

AUDIO SUPPORT

Page 14: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.

Use IMFMediaEngine Initialise and set source Control playback Render video

• Game retrieves video frame and renders video frame on the texture of an object in the game

• Game uses OnVideoStreamTick to find out whether a new video frame is ready • Game uses TransferVideoFrame to copy video frame to DXGI surface • OS can render RGB and YUV(NV12) formats

VIDEO CUTSCENE SUPPORT

Page 15: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.

TCP sockets with SSL support using StreamSocket/StreamSocketListener

UDP sockets using DatagramSocket C++ HTTP support via XmlHTTPWebRequest2 Winsock Peer Finder API NFC based player discovery Play via WLAN or Bluetooth

MULTIPLAYER GAMES

http://projects.developer.nokia.com/nfctalk

Page 16: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.

Nokia Premium Developer Program and Buddy.com User account management Scoreboards and achievements Push Notifications Cross-platfom 1.000.000 API calls/month for a year

GAME CLOUD

Page 17: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.

- Ads - Cross-platform advertising solution offered by Nokia Ad Exchange

- Try and buy - In-app purchase

- Support for durable (game levels) and consumable (coins) items - Can be used from XNA games as well, see http://tinyurl.Com/iaplightup

HOW DO I MAKE MONEY

Page 18: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.

Test your application on low memory devices! Test your application on high resolution devices!

TIP!

Page 19: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.

Your app can use up to 150 MB of available memory (up from 90 MB) If you need more, add the following capability to the app manifest: This will allow your app to use up to 180 MB on low spec devices or even

380 MB on devices with > 1 GB

TIP!

<App> … <FunctionalCapabilities> <FunctionalCapability Name="ID_FUNCCAP_EXTEND_MEM"/> </FunctionalCapabilities> </App>

Page 20: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.

If your application cannot run at all on low memory devices, use ID_REQ_MEMORY_300

This will make your app visible only to devices with 1GB RAM or more.

TIP!

<App> … <Requirements> <Requirement Name="ID_REQ_FRONTCAMERA" /> <Requirement Name="ID_REQ_MEMORY_300" /> </Requirements> </App>

Page 21: LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8

1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.

Thank you!