Gamehouse and QuickLua

Posted by

The nice people at MadeWithMarmalade are running a promotion with gamehouse where if you integrate their game network promotion api you win money and a Marmalade license extension. There are some stiff requirements (at least for me and my apps) to get the incentives, but I decided to integrate a couple of my apps just to see what it was like (and because I am on vacation with nothing to code). What I found out is that unlike most tap or impression exchanges, gamehouse will show your app thousands a time a day for free (at least during their beta period).

Two of the apps I integrated gamehouse with are written in C++ (what all the instructions are written for), but one of my app I used Marmalade’s Lua api. What follows is how I got the gamehouse extension working with my Lua project.

1. Download the gamehouse Marmalade extension from here:  http://gpn.gamehouse.com/sdk

2. Once the sdk is unzipped copy the gamehouse folder to the extension folder inside your marmalade folder. In my case that is: C:\Marmalade\7.1\extensions.

3. Modify your project .mkb to include the gamehouse extension in the sub-project section. Your subproject section should look like this (unless you have added other projects):

options
{
s3e-data-dir = resources
app-icf = ‘resources/common.icf,resources/app.icf’
}

subproject
{
gamehouse/gpn
}

4. Download the files located here: https://devnet.madewithmarmalade.com/questions/18739/gamehouse-and-quick-integration.html.

Place the header file in the header folder. On my machine it is located here: C:\Marmalade\7.1\quick\include.

And the source file here: C:\Marmalade\7.1\quick\source

5. Modify quickuser.mkf located here: C:\Marmalade\7.1\quick

By adding  the two files you just added. It should look something like this after your changes.

includepath .

files
{
quickuser_tolua.cpp
quickuser_tolua.pkg
quickuser.h

#Gamehouse c++ files.
include/CGGameHouse.h
source/CGGameHouse.cpp
}

6. Modify quickuser_tolua.pkg also located here: C:\Marmalade\7.1\quick by adding the reference to the header file. Your file should look something like this:

//——————————————————————————
// Mark-up in header files
//——————————————————————————
$cfile “quickuser.h”
$cfile “include/CGGameHouse.h”

7. Run the quickuser_tolua.bat file. According to the documentation it should be located here: C:\Marmalade\7.1\quick. Unfortunately I have not seen it in a few releases. If you don’t have it either copy it from the same folder but the 6.4 install (the last version that had it for me).

8. At this point you can either open the quick_prebuilt.mkb or any of your Quick project in Visual Studio and compile it using the x86 Debug target.

9. From within your Lua project now you should be able to initialize gamehouse by calling:

gameHouse.initGameHouse(“yourGameHouseAppKey”)

and request the display of the ad by calling:

gameHouse.presentAd()

10. Remember to add the required items for the particular platform you are deploying it to. For example for Android you need to add the required activity to the android manifest file. Instructions can be found in the gamehouse integration document found in this thread: https://devnet.madewithmarmalade.com/questions/18456/how-can-i-integrate-the-gamehouse-extension.html

That is all, if you run into problems let me know and I’ll try to help. I am back to bill paying work after the new year.

5 comments

  1. Hi , thanks for your great tutorial , i did every step and i get a black screen with this log(simulator):

    QUICKCPP LOG: Marmalade Quick 1.1
    QUICKCPP LOG: Loading app configuration…
    QUICKCPP LOG: Loading Quick engine…
    config.debug.general = false. All ‘dbg.’ lines will become comments…COCOS2DX LOG: cocos2d: GL_VENDOR: Google Inc.
    COCOS2DX LOG: cocos2d: GL_RENDERER: ANGLE (Intel(R) HD Graphics 3000)
    COCOS2DX LOG: cocos2d: GL_VERSION: OpenGL ES 2.0 (ANGLE 1.0.0.1275)
    COCOS2DX LOG: cocos2d: GL_MAX_TEXTURE_SIZE: 8192
    COCOS2DX LOG: cocos2d: GL_MAX_TEXTURE_UNITS: 20
    COCOS2DX LOG: cocos2d: GL supports PVRTC: NO
    COCOS2DX LOG: cocos2d: GL supports BGRA8888 textures: NO
    COCOS2DX LOG: cocos2d: GL supports NPOT textures: YES
    COCOS2DX LOG: cocos2d: GL supports discard_framebuffer: NO
    COCOS2DX LOG: cocos2d: GL supports shareable VAO: NO
    COCOS2DX LOG: cocos2d: compiled with Profiling Support: NO
    05/02/14 10:13:17.476 WEBVIEW: s3eWebViewInit DLL:e:\marmalade\7.1\extensions\s3eWebView\lib\win32/libcef.dll

    1. Never seen that error. I will try to follow my directions and upload a sample app this weekend. Hopefully I’ll figure out what I wrote out wrong.

      1. Thanks adrian , its solved ( i didn’t properly run quickuser bat file), but now i get error loading extension : gpn when trying to presents ad

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 )

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.