Friday, April 06, 2007

Heading "Home"

So, after a long year in the wonderful working world of real life as a mature adult (or as mature and adult as making video games for a living can be), i am heading back to the old stomping grounds of Boulder, Colorado. It's going to be an interesting experience, and a much needed break from the increasing "grind" of mySims. Hopefully I will be able to recharge the ol' batteries in time for my triumphant return to Neverland...

Labels:

Sunday, March 25, 2007

Ps3 vs Wii : Film vs TV

My friend was recently COMPELLED to purchase that strange oddity, the Ps3. He furiously spouted many reasons for his decision, but I truly hope that he was able to convince himself more than he did me. His reasons were as follows:

1) backwards compatibility (he is worried, and rightly so, that sony will remove the emotion chip from the US ps3 systems as they have done for the European launch).

2) comprehensive console ownership (as a game developer, he feels it is his duty to own each console that is commercially available, so as to better understand the current video-game climate. It turns out that I happen to appreciate this reason, as it lead to the realization that I am currently elucidating).

3) blu-ray

Before I continue, let me follow a quick tangent and point out that "Play next-gen games" was not an entry on his list. When we left Best Buy with the towering, monolithic monstrocity (of the 60gb persuasion), he carried not a single ps3 game, cradling instead a piping-hot, last-gen copy of God of War II. This was meant to justify reason number 1 and provide the opportunity to see Kratos in gloriously upscaled, hdmi-driven glory.

Again, before I finally attend to my point, let me take a quick tangent. At GDC several weeks ago, I vidied Greg Costikyan receive the Maverick Award and deliver his acceptance speech. His words struck a nerve with me, and I would like to quote a quick tidbit for your consideration:

"A dozen years ago, in an article in Chris Crawford's Journal of Computer Game Design, I asked whether the new interactive medium of games would ultimately become, like the written word, one that illuminates and helps us understand our world, or like television, one of deratiocinated pabulum, to the detriment of our culture and intellectual life."

You can see the whole speech at Greg's blog here: http://www.costik.com/weblog/2007/03/maverick-acceptance-speech.html

He continued with the opinion that we are "not doing so hot." I tend to agree, and I would like to use the current console war as an exemplar of this QUALITY DIPOLE.

This leads us back to the point. I would like to slightly modify this comparison, however, by using Film as a substitute for the written word, not because I think that it is a better comparison, but because I think it is more relevant and applicable to contrast TV with Film than with literature. It also fits very snugly for other reasons, as you will see in a moment.

Now, some of you may point out that the medium of cinema doesn't fit for two reasons. First, movies have become increasingly stale and insubstantial of late. Second, that Film is no longer a good label, as digital methods have permeated that industry of late. Let me address both points: I agree completely. This is why I chose to use the word Film to describe that side of the dichotomy. When I say Film, I refer to movies back when they were one of the premier artistic offerings of our species. This is before the days of fancy digital effects and such a dearth of creativity that remakes are consistently the best option available to the public. This is back in the 50s-70s when Film was truly a medium to behold, when artists such as Orson Welles and Stanley Kubrick were teaching us what it means to be human.

So what I am talking about here is 2001 vs. Lost; Touch of Evil vs. Days of our Lives. This is the dichotomy that we are investigating, and this is the metric that we are going to try to apply to the medium of video-games.

Back to my friend and his Ps3. When we finally hooked the thing up (this was a few days later, mind you. Ps3s don't come with HDMI cables, and the only ones they had at Best Buy were the 100 dollar-per-3-feet-gold-plated-and-sanctified-by-god variety that marketing somehow sells to ignorant consumers), we were greeted by an extremely elegant, classy (and black!!! Woohooo!!!!) OS GUI. I should have expected this from sony based on my experiences with the ps2 and their black, particle-infused menus that apparently hover over a RESTLESS OCEAN. Nonetheless, I was surprised by the class that sony was offering up here. When the system first boots up, furthermore, the user is greeted with a fabric-like ribbon, a suave "Sony Computer Entertainment" logo, and a huge orchestral-soundscape moment that fills your room, reminding us of a logo of a major film studio before a particularly potent offering. When you move through the menu and highlight the currently-inserted disc, the entire screen changes into specialized skin, and some inspirational music from the game's score starts playing. This symbolizes Sony's attempt to bring a new kind of dignity to the medium, and it was apparent to me how important this effort was despite their previous blunders with the system.

Let's take a break for a moment and look at the Wii. Nintendo's simple console offers a very different view of the next-gen video gaming experience from the Ps3. The bright white menus with their large buttons and gaudy logos remind me of that toy with different animals around the rim that you point to to make different barn-yard sounds ("I call the Flinstone phone!"). What is really telling, however, is when you notice what Nintendo calls their organization system. These icons don't represent works of art, they represent "Channels." Each one is on an identical, regulation-size button. There is no noticeable difference between the "Wii Shop Channel" and "Zelda: Twilight Princess." Noticing anything here?

What we have here is a direct connection between these two different next-gen paradigms and the dichotomy that I am attempting to apply to our medium. With the Ps3, Sony is clearly saying "Games are serious, artistic masterpieces. When you turn on this system, you are enabling the cream of contemporary art to enter your living room." While I consider this to be fairly arrogant of Sony considering their ridiculous currently-available "next-gen" instances, this attitude is very much in line with my own thinking about the medium than that of the Wii.

With the Wii, its all simple, meaningless games and accessible, complacent artistry. Each is a channel, not artwork, which implies something about the commercial vision of the product as well as its intended significance. These are sound bytes, not speeches, and they are designed for the attention span of the MTV generation. If you don't wow us every 16 seconds, we change channels. The Wii doesn't mind, though, because there are 29 more channels where that came from. In 6 months time, there will be 30 more.

It seems clear that these two systems represent an EMPIRICAL TEST of the afore mentioned question: Will video-games, as a medium, walk the road of Film or TV; Style or Flash?

Before we get to the frightening conclusion of this point, let's first look at some player demographics. The Wii is, so far, the most universally accepted and successful video-game console on the planet. It has managed to achieve wide appeal and transcend the boundaries of the traditional "gamer." We, as gamers, enjoy these simple offerings such as Wii Sports, as they are fun, quick, and offer a break from the usual fare. We bring the Wii home over christmas, and, to our suprise, our parents and grandparents can dig these games also... wow. Next, we go to parties where "cool" people are engaged in "cool" activities such as drinking and beer pong... er... wait, are they playing a Wii? Yes, that's right, Wii Sports has even replaced traditional drinking games among this demographic, something I hardly considered possible a year ago. Is there anyone that the Wii can't please?

Well, to be honest, that person is me. Don't get me wrong. I develop for the Wii. I own a Wii. I play my Wii often (I understand that this is starting to sound dirty, but blame Nintendo. I am going to continue unabated). The bottom line, however, is that Wii games (so far) only provide what I would consider to be cheap thrills; gaming experiences that are neither rare or compelling. There is something extremely interesting about playing virtual golf in my living room, certainly, but am I learning anything or reflecting upon my own life while playing Wii Golf? No. The Wii, through its pop-culture leanings and TV-inspired organization, seems to cheapen what I consider to be the potential for a sacred experience. It can offer me entertainment, but it never takes things to the next level.

Now let's look at the player demographic for the Ps3. Most people who play Ps3 are... um... well, nobody. The largest demographic related to the Ps3 is that no one even owns one.

This seems to say a couple things about the medium. First, it seems to say, based on the direction that Sony and Nintendo decided upon, that Artistry and Popularity are mutually exclusive goals for gaming. Second, based on the resulting popularity of both systems, it seems that artistry and style do not sell; that substance and quality do not correlate to the public interest.

As a game developer, I believe that it IS possible to make games that have broad, mass-market appeal AND stay true to the medium as an art form; that this situation is more a product of specifics and timing rather than the overall direction and vision of the consoles. Nintendo struck a nerve with the Wii, but I think it is more related to the increasingly poor quality of Sony-type offerings over the years rather than the actual quality of the Wii titles. The Wii represents a breath of fresh air in a medium that has become a rather bloated and crusty case of devolution. These games hearken back to the days when a few developers could make an entire game and truly share a vision. These games are simple and fun, and they seem incredible when you compare them to the most recent iteration of The Wheel.

This does not mean that these Wii games are good. In fact, they are not.

The Ps3 IS a good system. The only problem is that they are deepening the same rathole within which we, as an industry, have been trapped. Blu-ray enables (i.e. FORCES) developers to create an obscene amount of content. If we have 50 gigs of space, by golly, we should use it. This represents seriously warped priorities, really, as it imposes design constraints based on what we MUST do, not what we can't do. Furthermore, we have SEVEN processors (well, 6, if you don't count the one that the OS controls... er... well, 5 if you don't count the one that can be stolen away from you at any moment... er.. well...). We are COMPELLED to use all of these resources, independent of whatever game design or message we are trying to convey through this technology. This leads to games that are completely bloated, unfocused, and, in most cases, utterly broken.

We, as game developers, realize that this situation is exactly that: situational. This dichotomy between Ps3 and Wii and the resulting popularity of the Wii system is due to a great many factors, none of which, I would argue, involves the specific paradigm of either system. Yes, the Wii embraces the pop-culture, TV model. Yes, the Ps3 tends to ignore you and stand aloof, almost announcing "You aren't good enough to purchase me" to prospective customers. However, these are just execution details, and they are not married to the paradigm.

The problem is that the Game Publisher CEOs of the world don't see it this way. All they see is trends and dollar signs. The Wii eschews art in favor of entertainment and sells bajillions of units to people who don't usually buy any of our product. The Ps3 stylishly pushes the gaming envelope, and no one seems interested. This is a very simple circumstance and leads to obvious future decisions: From now on, all the money is going to the TV side of video-games ("You do not know the POWER of the dark side!").

This realization, which I have known for some time, deeply troubles me. I know what the future of this medium could become, but I worry for the well-being of us all when the trends seem to favor glitz over quality so strongly.

In the end, the only thing we can do, as game developers, is try to push the medium forward with all of our offerings, no matter what system we release on. If you release on the Ps3 (or 360, for that matter), pay special attention to the needs of the more casual players. Make your learning curves shallower, and make your GUI and controls more intuitive. Similarly, if you are developing for the Wii, pay special attention to the needs of the more hardcore gamers. Try to come up with systems that are both simple and intricate; easy to understand yet emergent (This is what we are trying to do with mySims, and I am quite confident that we are going to be successful).

If we don't succeed, the Ps3 will be the last system that inherently treats this medium from an artistic perspecive, presenting our products as such to the consumer. The "big wigs" will destroy the last vestiges of passion and substance in our industry, and we will go the route of TV, cheapening ourselves with each passing year. We need to convince the people holding the money that they will get greater return on their investment if they treat the medium with respect, and we do this by treating our own games with respect. Sony can't tell the players what to think about us. We need to validate their stylish menu with the experience that follows after clicking that button. Otherwise, we might as well get jobs writing for Lost.

-Max

Fulcrums for the Mind

I am going to start using this blog more as a muse on the nature of video game design and production rather than an investigation of fractal concepts. Note that I will most likely continue to mention fractals here and there, as I feel strongly that the nature of fractals is inextricably linked to game theory.

As our little game progresses (mySims for those who don't know what I am working on), we are starting to see some very profound developments in terms of overall message and theme. I was having some interesting discussion with our lead designer about the nature of feedback from a game system and the unique educational possibilities that emerge from the unique relationship between player and game. Here is what I believe to be an important excerpt from that conversation:

"I think games have the power to be compelling and enlightening beyond the point of anyone’s wildest expectations. “Karma” is an extremely sublime concept, but it is true and real and exists in a very real sense, on a personal, societal, and universal level.

Real life karma comes in a few flavors, depending on how spiritual you are willing to go, but, at the most grounded, personal level, it exists as an internal pressure that comes from inherent recognition of morality in our choices. When we do bad things (destructive, chaotic), it poisons us from the inside, making us feel worse about ourselves and further disconnecting us from future choices (I have a theory that all chain-reactions are either positive or negative feedback loops. True self-regulation is generally temporary). This has the effect of introducing additional chaos and decay into our lives. On the other hand, when we do good things (constructive, orderly), it enforces order internally as well, which increases our ability (and, I would argue, tendency) to maintain balance and further refine the structure of our thinking.

This is what interests me as a game developer. If I can produce art which both increases people’s ability AND tendency to create and order their environment, I can affect the order of reality as a whole far beyond my small physical limits as one human being. Thus we can use games as a FULCRUM to multiply the power of our minds.

If we make games that act as caricature for karma, we can help people to realize the intricate, interlocking system of dependency that is their daily existence. Through this illustration, we can introduce the realization that not only do choices matter, but that 1) the nature of choice is deeply entwined with the fabric of reality and 2) even the simplest of choices can affect massive change throughout the system."

What I am getting at here is, basically, that games are in a unique position to act as a mirror for a player. Think back to Ender's fantasy game. That game acted at once as a playmate and counselor, providing fun experiences each packed full of intense purpose and significance. Art in other mediums can be profound, but it is always static with respect to its viewer. Considering that choice is such a significant element of our existence as human beings, very few forms of art really have the ability to reflect the potency and duality of a dilemma. Because of the unique nature of the medium of interactive video games, we DO have the ability to reflect this significance. In games, we have unique methods to present the player with his/her own dilemma, and then show the aftermath of changes and evolution of states that follows.

Using dilemmas, game developers can truly illustrate existence without predisposition. Instead of warning against the dangers or extolling the virtues of a specific choice, we can instead show the very nature of choice itself, and provide more of a TEMPLATE for thinking rather than a library of example data. This is the difference between a flight manual and a simulation.

-Max


Labels:

Wednesday, May 03, 2006

Variable Delta Brownian-Bezier-Splines: Fun... in Motion!

Welcome to my VDb-b-splines (the extra b is for byob!)

These shots are made by taking a brownian path and making a b-spline out of it for various levels of resolution (or various values for delta t).

The shots are in order of increasing resolution: Enjoy!




Friday, April 28, 2006

Shhhh..... It's a Secret!


Here is a rendering of a project that I am working on. I am not ready to be talking about it yet, as it might end up being important and highly valuable. You can draw your own conclusions about what you see here.

All I am going to say is what is already available to observant web-browsers. This shot is titled floorplan_fractal1...

Monday, April 17, 2006

Brownian Rain

WOOOOOOOOOOOOHOOOOO!

this is good stuff...
I call it "Brownian Rain," and its going to get better soon. More on this to come as I noodle with it, but so far so good. This is 100 little brownian particles going nuts from random spots around the origin. I want it to spawn around the camera so you are engulfed in them like rain...


Here is a newer variation. The particles spawn all around the camera and have random lifespans. The darker lines are the paths of near-dead particles.

Wow so I just took this idea and ran with it. Here is some more stuff based on the same concept.

These ones are made by introducing a small bias into the randomness so that a particular direction is favored. You can easily see the progression of movement from the particle well (the pointy end) along the bias vector.

I think this is the high point of the website so far. I am quite pleased with these renderings. Keep in mind that all of these renderings were produced with the same algorithm across different instances and with some variable tweaking. This is definitely some of my best work.

Sorry, I am getting a bit excited. There are lots of applications for something like this, though, and it is really fast to compute cause there is basically no computation. The original ball is still the king though.
Ok, then i was thinking, why not add gravitation to the system? I did and this is what it looks like. The particles all start far away from eachother and gradually are sucked together.

So next I had to try something even weirder. I started the particles close together, added in the bias, and adjusted gravitation to the point where the particles gradually start to reach escape velocity. The resulting rendering is a 3D image of what a timeline of the big bang might have looked like. At first its a singularity, but it cannot sustain that level of energy and particles start to seep off its event horizon... ...Then again, it also looks like a piece of celery.

Thoughts on the Future of Gaming


the majority of this post was originally a comment that I left on my friend Namaste's blog. To see the whole conversation, go to http://namaste.soylentsoft.net/2006/04/01/future-game-design-methods/

So the topic is the direction of game design and emergent systems. Namaste's proposition is that increases in computer speed are allowing for more and more emergence in contemporary games, but also that a game designer can embrace emergence in his/her outlook from the beginning. Namaste uses the example of Will Wright's philosophy towards the upcoming game Spore and how he used a rapid prototyping model instead of the more traditional "2 years of whiteboarding" approach.

The idea is that you can get emergence from the rules of the system, but you can also get emergence through a more elastic, dynamic creation of the system in the first place. If you approach the problem with an open mind and some imagination, a designer can actually encourage emergence.

Scott Cronce told me that EA can afford to produce two “risk games” each year. These “risk games” are defined as games that do not closely follow the archetype established by a previously successful archetypal game. Spore is one of those games.

What is really interesting is this: the only reason that EA can afford to gamble on 2 high risk ventures per year is that they produce so many bland, lifeless rehashes. Not that these games are bad, in fact I believe that the vast majority of EA games are in the “good” category, they are just unimaginitive. For those of us that highly value imaginitive games (which Luke, Namaste, and myself certainly consider ourselves to be), this means that we can get what we want (spore) but only as long as the people who dont value imaginitive games (see anyone who obsessively plays counterstrike) also get what they want.

It is only because there are millions and millions of people paying 50 dollars for a coat of new paint on Madden each year that Spore exists in the first place.

Make whatever you will of this situation, but I see it as a good stepping-stone towards the time when virtually all gamers have seen the light and when game companies can make only great, original, high-quality games (and I believe that this is EA's long term philosophy also). If game companies can get enough creative games out the door, I believe that a paradigm shift will take place. Eventually, after playing many games like Oblivion, the public will refuse to pay so much for the next version of Madden. It certainly doesnt cost as much to produce Madden ‘06 as it does to produce Oblivion, yet they cost the same.

Only truly ignorant gamers (read 99% of the gaming population of Earth) will continue to pay more for less. Eventually, even a process as slow as natural selection will run its course.

Projection: Either we have a speciation of gamers into Homo-sapiens and Neo-sapiens, or we convince all those who play mediocre games every day to get a clue. I think the movie industry is going through the same growing pains right now. We are smarter, though, cause it took them nearly a century to figure it out


Imagine that you came up with this great experimental game idea that would most definitely produce emergent behavior. You work on one version with 10 million dollars and you produce an amazing skeleton of goodness. You ship it out there or zap it to the nets, and people eat it up. It's good stuff and everyone is in to it.

Now go back in time and imagine if you started the same project with 200 million dollars. You could develop the same code and then, at the very least, buy a boatload of supercomputers and a small building to put them in. You set up your system on the computers and let it run for half a year, THEN you release it. With the extra manpower that you could afford on the side, you could probably complete the whole process in the same amount of time.

The amount of content that would be produced with the second model would be exponentially larger than the original. People would have a ridiculously huge would to explore right from the getgo. When you come into the world, it is fully formed for the most part. You can create your works and then you die, but you dont start out in a void, or a nearly blank canvas. Now, I agree that there could be an amazing design that did start with a blank canvas on purpose, and it could still be a mode in the second version, but you would also have the other crazy computer-rendered world there for those who wanted to explore it.

I think the projects that you are working on will eventually lead there, as I hope mine will, but what we hope for is a SYNTHESIS of the two. The games industry is massive, and it can easily support a full cornucopia of ridiculous games in only a few years. If we can get the major studios and the major funding sources towards the good stuff, then we win. Gamers everywhere win, and the payoff will be big-time.

I hope your goal is to create the stuff at the beginning, but work towards something larger, something bigger than what exists elsewhere. To do something like that you need people. Our civilization is what makes us strong, and if you get a bunch of brilliant artists together the result is magic.

Wednesday, April 12, 2006

Brownian Motion: the Drunken Amnesiac Particle

UPDATE: Luke Palmer helped me fix the problem, and now the distribution looks uniform!
The above rendering is with the new code, which replaced the old code below.

We learned about Brownian motion in fractal class today, so I programmed up a little guy to run around drunkenly, and I taught him to drop breadcrumbs so that I could see where he went. The result is quite beautiful, even though the fundamental basis of the rendering is totally "random," meaning the directions of the steps are taken from a random seed.

*UPDATE*: I was falling asleep last night, when the thought struck me that I should show the path of the particle as opposed to a cloud of points. It seems so *$%#&ing obvious to me now that I can't imagine how I didnt think of it this way to begin with. After I implemented the path trace (see above rendering), I thought back to my CAGD class (Computer-Aided Geometric Design) and remembered b-splines. The idea of a b-spline is to extend a Bezier curve into a long "frankenstein" curve that is a concatenation (and combination) of any number of Bezier curves into one composite curve, which is defined by the control points and a sequence of knots which define the time spent in each portion of the curve (which basically means "how fast the particle is moving through the various sections of the curve"). This technique is used extensively in computer animation, for example Pixar films. The animators use a b-spline to trace the path of an object through the virtual world, like a ufo flying through space, and the knot sequence determines the acceleration and speed of the ship through the various turns, twists, and straights.

If I have some time, and if I can get my head around it, I will try to turn the path of the particle into a sequence of control points for a b-spline. The knot sequence wouldnt be too important for this application, but to ensure that the curve is as smooth as possible, they should be uniformely spaced through the middle, one per control point, and a multiplicity of two or three on the endpoints. The end result of this method would be a nice, pretty, smooth curve that represented the particle's path as opposed to the sharp, geometric, computerized form that it has currently.

Also, I think that it would be a closer approximation of actual brownian motion, because I would be treating my collection of points as a sample instead of a population. The b-spline would approximate what the particles actual path might have been, since in reality the particle's path would be continuous (at least) through its second derivative (not sure about this... any math people want to comment or correct me or give a specific explanation?). If I used the b-spline technique, it would be C2 and G2 continuous, which mean, *basically* (look them up for more detailed info), that the curve is continuous on its first and second derivatives through all junctions.

*END UPDATE*

************2ND UPDATE*****************

Brownian Motion in full continuous glory! I used the path samples as control points and formed a uniform cubic b-spline! Now the particle appears to actually fly through the air in a somewhat realistic way. The laws of physics are no longer put on hold!

Here is the equation that I used for you b-spline junkies:

vec result= (1.0f/6.0f) * (pow((1-t), 3) * p[3] + (3 * pow(t, 3) - 6 * pow(t, 2) + 4) * p[2] + (-3 * pow(t, 3) + 3 * pow(t, 2) + 3 * t+1) * p[1] + pow(t, 3) * p[0]);

Where p[0], p[1], p[2], p[3] are current and previous 3 points. p[0] is the current point, p[1] is i-1, and so forth, and t is a parameter that ranges across [0, 1] by increments. In these renderings, I used an increment of 0.05 to get 20 piecewise chunks for each curve segment. As t goes from 0->1, the curve from p[1] to p[0] is traced using the information of the previous points to maintain continuity.

This is a very basic b-spline equation but it does the trick. If you want to see a more palatable (but less functional) representation of this equation, go to wikipedia and search for "cubic b-splines" or just "b-splines."

Here are some renderings: DONT CLICK ON THEM FOR A CLOSER LOOK! because of the smoothness of the curve, there are some major aliasing problems resulting from blogger's compression. The best way to view these renderings is the way they look here on the page.

note: although it appears that there are some cusps, keep in mind that these are fully 3d particle path traces, and if viewed from a different angle, the cusps are all revealed to be tight loops.

***********end 2ND UPDATE********************




The code I am posting should be completely executable (if you set up an opengl window), and providing you write a function called randrange(float min, float max), which returns a random floating point number between the two boundaries.

Note: I still cant post code properly for some reason, even when i use the tags that they say should work online. I have changed the line that keeps getting chopped out with psuedocode. This is the best solution i could come up with. sorry.

[code]
class brown
{
public:
vec position;//mean

float range; //"variance"

int stepcount;

bool live;

vec varray[2000000];
int varray_cursor;

brown()
{
position=vec();//(0,0,0)
range=100;
stepcount=0;
live=true;

varray_cursor=0;

srand(time(NULL));
}


float randrange(float min, float max)
{
return float(rand()) / RAND_MAX * (max - min) + min;
}


step()
{
vec direction;

direction.x=randrange(-1, 1);
direction.y=randrange(-1, 1);
direction.z=randrange(-1, 1);

direction=(~direction)/10.0f;

int count=1;
//pseudocode
for(int i=0; i less than range; i++)
//end pseudocode
{
if(((int)randrange(0, 1000))%2==0)
count++;
}

direction*=count;

position+=direction;


varray[varray_cursor].x=position.x;
varray[varray_cursor].y=position.y;
varray[varray_cursor].z=position.z;
varray[varray_cursor+1].x=position.x;
varray[varray_cursor+1].y=position.y;
varray[varray_cursor+1].z=position.z+2.0f;
varray_cursor+=2;
}

tick()
{
if(live)
step();
if(stepcount>=1000000)
live=false;

draw();
}


void draw()
{
glColor3f(1, 0, 0);
glEnableClientState(GL_VERTEX_ARRAY);

glVertexPointer(3, GL_FLOAT, sizeof(vec), &varray[0].x);
glDrawArrays(GL_LINES, 0, varray_cursor*2);
}

};

[/code]


By changing the variable "prob", the "width" of the drunken particle's path is increased or decreased, which accounts for the difference between the crack above and the nebulous cloud below. The closer prob is to -1, the thicker the cloud. The closer prob is to 1, the narrower the cloud. (note: the code no longer works this way. Luke pointed out that there is an inherent bias towards the negative in computer representations of numbers, so the code has been changed to a x%2=0 binary selection where x is a random number. The steps can be as long as 100, but it is insanely unlikely. This represents a somewhat reasonable probability structure, but not a bell curve. This is more like a gravity well than a bell curve.)



Clearly something is broken here. I would expect the particle to wander more aimlessly than it does. It seems as if either x, y, or z is biased towards a single direction. It is not completely locked in that direction, as can be seen if you watch the particle in motion (which will go in seemingly random directions on a local scale), but there is a definite large scale trend as if the particle is actually trying to get somewhere, despite constantly forgetting where it is and where it came from.

(This is no longer broken, as can be seen at the top of the post. It looked interesting when it was broken anyway, though, so it stays up).

Monday, April 10, 2006

The Vision Beyond the Darkness

What do you see when you fall backwards out of the back of your head?

John enters a world where no one seems to recognize him.

A dark haze seems to block his view. Bright flashes break through the darkness, but only to blind him. Debris blows everywhere, getting in his eyes, and he searches desperately for his handkerchief. Old friends fly by, waving as they pass.

Then, the darkness.

A great deep void presses in around him as he struggles to maintain his identity.
Friends become shades and phantoms, grasping at the edges of his soul, pulling loose threads until the fabric starts to fray.

Shaking violently to keep the specters from tearing him apart, he runs in random directions as fast as he can. The shadows cling to his legs and arms like smoke, and wisps of dust trail away from his extremities through the dead vacuum of the place.

Eventually he spies a shining thread off in the distance. He runs faster.

When he reaches it, he is amazed to find that it really was just a thread, and that it had seemed no larger from hundreds of meters in the distance than it did now. It was finer than a hair, and it glowed so brightly that John had to take his eyes from it after a couple of seconds. Keeping it in his peripheral vision, he reached his finger slowly towards the glowing strand.

He touched it ever so gently.

It pulled in response to his touch. "Come with me, follow me, come here, I need you," it seemed to say. It called to him, begged him, and he finally relented. He grabbed it quickly and firmly, and he pulled.

As the thread came loose from whatever had been holding it there in space, it began to form a small tear. As John pulled more and more of it out, it started weaving itself into the frayed patches of his body where the shadow had threatened to devour him. It made him whole.

And yet, as soon as he was done, he was gone.

Monday, March 27, 2006

Crackpot Photographs Truman Again


(The title of this post is a line from the emmy award winning futurama episode "Roswell that Ends Well," and it is the headline of a newspaper article that contains a photograph that a conspiracy nut took of president truman. The picture looks like a few lights in the sky, similar to some of the fake ufo pictures of the 20th century.)

ok, so as per the instructions from professor Taylor, I tried to get some renderings of the julia set. I used the formula f(z, c)=+-sqrt(z-c), which actually got a little complicated when i realized that i had to program some complex arithmatic and square roots also! Luckily, Wikipedia exists, and i was able to get a formula for taking the square root of a complex number. Here it is: http://en.wikipedia.org/wiki/Square_root#Square_roots_of_negative_and_complex_numbers
\sqrt{x+iy} = \sqrt{\frac{\left|x+iy\right| + x}{2}} \pm i \sqrt{\frac{\left|x+iy\right| - x}{2}}
(from wikipedia)

also, the magnitude of a complex number |x+iy| is simply sqrt(x^2 + y^2).

In this way, we get another complex number when the square root is taken. Actually, we get two of them, which is how the points are collected.

You start at a point (which i initially did as (0, 0) but that didnt go anywhere) and send it through this process until you have a million points (literally). Then we draw and it looks like the above picture.

The point that i started with for the title rendering was (1+0i) and the c was (1-1.5i).

The point that i started with for the first rendering below was 1+1i, and the c that i used was 0.2+2i.




The last rendering here was with c as 0+0i. I was under the impression that I should get a circle of sorts. I am not sure why it is this squiggly line instead.

Saturday, March 18, 2006

It's a cliche, butter spreads nicely on 3D Mandelbrot


Thats right, you heard me. I am talking about almond-bread, not Benoît Mandelbrot, a French mathematician (wikipedia if you want to find out about him).

Anyway, yummy breakfast plans aside, I worked on doing some plotting of the Mandelbrot set fractal while eating a bagel with cream cheese (the American equivalent to the German mandelbrot and Nutella®).

this is a function f(x, y) which returns a value, which I treat as the height on a heightmap.

(YAY i figured out how to post code!! i will put some code in my earlier posts for those who are interested)

[code]

double mandelize(float x, float y, int max)
{

double x1, y1, xx, xmin, xmax, ymin, ymax = 0.0;

double xperc=x/(float(max));
double yperc=y/(float(max));

int looper = 0;

//this here determines where on the set the view is focused. Right now, this is a zoom on a //region of the set which produced the below renderings
xmin = -0.487f;
ymin = -0.629f;
xmax = -0.486f;
ymax = -0.630f;

x = xmin + xperc*(xmax-xmin);
y = ymin + yperc*(ymax-ymin);
x1=0;
y1=0;
xx=0;
looper = 0;

//this loop keeps track of how long it takes for the function to grow both x and y.
//whenever the distance from the coordinates to the origin becomes larger than 2,
//the loop exits. If this doesnt happen before the counter reaches 200, then the point
//is considered to be an element contained in the mandelbrot set at this resolution
while(looper < xx =" (x1" y1 =" 2" x1 =" xx;" xperc =" looper" val =" (xperc" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/6686/2189/400/Mandelbrot3DZoom2.jpg" alt="" border="0">

The technique that i used to display the terrain is an iterative detailing technique. I start with a square (this represents the viewing area) which is made of 4 triangles. Then we test the shared vertexes and see if there is a large disparity between the values of nearby points. If the difference is great enough, we "break" the triangle in question in two. This is done everywhere where it is necessary up to a certain maximum depth which is a constant that represents the resolution of the rendering.

Without further discussion, here are some more renderings of a zoomed region of the mandelbrot set (in 3D).

Friday, March 17, 2006

Tie the proverbial knot using math!



I worked on creating a sort of fractal sequence by using two simple transformations: First, I started with a single tetrahedron in space. and I rotate it by a random amount about a random angle. Next, I transform it a small amount outwards to create a long strip of tetrahedrons. This sequence creates the sea urchin look of the thing above.

To make this thing move, I rotate the first tetrahedron in a chain by a tiny amount, then the next, then the next, each time maintaining the coordinate system that the previous rotation created. When done each frame, this causes the tentacles to "curl" inwards, and the severity of the angle and its direction determine how quickly and in which orientation this curling plays out. Here is a series of screens that illustrate the transformation (the coloring is just for effect).


The order of the original structure (even though there is some randomness to how it is shaped) is quickly turned into a chaotic mass of tentacles that curled quickly, eminating grasping tentacles that curled slowly. Thus we have chaos from order!

Monday, March 06, 2006

The "Diet Coke" of random. Just one calorie... not random enough!


Randomness. What is it and who needs it? I think life would be more fun if it made sense! Everything should happen exactly as it is supposed to, no excuses. If I call heads, heads it is.

How droll.

sigh. Now I am bored. I wish things would surprise me for once...

But, even though I am bored, I want to be able to have some sense of what is supposed to happen so I can sleep at night. Therefore, I am going to say that the universe is deterministic. I don't believe in luck, and everything is just falling.

I havent ever read up on quantum mechanics either...

Once we get into the realm of the really really, quite ludicrously small things, it becomes hard to maintain that point of view. One of the most classic examples of a random number is the flip of a coin, and this method of producing a random number relies entirely on quantum mechanics.

See, when the coin is fired up into the air, it rotates around, reaches its pinnacle, then plummets downward for a crazy impact. The moment of that impact is completely unpredictable, and here is why: The deflection of the coin is based on the collision of opposing negative forces of what are essentially electron probability clouds. Because the electrons of the floor and the electrons of the coin are moving at nearly the speed of light, the exact position of the forces that determine the angle and force of deflection will be unique and unpredictable (two important properties of randomness). Furthermore, the coin flip depends on human factors like the velocity and direction of the flip, or possibly sweaty hands, and cannot be accurately described using mathematics.

Now lets consider how we generate a random number on a computer. We use a recursive equation that will spit out a stream of seemingly unrelated numbers when initialized with a seed. The trick is that the seed must be a random number for the sequence to be random*. What we have then is a random number generator that requires a primer of an initial random number to get it rolling. Seems a bit silly, really... if we can already generate a random number, then why would we be trying to generate a random number?

The answer is that there is one pretty decent random number that we always have available, and it is the same mechanism that drives the randomness of the coin flip. The heart of the coin flip was the uniqueness of that particular moment when the coin hits the ground. That freezeframe in time was the random engine. Indeed, that spontaneous instant when you decide to let go of the coin is the force behind the randomness. In computers, it is the exact instant in which the random number generator is initialized that determines the sequence. So the force behind the random number is again, in a way, the spontaneity of your decision to run the program.

In the end, we use our own absurd brains and weird fuzzy logic to break free of the order of a computer to find the chaos that is required to get a truly random number. *Granted, it can be argued that the numbers that computers generate are not random in the same sense as the flip of a coin, but is the flip of a coin random in the same way as rock-paper-scissors?

In rock-paper-scissors, again the random mechanism is slighly different but it returns to the spontaneous instant. There is still a 50% chance of either outcome, but it is based entirely on the whimsical fancy of 2 humans; not on literal quantum collisions but on the interactions of quantum-level software encoded in the brain's neural network.

So what is random? it seems like every random event has its own flavor. I mentioned three examples of "random numbers." Each is determined by a different mechanism, yet each seems valid in different ways, and that is the magic of the random.

I say randomness IS the spontaneousness itself. Its the shifting passions and tides of reality and the urges that make us yell out "rock!" or double click on a program right now instead of now. Maybe that is why a computer will never understand a true random number. They need human beings and our absurd nature to supply that extra kick of random flavor.

mmmmm.... sweet random flavor. Life is good when you don't know what hit you.

Floating like a Flea
I live only where I don't
You cannot find me

-random haiku

Sunday, February 19, 2006

Gainful Employment



Three cheers! Electronic Arts wants yours truly to join the team and make games!

I suppose my college education was worthwhile after all...

more info to come!

Wednesday, February 15, 2006

contraction fractal


I finally had a chance to check out the contraction toy that we were taught in class last week. The idea here is that we use an affine map to tranform points in the unit square repeatedly. The transformation matrix that we are using is [0.5 0.5]
[0 0.5]
There are two transformations that are done on the pointsT1 is simply the above transformation matrix. T2 is the above transformation matrix combined with a translation of [0 1] transpose. I started with the 4 corner points of the unit square and did both transformations on each to get 8 points, then again to get 16 points, and so on. When i had a decent number of points in my bag, I draw them. I am still playing around with this stuff, too, so expect more screenshots and discussion. I may not even have these renderings right. They look strange...

Sunday, February 05, 2006

Back to Basics: Return to Sanity?


So, all those renderings that I posted for the attractor fractals before were "wrong." They are something, and they might be interesting, but they are not renderings of the actual attractor set. After clearing up the math with Professor Taylor, I produced the following renders of the set that is created by this function f(x, y):

f(xn, yn)=(yn-1*xn-1*(1-xn-1), yn-1)

or

vect f(vect v)
{
vect result;
result.x=v.y*v.x*(1-v.x);
result.y=v.y;
return result;
}

Points are collected and drawn starting at a certain value (at which point we hope that the point is approaching the set), such as 995-1000 for the wide shots and up to 1,999,995-2,000,000 for the focus shots. The increment of y on this shot is (ranging from 3.0-4.0) is 0.0001.
Here is a zoom on the portion of the graph where y is between 5.575 and 5.5759. The increment was at 0.0001.
The detail is not high enough to make out the structures clearly, so I decreased the increment to 0.000001 to achieve the next few shots and set the n limit to 2,000,000. It took several minutes to calculate the points before they were rendered at this level of detail.

There is still instability in the system, even at this high level of iteration, which blows my mind. You can tell this due to the peppering of seemingly uniformly distributed points that clouds the structure of the image. If the system were converging faster, there would be more empty space like in the original image.