Augmented Reality: Suddenly it’s hot – are we reaching a tipping point?

I was really thrilled when I saw Google’s Glass, a video presentation about Augmented Reality using some tech mounted on a glasses frame. Then Oakley stated it was working on something like that, tying smartphones to AR glasses (ok they’re thinking a bit small), then Mike Abrash from Valve (previously from RAD, Microsoft, id) posts that he’s working on “wearable computers”, citing Neal Stephenson’s  augmented reality Metaverse from his Snow Crash book.

Yesssssss!

I went to school before the Internet took off and with the power I now have at my fingertips to just plain find stuff out, I’m a hell of a lot more effective in getting stuff done and choosing the right direction to go in more often than not. In my day job I work on cool personal computing tech, trying to make it even more effective and cooler, and trying to guess how it’ll be implemented in 3 years. I find that reality is way cooler that I think it’ll be. I’ve watched cell phones turn into GPS units, entertainment systems, video players, cameras, email systems, sensor platforms, crowdsourcing enablers, and realtime networked data sampling probes, and I realize that in a few short years the computing power that’s in a cell phone, coupled with networked connectivity and a sensor platform will certainly be able to drive some form of AR. As soon as you have some form of hands-free interface, the “cell phone” goes away because the phone part is just networked connectivity that part of a larger AR package. Glasses, direct visual input, or something similar are the natural way to do it. So yes – “wearable computer” is more apt than “cell phone”. To have Google and Valve working on tech similar to what MIT researchers Pattie Maes and Pranav Ministry’s SixthSense AR tech demo’d is nine kinds of awesome. I’ve played enough games to know that a HUD coupled with networking and sensors is game changing. Just read Daniel Suarez’s book Daemon and you’ll get an idea of the power of an AR system. darknet anyone?

  • Just why was Tim Cook – Apple’s CEO – at Value a few days ago?
  • (UPDATE: Valve says that Tim Cook didn’t visit them…)

Posted in Augmented Reality, Technology | Leave a comment

Standalone DirectX no more – Starting with Win8 new DirectX versions will be OS upgrades

Many folks have been wondering where the DirectX SDK (the developers package for writing DX applications) update has been. Microsoft had been churning them out like clockwork but – pfffft- nothing for over a year. With the advent of hardware accelerated UI elements (DWM – the Desktop Window Manager) and the optimized software rasterizer (Microsoft’s WARP), it’s pretty obvious that MS has realized that utilizing hardware acceleration (even if it’s a software fallback) of the entire desktop is imperative.

This was posted under “Where is the DirectX SDK?” on the MSDN web site, along with the following quote;

Starting with Windows 8 Consumer Preview, the DirectX SDK is included as part of the Windows SDK.

We originally created the DirectX SDK as a high-performance platform for game development on top of Windows. As DirectX technologies matured, they became relevant to a broader range of applications. Today, ubiquity of Direct3D hardware in computers drives even traditional desktop applications to use graphics hardware acceleration. In parallel, DirectX technologies are more integrated with Windows. DirectX is today a fundamental part of Windows.

Because the Windows SDK is the primary developer SDK for Windows, we now ship DirectX as part of the Windows SDK. You can now use the Windows SDK to build great games for Windows.

So starting with Win8 we’re not going to see a lot of innovation in the graphics API anymore, especially if if only get major updates with a new operation system. Of course there’ll be service packs, but it’s rare for a service pack to modify an API beyond minor tweaks. I suspect that with the folding in of DirectX into the operating system innovation will slow as the graphics system becomes a resource managed by the operating system, rather than just a host for a graphics program.

Posted in Windows 8 | Leave a comment

Working with C++0X/C++11: Lambdas – part 3 – introducing closures

Closure

In computer science, a closure (also lexical closure, function closure, function value or functional value) is a function together with a referencing environment for the non-local variables of that function. A closure allows a function to access variables outside its typical scope. Such a function is said to be “closed over” its free variables. The referencing environment binds the nonlocal names to the corresponding variables in scope at the time the closure is created, additionally extending their lifetime to at least as long as the lifetime of the closure itself. When the closure is entered at a later time, possibly from a different scope, the function is executed with its non-local variables referring to the ones captured by the closure.

(source: Wikipedia)

The most compelling use (in my opinion) for lambdas is for creating closures out of simpler lambdas. Once you understand that a lambda can return another lambda, you suddenly have a whole new toolkit at your disposal.

Let’s suppose that you want to write a set of parsing routines that you can use to create a command line parsing utility. Typically you’ll just find a switch statement that parses the command line in a C++ program, but basically you just need;

1) a “key” (i.e. the key or command that indicates you want to alter some particular behavior in the program).
2) some way of indicating that change to the program – typically through the use of a variable.

You can write an much more extensible utility using lambdas to hide behavior and variable references. It gets tricky here because the input is a string (part of the command line), and the result is that a “variable” gets set or modified. It’s tricky because the “variable” is the part that typically needs specialization. However this is where lambdas excel – we can use partially specified lambdas to hide the underlying variable. In other words, we’re going to use one lambda to create another, hiding some state inside.

So let’s create a function that takes an integer reference and a const string pointer, parses the string to an integer value, and stores it in the int. So far, so good. The tricky part is we’re going to return a function pointer to a function that takes the const string pointer as it’s argument. It looks like this;

.
     auto store_int =
    [](int& x) -> function < void (const char*) >
       {
        return [&x](const char* y){ stringstream(y) >> x; };
        };
.

Let’s go over this in detail;

.
    auto store_int = 
.

I’m storing something (TBD but I know it’ll be a function pointer) in a variable named “store_int”. The next part is;

.
    [](int& x)
.

I’m storing a lambda that takes an int address and doesn’t capture any scope (it’s just a function that takes an int reference). Now we need to specify what this function returns;

.
     -> function< void (const char*) >
.

… it returns a function pointer (the keyword function) and this function returns void and takes a const char pointer as an argument. In other words, I’m creating a function that takes an integer address as its argument, and this function then returns a function pointer to a function that takes a const char* as an argument and returns void. Now I just need to write the body of the lambda; This is going to be *another* lambda!

.
     { return [&x](const char* y) { stringstream(y) &gt&gt x; }; };
.

So I start the lambda body with an open curly brace, then I return a new lambda which I create in place; This inner lambda takes the reference to argument “x” (which was passed in as an argument to the outer lambda). Pass by reference allows it to modify the value in “x”; The inner lambda takes a const char pointer as its function argument. This argument comes from the argument list of the inner lambda I’m creating. Finally in the body of the inner lambda – I use stringstream to convert the string to an int through the right shift operator (it’s less error prone than atoi, and it works to convert to most data types, I use stringstream when I need to parse strings). So this is where the two function arguments actually connect, I parse the string and store it in the integer address. But these are provided in two separate function calls – the outer one and the inner one.

This is the trick – I create one function that takes a reference to the variable I want to store the command line parameter result in. This function encapsulates that integer reference up in another function that takes a char pointer. This is what gets returned. The integer reference is totally hidden from the outside. When you call this function the string argument gets parsed and stored in the referenced integer. This is a closure. Sometime after I create this function, I can call it with a const char* argument, and that string will get converted to an integer and stored in the integer address that was passed in when I created the closure.

I’ll post how you’d use this in a more complete implementation in my next post. That will make the magic of closures much more obvious. But to wrap up, let’s look at using what we created above;

.
     int myInt;   // create an integer

    // pass the integer to store_int
     auto mfunc = store_int(myInt);
    // mfunc is a function taking a const char*
    // the reference to myInt is hidden inside mfunc

     mfunc("4"); // use it, the string gets parsed
    // myInt gets set to 4
.

So we’ve used closures to hide a reference to a variable and its type. Next time we’ll use this not only to hide variable address and type information, but to hide behavior modifications as well.

Posted in C++0X/C++11 | Leave a comment

Seamus Blackley launches iOS games company with a boatload of Atari veterans

I was wondering where Seamus would end up after leaving Creative Artists after eight years, but I was pretty sure it’d be game related. I was right. Apparently he’s been planning this a while because he’s popped up as head of a new startup – Innovative Leisure. He’s hired 11 Atari game veterans from the 70’s and 80’s, plus a bunch of interns (I assume to do the actual coding) and has gotten funding from THQ, which has the right of first refusal for all the games. Kudos to Seamus for jumping back into the fray, though I hope he gets some early successes out, because THQ isn’t known for keeping on developers who fail to deliver successful games. When the CEO takes a 50% salary cut, it’s not a good time to be an expense to a company. Dean Takahashi in Games Beat posted a nice article. But you can also read THQ’s press release, the salient parts I’ve posted here. Let’s hope that the video arcade brain trust he’s collected can come with something to hold the interest of the attention deficit denizens of casual gaming.

AGOURA HILLS, Calif., Feb 03, 2012 (BUSINESS WIRE) — THQ today announced a strategic agreement with digital development studio Innovative Leisure, a new company formed by games industry veterans. The agreement will focus on creating and publishing digital games available through digital and mobile platforms. The agreement gives THQ the right to publish multiple Innovative Leisure titles starting in 2012.

Innovative Leisure comprises games industry icons with experience on some of the industry’s biggest games through its history. The team includes Seamus Blackley (“father of the Xbox”), Van Burnham (Supercade), Ed Logg (Asteroids, Centipede, Gauntlet), Rich Adam (Missile Command, Gravitar, PGA Tour Golf), Tim Skelly (Rip Off, Star Castle, Reactor), Owen Rubin (Major Havoc, Space Duel), and Ed Rotberg (Battlezone, S.T.U.N. Runner, Steel Talons). The team’s experience designing and developing highly popular pick-up-and-play gameplay mechanics will be leveraged to innovate and iterate brand-new, modern games on mobile, social and downloadable platforms.

“We are always looking to work with the best creative talent in the video games industry and we feel this relationship with Innovative Leisure reinforces our goal,” said Danny Bilson, executive vice president, Core Games, THQ. “We are committed to delivering creative games through digital distribution and Innovative Leisure has the expertise to deliver remarkable and cutting edge games for a new generation.”

“It’s a great honor (and a lot of fun) to get the opportunity to work with so many of the designers responsible for the gameplay mechanics that form the basis of our whole medium,” said Seamus Blackley, President of Innovative Leisure. “We’re excited about getting to make and release a bunch of awesome games.”

Posted in Ex-Microsoft, Game Industry | Leave a comment

Phantom Lapboard – still alive

It’s been as while since I reported on Phantom Entertainment (nee Infinium Labs) and I though I’d check up on them as I haven’t seen the Lapboard reported on it a while. It’s seems they are still alive, though barely. After an initial rush of somewhat positive reviews in the media, the Lapboard seems well received by those it is targeting – online gamers who sit withing 10 ft of the TV. Definitely not a data-entry design, but apparently suitable for the target audience. Personally I’d like to see a few improvements to make it a bit more general purpose – say for those of us who’d use it for HTPC’s and big-screen web-surfing. YMMV. You can check it out yourself here.

Update: It’s always nice to get a response, and I got one from the Phantom CEO, John Landino (see comment below). I’ve edited the article to reflect some corrections he was gracious enough to share with me. The original subtitle was “still barely alive”, but after a year on Amazon they have over a dozen reviews, so being in business 4+ years and getting sold on Amazon amongst other places they are doing better than I thought.

Posted in Infinium | Leave a comment

Working with C++0X/C++11: Lambdas – part 2 – Scope Capture

Since a lambda is a local function defined with a scope (i.e. inside another function) it can have access to the same variables that are in that scope. This is where the capture-mode comes in. (Perversely, this prevents lambdas from working with templates, since templates have to be defined in a global scope.) The takeaway idea here is this;

Variables that are specified in the capture-clause are specified when the lambda is created. Think of these like values passed into the constructor of a functor.

Variables that are specified in the parameter-list are passed in as an argument – that is – when the lambda is called. Think of these as the parameters passed in with operator() of a functor. Thus you have the options of capturing state when the lambda is created (unique to lambdas) or when it is called (just like any other C++ function).

In addition to that, you have the option of passing parameters in by value or by reference, and either at declaration time (lambdas only) or invocation time (like any other C++ function). This is the power of lambdas, something that a lot of other languages don’t have – the ability for C++ lambdas to have effects on an outside scope.

This not only allows you to use lambdas as local functions, but also to create lambdas that encapsulate state. This is useful for creating closures – where a function accesses a variable outside it’s scope – something I’ll talk about in the next installment. For now, let’s cover the capture syntax and how it works.

Let’s go over some scope access samples

.
    // inside some function...
   int n = 5, m = 6; // we have some variables
   // let's define some lambdas
   []{ n; }; // error - no capture mode defined, can't access "n";
   [=]{ n; m; }; // OK - n & m are accessible by value
   [n](){ n; m; }; // error - n is accessible, m is not
   [=]{ n++; }; // error - n is const
   [&n]{ n++; }; // OK - n is passed by reference
   [=]() mutable { n++; }; // OK - parameters are mutable
.

Before we examine this in more detail, we first need to be able to execute the lambda. Remember a lambda is like a local function, so we have defined lambdas, but we need a way to invoke them whenever we want. You can invoke them in place by adding an parameter list after defining them, or you can get a function pointer to them and invoke them later on. Let’s do the latter;

.
    auto myLambda = []() throw() -> void {}(); 
.

So here we’re defining a pointer to our lambda function and we’re using the auto declaration since we don’t know or care what the exact declaration is. “myLambda” is the pointer to the function.

So let’s look at the last lambda statement from the previous sample in more detail and let’s give it a name, then we’ll call it a few times and see how the scoped variables behave.

.
    int n = 5, m=6
    auto myLambda = // capture it's address - we're getting a function pointer here
    // define the lambda
    [n,&m] // we capture n by value, m by reference
    () mutable  // no parameters are passed in & can modify non-ref variables locally
    {
	 n++; // post-increment
	 m++; // post-increment
    }; 

    // at this point n=5, m=6;
    myLambda(); // inside the lambda, both get incremented
    // at this point n=5, m=7;
    myLambda(); // inside the lambda, both get incremented
    // at this point n=5, m=8;
.

By default, the parameters passed in are const and can’t be modified in the lambda body. Thus the use of the mutable modifier. You can see how the capture-by-value & capture-by-reference syntax let us modify the local value or the scoped-one. While it’s nice to be able to create local function right where they are needed, I think the real power in lambdas lies in using them as closures, encapsulating (i.e. capturing and hiding) some bit of state for use later – using them this way is called a closure and will the the topic of my next C++0x blog.

Posted in C++0X/C++11, Code | Leave a comment

Working with C++0x/C++11: Lambdas – part 1- Syntax

Lambdas are new to C++0x and if you are familiar with functors then you already have a good idea of how lambdas can be used. Where lambdas really become useful (in my opinion) are allowing you to encapsulate behavior (as a local function) and encapsulate state (as closures). Once you get used to these ideas it gets easier and easier to see instances where you can simplify your code by using lambdas. But we need to crawl before we can walk so let’s start off with some basics. Lambdas in C++ add a lot of power over other language’s versions (Java and C#) because they allow you to not only capture state but to affect state as well. So let’s jump in. The simplest valid lambda expression is the following;

.
    []{}; // in some scope, not global. Valid C++0x code</code>
.

The [] is the lambda-introducer, which tells the compiler that a lambda expression is beginning. It’s also where you can specify the capture-clause, which is the kind of scope-capture you want to use as the default for the lambda. Here it’s empty, so there is no default scope. The {} is the compound-statement, which is the actual local function that you are defining, which uses the variables at the scope that the introducer defined or the parameters passed into the lambda. In this case it’s just an empty function.

There are a lot of modifiers for a lambda, and if you wanted to have all the bells and whistles specified you could write something like this;

.
    // the simplest lambda with all the parts exposed, also valid C++0x code
    [=]() mutable throw()-> void {}();
.

The [=] specifies that the default capture mode is by value. The default [] is to capture nothing. [&] means the default is capture by reference. The first ( ) specifies the parameter-declaration-list, which are the const pass-by-value variable and/or by-reference declarations. Since parameters that are pass-by-value are const, there’s an “mutable” keyword that undoes the const-ness of those parameters.

 
The second ( ) following the throw is the type of exception that this lambda can throw – the default is none. The -> is the return-type-clause, the default return is of type void. This is only necessary if the return type isn’t obvious. The { } defines an lambda body – in this case it’s an empty function.

The last parenthesis at the end are the actual parameters if you wanted to create an instance of the lambda and call it with those parameters. In other words this actually creates a lambda and calls it with those parameters. I just include it for completeness and to totally weird you out with the syntax. It’s legal but usually you’d see that in some stl container iterator implementation where you’re declaring and invoking the lambda in one go.

There are three basic parts to a lambda – the block that describes the scope of the various parameters, the block that describes the return signature of the lambda, and finally the actual compound statement that makes of the lambda body.

In actual use it’s a bit cleaner. Usually there will be the introducer with a capture clause and the compound statement, which is just the lambda (i.e. function) body. The capture scope is where you get a lot of the power of lambdas – plus a lot of opportunity to mess things up if you don’t understand scope capture. That’s what I’ll cover next time.

Posted in C++0X/C++11, Code | Leave a comment

Seamus Blackley to leave Creative Artists Agency

Seamus Blackley is leaving Creative Artists Agency after eight years. He’s reported to be planning to launch his own production company to develop games. Seamus was one of the original creators of the Xbox. While he was at CAA they negotiated deals for famous names like BioShock creative lead Ken Levine and Flower devs thatgamecompany, and helped ex-Infinity Ward heads Vince Zampella and Jason West get new gigs. Reuters recently ran an article about how CAA is thinking of opening a Silicon Valley office in order to be closer to some of the major tech firms.

Posted in Ex-Microsoft, Game Industry | Leave a comment