Presentation is loading. Please wait.

Presentation is loading. Please wait.

Creating a Cutting-Edge Game for Windows Tablets Chas. Boyd Windows Graphics 3-043.

Similar presentations


Presentation on theme: "Creating a Cutting-Edge Game for Windows Tablets Chas. Boyd Windows Graphics 3-043."— Presentation transcript:

1

2 Creating a Cutting-Edge Game for Windows Tablets Chas. Boyd Windows Graphics 3-043

3 The Broad Range of PCs

4 The Opportunity More users are spending more time with tablets/convertibles Living room and commute The hardware ecosystem is going there as a result You can target those users via a Windows Store Game

5 Broader PC Innovation We know the platform is already capable of much more Let us show you how you can use that platform to create an experience where you will stand out from the masses These are the key areas where we have invested: All the key tablet features Most cutting-edge technology You can self-publish Easiest development

6

7 PennyArcade on Surface Pro

8 Movies & Cut Scenes Your Killer Game Game Input Graphics Audio Direct3D11 DirectX Video Pointer Point Pointer Point PLM Windows Live Connected Services Local Services Direct2D XInput Sensor API WASAPI Windows Store Xbox LIVE Media Foundation AppData Contracts Visual Studio Asset Viewers Asset Processors Tools Windows 8 Game Platform Technologies HTML XAML XAudio2

9 PointerPoint Input win->PointerPressed += ref new TypedEventHandler (this, &LonLatController::OnPointerPressed); void LonLatController::OnPointerPressed( _In_ CoreWindow^ sender, _In_ PointerEventArgs^ args ) { float2 position = float2( // position of contact args->CurrentPoint->Position.X, args->CurrentPoint->Position.Y ); m_lonLatLastPoint = position; // save for use in controller m_lonLatPointerID = args->CurrentPoint->PointerId; }

10 Cutting Edge Graphics in Windows 8.0 Halo: Spartan Assault Reckless Racing Ultimate

11 Movies & Cut Scenes Your Killer Game Game Input Graphics Audio Direct3D11.2 DirectX Video Pointer Point Pointer Point PLM Windows Live, Azure Connected Services Local Services Direct2D XInput Sensor API WASAPI Windows Store Install Xbox LIVE Media Foundation AppData Contracts Visual Studio Asset Viewers Asset Processors Tools Windows 8.1 Game Platform Technologies HTML XAML XAudio2 Shader Debugging WiFi Direct Azure

12 Cutting Edge Games: Graphics

13 Direct3D11 Photoreal Rendering can help differentiate your product Tablets run the Direct3D 11 Graphics API e.g. Surface Pro, etc. The Direct3D 11 API runs all PC hardware: Tablets to SLI reduced-precision data types, shadow sampling, etc.

14 DirectX 11 Feature Levels

15 DirectX 11 Feature Level 9 Vertex shaders Pixel shaders 8 Textures 4 Render Targets Cube maps Volume textures Anisotropic filtering Antialiasing HDR rendering Texture compression BC1, BC2, BC3

16 DirectX 11 Feature Level 10 Vertex shaders Pixel shaders 8 Textures 4 Render Targets Cube maps Volume textures Anisotropic filtering Antialiasing HDR rendering Texture compression BC1, BC2, BC3 Geometry shaders Stream out 128 Textures per shader 8 Render Targets Integers in shaders Vertex textures Shader sampling Constant buffers Alpha-to-coverage Basic DirectCompute BC4, BC5 formats

17 DirectX 11 Feature Level 11 Vertex shaders Pixel shaders 8 Textures 4 Render Targets Cube maps Volume textures Anisotropic filtering Antialiasing HDR rendering Texture compression BC1, BC2, BC3 Geometry shaders Stream out 128 Textures per shader 8 Render Targets Integers in shaders Vertex textures Shader sampling Constant buffers Alpha-to-coverage Basic DirectCompute BC4, BC5 formats Full DirectCompute Random access writes Tessellation shaders New compression formats BC6, BC7 Min10float, min16float Shader linking Present() optimizations Hardware overlays/scalers Tiled Resources

18 Approximate Market Segmentation

19 Creating the Direct3D Device and Context

20 Tiled Resources

21 Graphine

22 Tiled Resources Applications Games: terrain, shadow maps, skyboxes, etc. Atlases: fine-grained memory management with minimal state changes Imaging: 256Mpixel image display/editing Maps: massive datasets See Talk 4-063: Massive virtual textures for games: Direct3D Tiled Resources

23 Cutting Edge Game Performance How do I make my high-end game fast enough on a tablet?

24 Graphics Performance on Tablets 2D / sprite games should run at native resolution wherever possible Look at ways to minimize overdraw, such as more complex meshes. 3D games may need to render the scene at lower-than-native resolution, and scale up to native before the overlay elements (score, etc) are applied This is common practice on the PC and consoles The new overlapping Swapchain API enables accelerated scaling As we’ll see later

25 Graphics Performance -Language Also consider programming language C++ is the fastest language we offer Enables the most ‘vertical’ portability The C++ sample code is very straightforward Modeled after XNA architecture

26 Cutting Edge Games: Size

27 App Packaging and Distribution Typical cutting edge games of today come on dual layer DVDs (xbox 360, PC, etc) and are 8 GB to 25GB Digital downloads can take a while… How do I fit my game on a tablet?

28 App Packages in Windows 8 x86 Binaries Audio Textures Shaders Animations x64 Binaries Audio Textures Shaders Animations ARM Binaries Audio Textures Shaders Animations 2GB

29 App Packages in Windows 8.1 x86 Binaries Audio Textures Shaders Animations x64 Binaries Audio Textures Shaders Animations ARM Binaries Audio Textures Shaders Animations 8GB 25GB

30 How do I minimize download time & storage? DX9 GPUs don’t support some texture formats Choice: Use DX9 textures even for DX11 users(LCD) DX11 users want the higher quality their hardware can use Ship both: make DX9 users wait for DX11 textures to download New PC hardware has wireless connectivity and SSD storage

31 25GB Windows 8.1 App Bundle x86 Binariesx64 BinariesARM Binaries DX9 Textures DX10 Textures DX11 Textures 1.0x UI Elements 1.4x UI Elements 1.8x UI Elements

32 ARM binaries DX9 Textures 1.0x UI elements Deployment 1 DX9 Textures 1.0x UI Elements ARM Binaries

33 Deployment 2 x86 Binariesx64 BinariesARM Binaries DX9 Textures DX10 Textures DX11 Textures 1.0x UI Elements 1.4x UI Elements 1.8x UI Elements

34 x64 binaries DX11 Textures 1.4x UI elements Deployment 2 x64 Binaries DX9 Textures DX11 Textures 1.0x UI Elements 1.4x UI Elements

35 App Packaging -How To Keep game resources in separate folders Standard naming convention for resource identifiers Build time: Packager tags them all in the bundle Deployment: Installer checks device, and installs the applicable bits Note: The default bits for a single package are always installed: FLDX9, 1.0x DPI setting, Locale language

36

37 Create the App Bundle

38 App Bundle Contents

39

40

41

42 Notify Resource Manager of Desired Folder // Set current UI thread's MRT ResourceContext's DXFeatureLevel // Note: GetForCurrentView is per UI thread and will fail on the background thread auto rcontext = Windows::ApplicationModel::Resources::Core::ResourceContext::GetForCurrentView(); rcontext->QualifierValues->Insert("DXFeatureLevel", "DX9"); // “DX10” or “DX11”

43 Set Feature Level String ResourceContextFL; switch ( m_featureLevel ) { case D3D_FEATURE_LEVEL9_1: case D3D_FEATURE_LEVEL9_2: case D3D_FEATURE_LEVEL9_3: ResourceContextFL = “DX9”; break; case D3D_FEATURE_LEVEL10_0: case D3D_FEATURE_LEVEL10_1: ResourceContextFL = “DX10”; break; case D3D_FEATURE_LEVEL_11_0: case D3D_FEATURE_LEVEL_11_1: ResourceContextFL = “DX11”; break; default: error; } D3D_FEATURE_LEVEL featureLevels[] = { D3D_FEATURE_LEVEL_11_1, D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL_10_0, D3D_FEATURE_LEVEL_9_3, D3D_FEATURE_LEVEL_9_1 };

44 App Bundle Summary App bundles let you tailor your product to your customer Up to Blu-Ray™ install sizes DirectX APIs already help you span different vendors App Bundles let you span different generations as well, as the industry continues moving forward via innovation

45 Cutting Edge Games: Controls

46

47

48

49 Automatic Input Routing Touch Mouse Keyboard + Weight Game Logic Game Controller Accelerometer Weight

50

51 Cutting Edge Games: Display

52 All the Inches 891011121314151617 18192021222324252627 Tablets Convertibles Notebooks Desktops & All-in-Ones

53 2-D Visuals: New DPIs At 10” tablet panel 1366*768 1.0x 1920*1080 1.4x 2560*1440 1.8x

54 OS DPI Scale factors Modern 1.0x 1.4x 1.8x Desktop 1.0x 1.25x 1.5x 2.0x

55 New Resolutions And Performance 1024*768 0.75MPix 1280*800 1 MPix 1366*768 1 MPix 1600*900 1.4MPix 1920*1080 2 MPix 2560*1600 4 Mpix 3840*2160 8 Mpix

56 Hardware Solution: Scalers and Overlays For performance, hardware can scale up imagery for free Main rendering can be at a lower resolution for better performance – the hardware will scale it back up It can also preserve quality of 2-D content: Create a second swapchain for an overlay to store 2D imagery (text, score, cross-hair, etc.) at native resolution

57 Overlapping Swapchain Composition Hardware accelerated scaling of content up to native resolution at high quality Hardware accelerated composition of overlay elements onto background content out RGB = top RGB + bottom RGB *(1 – top A ) See talk 3-062: What’s New in Direct3D HUD swap chain (1920x1080) Display (1920x1080) 3D swap chain (1280x720)

58 Swapchain Creation DXGI_SWAP_CHAIN_DESC1 bottomSwapChainDesc = {0}; bottomSwapChainDesc.Width = RenderTargetWidth; bottomSwapChainDesc.Height = RenderTargetHeight; bottomSwapChainDesc.Scaling = DXGI_SCALING_STRETCH; dxgiFactory->CreateSwapChainForCoreWindow(... ); if (m_dxgiOutput->SupportsOverlays()) { DXGI_SWAP_CHAIN_DESC1 topSwapChainDesc = {0}; topSwapChainDesc.Width = 0; // screenWidth; topSwapChainDesc.Height = 0; // screenHeight; topSwapChainDesc.Scaling = DXGI_SCALING_NONE; topSwapChainDesc.Flags = DXGI_SWAP_CHAIN_FOREGROUND_LAYER; topSwapChainDesc.AlphaMode = DXGI_ALPHA_MODE_PREMULTIPLIED; dxgiFactory->CreateSwapChainForCoreWindow(... ); }... bottomSwapChain->Present(1, 0); if (topSwapChain) topSwapChain->Present(1, 0);

59 Option Menus and Inventory Screens

60

61 Secondary Apps In App Purchase store, server status app, chat client, Skype Launch a new app (split-screen) New cross-app launching API Lets users control split via familiar OS UI Can stays running when invoking app quits See Talk 2-010: Building Apps that Work Together

62 Best Practices Be sure to throttle back rendering speed of any window that loses focus (changes activationState ) Speeds up the window or app the user is actually using On occlusion, pause gameplay Auto-resume on tap/click or just a timer

63 void DirectXApp::Run() { while (!m_windowClosed) { if (m_windowVisible) // from window->VisibilityChanged event { dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent); m_renderer->Update(timer->Total, timer->Delta); m_renderer->Render(); m_renderer->Present(); } else { dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending); }

64 Multiple Displays Multi-Mon More screen real-estate “Docking” your tablet Projection/TV Immersion Share your display

65 Share Your Display

66 Let everyone see the game board, track map, rankings, or world map, … User can just use Multi-mon to Miracast Miracast (aka WiDi) is based on WiFi Direct, so no WiFi AP reqd User feature: No APIs need to be called by developer

67 ProjectionManager API

68 Cuting Edge Games: Connectivity

69 Game Scenarios Play-Pause-Resume Tablet to convertible to laptop to desktop PC use roaming, save state and dynamic input switching Windows Phone to Windows to Xbox use services and cloud – or roll your own with Azure Cross device vs. cross screen – compare & contrast mechanics and mobility

70 Living Room

71 Living Room -sociable

72 Considerations for Gameplay Types Async: turn-based, crowd-sourced real-time, rankings, etc. Sync: simultaneous multiplayer via TCP Local Multiplayer - Wifi Direct and NFC, e.g. for matchmaking See multiplayer talk 3-051 by Jianye & Priya Tune mechanics and difficulty per form factor and perf profile “Lean forward” vs “lean back” content

73 Connectivity Innovation More broadband wireless devices are coming Metered network considerations New store packaging and installer helps with that Scenarios for connected play Gameplay Design

74 Implementation Strategies Isolate code for core game logic from device-dependent code Console / desktop / phone / tablet specific features (e.g. XAML UI/input/contract usage) C++ dlls are a good solution

75 Cross Device Development Tools Visual Studio 2013 builds apps for all MS platforms Windows Desktop Windows Store Windows Phone Console New for Windows 8.1 and VS 2013: DirectX Debugging

76 Visual Studio Talks See talk 3-141: DirectX Graphics Debugging Tools See Also: 2-305 What’s New in Visual Studio 2013 2-211 C++ for Windows Phone 3-329 Using VS C++ 2013 to get the best performance 3-308 C++ Best Practices

77 Cutting Edge Game Features Windows 8 Direct3D 11.1 XAudio PointerPoint MouseLook XInput C++ Windows 8.1 Direct3D11.2 Tiled Resources Scalers & Overlays HLSL Shader linker 8-25GB packages Multi-mon Wi-Fi Direct

78 Go For It Get your cutting edge game out to these new users/places Pioneer this new space Check out the solutions for your case: Store, packaging, installer Rich input/controller options Direct3D11 graphics, hardware scalers Networking, services

79 Related talks TitleSession ID Building Games for Windows2-047 What’s new in Direct3D 11.23-062 Massive virtual textures for games: Direct3D and Tiled Resources4-063 DirectX Graphics Debugging Tools3-141 Bringing Desktop PC Games to the Windows Store3-190 Tales from the Trenches: Developing “The Harvest” and “Gunpowder” with Unity3-044 Accelerating Windows Store Game Development with Middleware3-187 Bringing Halo: Spartan Assault to Windows tablets and mobile devices2-049 From Android or iOS: Bringing Your OpenGL ES Game to the Windows Store3-189 Cutting Edge Games on Windows Tablets3-043 Play Together! Leaderboards with Windows Azure and iMultiplayer with WiFi Direct3-051 Innovations in High Performance 2D Graphics with DirectX3-191

80

81

82 Example Assets Used DX9DX10DX11 Texture.ddsBC1 4k x 2k BC7 4k x 2k Normal.ddsR8G8 2k x 1kBC5 4k x 2k Height.ddsR8 2k x 1kBC4 4k x 2k DX9DX10DX11 Texture.ddsBC1 4k x 2k.5 5.46MB BC7 4k x 2k 1 10.9MB Normal.ddsR8G8 2k x 1k 2 5.46MBBC5 4k x 2k 1 10.9MB Height.ddsR8 2k x 1k 1 2.73MBBC4 4k x 2k.5 5.46MB Total Sizes:14MB14 + 22MB14 + 27MB

83 Hardware Form Factors PhoneTabletDesktop/Laptop Always available 10min engagement Each user has one Moderate performance Small display size 3-5” 720-1080p resolution DirectX 9 Touch input Always connected -3G Living Room, Commute 30-60min engagement Multiple per household Moderate performance Med. display size 7-11” HD resolution (1080p) DirectX 9-11 Touch input, stylus Always Connected -WiFi Seated at workstation 2+hr session Shared across household Top performance hardware Large display size 13-24” Full 1080p or higher resolution DirectX 11 Mouse&Keyboard, trackpad Always connected –LAN

84 Game Categories Casual Mid-core AAA Simple gameplay 2-D Sprites 1-10min session Asynch multiplayer 4-25 weeks, $50k 1-5 developers Self-published Easy to port to new platforms $1 - $5 unit price ~5% total user spend 1-2GB install Not sticky, 4x turnover of AAA XBLIG 1000s released/year Moderate gameplay 3-D rendered 30min to 60min Local multiplayer 1 year, $100k to $2M 5-10 developers Steam, XBLA, Impulse Reasonable porting cost $5 - $10 Significant portion of spend 2-8GB install Very popular with users XBLA, PSN ?? Challenging gameplay 3-D Photo-Real 2+hrs session Web and local multiplayer Up to 2-5 years and $5-25M 20-100 developers Large Publishers Challenging to port ($1-2M/per) $20 - $60 Majority of Total Game Spend 8-25GB install Create a loyal audience Xbox, PS3 Dozens released /year


Download ppt "Creating a Cutting-Edge Game for Windows Tablets Chas. Boyd Windows Graphics 3-043."

Similar presentations


Ads by Google