Virtual Worlds

I have a certain fascination with virtual worlds. I guess it stems from spending so much damn time in my head as a child, and once I got the internet, too much time role playing online. Perhaps most interesting to me is how virtual worlds have significant events that can affect the real world. Cracked has an interesting article ‘The biggest dick moves in online gaming history’, which contain a number of great examples of how our virtual worlds tend to spill over into the real world. Oftentimes the overlap between the two worlds create some very powerful moments. The most interesting and powerful to me are virtual worlds from earlier times. Perhaps I am merely looking back on history through rose-colored glasses, but the games those earlier games seemed to have a world that the players believed in more strongly than the current crop of MMOs. I suspect this is in part due to the lesser amount of players in those days (Koster’s Law), and also that, at that time, virtual worlds were a new, separate place.

These earlier worlds had a number of fascinating revelations take place for both the inhabitants and researchers of the worlds that we take for granted today. Both
A Rape in Cyberspace and A Story About a Tree exemplify people being amazed at the incredible power of the virtual worlds to affect those who inhabit them. Today it is no surprise when we hear about a couple first meeting through World of Warcraft, or a teen girl being bullied through the ‘Virtual World’ of Facebook.

I gather that what we have seen in the past decades years is a gradual merging of the virtual and real, such that events are no longer separate. Thus, a report on a virtual world is never about the virtual world anymore, but about the the real world and its virtual component. The characters within the virtual world are no longer seen as separate, but one-and-the-same as the players playing them. Years ago, I would have found this idea incredibly exciting. “Yes”, I would think, “finally the real and the fictional have combined together into a whole.” But now I feel a bit nostalgic for the day when virtual worlds were viewed as separate entities. Almost as uncharted lands to explore.

Looking for inspiration in all the animation

Every so often I come across a bit of animation that seems to capture a bit of awesome playfulness. I ran across this awesome piece of animation the other day, and the clouds reminded me of the clouds/smoke that seb_ly showed off in his creative JS workshop. So, taking cards from both of their hats, I have made a bit of a fun ‘cloud shaping’ tool.

Its mostly just a particle system. The only addition is that it accepts a bit of input looking for collisions within a radius of the mouse pointer, and then adds the pointer’s velocity to the particle.

Next time I think I will explore some blob physics to make those clouds clump together. Until then, I hope you have some fun with it.

L-systems

A few weeks ago I developed an interest in generative art. This was primarily from my desire to follow in the path of a number of great Flash developers whose art tools were both amazing and inspiring. My search lead me to the generative art wiki, which while sparse, is certainly a good starting place for such things. One page in particular caught my eye: l-systems. These systems can be used to create some very complex and interesting simulations of plants & other abstract visuals (which I discovered quite by accident).

For the full (highly mathematical (and incredibly difficult for me to grok)) breakdown, I would direct you to The Algorithmic Beauty of Plants, which is about a decade and a half old, but still appears to be a great introduction to the subject. Here I will present my own work with l-systems in Actionscript 3 and Flash.

The (extremely) basic concept of an l-system is to generate progressively more complex strings given a start point and a set of transformations (called ‘productions’ or ‘production rules’). Anytime a rule is matched, the character is replaced with the characters from the rule. If no rule is matched, the character is copied into the new string unchanged. For example, an l-system may have a starting string of “A”, and a production rule of “A => BAB”. The first iteration of l-system will be “A”, the second “BAB”, the third “BBABB”, and so on.

(A quick note on the replacement: don’t do what I did and just run a quick stringReplace on each rule & iteration. It has to be done per character, especially as the rules get more complex. That isn’t to say the string replace produces some interesting results…)

In order to create something graphical, the production rules are linked up to a ‘turtle’ with each character affecting the movement of the drawing pointer. The ‘vocabulary’ of the rules is slightly extended in order to allow more complex actions. A basic 2D turtle uses the set of characters ‘F[]+-’.

  • F: move forward by a set amount
  • [: save turtle state (position, line size, heaving, etc)
  • ]: Pop the last turtle state off the stack, and reset turtle to that state
  • +/-: Rotate the turtle left or right by a set amount

Other letters may also be added into the vocabulary to be replaced by production rules later on. The first letter typically used is ‘X’.

So, taking a cue from the generative art wiki, a simple system may be defined by these rules:
w: X
p1: X → F[+X]F[-X]+X
p2: F → FF

and would result in

n = 0; X
n = 1; F[+X]F[-X]+X
n = 2; FF[+F[+X]F[-X]+X]FF[-F[+X]F[-X]+X]+F[+X]F[-X]+X

with a graphical representation similar to:

This should be enough to get going. For more information, I highly reccommend “The Algorithmic Beauty of Plants” mentioned earlier.

In addition, I made a little Flash example that randomizes some of the production rules. It creates some interesting results, though not as full-bodied as I would like.

Generative Foliage

I have been working on my own bit of generative art recently, but I wanted to gather a number of the pieces that have served as inspiration for my own work into one place and share them (and perhaps keep them updated as I find more).

First there are these that I have recently run across:
Matthew Cooley’s HTML5 tree. Love the colors.
Daniel Brown’s BBC Bloom Flower. Amazing 3D.
Daniel Brown’s On growth and form. Love it, perhaps my ultimate goal.

Perhaps most important to my work is Grant Skinner’s Sakura, Tree, Elm. These are the experiments that lead me to try my own hand at tree generation. Luckily, Grant explains his approach here.

I have decided to make things a bit more difficult on myself, and have approached the foliage generation with an L-system implementation.

Trainification

I picked up Don’t Shoot the Dog the other day from Wolf Park. It was a fascinating read that has inspired me to return to training my dogs (and perhaps one day some fish).

As I progressed through the book, I couldn’t help reflect upon Raph Koster’s work, A Theory of Fun for Game Design. It has been some time since I last read it, and I am guilty of having paraphrased it incorrectly before, but the (very) general message of the book boils down to “fun is using a skill to accomplish some task”. Its a bit more complex than that, but that should do for comparison.

What made Don’t Shoot the Dog so interesting was that Karen Pryor wrote of the training being ‘fun’ for the animal as it accomplished the goals set out for it by the trainer. The animal was, in effect, playing a game and having the exact same type of fun that Koster refers to in his book: using or developing a skill in order to achieve a goal. There are other points in the book that are similar to key concepts in game design, such as reward spacing. Pryor emphasizes that rewards should be given quite liberally early on during training, should be linked as closely to the desired action as possible, and rewards should be decreased or given for more complex actions as time progresses. This type of reward structure is very similar to how a good game works. For an example, go to kongregate.com (or any other casual flash games site) and play through a few games. Even better, load up a level-based MMO. You’ll find early rewards & tips throughout many of the games, with decreased payout as the game gets tougher.

I’m sure this is not really anything new to game designers (though if it is, perhaps its time to start training dogs). Perhaps most interesting to me is just how similar our minds are to animals, and how easily ‘hacked’ they can be when one uses a reward system that is strongly linked to a desired action. I think this is what gets people when they listen to Jesse Schell’s talk on games invading real life. When one listens to his speech, it can quickly become disgusting as he plays that Mario coin noise for every ‘good’ action someone takes in his world of the future. One thinks to themselves “There is no way I could be so easily taken in by a few ‘points’ “. But just as Karen Pryor can get ‘untrainable’ professionals to do the most ridiculous tasks with just a few words pointing in them in the right direction, companies and other individuals can control our actions with just the right encouragement.

This concept shouldn’t create fear in an individual. Instead, it should just serve as a reminder for one to live an ‘examined life’, and think about why are they doing what they are doing. Knowing that rewards are a huge incentive for one’s actions should allow an introspective individual to analyze more deeply the causes of their actions, and perhaps even tweaks those rewards to influence their life in the direction they wish to progress.

My final point of this analogy is that this whole concept of ‘gamification’, the buzzword du jour, could be considered stale and well-researched. I argue that anyone seeking a gamification expert should find the best animal trainer they can find, and put them to work ‘shaping’ their target audience to their desired action. Trainers, get out your clickers…