GAMES DEVELOPMENT Lucian Tomuta Chief Engineer LUMIA APP LABS #7
Jan 12, 2015
GAMES DEVELOPMENT
Lucian Tomuta Chief Engineer
LUMIA APP LABS #7
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
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?
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
1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.
GAME ENGINES
Unity
Havok
Cocos2D
Marmalade
Wwise
Scaleform
FMOD
Ogre
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
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
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
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
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 ?
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
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
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
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
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
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
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
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!
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>
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>
1/23/2013 © 2013 Nokia. All rights reserved. © 2013 Microsoft. All rights reserved.
Thank you!