Saturday, November 15, 2008

Surrealism

In an effort to get back to why I started working in digital in the first place, I set out to do some surrealist drawings. My intention in working with a computer was to get it to do the same kind of surreal work that I did long before my return to art education.

Needless to say, I got sidetracked.

Surrealist drawings

It's almost like the opposite of programming. This work is free and mindless, whereas working with a computer is intensely cerebral and structured.

The next game of mine to be released uses the Logo style path language I blogged about before. If I applied this path behaviour as thrust on particles instead of walking a line, I might have beginnings of how to teach the computer my particular drawing language.

Timeline of Internet Memes
The Daily WTF
Rat Brain Neural Network
Super Mario - wall climbing level (idea research)
Theo Jansen creates new creatures (TED Talk)
EA Cancels Tiberium article (and ensuing bitching in the comments)
Real Life Tron on an Apple IIgs
Lost and Found (short film)
Emmanuel Guibert\'s drawing technique
Keith Schacht & Zach Kaplan: Products (and toys) from the future (TED Talk)
The McCollough Effect
Fold It (protein folding science game)
Robokill (polished flash game)
A Series of Letters to the First Girl I Ever Fingered

SWFBridge AS2 to AS3 communication
Adding a fullscreen option to the context menu in AS3
Regex Tester
Regex Advice (forum)
Adobe Documentation on Regex Groups
Flex Documentation on Regex
How to poach an egg

Tuesday, November 04, 2008

Bomba

I've made a mouse avoider.

Bomba

I made it immediately after Final Ninja in the heat of a small office in summer with no air con. May God have mercy on my soul.

Saturday, August 23, 2008

Compression Depression

At work I've been coming up with a new method of managing monsters by giving them a Logo style script. It's a list of letters followed by numbers. The real tough part was nesting scripts within each other so I can have monsters spawn other monsters. This is tough because I have the new script in between brackets and regex can't do a balanced search. It's okay to spawn one monster, but what if that monster wants to spawn as well?

The solution was to match the deepest spawn that wasn't spawning itself and work back from there. I store that in an array, then replace it with a marker to that point in the array:

var path_string:String = "a bunch of commands go here"
// spawn commands look like: S(monster commands)
const SPAWN_COMMANDS:RegExp = /(?<=S \()[^\(\)]*(?=\))/;
const SPAWN_COMMANDS_REPLACE:RegExp = /S \([^\(\)]*\)/;
var subroutines:Array = new Array();

if (subroutines.length == 0){
// extract spawn instructions and replace with an index to the subroutine list
// matching works from the deepest nest up as the parenthesis is replaced
do{
var spawn:Array = path_string.match(SPAWN_COMMANDS);
if(spawn != null) subroutines = subroutines.concat(spawn);
path_string = path_string.replace(SPAWN_COMMANDS_REPLACE, "S "+(sub_index++));
} while (spawn != null);
}

I then give each spawn a reference to the subroutine array, which means I only have to parse subroutines once and I save on memory. Even if the parent monster is erased, the reference by the spawn to the subroutine array saves it from being garbage collected.

The crazy thing is that the first spawn command will get replaced with "S 1". If I'm wise to this when I write a monster's script, I can type "S 1" any where in the script and it will call that subroutine. Even inside the first spawn's own script. This means my monsters can recursively generate.

All well and good. But now I have a massive XML full of instructions for every monster. Chris Burt-Brown at work had already opted for an RLE compression method that I've also adopted (multiples of the same item you replace with a quantifier and the item), but this isn't enough for complicated instruction sets. Looking around I found an LZW compression algorithm in AS2. It even produces XML safe output! Problem solved right? Wrong. My level editor uses a javascript method to save the XML that I cribbed from Galasoft. That method only saves ANSI encoded text files. The LZW algorithm produces UTF-8 encoded output. Saving those strings as ANSI destroys all the data. I was lucky enough to find out that Mozilla browsers have the ability save XML with the XMLSerializer method in UTF-8. There's a thread on the topic here. A quick mod to the Galasoft script and I was home free.

Now if I could figure out how to operate FZip, then I could take the operation further and get more assets within the game packed down to size.

Self Aware Robots (TED talk)
Simplicity Patterns (TED talk)
Big Buck Bunny (Blender made cartoon)
Curved electronic eye created
Double Taker (Golan Levin)
A robot with a biological brain

Alternativa 3D for Flash
AS3 Mouse Gesture class

Thursday, July 24, 2008

Final Ninja

I'm quite pleased with this one and I hope people enjoy it:

Final Ninja

It started out as a sort of cross between the Dirk Valentine and Dangle engines. Then on the way to pick up my usual lunchtime Thai noodles the ninja theme suggested to me that he should be able to turn invisible as well. This is also my first project in AS3. The most tricky part of the transition is that they've completely buggered up animation control in AS3. Having complex nested animations is no longer possible due to gotoAndStop being processed at the end of a frame. I've also not noticed the fabled speed increase everyone is speaking of (and even in Processing I was a total speed whore). It is however refreshing to know when I'm being a bad programmer, and you can trick AS3 into behaving like AS2 when you need to.

Saturday, May 31, 2008

Ogre

Well I finally got Ogre to compile. Bugger knows how I'm going to graft Openframeworks libraries into it. I only really need sound and the VideoGrabber, but those are still tall orders.

If you want to play with Ogre on a PC you'll need the following:

Visual Studio 9. Trying to get it to work with Code Blocks is more trouble than it's worth, especially as it breaks Openframeworks when you get the bare minimum working. Plus VS9 is pretty damn good. I'm amazed that Microsoft made it.
The Ogre SDK
DirectX Runtime

Then you'll want to read the following:

Installing the Ogre SDK
Setting up an application. No the Ogre Application Wizard doesn't work on VS9. This means we have to do some twiddling with project settings to get it to work. But despite this being a pain, it teaches you how to set up projects properly and will help you in the long run.
My thread in the Ogre Forum about trying to get VC9 to compile Ogre. I didn't quite read the instructions in the previous link thoroughly, but those instructions also assumed some knowledge I didn't have. Most of the difficulty of getting Ogre to compile is down to correct project settings and correct file placement. So you have to use your initiative a little to figure it out. Now I'm at the following stage:

Ogre Tutorials

I'm going to settle in to this stuff now to put off the nightmare that combining Ogre and Openframeworks will be.

Bruce Sterling on the future of interaction design
Magic Pen
Artificial Stupidity
Fruit Mystery game
Cat with Bow Golf game
Floating Head
The Control Master (a Run Wrake film)
Metal Gear Solid 4 game play demo

C++ optimisation strategies
Processing for Javascript

As a side note I got a new phone recently. So I downloaded the latest Mobile Processing and spent one Sunday writing a new and more clever game of Snake vs the Computer for it. It uses the new A* algorithm I built and shows the Snake's thoughts about which path to take ahead of it.

Snake AI 2

Wednesday, May 21, 2008

Knuckleheads

Well. This is a weird one. Certainly an experimental system.

Knuckleheads

The trouble with this game is that basically moving was so difficult that it was hard to put any challenges in the game without making it bloody impossible.

Progress with C++ is slow but fruitfull. I've managed to port the basics of my Processing breakout project over and bloody hell is it fast. I'm now trying to get Ogre to work. I looked at OpenSceneGraph but the set up instructions are incomprehensible and the forum is in Chinese. Seeing as I have enough trouble getting a Hello World out of C++ with out spending a few hours picking the brains of a forum on how to do it, I doubt I'm going to get any where with that one.

Thursday, April 24, 2008

Snotput

We've made a snot flinging game.

Snot Put

Amazing the things you can do with verlet integration and a chain of springs.