course topics creating your first marmalade game 01 | intro & marmalade overview 02 | gameplay...
TRANSCRIPT
Creating your first Marmalade game
Course Topics
Creating your first Marmalade game
01 | Intro & Marmalade Overview
02 | GamePlay
03 | Scene Management
04 | Packaging & finishing Touches
Click to edit Master subtitle style
04 | Packaging & finishing Touches
Lee Stott | Technical Evangelist, MicrosoftJames Mintram | Lemon Moose Games
• Adding C++ extensions
• Try and Buy
• Ads in Game
• Packaging your game
Module Overview
Click to edit Master subtitle styleAdding your own C++ Bindings to
Quick
Adding your own C++ Bindings to Quick
• http://docs.madewithmarmalade.com/display/MD/Adding+your+own+CPP+Bindings+to+Quick
• All new C++ functionality must be compiled into the "app binary" - a standard C++ Marmalade app that Quick app packages include at deploy time. This means we need to rebuild the C++ part using standard C++ SDK tools when adding new functionality. If you want to expose a C++ extension, you need to also include it as a subproject in the app binary.
To support new C++ APIs in Quick, you need to:
• Make sure the new APIs conform to a certain format
• Put some tolua comment blocks around the declarations of functions you wish to expose (in .h/.hpp header files)
• Add paths to those header files in a package file inside the <Marmalade>/quick folder
• Run the bundled tolua++ script, which will generate Lua wrappers for all your C++ functions and expose them to game code
• Add extension projects to quick's project files (if using any extensions)
• Rebuilt the quick binaries from source so that any source, libraries or extensions you are exposing are built into the app binary
• With that done, you can then simply call the new Lua functions from within your app code. The app itself does not need to have its project file changed or any require/dofile calls added.
Editing you solution in Visual Studio
• You need to manually build the solution using Visual Studio
Building the Solution in Visual Studio
Editing Solution with Visual Studio
DEMOEditing in visual studio
Click to edit Master subtitle style
Try Buy
• Try and Buy
You can design and implement a trial mode of your app in the Windows Phone Store. Experience shows that users enjoy trying out new products and are much more likely to buy an app if they have been able to try it before buying.
Windows 8 http://msdn.microsoft.com/en-us/library/windows/apps/ff967558(v=vs.105).aspx
Windows Phone http://msdn.microsoft.com/en-us/library/windows/apps/ff967558(v=vs.105).aspx
Module Overview
Try before you buy
82% of top 50 paid apps use Trial
Trial mode
• Marmalade makes this feature really easy to access.
• Add s3eWindowsStoreBilling to the subprojects section of your MKB file.
• Then in the file that you want to access the API you need to add the following line of code:
• #include <s3eWindowsStoreBilling.h>
• Marmalade provides an API call which will check with the Windows device whether the app is running in trial mode:
• s3eWindowsStoreBillingIsTrial (*bool)
• Call this during startup and resume.
• Once you have cached this value you can do with it as you please to restrict your app.
• Once this is in place, you need a way to let the user upgrade to the full version. This is also incredibly easy.
• s3eWindowsStoreBillingBuyFull ()
Store Billing
• In addition to trial mode functionality, Windows Phone 8 also allows you to monetize your app through micro-transactions using Marmalade's cross platform "IwBilling" API.
• Alternatively, you can use Marmalade’s comprehensive API for working with both the Windows Phone 8 marketplace and Windows 8 store.
• For a detailed example open the sample project provided with Marmalade found in:
• %MarmaladeDir%\examples\s3e\s3eWindowsStoreBilling 6
• Ad Duplex
• Ad Duplex is cross-promotion network targeted at Windows 8 and Windows Phone 8 apps and is supplied as an extension with the Marmalade SDK. Like everything else it is very easy to integrate and show Ads within your app.
• To make the AdDuplex API available to your app, you need to add s3eAdDuplex to the subproject section of your MKB file.
• Include the AdDuplex header file any place you wish to use the API
• #include <s3eAdDuplex.h>
• Configuring AdDuplex is easy, a simple configuration will be shown below but for the full range of options visit the API Documentation.
• Every application which uses AdDuplex has its own ID. This ID is passed to Ad Duplex’s init routine. A great place to keep these IDs is within the app ICF file under a custom section, here is an example:
• [AdDuplex]
• AdDuplexId="123456"
• The code which initializes AdDuplex would then look like this:
• if (s3eConfigGetString(
• "AdDuplex",
• "AdDuplexId",
• adDuplexID) == S3E_RESULT_SUCCESS)
• {
• s3eAdDuplexRegister(
• S3E_ADDUPLEX_CALLBACK_ON_CREATED,
• adDuplexInitCallback,
• 0 );
• s3eAdDuplexRegister(
• S3E_ADDUPLEX_CALLBACK_ON_LOADED,
• adDuplexLoadedCallback,
• 0 );
• s3eAdDuplexCreate (adDuplexID);
• }
• Notice that two callbacks are registered before calling s3eAdDuplexCreate. These callbacks are important. The s3eAdDuplexCreate is asynchronous, so the first callback is triggered when AdDuplex has finished initializing. 7
• static s3eAdDuplexHandle adDuplexHandle;
• int32 adDuplexInitCallback(void *systemData, void *userData)
• {
• //This handle is a reference to your AdDuplex instance
• adDuplexHandle = (s3eAdDuplexHandle)systemData;
• //Configure small Ads to appear at the top of the screen
• s3eAdDuplexPropertySet(
• adDuplexHandle,
• S3E_AD_DUPLEX_V_ALIGN ,
• S3E_AD_DUPLEX_VALIGN_TOP );
• s3eAdDuplexPropertySet(
• adDuplexHandle,
• S3E_AD_DUPLEX_SIZE,
• S3E_AD_DUPLEX_SIZE_292X60);
• //Show the ad duplex control on the screen
• s3eAdDuplexShow(adDuplexHandle);
• return 0;
• }
• In the callback above we retrieve the s3eAdDuplexHandle as it is required for any further calls to the API. Then we configure where and what size we would like our Ads to be, then finally then are shown with a call to s3eAdDuplexShow. Once the control has been shown, Ads will rotate automatically.
Click to edit Master subtitle style
Ads in Game
Ad Duplex
• Ad Duplex is cross-promotion network targeted at Windows 8 and Windows Phone 8 apps and is supplied as an extension with the Marmalade SDK.
• To make the AdDuplex API available to your app, you need to add s3eAdDuplex to the subproject section of your MKB file.
• Include the AdDuplex header file any place you wish to use the API
• #include <s3eAdDuplex.h>
Ad Duplex Configuration
Every application which uses AdDuplex has its own ID. This ID is passed to Ad Duplex’s init routine.
A great place to keep these IDs is within the app ICF file under a custom section, here is an example:
if (s3eConfigGetString(
"AdDuplex",
"AdDuplexId",
adDuplexID) == S3E_RESULT_SUCCESS)
{
s3eAdDuplexRegister(
S3E_ADDUPLEX_CALLBACK_ON_CREATED,
adDuplexInitCallback,
0 );
s3eAdDuplexRegister(
S3E_ADDUPLEX_CALLBACK_ON_LOADED,
adDuplexLoadedCallback,
0 );
s3eAdDuplexCreate (adDuplexID);
}
Notice that two callbacks are registered before calling s3eAdDuplexCreate. These callbacks are important. The s3eAdDuplexCreate is asynchronous, so the first callback is triggered when AdDuplex has finished initializing.
Making Ads Rotate
static s3eAdDuplexHandle adDuplexHandle;
int32 adDuplexInitCallback(void *systemData, void *userData)
{
//This handle is a reference to your AdDuplex instance
adDuplexHandle = (s3eAdDuplexHandle)systemData;
//Configure small Ads to appear at the top of the screen
s3eAdDuplexPropertySet(
adDuplexHandle,
S3E_AD_DUPLEX_V_ALIGN ,
S3E_AD_DUPLEX_VALIGN_TOP );
s3eAdDuplexPropertySet(
adDuplexHandle,
S3E_AD_DUPLEX_SIZE,
S3E_AD_DUPLEX_SIZE_292X60);
//Show the ad duplex control on the screen
s3eAdDuplexShow(adDuplexHandle);
return 0;
}
The s3eAdDuplexHandle as it is required for any further calls to the API. Then we configure where and what size we would like our Ads to be, then finally then are shown with a call to s3eAdDuplexShow. Once the control has been shown, Ads will rotate automatically.
Click to edit Master subtitle style
Cloud Services
Cloud • Marmalade Quick supports multiplayer gaming by bundling the Photon
Lua APIs. These are designed to be used with the Photon Cloud hosted service: http://doc.exitgames.com/photon-cloud/
• The Photon components can be found in the /quick/photon folder.
• An example project (which can be imported into the Marmalade Hub) can be found at quick/data/photon/src/demo-particle/demo-particle.mkb
Photon Setup
• To use the Photon APIs, you must first sign up as a developer with Photon: https://cloud.exitgames.com/Account/SignUp
• By default, you will get the ‘Forever Free’ product, which allows completely free use of the service, up to 20 concurrent users (CCU). Once you need more scalability, you can upgrade to various paid services: https://cloud.exitgames.com/Pricing
• Once you have confirmed your email address, you will get a developer dashboard: https://cloud.exitgames.com/Dashboard
• This will show your “AppID” for the ‘Forever Free’ service. See the example demo-particle.mkb project, and the file ‘cloud-app-info.lua’ to see where to insert your AppID.
• For any questions about the Photon Lua APIs, or the Photon Cloud service, please contact Photon support directly:
• Support forum: http://forum.exitgames.com
• Support email: [email protected]
Click to edit Master subtitle style
Packaging your game
Specific Considerations
• Use the Windows Phone Store Test Kit to verify your application.
• The Store Kit can be executed from within Visual Studio (Right Clicking the Marmalade.Shell project and selecting “Open Store Test Kit”)
• Run both the automated tests AND the manual tests.
• Windows Phone 8 Beta store, this will let you test your app in a sandbox environment.
• When targeting Windows Store 8.1 and later, shaders are automatically compiled at runtime using the HLSL compiler built-in to the OS.
• When targeting Windows Store 8, the OS does not support compiling shaders at runtime and therefore you need to build and pack shader binaries for the application package in advance.
Specific Considerations
• App Name
• Splash Screen
• Icons
• Hardware Limitations
• http://docs.madewithmarmalade.com/display/MD/Distributing+Windows+Store+Apps Windows 8
• http://docs.madewithmarmalade.com/display/MD/Distributing+on+Windows+Phone Windows Phone
Click to edit Master subtitle style
Privacy Policy
Privacy Policy
• Is required if your app sends any data to a third party
• 4. Windows Store apps put the customer in control– 4.1 Your app must comply with the following privacy-
related requirements:• 4.1.1 Your app must have a privacy statement if it is network-
capable– If your app has the technical ability to transmit data to you or a third party,
you must maintain a privacy policy. You must provide access to your privacy policy in the Description page of your app, as well as in the app’s settings as displayed in the Windows Settings charm.
• Privacy policy url is required during submission and in game
• Can display policy in game or redirect to website
Publishing to Windows 8.1
Publishing to Windows 8.1
DEMOPublishing a Windows 8.1
Testing your game
• Windows Application Certification Test Kit
• http://msdn.microsoft.com/en-us/library/windows/apps/hh694081.aspx
DEMOTesting your game with WACK
Publishing to Windows Phone
Publishing to Windows Phone
DEMOPublishing a Windows Phone 8.1
Memory
• Memory comes in multiple configurations: 512 MB of RAM for the WVGA devices, and minimum of 1GB RAM for the 720p devices.
• The newest phones such as Nokia 1020 are up to 2GB.
Hardware APIs
• All Windows Phone 8 devices feature accelerometer support which is available through the S3E Accelerometer API.
• Location services are available with the S3E Location API
• Compass services are available with the S3E Compass API
• The microphone can be used with the S3E Sound Record Overview
• Camera capture is available through the S3E Camera Capture API
Got-ya
• There are a couple of settings you will need to retrieve from the Windows Phone 8 developer portal, namely your PublisherID and ProductID – both of these settings can be found under the basic tab. You will need to fill out information in both the Basic tab and the Project tab, this can easily be missed!
Windows Developer Offer MarmaladeApply, port and publish! Then claim over $1000 in incentives!
Spreading your game to the Windows Store and Windows Phone Store has never be easier – or more rewarding!
Has your game received a 3 star rating or above? And/or has it had at least 5,000 installs (paid) or 50,000 (free)? Is your game innovative, unique and does it boast a great user experience?
What’s in it for you?
$100 gift voucher Priority view for Windows Phone store promotion A developer account token for the Windows Phone store A license to Windows 8.1 Pro A Windows Phone device A Marmalade Indie license
Apply now to take part!
www.madewithmarmalade.com/offers/windows
• Adding C++ extensions
• Try and Buy
• Ads in Game
• Packaging your game
Module Review
©2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics 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.