Sunday 30 December 2012

Final Blog of 2012

My Final Blog

That's it guys and gals, my final blog (for 2012 that is) and scheduled to return after the new years annual 'drink myself into oblivion' party in Wigan. I have spend the day attempting to clear my Christmas email backlog and sort out my explosion (affectionately called my office) ready for 2013.


What 2013 Brings

My schedule for 2013 has been deliberatively cleared for what will be a nice BIG project; FPS Creator Reloaded. I will be developing it solo for the next eight months, with perhaps some help from FPSC friends along the way. My ambitions are high for this one, and will be locking myself away in the deepest part of the dungeon to do my coding. My only contact with the outside world will be this blog (and the other thousand social feeds of course), but here is where I will write down my thoughts.

I will also be keeping a toe in the AGK/Freedom-Engine camp to ensure it goes in the direction I think it should go. This project will be headed by our resident genius Paul, who is more than capable of handling the various aspects of this awesome and gigantic engine.

Apart from a few small AGK app projects and the occasional competition, these are my babies for 2013.  My aim is to have a product that will shock the FPSC world (in a good way) and see that TGC emerges with a super-solid-super-powerful AGK/FE technology for Christmas 2013.


FPS Creator Reloaded Blog

This blog will be the home of my 'almost' year long development diary for Reloaded, much like the diaries I maintained ten years ago before before the word 'blog' even existed :)  

Along the way I will inject some non-FPSCR content to keep things fresh, and open the door to the kinds of interesting things that can distract me in a typical year.


Happy New Year

If I survive all the beer, I will see you all in 2013!




Thursday 8 November 2012

RELOADED - Kickstarter Funding In Doubt

We recently started a Kickstarter project called FPS Creator Reloaded to bring our successful FPSC product up to date, but it looks like the battle with Kickstarter votes is being lost. As I write this, we have 208 pledges from some great wonderful visionary people, £12K in the fund with £48K to go. The trouble is that we only have 22 days left to do this, and the percentages say we are 26% of the way through the Kickstarter and only 20% funding so far. You run the chart through the next 22 days and take into account the Day One pledges, the maths say we will fall short by quite an amount.

Perhaps had we run this a year or two ago we would have been drowning in funding, but that is sometimes the way of things.  I recall a very useful guide called the Official FPS Creator Community manual which had so many pearls of wisdom in it the thing was practically a treasure chest, and I recall laughing at the comic strips that where injected at certain points in the tome:


It really showed the spirit of the FPSC community, that despite the fact the engine would break and stutter, and completely ruin their game, they could laugh about it and carry on regardless.

I always wanted to return to FPSC and finish the job I started all those years ago with the things I have learned since. Sometimes, the smallest change can make the biggest difference.

When Kickstarter came to the UK earlier this year, the opportunity presented itself to fire up this belated project in the form of FPSC Reloaded, a massive full-time development to take every little (and major) niggle that had blighted FPSC fans for years and do something about it.

I've been recently working on the V120 beta, a version that is being groomed for a UK DVD release in the UK, and I've found myself really enjoying the job of tracking down little issues that cause so many problems, fixing them and watching the engine hum along with it's new-found functionality.  I was so looking forward to making an amazing revamp of FPS Creator, but it seems that not enough of the world wants to see it.

I will not be deterred however, and from now and the 22 days that are left I will be trying every trick I know to get the word out about Kickstarter Reloaded. I have chatted with big online magazines, I have engaged an online marketer in the very darkest corner of the web, I've blogged, tweeted and posted, stopping short of it becoming out and out begging.

I am spending my own money to pay our key artist to start making art right now so we can show potential pledger's what they will be getting in the new product and finding every spare minute to research the internet to find ways to tell people about this. We have directly sold the original FPSC to a five digit audience, and now I just need to find out where they've all gone ;)

I am also hearing the alarming feedback that users are following the project and are excited to see it happen, but are not pledging. Instead they are waiting to see what the fund does before acting. They think the money will leave their account right away and not come back. The idea of a Kickstarter is you pledge an amount in principal. Only when enough people have 'theoretically' pledged over the funding required does the money get transferred. That is, only when the project is a go ahead will the pledger's actually need to spend any money, and of course by that time it's like the worlds longest pre-order.  A pre-order with some amazing benefits of course!

I may be proved wrong, and on the 11th hour a flood of pledger's will come in and save the day, and I will be the happiest little boy on the planet on that day, but I am mostly a cynic and realist, and spreadsheets and graphs are alarmingly accurate things.

If you are reading this far, and have gained a modicum of sympathy for my plight, you might want to check out the Kickstarter Reloaded page in question, and indeed pass this link on to anyone you think would want to make their own kick-ass gorgeous looking, highly engaging FPS game this time next year. One of the pledge gifts is a full version of the current FPS Creator product so they could get creating in less than a month in fact.

Here is the Kickstarter Reloaded link:

http://www.kickstarter.com/projects/tgc/fps-creator-reloaded

I continue to hope, and I check in the Kickstarter page every day to see what it is doing. The last two days have been particularly slow as three days ago the percentages where dead even, meaning we had a small chance it would continue at that pace, but it did not.

Anyhow, I will continue my PR quest to get Reloaded in front of millions, and if anything dramatic happens I will blog my happiness on these pages.  Now back to bug fixing and that wonderful world we call software development.

Saturday 3 November 2012

Video and 3D In AGK V108 BETA3

Just a quick video to see what we are getting up to these days with AGK and Freedom-Engine:


We also started a Kickstarter a few days ago, so if you want to pledge something to make this project real, check out the link:





Friday 26 October 2012

Light Mapping in HTML5

It took best part of two weeks but we now have light mapping in Freedom-Engine 3D and AGK, and can be seen running right now.


Simply visit https://freedom-engine.com/ide.php and select the 3D - FPS Example, press PLAY and then run around the 3D scene. There is no collision in the Freedom-Engine version at the moment, and we plan to add optimisation on the media and the file structure for faster loading and smaller media files.

We're still in BETA, and both commands and engine are still work in progress, but you should be able to use this version to import your own OBJ and texture files, and start creating some interesting 3D scenes.  One very cool aspect of this version is that you can create vertex and pixel shaders right in the editor. Simply click to create a new source code file and then rename it with .VS for vertex shader and .PS for pixel shader. These files will then be used as media files when you use something like LoadShader ( 1, "vertex.vs", "pixel.ps" ) to load the shaders in.

Here is the source code that created the example above:


rem
rem 3D Lightmapping
rem Artwork by Mark Blosser
rem

rem Init app
SetSyncRate(60,1)
SetClearColor(128,64,0)

rem Loading status
customimg=LoadImage("custom.png")
CreateText(1,"Loading Metro Theatre Scene")
SetTextFontImage(1,customimg)
SetTextAlignment(1,1)
SetTextPosition(1,50,45)
SetTextSize(1,10)
CreateText(2,"Artwork by Mark Blosser")
SetTextFontImage(2,customimg)
SetTextAlignment(2,1)
SetTextPosition(2,50,60)
SetTextSize(1,8)
Sync()

rem Load world
gosub _load_world

rem Setup camera
plrx#=1850 : plrz#=-3650 : plra#=0 : eyeheight#=553
SetCameraPosition(1,plrx#,eyeheight#,plrz#)
SetCameraRotationEuler(1,0,plra#,0)

rem Start loop
DeleteText(1) : DeleteText(2)

rem Main loop
do
 `
 rem Move camera
 if GetRawKeyState(38)=1 then MoveCameraLocalZ(1,4.0)
 if GetRawKeyState(40)=1 then MoveCameraLocalZ(1,-4.0)
 if GetRawKeyState(37)=1 then RotateCameraLocalY(1,-4.0)
 if GetRawKeyState(39)=1 then RotateCameraLocalY(1,4.0)
 `
 rem Framerate prompt
 fps=ScreenFPS() : Print(fps)
 `
 rem Update screen
 Sync()
 `
loop

_load_world:
 `
 rem Shaders
 shaderindex=1 : LoadShader(shaderindex,"vertex.vs","pixel.ps")
 `
 rem Load lightmaps
 dim lm[10]
 lm[0]=LoadImage("0.png")
 lm[1]=LoadImage("1.png")
 `
 rem Load all OBJ making up world (created in FPS Creator)
 objmax=50
 for obj=1 to objmax
  obj$="mesh"+str(obj)+".obj"
  LoadObject(obj,obj$,0)
  if obj>=1 and obj<=7
   tex$="mesh"+str(obj)+"-1.jpg"
  else
   tex$="mesh"+str(obj)+"-0.jpg"
  endif
  texname$=left(tex$,len(tex$)-4)
  lm$=right(texname$,1)
  if lm$="-" then lm$="0"
  SetObjectImage(obj,LoadImage(tex$),0)
  SetObjectImage(obj,lm[val(lm$)],1)
  SetObjectShader(obj,shaderindex)
  `
  rem Progress status
  perc#=obj : perc#=perc#/objmax : perc=perc#*100
  SetTextString(1,"Metro Theatre - "+str(perc)+"%") : Sync()

 next obj
 `
return


I'm pretty buzzed about this version as it allows decent looking scenes to be created and played in a native HTML5 browser, no plug-ins need apply! In the near future we plan to get everything else in such as point and directional lighting for the built-in shaders plus more control over how your models are loaded in and how they are formatted for advanced shader features.

The next few steps is to make sure you can deploy these new 3D apps flawlessly, so you can share what you have created while you work on the latest version.

Wednesday 17 October 2012

HTML5 and WebGL

I won't be having a blog next Monday as I am not in the office, so I have decided to post now to report on a cool tool that just saved me a heap of work. It is called WebGL Inspector and is a Chromium Extension for HTML5 developers using WebGL.

The link is : https://chrome.google.com/webstore/detail/webgl-inspector/ogkcjmbhnfmlnielkjhedpcjomeaghda

Without this valuable way to step through every single event the WebGL performed during a single rendered frame, I would probably have never noticed the absence of two small state changes in the 150 state changes that represented by very simple 3D scene.

For those keeping up with Freedom-Engine progress (www.freedom-engine.com) this was the tool that helped me solve the 'missing 3D on a Mac' issue, as it turns out when the uniforms (like global constants) for the shader are collected, they are collected in a different order on the PC as they are on the Mac. In addition, it also highlighted a bug where I was only collecting the first of the shader uniforms meaning subsequent uniforms where being ignored. 

I often say that when you understand the question thoroughly, the answer presents itself.  Within every question lies the answer!

Monday 15 October 2012

Transparent Computing

Work

I would like to share with you an article I wrote to highlight the strong link between Transparent Computing, HTML5 and the work we are doing at TGC with AGK and Freedom-Engine.  As a treat for reading the article, you will find a link half way down the page which runs one of my Freedom-Engine apps I deployed about a week ago.

http://software.intel.com/en-us/articles/transparent-computing-with-freedom-engine-html5-and-beyond

I did not need my own server, or pay broadband costs, or learn any fancy web languages either. I just knocked out a few simple lines of code, pressed the Deploy button in Freedom-Engine and I had an instant link I could share. It does not get any easier than this.


Play

This blog would not be complete without something a little more light-hearted and a little less tech:


This is me, Virginia and Alistair (author of the Hands On Series) balancing precariously on the edge of a hill riding the new Segway X2 machines. Here is a video clip of the start and end of my one hour on two wheels.



I must confess they are the most unlikely method of propulsion but having rode on one, you suddenly realise they are extremely smart, super fast and the X2 model is all-terrain too which is immense fun!


Progress

My work sheet for this week is pretty packed with plenty of Freedom-Engine in addition to some side project work too, so keep your eye on the blog tab at www.freedom-engine.com for more news on what's happening in the team.


Thursday 11 October 2012

Freedom-Engine Round-Up

I can't believe it's been a whole month since we launched Freedom-Engine at IDF 2012 and I've only now been able to clear my plate of the back-log of everything I brought back with me and ideas we had on the plane out there and back again.


We had plenty of things to do in anticipation of the Freedom-Engine Beta launch and in doing so we neglected to post updates to what was happening on the AGK side.  Fortunately this has now been addressed and we are now at Beta 2 of the AGK V108 which introduces over 180 new commands and we're looking at adding a few more before we release the update officially.

Blogs Blogs Everywhere

I will also be blogging almost daily on the Freedom-Engine blog tab but will also include any relevant AGK news in there as the technologies are so intertwined it would not make sense to do otherwise. I currently have a few logistical issues to deal with about where I should be posting my feeds. I now have this blog, the Freedom-Engine forum and the FE blog tab, the AGK forum, new newsletter articles and my own twitter feed.  We also have Facebook and Linked-In feeds which thanks to TweetDeck automates that with my twitter posts. I will probably be looking for a one-size-fits-all system so I can post something once and have it propagate across all my social end points. Phew!

My plate is not too hectic at the moment with only one side project (built using AGK/Freedom-Engine) and the usual drill of answering mail and replying to posts. This means I have a huge chunk of time to do nothing but solidify AGK and Freedom-Engine in three main areas; browser stability, command set completion and platform deployment.

Freedom-Engine Priorities

We're getting good on the browser stability with compiler time slicing to help the slower Firefox JS virtual machine and engine optimisation to hog less resources by default. Deployment is being handled by other team members who are doing a grand job and the first of the platforms over and above HTML5 should be live any day now. The command set completion lands squarely on my shoulders and is the largest of the tasks ahead of me.

The present Freedom-Engine was fleshed out with V107 functionality, with only partial V108 commands integrated which means there is a way to go before we can say we are 100% V108.  The good news is that when we reach that stage, it will become fully compatible with the AGK product and allow the same project code to work on both solutions.

At some point, to show the technology is essentially identical, we will be renaming AGK to something like Freedom-Engine Desktop (or similar) and slowly bring the AGK forum over to the new site.  We feel this is important as the perception is that there are two products, when in fact they are two sides of the same coin.

Ground-Walker or Cloud-Dweller

Some developers will always want to code on the desktop and store their files locally, and other developers see the benefits of moving entirely to the cloud and making their home there. As a team we believe this shift to cloud based solutions has only just begun and in a few short years you will find so many benefits to working on the cloud that developing on a local device will seem extremely restrictive.

In order to stay relevant (and to edge our bets), we are offering solutions for both approaches and by keeping the language, technology and ethos the same, the transition from one to the other will be smooth and natural.

For a current peek at what we have added to Freedom-Engine in the last few months, check out the V108 beta page for more details:

http://forum.thegamecreators.com/?m=forum_view&t=200598&b=41

Voodoo Fun

I don't know where it came from but I had the urge to seek out and play an old computer game I used to play back on the VIC-20 called Voodoo Castle. At the time I remember getting really far but never finishing the game. Well I started playing at 11PM last night and was overjoyed to have completed the game by 1AM (admittedly cheating twice to google for clues). Whilst playing, it occurred that I also remembered a better game called The Count. This one was really tough as I recall, and I have promised myself the game as a treat for finishing some more commands next week.  Happy days!

Next Things On Lee's List

I am off to Scotland at the weekend to collect a consignment of tomes from my good friend Alistair Stewart and maybe to try my balance on a SegWay. If I can get a photo, I may post it here next time. I start my 'side project' on the following Monday which will test AGK V108 to it's core, and specifically the new video commands we've added recently. 

As part of and in addition to this work, I will be completing the command set in Freedom-Engine with an emphasis on the 3D commands. I know it's not everyone's cup of tea, and some would argue 3D in the native browser has yet to take hold but it's such an exciting technology that generates such innovation, I am eager to see what AGK and Freedom-Engine users can do with it.  There are other key command sets such as our file system (which will use the limited HTML5 LocalStorage system) and AGK Ultrabook Sensors which I can access from the Win32 side of the platform, and hopefully I can bring the features up in parallel until I have a complete V108 feature set for both AGK and Freedom-Engine users.

In the meantime I will tweet, blog, post and reply where I can, and hopefully keep you as informed as possible on what I and my team are getting up to between the weekends. Be safe and happy coding!

Lee Bamber
The Game Creators
www.freedom-engine.com

P.S. These blogs remind me of a time I used to write a developer log many moons ago. The trick I failed to learn was to make sure you code more than you blog ;)

Monday 8 October 2012

Ultimate Losers Blog

Beyond The Challenge

I enjoyed my blogging so much during the Coder Challenge that I have decided to continue posting. Just so my readership know, I totally failed to win the Ultimate Coder challenge. It was a hard fought thing, and in the end all the technology coding in the world does not mean a thing if in doing so I fail to deliver a compelling app experience. Lesson learned (I hope)!


Here's Mud In Your Eye!

I've decided to keep the Ultimate Coder Blog, not in reference to myself, which is clearly no longer the case, but in reference to you guys, who are all ultimate coders in your own right.  If ever I get big in my boots and start talking like some uber-coder, just remind me about Blog Seven and we'll say no more about it ;)

Another Ultrabook Competition

If you're astute coder with some free time, there will always be a competition for you to join. It just so happens the next one that caught my eye also centres around those incredible Ultrabooks:

http://www.codeproject.com/script/Awards/competition.aspx?cid=598

Fortunately, you don't have to be overly ultimate to enter this one, and there are considerably more prizes up for grabs. I would act soon though as the deadline for the first round ends this month.

The great news is that most of the apps are for 'Desktop Apps' rather than 'Metro-style Windows Store Apps', and the destination of your app is the App Up Store run by Intel and their partners.  This is great because you can use existing tools to quickly produce your apps and get them running great on the Ultrabook!

We have just released the AGK V108 beta which includes all the commands implemented for my Ultrabook app, all empty but documented!  In the next month I will be adding some basic support for some of the Ultrabook sensors through the 'Desktop Mode' (which means Win32 with knobs on) which means your AGK apps can tap into some of the cool features of the Ultrabook.

This should give you a considerable jump on your competitors and allow you to focus on your app content rather than the 'how-to' of the technology. Be aware though that although the deadline for round 1 is the 24th October the sooner you submit your article for consideration, the sooner you will be picked to receive a free Ultrabook to code up your app so get cracking right now!

Freedom Has A Voice

In Freedom-Engine news, we've put extra man hours into the forums from now on to make sure AGK and FE users are catered for who have questions about this new technology. In fact, almost every team member will be trampling through the posts and making comments almost every day, so if you want some good advice on all things cross-platform, look no further:

http://www.freedom-engine.com/forum/

We've also done some nifty additions to the HTML5 deployment feature so you can post a permanent version of your app on our server to show your friends and end users, even with the free account!

Thanks For Reading

Thanks for reading and I hope to post something else in a week or so.  For those in a competitive mood, good luck and happy coding!

Monday 24 September 2012

Intel Ultimate Coder Challenge - Part Six

Journey’s End

Well boys and girls, I hope you enjoyed our adventure into the mind of a software coder and hopefully gleamed some useful insights into the world of Ultrabook development! From a five page design document to a finished Ultrabook app, it’s been a labour of love through a mine-field of cutting edge technology.

Reflecting on the journey, my decision to create an entire WinRT engine in six weeks was simply bonkers. I don’t recommend it to anyone who values their sleep!

As much as you might expect this blog to be a nice neat (and short) wrap up of the project, I spent every day of the allotted six weeks coding my little socks off to ensure I could get as much into the final app as possible. I have something for everyone in my final episode, including a ten minute video of the Love Hearts(r) app and a gallery of screen shots.

I also want to cover the technology I implemented in my final week, including in-app purchasing, Ultrabook camera and social integration. Before we charge headlong into the technology, let's see the final Love Hearts(r) app in action:


I'll be the first to agree my video recording skills are less than passable, so I have created a wall of images which explodes the app so you can see each screen at a glance in a little more detail:


An app crammed with sensor goodness
can you find them all?

You can send custom photo messages through
all your favourite social outlets


Maintain a friends list to make sending
more messages a breeze

Type your message using the Ultrabook keyboard,
no need for a virtual one

Use the built-in Ultrabook camera,
or access the Photo Library
  
Position and crop the capture
for that perfect wave

Take your photo into the art tool,
ready to customise your picture

Use coloured pencils and brushes, plus rubber
stamps for a beauty make-over
  
Swipe the screen to reveal a
new surprise from the app

One surprise might be a piece from a jigsaw,
can you tell what it is yet?

Another activity is the Love Train

Can you beat your friends highest score?
  
Discover love poems, and send them
to your friends and loved ones

A red star notifies you of unopened
presents within the app

You are also notified of unopened presents
from the Windows 8 tile page

One of the surprise items might
be a joke you can share

You can also send messages to
another Love Hearts app

A bubble appears when a message
is waiting for you

Windows 8 tile page also lets you know
when a message is waiting
  
Tapping the bubble opens the message,
this one is a joke someone sent me

The joke is added to the joke heart at the
top of the page, just tap to laugh

The app monetises through the Windows 8
in-app purchase system

When published to the Windows Store, the app will
give you a price to buy unlimited credits

Find a love compass, always pointing to
your true love (providing it's north) 

Create photos and then share them
through your social graph

The app re-creates your message in the cloud
and allows you to tweet the link
  
You can also send the link as a Facebook update

Clicking the link takes you to your message,
courtesy of the cloud
For more information about app availability, I will continue running this blog site so check back in a few weeks to find out which stores you can download it from.

Windows Store 'Share' Button

The ‘Share’ option on the right slide-in bar enables apps to share content with other third party apps. The guidelines suggest that most if not all Windows 8 apps should take advantage of this feature which is expanded upon here: http://msdn.microsoft.com/en-us/library/windows/apps/hh465251.aspx

I was intending to add this feature but soon realised that optimal use of the feature would need some design changes to the app. For example, the current app asks you to click the Twitter icon, and then compose a message and finally takes you to the browser to enter your twitter account details and post the message link.  With the new Windows 8 ‘Share’ feature, the app could have been designed to have the Message Editor independent of the delivery method. When a message had been created, the user could simply swipe from the right, press Share and select Twitter, Facebook, Email or Browser. It's an elegant feature, and one I shall be taking full advantage of in the future.

Monetising an Ultrabook App

Initially I thought the Windows 8 Store did not allow in-app purchasing, but on closer inspection I discovered that it actually supports multiple forms of monetisation and enough documentation for me to get started supporting this under WinRT.

A great place to start the learning, and the starting point of my own mini-adventure was here: http://msdn.microsoft.com/en-us/library/windows/apps/br230836

With less than a week to go, I figured it made sense to register my particulars for a Windows Store developer account which lead me to the part where I had to pay £37 and fill in some rather aggressive online tax forms. This would give me the back-end ingredients I needed to create in-app tokens that represent what I chose to sell from within the app.

Finally, I located a C++ sample which in theory would contain all the code I needed to get in-app purchasing off the ground, found here: http://code.msdn.microsoft.com/windowsapps/Licensing-API-Sample-19712f1a

I did discover when creating in-app tokens that Windows Store does not allow internal currency as such, instead opting to sell in-app features which last a set time from 1 day to forever. As I needed a ‘buy credits’ feature, I set the ‘More Love Credits’ token for one day and would use some internal code to store app credits manually.

The first integration step was to create some in-app purchase commands for Freedom-Engine, and some code which would be handed over to Steve to add to the BUY button in the app:

rem Set the name of the app for Purchase Dialog
InAppPurchaseSetTitle ( "Love hearts" )

rem List out all in-app products and setup
InAppPurchaseAddProductID ( "More Love Credits" )
InAppPurchaseSetup()

rem If 'click', attempt to purchase the first item
if BUYButtonPressed=1
 InAppPurchaseActivate(0)
 while GetInAppPurchaseState()=0
  rem app is busy obtaining in-app feature
  Sync()
 endwhile
endif

rem Detect if first in-app product purchased
if GetInAppPurchaseAvailable(0)=1 and NoNewCreditsToday=1
 rem User has purchased 'More Love Credits'
 inc LOVECREDITS,50
 NoNewCreditsToday=0
Endif

Of course behind the scenes, this looks a little different in WinRT code, and after some initial wrangling managed to distil it down to some essential blocks of code. The first section is the classes we would be using:

using namespace Windows::ApplicationModel;
using namespace Windows::ApplicationModel::Store;
using namespace Windows::Storage;

Second, we are using the Store Simulator to test in-app purchases prior to publishing to the Windows Store, so we need to load in ‘pretend’ products, which is done with an XML file and the following code:

create_task(Package::Current->InstalledLocation->GetFolderAsync("data")).then([this](StorageFolder^ proxyDataFolder)
{
    create_task(proxyDataFolder->GetFileAsync("in-app-purchase.xml")).then([this](StorageFile^ proxyFile)
    {
create_task(CurrentAppSimulator::ReloadSimulatorAsync(proxyFile)).then([this]()
            {
        });
    });
});

Finally, the essential WinRT code to detect if a product has been purchased, and also to buy the product on demand is only a few lines:

auto licenseInformation = CurrentAppSimulator::LicenseInformation;
auto productLicense = licenseInformation->ProductLicenses->Lookup("product1");
if (!productLicense->IsActive)
{
create_task(CurrentAppSimulator::RequestProductPurchaseAsync("product1", false)).then([this](task<Platform::String^> currentTask)
     {
            try
            {
                currentTask.get();
                auto licenseInformation = CurrentAppSimulator::LicenseInformation;
                if (licenseInformation->ProductLicenses->Lookup("product1")->IsActive)
                {
                    // You bought Product 1.
                }
            }
            catch(Platform::Exception^ exception)
            {
                // Unable to buy Product 1.
            }
        });
}

As you can see, it’s relatively simple to monetise your app, and when you are ready to publish, simply substitute the CurrentAppSimulator with CurrentApp and you’re ready to go. For a working sample of in-app purchasing, Google ‘Trial app and in-app purchase sample’ for the example.

Submitting an Ultrabook App that uses DirectX and Webcams

Although there are a huge number of things to test when preparing your app, there a few gotchas that apply specifically to how you describe your app when submitting it. For example, you need to specify what the minimum DirectX feature level is for the app (9_3, 10_0 or ALL)? For Love Hearts, I am using a relatively simple shader which means I can choose ALL, but if you are for example making use of the special features of the Intel HD Graphics 3000/2000 Sandy Bridge chipset, then you need to specify 10_0 when submitting your app.

Also, if your app uses the webcam, which Love Hearts does, you cannot set the age rating to 3+ and the guidelines recommend you set this instead to 7+. Given my market, this was not an issue. The store also allowed rating board approvals to be optional for many target countries, which was a blessing for a small developer like me.

Windows, Drivers, Countryman!

A quick tip for developers who are working their way out of Windows 8 Release Preview to Windows 8 RTM, also check to make sure you are not using the Visual Studio Express 2012 RC which was only designed for the release preview OS. You can now find the official VS Express download from the Microsoft website. I highly recommend downloading the ISO to avoid bandwidth issues when using the web installer!

Another gotcha for DirectX developers is that the Windows 8 RTM uses the Intel HD 4000 driver (31/07/12) on the reference Ultrabook, but the drivers misbehave and flicker wildly. I had to dive into the Display driver and replace it with the older Microsoft WDDM 1.2 version (26/05/12) to restore visuals. To me, that’s a driver issue, and I hope I don’t get punished for this by the judges. Sometimes, I’m so cutting edge I chop my nose off!  Here is the fix:

1.       Go to desktop, right click Screen Resolution
2.       Click Advanced Settings
3.       Click Properties button
4.       Click Driver tab
5.       Click Update Driver
6.       Click Browse My Computer for drier software
7.       Click Let me pick from a list of device drivers on my computer
8.       Choose the WDDM 1.2 driver from the list and select Next
9.       Click Close and reset the Ultrabook if promoted

Yet another jungle trap is the 650MB Intel Sensor Solution driver set which lacks certain firmware updates required by the Ultrabook sensors. After some digging around challenge emails, I found a zip called SensorFirmware.zip sent to me by Norman@Intel which contained a file called ‘READ ME with Pictures’ which explained how to update the sensor firmware in six easy steps. Turns out steps two and three don’t play nicely in England unless you delete the <language> section of the dpinst.xml files, and even then step three decided to flip my screen vertically just as I was to press Finish. Tilting the Ultrabook forwards sorted that one out. Step six froze at the end, meaning you had to force as restart of the system but when the Ultrabook rebooted for the final time my sensors where once again working!

One thing to note though is that Windows RTM switches auto-orientation ON by default, which means as soon as you start moving the Ultrabook around, your page starts flipping.  To stop this, go to the Desktop, and right click and select Screen Resolution. Now deselect the ‘Allow the screen to auto-rotate’ tick box, and you are good to go.

Getting Social with the Ultrabook

Another feature of Love Hearts which had been postponed until after IDF was the Facebook, Twitter and Email functionality. On my return, some of the email functionality had started to take shape but the first two had not been touched.  After much research into a good way to involve these social feeds, it turns out the solution was a single command in Freedom-Engine.


Where ‘Hello’ is the link to the message we want to share. By employing the built-in browser, we allow Facebook and Twitter to handle their own log-in and authentication, and instil trust in the user who may not be happy entering their passwords into a third party application.

The WinRT code is a few more lines, but considerably easier than the Win32 equivalent:

Platform:String^ str = ref new String(“www.facebook.com/etc”);
Windows:Foundation:Uri^ uri = ref new Windows:Foundation:Uri(str);
Windows:System:Launcher:LaunchUriAsync(uri);

The last two message styles, Email and App2App rely on PHP scripts sitting on our server, called with a number of HTTP commands built into Freedom-Engine. For all the cleverness contained in the app, a core ingredient of the technology is our server, which runs a series of scripts to take the Love Hearts message text and images, and produces a unique link which can be viewed through a browser, send emails, authenticate and direct queues of messages to the appropriate user for delivery through the app.

In WinRT, the WinSock API is not available for Windows Store apps and instead promotes the use of XMLHttpRequest2 to handle the sending and receiving of HTTP POST and GET calls. These commands alone took two days of solid coding, and a great source of code can be found by searching for the ‘HttpRequest’ sample on MSDN code.

Ultrabook, let there be Sight

In the pursuit of ever more Ultrabook sensors, it is easy to overlook the biggest sensor of them all, the built-in camera. I intended to leave this to the end as it was not an exciting sensor to bedazzle the world with. Nonetheless, it is a vital part of the Ultrabook experience and should not be dismissed out of hand. One of the pearls I took away from IDF is that Perceptual Computing, the technology of understanding what the user is doing when not touching the device, will become key to the evolution of the Ultrabook.

For the here and now, the actual camera capture was catered for rather elegantly by handing it over to the Ultrabooks built-in camera capture tool:

CameraCaptureUI^ dialog = ref new CameraCaptureUI();
dialog->PhotoSettings->CroppedAspectRatio = Size(16, 9);
concurrency::task<StorageFile^> (dialog->CaptureFileAsync(CameraCaptureUIMode::Photo)).then([this] (StorageFile^ file)
{
     m_CameraPhotoFile = file;
}

Coupled with the DirectX texture loader I created earlier in the project, I could use the file to load the image into the app allowing Love Hearts to capture and transmit lovely faces.

I also added WinRT code to allow the user to select a Picture from the Ultrabooks Photo Library, but ran into some issues. The trick here is to copy the image file from the sandbox protected Pictures folder to the Application Data Temporary folder; you can then load and use the image as above. Any developer reading this far into the blog will save about two hours of researching ‘access denied’ and getting nowhere.

Glancing Back

Six blogs is a lot to take in, so before I bid you farewell I would like to list out all the lovely Ultrabook goodness that we've added during our time together:

* A brand new WinRT application created in Visual Studio Express 2012
* An abstraction layer which allows OpenGL to run using DirectX 11 technology
* Using DirectX 3D calls to get super fast 2D rendering on Intel HD 4000
* Used PPL parallel coding to multi-thread loading of shaders and textures
* Re-writing old Win32 functions to their shiny new WinRT equivilant
* Followed Windows 8 guidelines for tile page and app launching graphics
* Tapped the Ultrabook accelerometer sensors to improve app visuals
* Added notification to alter the Windows 8 tile as the app state changes
* Added NFC detection between the Ultrabook and any enabled device
* Adjusted the app to handle any resolution from 1024x768 to 1600x900
* Added multi-point touch detection to scale and rotate on-screen assets
* Used high quality HD graphics to support the highest Ultrabook resolutions
* App checks for new messages every 5 seconds, ideal for Instant Connect
* Added Geo-location commands to detect the city the message is sent from
* One of the presents within the app is a fully working compass
* App detects ambient light and fades to night-mode if the room is dark
* Added Windows 8 in-app purchasing so the app can monetize easily
* Added webcam and photo library support to feed the app with rich media
* Added HTTP commands to access numerous services in the cloud

Phew! I'm sure there's more, but I think that's enough for one post.  I would have loved to add more, such as the Share option, but often in the case of development the act of creating an app produces more app ideas. The mark of a good developer is to know when to draw a line in the sand, bottle those ideas up for another day and share your creation with the world. I'm pretty happy that Love Hearts embodies many of the qualities that make a great Ultrabook app. Something you can pick up and play casually, but also has depth, allowing you create as well as consume. An app that integrates closely with the underlying OS and exploits as many of the unique features of the device as possible.

I also hope I did not get carried away on the technical side and delivered an app that is also bright, colourful, easy and fun to use, provides a touch, sensor and keyboard experience that befits the Ultrabook's capabilities and feels like a natural extension of the Windows 8 user experience.

Farewell

It’s fair to say that developers who want to create a true Windows 8 experience will have to learn WinRT. We’ve learned that the majority of Win32 APIs do not carry over. It’s clear that with the introduction of C++/CX, programmers must adopt a basic grasp of parallel coding to deal with asynchronous operations. Resulting code allows the app to take full advantage of the multiple cores and produce a smoother experiences for the user. The most exciting thing has been the Ultrabook itself, which proved itself most capable as a fully fledged development machine.

It’s been a real privilege to get early access to the reference design Ultrabook, and I’d like to thank the folks at Intel for allowing me to participate in the challenge. I'd also like to wish my fellow challengers the best of luck in their future endeavours, it was an honour to be counted amongst the very best our industry has to offer.

Time for me to perform an ultra-backup, clear my ultra-desk and go to ultra-sleep for an ultra-month. Happy coding and be well.

Lee Bamber
The Game Creators