Light Painting

This video shows something of what I think one corner of our holographic future could actually look like:

The artist, Darren Pearson, makes the moving images in a rather work intensive manner.  He paints with light sticks in the air while the camera’s lens is open in a dark scene.  It takes 24 paintings to make one second of movie.  Ouch.

Presumably tools are coming along that will make it easier for us to paint in light.  That’s one of my hopes, anyway.

Learning Unity

So far, a certain behavior of mine has resulted in an increased refinement of my ability to use Unity.  The behavior is a mistake and I groan every time I realize I’ve done it again.  While following a tutorial or working on a project I will test the project by “playing” or debugging the game.  I’ll see something to change or start following the tutorial again and begin seamlessly modifying the game environment.  However, the game is still in debug mode and everything I’m doing will be lost when I exit debug mode.

Whilst following tutorials this can represent several minutes of steps.  I’m then faced with the dilemma: do I try to remember every detail of the past several minutes or do I just rewind and start over?  The compromise I’ve found is to try to recapitulate the sequence of steps based on an understanding of the arc of where it was all leading.  In one case, I had to start over.  I’d missed some unrecoverable detail that derailed the whole thing.  Otherwise, I’ve managed to slowly stumble my way back on track.

The benefit of this stupidity is that I’m stumbling back on track faster.  Mistakes can be training tools when we don’t fail to engage them.

Now, back to all that lost work…

In Gaiaian Defense: My First Game

First of all, I just came up with that name as I was forced to title the blog post.  I like it though, and I’m likely to keep it.  Not only is [in-guy-in] fun and easy to roll off the tongue, but I love the letter combination “ai” (it’s everywhere in there, forwards, backwards, and even palindromically) and I like the modern appropriations of the Greek Goddess Gaia as a sort of personification of the superorganism that is the living planet Earth.  I also like the juxtaposition of the personification of the global superorganism with all those “ai”s, like some sort of hieros gamos.

So, once I realized how prepared I actually was to create a game, and decided that I wanted to, I was of course faced with the next most obvious unknown: what kind of game do I wish to make.  I didn’t know, exactly.  Two things, however, I did know.  One positive and one negative.

Positively, I knew there is a prepackaged bunch of 3D trees and other terrain elements and textures that are free to use that I wanted to include in my game.  In fact, I have almost no graphical editing skills and that, probably more than anything else, is going to be my challenge in this whole process.

Negatively, I knew I didn’t want to make some kind of shooter game.

So, I had trees and shrubs but no guns.  What to make?

I’m still a parochially bound mind that plays out the same boring cultural patterns as everyone else.  Case in point,  I decided on a game in which “pests” attack a grove of trees and “friends” defend those trees.  So, as you can see, not a shooter, but still a conflict.  C’est la vie.

Here’s the initial game board concept:

game board concept

As soon as I had that on paper my imagination started simulating games and coming up with new options.

I really like one of the earliest ones I came up with: the Orchid Mantis.

The orchid mantis is a praying mantis that looks remarkably like a generic flower.  It is the only known case of an insect mimicking a flower.  It attracts insects that are attracted to flowers and eats them.  It’s like a super bug.  So, I figured, that the orchid mantis could be a cool super powerful “friend” against the “pests”.  But obviously, there’d be a limited number.  Games have to simulate scarcity.  God-mode is no fun.

The above is a specific example of a more generic thing that I am already loving about writing games.  In them, you can mix up all sorts of things that interest you and the fact that it is a game allows everything to be blended together with a custom-fit narrative.  A good game is one where the narrative is interesting and isn’t too much of a stretch.  Or that is one kind of good game, anyway.  As I said in the previous post, I don’t play games much, so I’m no expert.

I’m going to do a list style breakdown of various aspects of the game.  I’ll have to refine these bullet points and give them some organization as my game comes together.  For now, I’m satisfied with a hearty helping of higgledy piggledy:

  • Start only with level 1.  Level 1 will limit gameplay flexibility, which is convenient since I am limited in skill and don’t have complex gameplay in any case.
  • Pests come in waves and have types that are of various degrees of Pest-Strength
  • There can be up to ‘x’ friends on the board at one time.
  • The player initiates control over friends by “tabbing” between them like active form elements.
  • Once the player has control, the movement options of the friend light up and the player can choose a direction to move.
  • The player also has the option of performing an action at the current location, whatever the friend species is capable of
  • The player also has the option to initiate an attack against a pest within range of the active friend.
  • Friends, when not active, have a default kind of behavior that is pretty stupid, but will attack pests if they happen in range.
  • Pests have a default behavior that is optimized to be destructive, but can be toggled in difficulty (Easy, Medium, Hard, Etc)
  • The game becomes a sort of real time strategy game of the player toggling between friends to prioritize the destruction of pests.
  • The player is themselves represented by a penultimate tree (think Hometrees in Avatar)
  • The control the player takes over “friends” is represented by pulses of energy leaving the Player’s tree, traveling to the “friend”.
  • The player has “life” that is whittled down as pests make their way through the defenses and chomp on the player’s tree.
  • The player can only communicate to “friends” that are ‘y’ distance away and that distance dwindles as the player’s health is reduced.  This has the effect of narrowing the effective range of activity as the player is under active attack or has been under attack.
  • The player uses energy to communicate but can reroute that energy to heal.  Active friends cannot be controlled from as great a distance when energy is so rerouted.
  • The game is over when the player has lost all health or the level’s final wave of pests have been neutralized.
  • I will work on the following “friends” for level 1
    • Orchid Mantis
    • Ants
    • Bees
  • I will work on the following “pests” for level 1
    • Termites
    • Beetles
    • Wasps

There’re lots of details that I’m not clear on yet that I think are best approached as the thing takes form.

I’ve also got lots of ideas for later levels.  For instance,

  • I like the idea of adaptive gameplay in which the options available to the user increase in complexity as the user completes levels
  • I like the idea of introducing “worker” friends that are able to build infrastructure that increases the effectiveness of the “friends” defenses (becoming more like a RTS)
  • I like the idea of increasing the strength of the player, so that communication can increase in effective distance.
  • I like the idea of the player being able to prioritize their own strength increases by reducing the energy level put into defense, at the player’s own risk, of course.
  • I like the idea of allowing the player to advance the number of moves that they can queue up in a “friend” so that “friends” can begin to have more intelligent behaviors configured by the player so that they can be more autonomous.  As the player advances through the game, it is less about micromanaging particular “friends” and more about managing the “network” that is producing them.
  • Also allow the player to advance to the number and kinds of “attitudes” or “purposes” that can be assigned to “friends”.  This would allow different gameplay styles to organically (hehe) arise.
  • I like the idea of continually integrating the idea of changing the game’s purpose from destroying pests to designing sustainable networks of behavior by adjusting for pest side-effects and controlling pest populations while exploiting their strengths.
  • As the levels increase the types of threats could escalate.
  • The game could perhaps go the direction of social satire, morphing the pests into Oil companies, who, for instance, want to dump vast quantities of waste product in the Player’s beautiful landscape.  Aliens could swoop down.  Always appropriately outfitted “Friends of Gaia” would step up to bolster the planet’s chances.  The oil company level could have a sub level that takes place in a courtroom and involves “shooting down” impending dumps with “cease and desist” motions.  The oil companies could be made to look really sinister and perversely desirous of gratuitious destruction of the environment in spectacular ways.  Just a ‘for instance’ of one of the many directions a game like this could go.
  • Perhaps multiplayer could be supported such that one side controlled the “friends” and the other the “pests”.
  • It could also be much more of a game of life simulator, which also interests me much more than a social satire piece.

Now I’m going to go make the game.

Preamble to building a first game

It’s amazing how fast time flies when you’re having fun.  It’s already time to let the puppy out again.

I’m not actually a big game player, anymore.  That’s partially because there’s so much stuff I want to make and learn that I don’t have time for traditional games (I’d love it if learning were more gamified…).  And it’s partially because of repetitive stress injury from working with computers 12-16 hours a day as it is.  The last thing I want to do is play a game when it hurts to do so.

That said, as part of my Hololens initiative (it amuses me to use the word ‘initiative’), I decided I needed to learn Unity, a 3D environment for making games.

As I was playing around with the Kinect I realized that it really is only a partially realized device (probably meant to be paired with the Hololens from the beginning [and probably why it was included with the XBox from the start {because people would have bitched |but they did anyway <damned if you do and damned if you don’t>|}]).  The things I would want to do with it, can’t really be done out of the box.

For instance, if I wanted to create a runtime definable macro sign-language to associate with code expansions for use in my code editor of choice (visual studio) I could not at this time.  It’s probably possible, but I couldn’t in any direct sort of way.  Just like I described that there were steps necessary just to get my computer ready to develop the Kinect, there are steps necessary to get the Kinect into working order.

First of all, if I were to want to make such a Visual Studio plugin I would have to learn about writing Visual Studio plugins.  That’s a non-problem.  I hear it’s a somewhat tortuous process, but it’s not a real problem, that’s just knowledge acquisition, to be muscled through on a weekend.  I would also have to think of a way to get the Kinect to send messages to this plugin.  One way or another, that data pipeline would have to be established – ideally I could send very succinct messages back and forth between the editor and the Kinect code.

The Kinect code is what I’m really interested in (actually, that’s quite subordinate to the real goal and the coolness of a kinetic macro language), and specifically, the gesture recognition stuff.  But the fact is, out of the box, Kinect is not good enough for what I want.  It tracks three joints in the hand, four if you include the wrist.  Furthermore, it tracks them very poorly, IMO, and they jump around like Mexican jumping beans.  I could make something work over the top of that, but it probably wouldn’t help with RSI.  As far as I can see, any reliable complex gesture recognition from the Kinect with the provided SDK’s would require larger motions than are available from the fingers.  Larger motions translates into elbow and shoulder and that gets tiring quick.

Here’s an interesting article from Microsoft researches in China titled: Realtime and Robust Hand Tracking from Depth.  Apparently, good hand tracking along the generally recognized 26 degrees of freedom of motion of the human hand is a hard problem.  Nevertheless, they demonstrate that it has been done, including seemingly very accurate finger positioning.  And that is using inferior hardware to the Kinect and my computer.

I have some interesting intuitions of how to improve existing body tracking through a sort of geometric space of possible conformations as well as transitions between them (think finger position states and changes available to any particular state based on the reality of joint articulation, etc).  Ultimately, a body state would be maintained by a controller that understood likely body states and managed the transitions between states as indicated by the datastream keeping in mind the likelyhood, for instance, that the users leg is above their neck line.  I use that as an example because Kinect’s gesture recognizer very commonly puts my knee joints above the crown of my head when I’m sitting in a chair and moving my hand.  A body would be an integration of various body state controllers.  It would all have to be fleshed out (pun entirely intended).

Watching the demo in the linked article above got me into 3D modeling which led me to Unity.

Now that I’ve went through the Unity tutorials, I feel quite prepared to begin making a game.  I have to say that I am taking to Unity’s model of development like a fish to water.  GameObjects and Components are very intuitive to work with.  Seeing how easy it really is, I decided I’d make a game, even if game development in these sorts of traditional terms isn’t something that I intend to do a great deal.  I’ve got some catching up to do in terms of 3D math and geometric reasoning, but that stuff is fun when it is being learned in relation to problems that you encounter and need to solve to get to where you want to go.  That’s how math is best learned, IMHO. YMMV.

So, with all that, in my next post I’ll describe the initial plans for my first game.