C++ path into Win8


C++ in Win8

The most important (IMHO) thing to keep in mind is that you need to do some planning and make a decision as to which platforms you want to target (the reason why). Here I am focused on reaching as many different platforms, you will want to try to use. You can jump around if you would like here is the outline of what is covered here.

Inside C++ game development basically means that you’re working with DirectX, all graphics inside the c++ developing experience in Win8 is DirectX, you can mix XAML and C++, but this post is about C++ so we’re going to be hitting DirectX … Hard. If you’d like a tutorial or walk through check here. Working with C++ on Win8 means that you’ve decided to work inside WinRT, and also means that you want highly performent code.

General C++

If you are headed down the C++ / DirectX route then I suggest you check out the RandomChaos blog or GameDev-UK for more details on development experience.

DirectX

TIP: Check for the OnVisibilityChangedEvent to throttle your frame rate back to free up resources for other programs, this is best practices. It should also be noted that you have access to a larger feature set in DirectX (if your coming from XNA) and for some interesting fun you should consider what DirectMath can do to make your game environments more immersive. When your developing across platforms your solution architecture and development pipeline will necessitate a hardware compatibility layer.  For example on the tablet, PC and WP8 your not guaranteed to have the same DirectX API.  To develop against this you can set the feature level on the device by checking for it at runtime, and at development time you can set your graphics device to target which feature level you want inside the DirectX properties editor.

Not all DirectX will be different; Shadow Buffering for example has been ported down (from FeatureLevel 10) into FeatureLevel 9 (making DirectX 9.3). if you want to use Shadow buffering you will be using basically the same code as if you were using DirecX 10 and Shader 4, so although it is a feature not normally in DirectX 9 they have made a special DirectX API for WP8 to minimize the cross platform development headaches.

Windows Phone 8

Microsoft has expanded the developer landscape on the phone to include a new App type the Direct3D App, as well as gave access to DirectX (Interop) and C++ from inside the .Net XAML App. Developing on the WIndows phone has become more powerful now that the emulaters are hosted on Hyper-V (alternate graphics and resources models). Graphics subset Direct3D 11.1 FeatureSet 9.3. There is a beautiful shader sample that was presented at Minute 32 of talk 3-046 however I couldn’t find the source code. The WP8 API offers most of the expected stuff plus a few jems like WinSock support and new VSTS2012 templates and components specifically for WP8. But it doesn’t have Direct2D yet.

Direct 3D App

This project Defaults to draw a color cube in DirectX ,which is the normal 3D “Hello World”. The Direct3D App  is C++ only and allows you to access the Windows Phone 8 API Surface (WinRT, COM and Win32), can staticiall or dynamically link to you existing code.

Xaml App

Draws to 3d using a DrawingSurface XAML element (based on D3D swap chain), as well as the DrawingSurfaceBackgroundGrid (does not use the D3D swap chain). The DrawingSurfaceBackgroundGrid  is probably the most useful, as XAML element get composited on top of it (it must be a root element), basically it is a fancy background. This app type when created will also produce you basic Color Cube by default. This makes for a very handy screen model but you can read more about that here.

XBox LIVE

This is not about developing on the XBOX, it is about developing in the Xbox LIVE ID. You need to be Microsoft Licensed to used The Xbox LIVE SDK (not yet released), i.ee at least an Arcade level partner. What you get:

  • Live Gamer Tag
  • Title Groups
  • Title Managed Storage
  • Near real time cross screen multiplayer and matchmaking
  • Leaderboards
  • Achievements
  • DLC monitization

Xbox LIVE SDK

from the 3-056 slide deck

It now supports Downloadable Content (DLC), Offline Support and security sign-off (durability), Title Managed Storage (TMS) in the cloud, Global Cloud configuration and A/B testing, matchmaking and multiplayer (cloud state management), Server side proof of purchase and Federated Id. It is recommended to use PPL to work with the LIVE SDK due to the large amount of web calls (the basic Win8 async philosophy). The Framework communicates to LIVE via REST/JSON to set up a trust on XSTS (sounds to me like they are using the REST-ful WIF). The Xbox LIVE on Windows SDK will be separate from the Windows LiveID SDK. You don’t handle edge cases in your game code, you let MSFT handle those. I may have missed it but I didn’t see how, as a developer, you set up your content storefront although it does look like your storefront can authenticate to other ID even your own Credential Store via webauth broker. I’m not sure how I feel about DLC on credit (offline non-durable) but I you can allow it if you want and charge him after the fact. For in game consumables the coding looks very straight forward (as shown in the talk here). You can use Windows Push Notification Service (WNS) to  get toasts and tiles. Reasons to choose to use the Xbox LIVE API is that it will give you access to the full cross platform play-pause-resume experience. Note that this is different from the LIVE SDK.

Title Manage Storage (TMS)

This is an approach that allows a product title to allow for data storage across titles and screens. This is basically cloud storage (see minute 30 of 3-054). TMS Supports binary blobs (clasic saved game infrastructure) and Smart blobs (like JSON).

Xbox LIVE Publisher

To become an Xbox LIVE publisher you will need to send an email to the appropriate person, here is what that process looks like from a really high level:

  1. Submit your concept
  2. Concept is reviewed by Microsoft
  3. Production review
  4. Further Investigation
  5. Be accepted (if your lucky..?)

It is free, however you will need to be able to contribute good IP to the marketplace, and have the time to get through all of the hoops.

Avatar SDK

The Avatar SDK is bundled in the same package it is a C++ DirectX 11 rendering API. Game invites and sessions work across devices (Phone to PC to 360 in theory, but details at controlled by licensing agreement (AFIK)).

References:

3-046 : Sam George/Ross Odwyer : Windows Phone 8: Native C/C++ Game Development (including the Havok commercial)

3-056 : Brian Tyler : Xbox Live on Windows 8 Deep Dive

3-054 : John Bruno/Avi Ben-Menahem : Building Cross-Device Xbox LIVE Games

About Larry Louisiana

I'm a Microsoft Partner Consultant.
This entry was posted in Cloud, Computers and Internet, D3D, DirectX, Game Development, Graphics, Math, Programming, Windows 8 and tagged , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s