25 December 2009

Merry Christmas

'Tis the season for complainers, blah-blah blah-blah blah, blah-blah blah blah!
And anti-Christmastime campaigners, blah-blah blah-blah blah, blah-blah blah blah!
'Tis the season to dig trenches, blah-blah-blah, blah-blah-blah, blah blah blah!
So let's all be pedants and grinches, blah-blah blah-blah blah, blah-blah blah blah!

Enough with the War on Christmas, people!

I'm fond of saying that people who look at the world as though it's black and white see it as twice as complicated as it really is, because it is in fact grey. There's good and bad (and the smooth gradient in between) in all things, but people tend to make snap decisions and sweeping declarations, tossing things into either the "good" box or the "bad" box.

This kind of an outlook may seem at first blush to be a handy way to simplify your life, but as it turns out it really serves to overcomplicate it. Like the proverbial donkey with two equally tasty bales of hay, any time you come across something sufficiently "grey" and difficult to categorise, the decision of which box to chuck it in becomes needlessly stessful.

Christmas is one of those things that's pretty darn grey. For atheists like me, it's annoying because it's full of religious symbols. For many Christians, it's annoying because of its pagan roots. And for just about anybody the blatant consumerism is nauseating, but on the other hand who's gonna knock family and good food?

For me, though, Christmastime has, on balance, more good than bad. It's mostly because I love the time of year - if I'd grown up in the southern hemisphere, I might feel completely differently about it - but it's also partially because I dig the whole style of Christmas. Sure, it's superficial and cloying, but just like fast food and amusement parks, there's something about its particular brand of decadence that makes my brain scream "yes" louder than it screams "no", though scream "no" it does.

I like the general buzz of excitement and purpose. I like the excuse to watch "Ernest Saves Christmas", or listen to Weird Al's "Christmas at Ground Zero". I like the grounding effect it has on the year, the timekeeping effect it has on your life. The sights, sounds, and smells that come with each cycle trigger memories and emotions from passed days that might have never bubbled to surface if each year were totally different, stripped of the rhythm of Christmastime.

Granted, anything could fill the same role. There are plenty of other cultural holidays, some artificial, others not, and weakly irritating parodical celebrations like Squidmas. But similarly, any other combination of sounds and letters could subsume the role of the word "coatrack" - but doesn't "coatrack" already do the trick?. The point is that Christmas - for me, and millions of others - already does fill this role, and fighting against it seems like pointless windmilling, with just a touch of unbecoming self-importance.

But during this time of year, when everyone could otherwise be enjoying their acknowledgedly crass and superficial holidays, the "grinches" come out of the woodwork, whining about how offensive Christmas is and how everybody is terrible for wishing them a Merry Christmas.

Offensive? Offensive? There is no cosmic law that says you should be specially exempt from being offended. In fact, to be regularly offended might do a body good. Regardless of that, though, how much of an arrogant prude must someone be to be offended by how someone else chooses to enjoy themselves?

At the risk of complaining as much as the complainers I'm complaining about, I thought I'd briefly bring up this article by Sarah Miller. It's a real doozy, containing not just fluff-headed thinking, but trite observations and contradictions. These are the kind of dead reindeer points the pedants like to drag out and flog every year, and one does get tired of them. (Do bear in mind, though, that the article is written in the voice of the Grinch himself, and likely intended to be humourous. Don't take it or my retorts too seriously.)

How many times do I have to hear “Merry Christmas!” in my lifetime? How many times will I have to respond with “happy holidays” before people realize that not everyone is celebrating their holiday with them? Isn’t it a bit egotistical to assume that everyone else is ALSO celebrating Christmas? I find it super rude. Especially for those who are celebrating Hanukkah and Kwanzaa at this time of year. And funny no one wishes me a happy Raam Navami...

To put it into perspective, American Muslims don’t go around wishing EVERYONE “happy Ramadan” every year. Why? Because they know that not everyone in America is celebrating Ramadan with them. So why do Christians, or those celebrating Christmas, assume that everyone else is playing along with them? Weird.

What a kind spirit! Taking offence to someone wishing you well. Is that Jacob Marley's chains I hear rattling in the distance? What a world we have to live in, where a person has to fear uttering pleasantries! If someone did wish me a happy Ramadan, well, what of it? Happy Life Day to them!

There’s also the reality that the “Christmas tree” is associated historically with paganism and several other traditions but gained popularity in the U.S. and UK during Queen Victoria’s reign mid 18th century. As it turns out, it is a fairly new holiday association.


We all know there was a St. Nick who lived once. ... I like the guy. But...my point is, he doesn’t actually belong with Christmas at all. Call me a Puritan, but he’s not Christmas. And besides, you’re lyin’ to the kids and that ain’t cool.

People do love to point to all the Christmas traditions that are recent adaptations, as if that somehow makes them less "pure". Your head wasn't always a part of your body, either. Surely that is warrant enough to part you from it? Traditions are just that - traditions. Who the hell cares if Santa Claus or Baby Jesus are recent additions? It's like the infuriating grammar pedants who seem to think that language is our master, not our servant, that dictionaries antecede usage, and that the "misuse" of the word "hopefully" should be punishable with a flogging. We do not follow Christmas tradition - Christmas tradition follows us.

As a non-Christian and non- religious (but extremely spiritual) Being, I take offense to much of these customs that are seemingly forced upon us during this time of year.


Let’s first point out that Christ wasn’t a Christian- he was Jew. Secondly, I’m all for celebrating Christs’ day of birth except for one small thing: he wasn’t actually born in December. In fact, he was born sometime closer to spring. The Christians actually disguised their celebrations under the auspices of Solstice (a considerably “Pagan” holiday by some standards) in order to avoid persecution.

I find an alarming number (even one would be an alarming number) of non-religious people knocking Christmas for its pagan origins. Why should that not be a good thing in their eyes? Have they lived in a predominately Christian society for so long that "pagan" remains a stinging invective? I would have taken it as a compliment.

It’s disgusting. Kill nature. Then decorate it. Then throw it away. Oh so American! I am obviously not pro-killing trees for decoration. Tree farms? Still a bad idea.

Tree farms are "still a bad idea"? (am I the only one who hates, "yeah, but still..." arguments?) Next they're gonna start complaining about all those poor tomatoes we kill to make soup and ketchup. Oh, the humanity!

There are important things to be said about the excesses and imbalances of Christmas. Shopping centre stampedes and flagrant expenditure of fossil fuels are terrible things that should be taken seriously. But no one is going to listen to these important issues when they are surrounded by silly boring complaints about inflatable Santas and the premature commencement of caroling.

Have a good Boxing Day - and like it! (Gee, I hope I haven't offended any Americans...)

24 December 2009


I love sloppy, mouse-drawn web comics. So I made one of my own: !Science (say "Bang Science").

Don't expect them often.

22 December 2009

Meme Cloud Special: Misfits of Science

I was born in the tail end of the 80's, so I missed experiencing most of them firsthand. However, through the magic of reruns and VHS, my childhood could still benefit from large doses of 80's TV, movies, cartoons, and music videos. I've come out the other side with an undying love for all things that capture that glittering 80's style.

Indiana Jones, Die Hard, Duck Tales, NES games, Phantasy Star, Men Without Hats, MacGyver, Infosoc - the whole decade was made out of awesome (which, in case you've ever wondered what unprocessed awesome looks like as it occurs in nature, it looks a lot like this).

But there is one 80's TV series in particular that I wish to discuss here - "Misfits of Science". I've just spent the last couple of months working with fellow 80's nut, ThirdBass, constructing a fansite dedicated to the show, Science of Misfits. I must hasten to add that I merely tidied up the HTML and offered a few suggestions - the brilliant retro design, content, and hours of research were Bass's hard work.

I love so many things about the show: the rocking music selections; the humour, which is often content to slip by in the background or in expertly written cross-wise conversations; the comraderie of the characters, and the coolness of their superpowers; the fact that the show remains about the characters, and not about their superpowers; and of course, Johnny B, whose red guitar, super speed, signature colour blue, and wariness of water bear a passing resemblance to another one of my favourite characters. ;P

I could go on about the show itself, but you don't need to hear my trap flapping. Bolt on down to Science of Misfits and check it out for yourself - and if it doesn't put a smile on your face, you have a cold, cold, blackened heart.

13 December 2009

Sonic Extractor 3&K Mix Update Alert!

Just a minor update to Sonic Extractor 3&K Mix, to version 1.2. It now has the ability to view the original Sonic 3 alone object layouts.

Sonic 3 and Sonic & Knuckles were originally intended to be one epic 32 megabit cartridge (according to Yuji Naka), but the game was split in half, and the first few levels were released early as Sonic 3.

By the time Sonic & Knuckles was released, Sonic Team felt like making a few changes to the zone layouts. When Sonic & Knuckles is locked on to Sonic 3, the 6 zones from Sonic 3 are tweaked a bit - sometimes for general ease of play, other times specifically for Knuckles and his new abilities.

Unfortunately, the object layout data for these two games, locked together or not, is read directly from the ROM, not the RAM. Therefore, Sonic Extractor, which uses savestates to map the zones, has to already know the object layout data. It's built in to the programme, and can't be changed.

This was a problem, though, when trying to map Sonic 3 alone levels with the unrevised object layouts. No matter what state you used, Sonic Extractor would blithely fill the level using the modified Sonic & Knuckles object data!

Version 1.2 corrects this problem. The user is now given a choice which version of the zone to view. Now anyone with a taste for minutiae can export both versions of each zone, and get a comprehensive comparison of the changes for the first time!

08 December 2009

Code of the Ninja: Sinusoidal Motion

If you haven't already, read the Code of the Ninja: Introduction

Welcome, Code Ninjas!

This time we'll be looking at a simple script that makes certain motions look more natural.

Imagine you have a platform that you'd like to move back and forth, a common element in platformer games. You might use code something like this:

Create Event:

r = 64;//maximum distance in pixels the platform may travel from its origin before reversing direction

s = 1/32;//speed of the platforms. The divisor is how many steps you wish the platform to take to reach its maximum distance from its origin.

Step Event:

if a //moving forward...
  p += s;
  if p >= 1 { p = 1; a = 0; }
else //...and moving back
  p -= s;
  if p <= 0 { p = 0; a = 1; }

x = xstart + r*p;//update platform's position
xspeed = x-xprevious;//get platform's speed in pixels

(Note: If this code seems a little overcomplicated, it is because it had been purposefully written to be able to make platforms of any speed and range.)

This effect that this code achieves is a platform that moves away from its starting point at the specified speed, reaches its maximum distance, and then immediately reverses direction and trots back to repeat the process indefinitely. This is the sort of platform you'll often see in early 8- and 16-bit games.

The trouble with this kind of motion is the immediate reversal of motion. In one step, the platform can be moving with a speed of +5 pixels, and the in the next, with a speed of -5 pixels. This doesn't look very realistic, because in reality, most often when something reverses direction, it has to slow down to a halt, and then begin to accelerate again.

This jerky motion isn't so bad if the platform's "patrol area" is bounded by walls at its extremes - then it just looks like the platform is bouncing off of the walls, and the motion doesn't look too bad. But if the platform is floating in mid-air, as they often are, there is nothing that appears to plausibly reverse it, and the motion looks unnatural.

And it's worse than just looking unpleasant. It actually makes the game less fair, and less fun. If the player can't tell by some visual cue when the platform is going to decide to turn around, they have a much harder time getting the proper timing on their jump. They will have to use more trial and error, watching the platform make its rounds more than once before they can confidently make their move.

This is almost game-breaking if you want to keep good flow, as in a Sonic game. In the Sonic the Hedgehog games for the Mega Drive (Genesis), almost all platforms not bounded by walls move with a natural motion - decelerating as they reach their extremes, and accelerating toward their point of origin as they turn back around. This allows players to intuit exactly where the platform will be any time when they first come across it, without patient study of its entire cycle. This is one of the subtler points about the Sonic the Hedgehog game, seldom recognised, but it contributes not insignificantly to the sense of speed that made them popular.

Well then, how can we achieve the same effect so that our platforms move with a natural motion, rather than an outdated, unrealistic, and unfair jerky one? Why, with the trusty cosine function, of course!

Imagine, now, a platform that - instead of moving simply up and down, or left and right - moves in a complete circle, as many do in Sonic and Mario games. The platform's speed should be uniform, but if we were to look at just one component of its velocity - say, just the xspeed, or just the yspeed - we would notice acceleration and retardation of its speed. Simply imagine looking at the platform's circular path edge on, instead of face on. It would appear to be moving in a straight line, but slowing down at the edges and speeding up in the middle, just like those Sonic platforms we want to emulate.

So, in effect, what we want to do is make the platform move in a circle - just a really flat circle that might as well be a line. We'd use code something like this:

Create Event:

r = 64;//maximum distance in pixels the platform may travel from its origin before reversing direction (radius of the circle)

s = 180/32;//speed of the platforms. The divisor is how many steps you wish the platform to take to reach its maximum distance from its origin. (This time we use 180, not 1, because we'll be using degrees.)

Step Event:

a += s;
if a >= 360 a -= 360;
//alternatively the preceding two lines could be 'a = (a+s) mod 360;'.

//also, here we don't need to use two states, forward and back, because the circular motion takes care of that for us automatically.

x = xstart + r*cos(degtorad(a));//update platform's position
xspeed = x-xprevious;//get platform's speed in pixels

To make the platform move vertically, we can just replace all the references to x and make them y. Or, to make it actually move in a perceptible circle, we can have both sets of lines. By using a different range value for both x and y, you can squash the circle into any sort of ellipse you want - for example, a circle that is twice as wide as it is tall:

Create Event:

xr = 64;
yr = 32;

Step Event:


x = xstart + xr*cos(degtorad(a)); xspeed = x-xprevious;
y = ystart - yr*sin(degtorad(a)); yspeed = y-yprevious;

Remember to subtract the sine for y, and add the cosine for x, otherwise instead of moving circularly, it'll just move in a smooth diagonal - which is actually another useful effect you might want to achieve.

Well, that about does it for platforms, but the power of sinusoidal motion goes far beyond. There are other applications, and for just such an example, I'll use the purpose for which I first I needed it myself.

In games like Phantasy Star, when you talk to townsfolk or shopkeepers, their dialogue appears on the screen inside of bordered window, or a 'text box'. In most games, the text boxes appear on the screen gradually, either opening up, dropping down, or fading in.

I wanted this animation to appear smoother, so I thought perhaps I could apply sinusoidal motion as the solution. But there was a slight hitch.

Imagine you want to fade in a window, from an alpha of 0 (invisible) to an alpha of 1 (fully opaque). You could simply add 0.1 for ten steps, but that wouldn't look very smooth. How about, instead, we use a sine function.


step = 18;

for {a=0;a<=180;a+=step}
  alpha = sin(degtorad(a));

Well, clearly this won't work. The value of alpha will go from 0 (the sine of angle 0), accelerate toward 1 (the sine of angle 90) and decelerate back to 0 again (the sine of angle 180). The text box wouldn't fade in, it would fade in and back out again just as quickly! This obviously isn't what we want.

But why not just use 90, instead of 180, so that alpha will stop at 1, thereby fading the text box in how we want it? Well, in that case, the fade would start smoothly, but stop abruptly. I wanted it to both start and stop smoothly.

I needed some way to have the alpha value "move" like a half-circle (slow start and stop), but only "traverse" a quarter-circle (start at 0 and end at 1).

So I made a script, called it 'sinusoidal()', and this is the function I used:


//argument0: any value between 0 and 1

return (cos(degtorad(180-(180*argument0)))+1)/2;

Now, sinusoidal motion can be employed anywhere by calling the script. The text box fade code ends up looking something like this:


step = 0.1;

for {a=0;a<=1;a+=step}
  alpha = sinusoidal(a);

This little script can be very versatile. You can use it to slide logos or menus onto the screen. You could use for flashing lights for smoother look. You could use it to animate a pendulum. You could even use it to make your character push a block (as Link does in the Zelda games) with a less abrupt and better looking motion. And with clever modification, who knows to what ends a Code Ninja might put it to.

For an example GMK illustrating the difference between normal and sinusoidal motion in several types of movement and animation (flashing, shrinking, swinging, sliding), click here.

Next time we'll be looking deeper into text boxes - how to make the text type out, change the text speed, and more. Until then, happy coding, Code Ninjas, and happy holidays, too!

If you use my code or scripts in your game or engine, no credit is necessary. But I'd love to hear about your project if you do! Just drop me a comment below, or e-mail me at us.mercurysilver@gmail.com

16 November 2009


One of my favourite subjects is etymology. I was reading the dictionary recently, and came across a little tidbit that caught my fancy, and I thought I'd share it.


1. impulsive tendency: a tendency to sudden impulsive decisions or changes of mind
2. sudden change or action: a sudden unexpected action or change of mind
3. whim: a sudden idea, impulsive decision, or change of mind

Well, it's not too far a stretch to describe Sonic the Hedgehog, especially as the modern Sega portrays him, to on occasion be taken by caprice. So I was amused to read the etymology:

[Mid-17th century. Via French from Italian capriccio, literally "head with hair standing on end," from capo "head" (from Latin caput) and riccio "hedgehog" (from Latin (h)ericius)...]

Encarta ® World English Dictionary © & (P) 1998-2004 Microsoft Corporation. All rights reserved.

So, someone who is capricious is literally "hedgehog headed". It's a funny language we speak!

14 November 2009

Game Review: Sonic Boom

There's a new hack on the Sonic scene - Sonic Boom. It's been three years in the making, the brainchild of snkenjoi and iojnekns, with music by Tweaker and a host of others. It's not finished - it's only a single zone demo, but it's a big release for the community and deserves a full review.

The first thing I did after firing it up was to check out the Sound Test. I was met by a bevy of expertedly ported songs, mostly from the Megaman X Series, and a kickass (if a little wandering) original composition by Tweaker. The best of all, though, has to be the 16-bit versions of the "Sonic Boom" vocal tracks from the North American Sonic CD sountrack. Both the intro and outro versions are included, and they simply shine.

Then I returned to the intro to check out the game itself. I have to lodge a minor complaint here about the two options on the intro screen, though. Since there are only two, there is no way to tell which is highlighted and which is not - like all those bad DVD menus we have to struggle with. I would have assumed the lighter colour to be the selected item, but it wasn't. Furthermore, since the game remembers where you left the "cursor", and I wasn't expecting this, I went straight back to the Sound Test by accident when trying to start the game. I'll let this slide, though, since the finished version will most likely have more than two options here.

Now for the game - or rather, the zone: Power Plant Zone.

First, the art:

I have to be honest here and say that I'm disappointed by the visuals. The foreground art is nice enough, and so is the background art - but together they create a colour scheme I'm not sure works at all. It's generally not a good idea to have all three primary colours in the same scheme, and the addition of both bright whites and dark greys doesn't help matters.

Sonic's sprites are slightly better, but I have a few beefs with them, as well. For one, I think he's too dark, especially for the dark background of the zone. Also, I've never been a fan of the green eyes. On the more technical side of things: because he faces away from you when he takes damage, and he remains facing straight ahead (instead of looking at you) when he enters his waiting animation, he loses some of the expressiveness, and therefore appeal, that the original Sonic had. A distant, uninterested looking Sonic with low contrast in the eyes and face can throw a pall over the whole thing, breaking your connection with the character on the screen, and thereby your engagement in the game. This is why I've always preferred the Sonic 1/CD style sprites to the Sonic 3&K ones. I'm not advocating replacing Sonic Boom's sprites with Sonic 1's - I like the fact that they're different - but I do think that he needs to be a little more expressive and attitudinous. Also, the raised arms in the springing animation look retarded, but that rounds out my criticisms for the sprites. To end on a positive note, I like the way the kicking animations look, and the combination of Advance style sprites with the classic set is clever and rather seamlessly executed.

The bosses look absolutely fantastic, though. The shading is very well done, but of course they're perfectly round, so we'll just have to wait and see if later, more complex bosses come out as nice.

And now, the gameplay:

One of the first things to be learned about Sonic Boom is that there are new moves for Sonic to perform. And unlike a lot of hacks, you'll be needing - and in fact, wanting - to use them.

The Super Peel Out and Spindash have been included, which is pretty standard, but also pretty nice, and Sonic now has a double jump (much like the Electric Shield affords him in Sonic 3&K, only it takes him higher).

Then there is a class of moves that require Rings to perform. Sonic can shoot straight downward by pressing Down after jumping, which costs one Ring. This is a cool move, related to the Bounce from Sonic Advance 2 and Sonic Adventure 2, only without the rebound at the end. I like it, but I'm annoyed that it only takes a press of the D-pad. This causes it to happen accidentally, which is never good when trying to clear a pit of spikes. I would like it a lot more if you had to hold down and press A, B, or C.

Rounding out the Ring consuming moves are two types of Air Kick. One sends Sonic flying horizontally, costing 5 Rings, and dealing damage to enemies. The other is much like the first, only it sends Sonic diagonally towards the floor, and costs but 2 Rings. The great thing about this downward kick is that Sonic hits the ground running at close to top speed. It is a much more satisfying way of gaining speed than the Spindash or Super Peel Out, as long as you can spare the Rings.

Incidentally, I had envisioned a downward kick as a way to gain speed long ago, so I'm happy to see someone finally using a similar idea. I had come up with it because of Sonic Chaos. In Sonic Chaos, Sonic can do the Strike Dash (which is much like the Super Peel Out, only he is briefly invulnerable as he launches). Tails can Fly, but in order to make Sonic and Tails have similar controls, he must now hold Up and press the button to do so. This sucks (mainly because he can only start to fly from a standstill), but the idea of making Sonic and Tails perform their iconic abilities in the same way was intriguing. In Sonic 3&K, both Tails and Knuckles do their special abilities by jumping and pressing the button a second time. Sega had to give Sonic a comparable ability, and introduced the Insta-Shield. Now, some people don't give a fig for the Insta-Shield (I like it though), and one might want Sonic to have a more speed-oriented ability anyway. So I thought the Super Peel Out could be redesigned as an aerial ability, like Tails' and Knuckles', and that led to the speed-gathering dropkick idea.

Anyway, the move works very well and makes the game fun to play. Which brings me to the level layout. The layout is a strong point. It reminds me of the best speed levels from Sonic 2 and 3&K, like Chemical Plant or Flying Battery, and I suppose that's high enough praise.

They're just long enough, and don't drag, and you don't get lost. They also have to have the best sense of speed I've ever encountered in a fan game, and very nice loop structures. I'm not sure I'm wild about the "clear the room of badniks" parts, but they aren't nearly as onerous as the ones in Sonic Rush and don't mar the experience.

Well, what about the badniks? I counted four types on my way through, and they're all great. The challenge is higher than the Mega Drive games, but I think that was supposed to be the point. The best part about them is that they encourage the use of the new moves, which helps the game feel coherent, rather than a bag of ideas the developers just want to fit in.

Which brings us to the Bosses. The boss in Act 1 is absolutely brilliant. It too encourages the new moves, is challenging yet beatable, and has damage modelling, which is always cool. The Act 2 Boss, however, has a few technical glitches, and is significantly harder. I probably don't play enough Megaman, and my skills are atrophied, but this is like the Metropolis boss (my personal bugbear), only reimagined by a sadistic Dr Wily on LSD. Don't get me wrong, I like the boss, and am awed by the proficiency of the programming. I do however think that the choice to make Sonic invincible after hitting it (sort of like what happens when Sonic is hit) indicates that it may not be as balanced as it should be.

After defeating the Boss, and "surviving" Act 2, we are treated to a real surprise. Act 3, where Sonic has to high-tail it out of the plant with a wall of onrushing flame hot on his heels (pun intended). Again, my twitch gaming skills - underdeveloped as they are - conspire to let me down, but the concept is awesome.* It may sound strange for me, then, to advocate making it even harder, but I think that the edge of the flame should probably kill Sonic immediately. I suppose there might be some perspective or parallax going on, but it seems weird to be halfway into a wall of flame before you finally decide to die.

* It reminds me of Dino Run, which by coincidence I had played mere days before Sonic Boom. I'm not pointing fingers (after all, I think good ideas should be reused), but I am curious for curiousity's sake if inspiration was drawn from Dino Run, or perhaps they both share a common memetic ancestor.

Upon completion of Act 3 are credits (set to the aforementioned 16-bit remix of Sonic Boom) with a welcome "Cast of Characters" scroll showcasing the enemies, in the tradition of Kirby, Mario World, and Mean Bean Machine.

Overall, Sonic Boom is fun, sounds great, and is a technical juggernaut. With some spit and polish on the visuals, it could carve its way into the pantheon of Sonic Hackdom. I eagerly await the next demo. Good work guys, and ganbatte!

13 November 2009

Code of the Ninja: Watchers

If you haven't already, read the Code of the Ninja: Introduction

Welcome, Code Ninjas!

Today I have a simple fix for something that bugged me about Game Maker. First, let me tell you about the problem, and then I will move on to the solution.

Many times I would be running my game, and realise that there was some variable I needed to know the value of. Game Maker allows you to list the values of variables that you specify in a readout, but only when running in Debug Mode.

The trouble is, once you are already running your game, there is no way to dynamically switch to Debug Mode. You have to close the game, and run it again. This is kind of an annoyance, because compile time can get quite lengthy.

So, I thought, is there any way to have a list of "watchers" built into the game, that I can invoke and dismiss at will?

At first I used a simple method that worked much like any HUD (heads up display) in a video game. The values I needed to keep an eye on were just printed on the screen. This was fine and all, but there was no good way to add to it while the game was running. Game Maker's built in Debug Mode allows you to add watchers at any time.

Then I got the idea to - instead of printing out the values of a fixed set of variables - read the variables from a ds_list.

This ds_list would contain a series of strings, each of which would contain the name of the variable to watch (mouse_x, image_speed, etc). By right-clicking the list, I would bring up an input box that would let me add a new variable name to the ds_list.

How can you read the value of a variable by its name? Game Maker helpfully includes the functions variable_local_get(), and variable_global_get(), which take as their only argument the variable's name in string format, and return the value of the variable.

However, there are still issues with this method. A) You can only return the contents of variables, not expressions. This means you can print out the value of mouse_x and things like that, but never the value of instance_nearest(PlayerObj), and other such useful functions. B) You can't tell whether a variable is global or local, a constant, or part of an array, so you're pretty much screwed.

But then I had the brainwave. Instead of using variable_local_get() and its ilk, I'd use the execute_string() command!

Using this method, the ds_list could be filled with strings containing variable names, expressions, anything - using the identical syntax as the Game Maker Debug Mode watchers use. In fact, I could even save and load the strings to TXT documents in the same format, making them fully compatible with Game Maker's normal Debug Mode.

When drawing the watchers onto the screen, all I have to do is read the strings from the list. Then, I use the execute_string() command to perform the string as if it were code. By prepending "return" and a space before the string when I do this, execute_string() will return the value, which can be then drawn on the screen.

Code will demonstrate this better:


//a for loop that steps through the whole list
for (t=0;t<ds_list_size(watchlist);t+=1)
  //the code string in the list to be executed
  r = ds_list_find_value(watchlist,t);
  //align the text to the left
  //print the code - this is how you'll identify the watcher
  //return the result of the watcher
  r = execute_string("return "+r);
  //align the text to the right
  //print the result of the watcher

Now we have a watcher display that's just as nice as the Game Maker one. With a little bit of polish, you can add functions for adding, removing, replacing, and editing watchers from the list, as well as saving and loading lists to TXT documents.

For Code Ninjas who may need a working example to make sense of all this, here is a zip file which contains a GMK example and a sample TXT document of watchers.

Happy coding!

If you use my code or scripts in your game or engine, no credit is necessary. But I'd love to hear about your project if you do! Just drop me a comment below, or e-mail me at us.mercurysilver@gmail.com

03 November 2009

Only a Theory?

I began my last post with this sentence:

Sadly, there are those who deny the fact of evolution....

Before I even leave the starting gate, many creationist readers will have already snorted in disgust and stopped reading, merely because of my use of the word "fact", instead of "theory". Why did I not use the word "theory"? To be perfectly honest, I used "fact" because Richard Dawkins does, and I admire his forthrightness. But I had a deeper reason, too - and I think it is the same reason that Dawkins chooses to use "fact" as well (and it's not because we happen to believe in its veracity).

It is because the word "theory" causes unnecessary confusion.

What is a theory?

Many would here quote definitions from major dictionaries, trying to make a point about how "theory" has been watered down with a second connotation. I'm not going to, because others have already done the job admirably. Anyone who doesn't know the distinction between the two meanings has only to spend one or two minutes in the culture of evolution and its deniers to learn it.

Instead, I'm going to point something out that should be obvious, but apparently isn't to some. A theory is manmade. It is similar to a book, a song, or even a religion. It is a group of cohesive ideas, knowledge, and descriptions about a subject. But it is made of language, and doesn't actually exist in the strong sense.

However, theories are usually about things that exist (but not always). The things a theory is about, and the theory itself, are discrete. One should not be confused with the other. This is not an overly subtle point - it's about as obvious as saying that we should not confuse the dark side of the moon*, and the Pink Floyd album, Dark Side of the Moon.

* which, like the night side of the Earth, is not always the same side, unless you take "dark" to mean "unseen until mankind launched probes".

Is evolution a theory?

Well, yes, if you are being colloquial or elliptical. The word "evolution" is popularly used to refer to what should more properly be called the "modern evolutionary synthesis". It is also used to refer to Darwin's theory of natural selection. It is shorthand, though, and whenever one uses a shorthand term, things can get confusing. For instance, if you took "evolution" to mean Lamarck's theory of inheritance of acquired characters, "evolution" would be false. So, I wouldn't strictly call "evolution" a theory, anymore than I would call "light" a theory. There are theories about evolution, and about light, but evolution is a process and light is... well, ask a physicist.

By a quirk of language and history, the theory of evolution has come to be called simply "evolution". This has not happened in other cases, such as with light or gravity. But evolution is a process, which either happens or doesn't, in the real world.

You would never hear someone say, "Evolution isn't a fact! It's a word!" But the "only a theory" argument amounts to about as much. This is why I didn't say "theory". Theories are incomplete, and some, like Lamarck's, are demonstrably false. Even Intelligent Design is a theory of evolution, and I deny it.

Evolution is a fact of history. Those who take advantage of the "theory" canard have either not learnt enough about the subject or are being willfully obscurantist. I like to think the former, because then the problem is remediable.

29 October 2009

The History Deniers

Sadly, there are those who deny the fact of evolution - 130 million of them in the US alone, according to a recent Gallup poll. These "history deniers" (an apt designation I'll borrow from Richard Dawkins) remain unconvinced by the veritable mountain of evidence for evolution, a mountain which grows day by day. Recent books, such as Jerry Coyne's Why Evolution is True or Richard Dawkins' The Greatest Show on Earth - though triumphs of reason and lucidity - will hardly make a dent in the legions of the history deniers, the "unsinkable rubber ducks" (to borrow James Randi's delightful phrase). It will take a greater concerted effort than just a couple of bestsellers to turn the tide, and it's up to us laypeople to do our bit, too.

Hence this edition of Pernicious Fallacies. In it, I shall be addressing dyed-in-the-wool creationists - the persuasion that believe that the Earth was created in 6 days less than 10,000 years ago, and that all modern species of animal, including humans, were created in their present form before God took His well-deserved day off. I shall not be addressing the more "sophisticated" proponents of ID (Intelligent Design), who actually believe in evolution, albeit a gimped kind of evolution, helped along at crucial junctures by a God who was apparently too lame to get it right in the first place. Whatever percentage of you are already down with Darwin, feel free to stop reading now.

From Wolf to Poodle

Yes, I'm bringing up the tired old dog breeding argument. I'm fully aware of the creationist counterargument, but bear with me, because I have a twist on it.

Selective breeding of animals with the intent to exaggerate desired traits over successive generations, or "artificial selection", is well known and well documented. Even history deniers comfortable with dismissing the fossil, molecular, and distributional evidence for natural selection would think twice before denying the comparatively recent historical evidence for artificial selection. A good example of what artificial selection can achieve in a short span of time is the modern banana. Though there are those who believe the banana was designed by the Almighty Himself, I'd like to think these people are embarrassments even to creationists.

At the core of it, all Darwin and modern Darwinists are claiming is that Nature, as well as Man, can act as a selective breeder, through the non-random survival (and more specifically, reproductive success) of individuals, and that this "natural selection" is responsible for all the diverse life we see around us.

Where creationists have trouble is with that last bit. The difference between breeds of dog, or cabbage, while oftentimes spectacular, pales in comparison to the difference between a dog and giraffe, a cabbage and a tree, or even a human and an ape. Thus they find it hard to imagine these tiny gradations ever leading to all the diversity of life we see around us, from the tiniest microbe to the blue whale. Evolutionists, when trying to help them see how this could in fact be the case, often say something like, "if you can turn a wolf into a poodle in a few centuries, imagine what great change could be wrought in a billion years!" A billion years. It's no wonder the evolutionists find it so easy to accept a single-celled organism giving rise to all life on Earth, no matter how complex it appears - look at the time they have to work with! But creationists, sadly, haven't the luxury. They don't have more than a hundred centuries to work with - and it's a bit confining, but it's what they're stuck with.

Thus creationists accept (as they must) that artificial selection works, but only up to a point. "You can create variations of dogs and cabbages with the process," they'll concede, "but you'll never make a new species. Only God can do that." There's always the matter of the definition of "species", which began as scientific terminology and should remain thus, and should not be used to mean "groups of animals so obviously different I can tell them apart". But let's leave that to the side, as it really doesn't matter for our purposes here.

Creationist's Evolution

So let's, just for the sake of argument, concede the point. The Earth is only 10,000 years old (you could concievably buy that many candles for its birthday, whereas 4.6 billion would really put you out, so that's something at least), and you can't make a new species using evolution. So as a creationist, you accept artificial selection, and with a few logical leaps accept (let's say) natural selection as a comparable agency with comparable effects. It would then follow that all modern animals are at least as different from their ancestors in the days of Genesis as modern dogs are from the archetypal wolf. Or would it necessarily follow? To be sure, there are still wolves - certainly not the same wolves from the dawn of time (none live that long, of course), but a branch of descendants that differ very little from the archetypal wolf (God's wolf, if you like). So, would it follow then that at least most modern animals are as different from their original forms as a poodle is from a wolf, while some percentage have somehow managed to remain unchanged (conveniently for us, as we could use them as near examples of what the "Adam and Eve" of that animal species might have been like)?

This "creationist's evolution" I have led you to is not what I believe, of course, but it is reasonable within the framework of creationism. It would even help answer some prickly questions about God and creationism. For one, God would only have to have made a template for each animal species, an animal "Adam and Eve" as I put it. This template of His would then be subject to explosive variation at the hands of either Nature, or meddlesome Man, it matters little which. This would shed some light on God's apparent pre-occupation with beetles. Furthermore, it would make Noah's job a heck of a lot easier. A couple of spiders on the Ark might be bearable, but two of each of the 40,000 spider species?

I have made these points in an attempt to outline a kind of evolution in which a creationist might be comfortable believing. I wanted to make "evolution" less of a dirty word - it just means change over time, people. Unlike "atheist" or even "humanist" it doesn't have an inbuilt denial of God, or even of a Young Earth. It might be unpalatable to true Darwinists like me, but it could be useful for opening a dialogue, finding some common ground. After all, a denial of "change over time" is harder for a creationist to muster, especially with domesticated animals staring them in the face. This merry chase of "creationist evolution" is meant to divest the mere word "evolution" from the uncomfortable, monkey-laden specifics of Darwin's theory that creationists so revile.

But is even this Godly evolution inoffensive to the creationist? Or is even this ecumenical fiction I have constructed - no worse than most theological musings - still going to ruffle some staunch feathers? It might at that, because of something called "Platonic Essentialism".

Master Tapes, Signal Noise, and Wikipedia

It was argued by Plato that, for everything that exists, there is an ideal example (perhaps existent somewhere, perhaps not), an "essence". Every triangle, it might be said, is but an imperfect approximation of the "perfect triangle", drawn by fallible human hands on stone, papyrus, or today made of tiny pixels on a screen. In the same way, might there be an "essence" of every animal species, and every member of the species is but an imperfect approximation, cast from the essential mould? In the terms of our "creationist's evolution", these "essences" would be the animal Adams and Eves, the original ancestral archetypes of all future animals. Every animal born in the species would, instead of copying their own parents, copy instead the archetype, cast by God and therefore perfect.

We can here use the analogy of "master tapes". When (back in the day of VHS and audio cassette) a company produced thousands of tapes for the public to buy, each tape was a copy of a master tape (or, I imagine more rarely, a set of master tapes). It wouldn't have been wise to copy a second copy of the master tape, and then make a third copy by copying the second copy, and so on down the line. By the time you reached the thousandth copy, the picture (or sound) would have deteriorated far too much to be useful.

I must digress here briefly for the benefit of evolutionists. This "copied tape" argument is sometimes leveled against evolution as evidence against it. A thousandth generation VHS is mush - so how can a thousandth generation rabbit be anything but mush, if evolution is true? The answer is that VHS technology is analog, and the signal noise introduced with every generation is faithfully reproduced in the next. But DNA, the replicator upon which life depends, is digital, and signal noise doesn't accumulate quickly enough to reduce the message to mush. Certainly errors occur, as they do with our manmade digital devices, but they occur much more seldomly. At this diminished rate (characteristic of a digital process) the errors - mutations - don't build up, at least not in the same way. What do I mean by this?

Think of it like Wikipedia. Imagine any Wikipedia article of your choice as a gene pool, and any edits that are made to it as mutations. Anytime a deleterious edit is made (vandalism, misinformation, etc), it is promptly removed, reverting the article to its pure state. In the same way, if an individual bears a mutant offspring whose mutation has a harmful effect on the offspring's survival or reproductive success, that mutation is in effect removed from the gene pool. Unlike the signal noise on a VHS, the mutation will never reach a successive generation because it isn't as good at getting there. If a Wikipedia edit is constructive, however, it will not be promptly removed. Instead, it will persist. In the same way, any mutation, no matter how rare, if it has a positive effect, will persist. (We can ignore the specifics of neutral mutations, which - while well understood - complicate the analogy.) Even if in any given generation the vast majority of mutations do not have any positive effect, over time, the only effects that remain will be the positive (or neutral) ones. Negative, harmful edits (or mutations) simply cannot persist for long at all.

Thus, in a digital process such as this, signal noise does accumulate, as in an analog process. The difference, however, is that instead of descending into formless mush, the "noise" that accumulates hardly deserves to be called "noise" at all. Mostly, they are improvements. Of course, this can only work if there is some outside force acting on the system. In the case of Wikipedia, it is a vast public, who only find constructive edits to be useful. In the case of DNA, it is the reproductive success of the bodies it builds. In any situation where there is no outside force, the "noise" really is noise, and not improvements at all, no matter how digital the process. One such example would be hereditary diseases in humans (and of course all animals). They all, without exception* (save those rare few that have newly mutated this generation, which cannot in good conscience be considered hereditary at all) present after the afflicted individual reaches reproductive age. Why is it that we are at such greater risk of so many health problems when we reach old age? Simply because we have already reproduced by then. Natural selection, like a finicky Wikipedia moderator, has swept up all the spills that kill us early. But those beyond its reach hang doggedly on, causing much misery.

* Actually, there can be some exceptions. For instance Haemophilia can be carried into future generations through the female line, only causing harm when it arrives in male bodies. But my general point - that a fatal gene that switches on at age 7 will be swept away by natural selection, whereas one that switches on at age 70 has a much higher chance of becoming frequent in the gene pool - stands.

So, now back to the "master tapes" and the archetypal animals. The Essentialist viewpoint would be that every mutation is necessarily deleterious, and that none should ever persist. Any deviation from "God's rabbit" would be an imperfect rabbit, and God would presumably not want his divine rabbity plan to be eventually lost in signal noise, even digital, naturally selected "noise" that resulted in a fully functioning animal thousands of years hence. It might be a great animal, fantastic at survival (it couldn't be around if it wasn't), but it wouldn't be rabbity enough for Him.

But we know from incontrovertible evidence, from centuries of artificial selection, oftentimes performed as direct experimentation, that animals don't copy some ideal "essence". They (and we, for we are animals) copy our parents. Anybody denying evolution, not just Darwinian evolution with all the trappings, but evolution of any kind, even the "what happens within a species stays within a species" kind of variation I suggested earlier, has to be able to show (or at least formulate some sort of reasonable argument for) why it has not happened. After all, if we can change a species by our own hand using artificial selection, how can we expect natural selection to have done absolutely nothing, even in 10,000 years?

Natural Selection - Friend or Foe?

Perhaps natural selection is not a creationist's enemy, but their friend. Perhaps natural selection can be invoked to explain how animals (and humans) remain the same today as they ever were (if we grant the creationists this viewpoint temporarily for the sake of argument), even in the face of all the mutation that must occur.

In fact, one of Darwin's contemporaries, Edward Blyth, suggested just such a thing. He suggested that natural selection, far from guiding the cumulative mutations toward evolutionary ends, instead strictly penalised any variation at all. So natural selection didn't work to improve, but merely to maintain the status quo.

I find it ironic - given that evolution (in the sense of "change over time") is undeniable, and practically a tautology - that the onus is on creationists to explain how in their view it in fact did not happen to any animal at all, until meddlesome humans began their breeding experiments. And that perhaps the only way to do so is to embrace the theory of natural selection itself, as a kind of universal janitor, mopping up any rabbits that aren't quite up to spec.

As it happens, though, this view of natural selection turns out to be false, and isn't worth clinging to. Why? Because of the Second Law of Thermodynamics, which basically states that, in any closed system, entropy will always increase. Creationists should be familiar with the Second Law, since many of them love to claim that Darwin's theory violates it.

The Second Law

Of course, they are infantile to even suggest it. They should pause a moment before leveling such an accusation at evolutionists. Think what you are accusing us of! There is a famous quote by Arthur Eddington:

If someone points out to you that your pet theory of the universe is in disagreement with Maxwell's equations — then so much the worse for Maxwell's equations. If it is found to be contradicted by observation — well, these experimentalists do bungle things sometimes. But if your theory is found to be against the second law of thermodynamics I can give you no hope; there is nothing for it but to collapse in deepest humiliation.
By this, Eddington is stressing just how important the Second Law is to scientists. Do creationists really believe that the entire scientific community believes in a theory that violates such a fundamental principle? Ask any scientist if a perpetual motion machine is possible, and they will tell you "No" without any hesitation. There is no way that evolution even comes close to violating the Second Law. How can we be sure? Because every reputable scientist alive supports it. It's iron clad. It would have been rejected with due scorn otherwise, and evolutionists would today be loonies in their garages with deely-bobber hats investigating crop circles and drawing pentagrams.

Blyth's theory, however, would violate it. Short of God's continual intervention, no force can stop the accumulation of mutations in DNA. Bad mutations die, good mutations survive. Eventually, the gene pool is full of nothing but the creme de la creme, a book of happy accidents. By chance, some mutations, no matter how few, are going to be better at surviving. Nothing will stop them from taking over. There is no grand industrial machinery checking rabbits against some ideal template. If DNA can change for the better, to take better advantage of its environment, it's going to. Like a ball rolling down hill, it has to happen. The energy and information necessary to keep everything adhering to some essence, eternally immutable like the Heavens of the ancients - where does it come from? The energy necessary for Darwinian evolution comes from the sun - the math can be done, nothing else is needed. But to be truly unchangeable - to not evolve - that would violate the Second Law.

So, is that what God does? Does he sit up there all day, making sure that everything matches His divine specifications? Even the theists can but guess.

I hope I've shown, in some small way, that evolution, whether complete with all the Neo-Darwinian trappings that I believe in or not, is ineluctable. The history deniers must answer to their own satisfaction how it can not be. You have built your own Ark, and you must deal with the consequences. This is evolution's foot in your door - can you really ignore it, no matter how dilute the form, any longer?

14 October 2009

The Meme Cloud, Part 2

Software/Hardware: Commodore 128

Back when I was about 10 or 11 years old, the only computer I had that was user programmable was the Commodore 128 (I went through several models, but the 128D was my favourite, and the longest lasting).

At the time I was addicted to Genesis and Super Nintendo games such as Phantasy Star II, Starfox, and Super Mario Kart. I wanted nothing more than to be able to make my own 16-bit video games.

The Commodore, while woefully underpowered for anyone with 16-bit ambitions, was the closest thing I had. Far from sneering at the primitive machine, I threw myself into learning how to coax anything video-gamey out of it. I tricked it out with a RAM expansion cartridge and set to work.

For the most part I was interested in making graphics, and ended up making more intro and cinema sequences for games than games themselves. I never moved beyond Basic 7.0, squeezing every last drop out of it instead of attempting the seemingly insuperable task of learning the arcane Machine Language.

I have many fond memories of the era, and even if I never accomplished much of note with the Commodore, it helped to shape me into a programmer and video game designer. The abstract lessons I learnt in those early years are still with me, even in the age of Game Maker, when there are almost no graphic, memory, or processor limitations.

TV Series: Mr Bean

I watched Mr Bean because I loved Rowan Atkinson's performance as Blackadder.

Mr Bean is almost the exact antithesis of Blackadder, but equally well-performed and hilarious. While Blackadder is the epitome of sophisticated verbal wit, Mr Bean is the epitome of simple physical comedy.

But it's not your average tired slapstick routine. It's exceptionally clever, like when Bean is brushing his teeth and changing into his suit while driving his mini - with his feet. Even watching the man prepare a sandwich is funny.

Music (Band): They Might Be Giants

I have Sega to thank for turning me on to TMBG, as their song "Mammal" was on a Sampler CD that shipped with the Sega CD to show off its CDA playing capabilities. The song was a true novelty, a dollop of weird in my otherwise Beatles soaked music world. To this day it remains a favourite of mine, and the only song on the sampler that I remember at all.

It wasn't until I began to listen to the Dr Demento show regularly that I encountered TMBG again. That's where I heard most of their hits, like "Istanbul (Not Constantinople)", "Why the Sun Shines", "Birdhouse in Your Soul", and "Particle Man". It was great to discover that that little band I had a soft spot for because I associated them with the day I got Sonic CD actually had more to offer.

The first time I ever saw them performing was on "The Screensavers" (which I watched religiously at the time). John & John's charming and quirky personalities (as well as the sheer fact that they were willing to be on a geeky show like The Screensavers) won me over, and I had to become an active fan and follower.

The thing I like the most about TMBG is their ability to make a song out of anything. "Hovering Sombrero", "I've Got a Fang", "Unrelated Thing", "Mink Car", "Edison Museum"... the list goes on and on. No other band expresses that prodigious overbubbling zest for clattering around and having fun making music for music's sake as well or as much.

Music (Artist): Roger Miller

Because Roger Miller seems like something only boring old people would listen to, it may come as some surprise that someone who just cited TMBG can squeeze him in their Meme Cloud. It becomes less surprising, however, when one realises that Disney's animated Robin Hood was how I was first introduced to his music. And less surprising still, because it was also the Dr Demento show that offered further exposure - significantly, "I'm A Nut", one of the best novelty songs ever written. In fact, Roger Miller's song "Whistlestop" was sped up and remixed to create the infamous Hampster Dance, and you can't get much more relevant than that, can you?

In all seriousness, though, his songs can range from wry to bittersweet to uproarious, but they're all sung with such an honest, soul-baring frankness that it plays havoc with your natural laugh / cry instincts.

Not only is this the only country-and-western music I will tolerate, but I actively adore it.

TV Series (Animated): The Adventures of Tintin

Here I'm specifically referring to the Ellipse / Nelvana cartoon. Though I'm sure the original books by Herge are fabulous as well, I can't speak for them because I haven't bothered to read them yet (I have a general dislike for the comic book format that I'll have to overcome first).

The wonderful thing about the cartoon is that it is refreshingly adventurous. Almost all children's adventure cartoons these days are terrible. Not least because of the stringent rules about depictions of violence. With the inability to depict realistic guns, or show any blood whatsoever, all action sequences devolve into mindless bonecracking fistfights, numbing explosions of ever increasing magnitude, and laser weapons that seem programmed to miss. The Japanese are able to make more entertaining adventure cartoons for the same age group, but by the time they reach our shores they more often than not are bowdlerised, impotent (sometimes to the point of being unintelligible, as is the case with some Yu-Gi-Oh! storylines), and poisoned by cringe-inducing dubbing.

But Tintin avoids all of those pitfalls. It harks back to the same era as does Indiana Jones, when men were men (and dogs, aparently, were superhumanly adorable). It's just adventure, plain and simple - with exploration, intrigue, danger, and yes, real guns. There's no cynicism, no "look at how awesome we are", and no gaggle of identical superfriends with 5-foot wide shoulders and the same brand of humour as the House scriptwriter who "wrote" all their lines (you can't tell I hate Justice League Unlimited, right?).

And it also has the best orchestral theme song this side of a John Williams score.

I'm hoping that the new CG movie does at least as well, but I'm not terribly optimistic about it.

06 October 2009

Developer Spotlight - Yasushi Yamaguchi

Yasushi Yamaguchi (also known as Judy Totoya, the nickname he was known by during the early days at Sega when their developer's identities were kept secret) is probably best known in Sonic circles for having been the character artist for Sonic 2 and the creator of Miles "Tails" Prower. But that's just the tip of the iceberg.

Not only did he create and design Tails, he re-designed Sonic for Sonic 2. Sonic's a lot more hip and cool looking in the Sonic 2 character art than in Sonic 1, where he's a lot more like a character from the classic animation era.

He also was responsible for most of the mechanical enemy designs, and Robotnik's new improved Egg Mobile.

And the Tornado, Sonic and Tails' indispensible bi-plane, which has practically become a character in the Sonic series in its own right.

Of course the Tornado is cool - Yamaguchi has always had a strength for mechanical design, as evidenced by the awesome robotic monsters he designed for Phantasy Star II.

His designs are also showcased in the geek-cool Master System game, Cyborg Hunter (Choonsenshi Borgman in Japan).

As well as working on Sonic 2, Yamaguchi was involved to a lesser extent in the creation of Sonic CD. He was a Special Stage designer, and what Special Stages they are!

The expanded data storage capacities of the CD-ROM format allowed Sega to include bonus art in Sonic CD by the designers. Yamaguchi took the opportunity to advertise his new character Tails.

(I love the fact that the licence plate says "Miles"!)

The "See You Next Game!" line probably refers to Sonic 2 - Yamaguchi most likely made the picture before leaving the Sonic CD team to begin work on Sonic 2 in the USA. Sonic CD, however, ended up being released later than Sonic 2, so it seems a little confusing - leading some to speculate that it really refers to Sonic Drift. The car beside Tails helps lend this a little credence, but I don't think there's any proof. It's not the same car design from Drift. Why the car in the first place then? Yamaguchi might have just been expressing his penchant for vehicle design.

If it does in fact refer to Sonic Drift, that might mean Yamaguchi was responsible for the vehicle designs from that game, which would make sense, judging from the style.

Back in the really early days of the Genesis, Sega had a newsletter called SPEC (Sega Players Enjoy Club), drawn by the actual game designers, such as Naoto Ohshima, Rieko Kodama, Tohru Yoshida, and of course, Yamaguchi. They all went under nicknames when drawing the issues, and Yamaguchi went by Judy Totoya (for reasons opaque to me).

Yamaguchi sometimes got cover duty, and he really did a good job, as with this Shinobi cover.

Why wasn't Sega Visions this awesome?

But Yamaguchi's coolest contributions to the SPEC magazine were his Phantasy Star manga. They were serialised, and sadly didn't get to conclude, because SPEC was discontinued. The "Basic Saga" was a humourous retelling of the story of the Master System Phantasy Star. The characters are drawn in a hilarious chibi style, and Myau looks a little like Tails...

The "Outside Saga" told of further adventures of Alis and Lutz outside the Algol system. It was drawn with a more serious tone. Seeing it makes me ache for a full-blown Phantasy Star anime series from the early 90's, but no such thing exists. Now I'm really despressed.

Yamaguchi was reunited with Rieko Kodama on Magic Knight Rayearth, but hasn't been credited since the Sega Saturn era. Where has he been? Today's games sorely miss the coolness that his personality and pen could offer, Sonic games in particular.

Yasushi Yamaguchi article at Sonic Retro

Yasushi Yamaguchi article at Wikipedia

SPEC scans were gotten from Gazeta De Algol

25 September 2009

Sonic Genesis Rant

You know how when people get really mad, they write really vitriolic letters, but throw them away instead of sending them? Directly after playing Sonic Genesis for the first time (years ago), I typed something like that, but never posted it anywhere. I've since calmed down, of course, and feel that criticism should be constructive. If I'm to point out its flaws, I might as well be helping others to avoid them at the same time. But it's still mildly entertaining, so I've recreated my original rant here.

Ah, Sega. Can you stoop any lower? After re-releasing Sonic the Hedgehog 1 for every system imaginable (Saturn, Dreamcast, Gamecube, Playstation, PC, Cellphone, Wii Virtual Console, etc), you still feel as though you can continue to milk the poor game for yet more cash. Especially since the new games aren’t selling very well….

Forget that you missed the 15th anniversary by seven months, forget that we’ll have to pay $19.95 for the thing (I remember buying Mega Collection for the same price and getting 12 games, plus a load of nifty extras. Funny that), and forget that it’s going to be released for five bucks on the Wii 2 days later. Sonic 1 is still the best 2D action game ever made. Ever. It changed the industry, changed our lives, and changed the world. It spawned a thousand rip-offs (Oscar, Rocket Knight Adventures, Gex, Rocky Rodent, Aero the Acrobat, Crash Bandicoot), and for a short time one couldn’t turn around without bumping into an animal mascot over-brimming with ‘tude.

More importantly, the vast, unwieldy genius of one Yuji Naka would make the game more unique still – never before had we seen such brilliant programming, such tight physics, such fluid motion and control. In a time when video characters were running at fixed speeds across flat boxy ground, and jumping one block up and across no matter what their inertia, Sonic was running over lush hills and around gravity-defying loops, gaining momentum by rolling down hill, rebounding off of objects, drifting through the air like a discus, and of course, running at improbable speeds (all with realistic acceleration, friction, gravity, and collision detection) and looking cool doing it. Very few, indeed probably no, games at the time had pushing, tipping, waiting, and halting animations. Certainly none had such style. Suddenly here was a game where a cartoon character was soaring through fantastic, vibrant worlds, and all to some of the catchiest music to ever be written, for a video-game or otherwise. Never again would the populace be satisfied by notched hockey pucks or monochrome spaceships. A new era had begun.

A game so revolutionary, so infinitely groundbreaking and fun, must surely still be all these things, even in today's era of Metroid Primes and Windwakers. So why not release it one more time, on the world’s coolest handheld system, where it can keep some of the other greatest games of all time company? Where it can share the hallowed halls with Minish Cap, Zero Mission, Superstar Saga, Chain of Memories, Empire of Dreams, and its flashy brethren, the Sonic Advances. Where a whole new generation of young, impressionable children can discover the joy that is Sonic the Hedgehog….

Yeah, right. That’s assuming a single soul left working for Sega has any brains. Sadly, they’ve all either left, or are still celebrating National Opposite Month. “Sonic Genesis,” as they so maddeningly called the game, will do none of these things. Instead, a thousand unsold copies will linger in every retail outlet until somebody takes them out with last year’s Christmas tree and buries them like the nuclear waste that they are. And if they have any sense, they’ll shoot each one with three rounds from a high-calibre weapon for good measure.

Why is Sonic Genesis so bad, you ask, if Sonic 1 is so darn good? How can Sega, no matter how bad they are at making new Sonic games, possibly fubar a freaking re-release?

Simple. They’re Sega – it’s what they live for. Corporate restructuring, firing all their good talent, and methodically, no, surgically removing every last good thing about Sonic the Hedgehog and Phantasy Star. It’s their primary goal, just like Microsoft wants to rule the world and Nintendo wants to embarrass you in public (not even mentioning Sony’s fiendish plot to upset the world economy!)

I will now, just as methodically and surgically, list every single flaw I’ve found in Sonic Genesis, every glaring oversight that screams sloppiness, laziness and negligence. Read them and squirm. And may Sega be struck by bolts of alpha-blended lightning for not fixing each and every one of them. They deserve every scorch mark they get on their sorry hides for, yet again, screwing their customers and leading a whole new generation of children to believe that Sonic 1 must have sucked. Those children will some day be the ones who run our businesses, our television stations, the United Nations – and they’ll think Sonic 1 sucked. Oh, Sega, you make me so mad!

And just to make sure that we can never find it in our hearts to forgive them, they go and do the unthinkable. They say, on the back of the packaging, “A perfect port of the original that started it all!” You can be crapulous, Sega, and I’ll forgive you. But when you are crapulous and say you are not, clearly I can no longer give you the time of day.

If Sonic Genesis is a “perfect port,” I’m Sasquatch.

I'm not sure the back of the packaging really says what I claimed it did. I must have seen it in advertising for the game at the time and got mixed up as to the source.

P.S. I'm not Sasquatch. Really.

The Nitpicker's Guide to Sonic Genesis - Part I

Hello again, Code Ninjas, and welcome to the first ever Code of the Ninja special, The Nitpicker's Guide to Sonic Genesis - Part I.

Some Code Ninjas are a disgrace to their title - they fail spectacularly at our subtle art. Perhaps they lack the necessary commitment or training. Or, perhaps they are not entirely to blame, and the reason for their failure is a lack of time, or budget.

Either way, the results of their efforts suffer terrible scars, belying the shoddy and haphazard code underneath. This is unacceptable, for the Code Ninja should be swift, efficient, and invisible.

The outstanding example of such an unsuccessful mission is Sonic the Hedgehog Genesis, for the Nintendo Game Boy Advance. It is supposed to be a port of the 1991 Sonic the Hedgehog for the Sega Genesis (Mega Drive), but you'd barely know it. Whereas the original Sonic the Hedgehog is an exemplar of good programming by a true Goemon of code, this embarrassing port is a shambles, infamous for being the worst Sonic game ever. In fact, it has a strong claim to be the worst programmed video game ever (a distinction a certain Bubsy Bobcat is used to enjoying).

In this special series of Code of the Ninja, I aim to draw attention to each of Sonic Genesis's plenitude of flaws, with special emphasis on their likely causes. It is one thing to notice that Sonic Genesis is bad - it is entirely another to find out why. It is a testament to the degree of the abject failure of the Sonic Genesis programmers that the likely causes of the many glitches in the game are not opaque.

To be sure, I cannot be 100 percent certain of any of the causes I will cite. I do not have access to the programmers' code, nor the inner workings of their brains (and I'm grateful, for they would assuredly be terrifying), but I can make educated guesses. As a Ninja whose current mission plants him squarely in the wilds of his own Sonic engine, I am in a better position than most to make such observations.

As in the infancy of the discipline of taxonomy, before the advent of the field of genetics, one simply looked at the external features of a lifeform when classifying it. The underlying coded information, the recipe for those external features, was invisible to taxonomists at the time, just as Sonic Genesis's code is unavailable to me.

They made mistakes, certainly, especially because of the wonderful yet maddening effects of convergent evolution, but plenty of good work was done, enough to cement the endeavor as respectable.

It is in this spirit that I undertake nitpicking Sonic Genesis. Whether all of my evaluations turn out to be true or false, I hope many of them will be incising insights, which will arm inchoate Code Ninjas and help them avoid the same traps and pitfalls (some of which the Sonic Genesis programmers' feet are still sticking out of, accompanied by contented digestive noises).

As a bonus, I will be pointing out some extra flaws each time which were not the result of programming.

Code Flaw #001: Sonic is not synched to moving platforms



Programming moving platforms in a video game is actually relatively easy. When the character object detects a platform, it remembers the ID of the platform. From then on (until the character falls or jumps off the platform), the platform's motion is simply added to the character's.

Sounds easy enough. But a lot of beginners (including me, back in the day) are surprised to discover upon running their game, that the character's movement is not perfectly synchronised with that of the platform.

It turns out that it all relies on the order in which the code is performed. Every frame of the game (and there are usually 60 per second), the objects perform their code. But they can't do this at the same time - they queue up and do it one after another.

If the platform moves first, then Sonic follows suit. Then the screen is refreshed, and the player sees Sonic stuck fast to the platform. All is well.

But what if the platform comes later in the queue than Sonic? Then, Sonic moves based on the speed or position that the platform had in the last step. Then the platform moves to its new position. Then the screen is refreshed. The player sees Sonic juttering about the general vicinity of the platform, but not firmly atop it. Sonic is lagging behind, basing his position on variables that are one frame out of date!

Unless all moving solids complete their code before the character object's routine is run, this will be a problem. In Game Maker, this would amount to putting the platform routines in the "Begin Step" event.

Apparently the "programmers" of Sonic Genesis were too rushed or lazy to bother with this simple fact, and so they fail to achieve decent moving platform physics - something that early NES games can do in their sleep. It's pretty pathetic, when you think about it.

Bonus Flaw #001: The background in the title screen isn't animated

Not only is there no paralax, and the clouds don't blow by on the breeze, but the waterfalls and sparkles on the surface of the lake are totally frozen! The GBA can palette cycle, so there seems to be no explanation for this besides sheer sloppiness.

Bonus Flaw #002: There is no shrapnel when crushing through walls

Yes, folks - the segments of rock (or metal, in Starlight Zone) simply disappear, accompanied by a lame "poit" sound effect that is nothing like the original. I'm guessing that the 6 month delay still wasn't enough time to implement a few bits of shrapnel flying away.

Well, that's it for now. The normal Code of the Ninja will not be interrupted by the Nitpicker's Guide, so I'll see you next time.

Happy coding!

18 September 2009

The Mobius Fallacy

UPDATE: This article has been featured at Saturday Morning Sonic, so you could zoom over and read it there instead.

Welcome to the first Pernicious Fallacies post. In this series I hope to shed some light on certain issues, and reverse some of the damage done by the spread of misinformation and well-meaning "theories". The subject will most often be Sonic the Hedgehog and its development, but at times I may branch out.

Today's Pernicious Fallacy is "The Mobius Fallacy". It is best summed up by quoting one of its carriers, the Concept Mobius website:

Concept Mobius:

In fact, Mobius itself is all but a simple misinterpretation on SOA's part. Let me take you back to the year of 1992, when Sonic 2 was still in the makes and interviews and press releases were filling the media of the blue blur…

Back when Sonic 2 was released, which was basically the impending of one of the most prestigious video games of all time, many interviews and many magazine articles were published prior to its release. One of which was a Sega Visions issue where Yuji Naka was interviewed, and he mentions the word 'Mobius.'

Yuji Naka was not making a reference to a planet, but instead an obstacle. A Mobius strip is a mathematical testament of geometry that is continuous one-sided surface that can be formed from a rectangular strip by rotating one end 180° and attaching it to the other end. Sound familiar? Exactly. Those corkscrew roadways in Emerald Hill Zone were Mobius Strips.

The Mobius strip (right) is what the nifty corkscrew highways in Emerald Hill Zone (left) were based off of.

Yuji Naka meant to point out the Mobius strips. Because hey, we all know he is bad at English — the only time he uses good English is when he is kissing an American car salesman's ass to haggle down a shiny new Ford GT. But other than that? Bupkes.

This little misinterpretation stuck with Sega of America, so it was thus morphed into what we know today as Mobius - the world that Sonic comes from in the comics, AoStH TV series, SatAM TV series, and the Sonic Underground TV series.

Here is the offending quote from the Yuji Naka interview in question:

And here is the entire interview at Sonic Retro.

Now that you have a clear and colourful picture of the Mobius Fallacy, it is time to dismantle it.

Firstly, the Mobius Fallacy is based on two independent precepts, which must be dealt with separately.

1. As a result of this interview, the word Mobius was applied to Sonic's homeworld.

The name Mobius for Sonic's homeworld was in use long before this interview was conducted. For example, the Promo Comic from 1991:

(Promo Comic article at Sonic Retro)

And the "Sonic Bible" (an internal document used by Sega of America), dated June 24th, 1991:

(Sonic Bible thread at Sonic Retro)

Now, it is entirely possible that the name Mobius was given to Sonic's homeworld by SoA due to the loops and twists in the Zones. But it certainly was not due to any utterance of Yuji Naka's in this particular Sega Visions interview. The very notion that SoA would mine an interview for ideas on what to name their planet is silly anyway, even if it had not come too late.

2. Yuji Naka said the word Mobius, referring to the corkscrews, but was misunderstood / mistranslated.

Why did Yuji Naka say Mobius? It's a SoA term, after all, not official in the Japanese Sonic canon.

First, there is no proof he ever did. Many interviews with Japanese game developers are conducted through a translator, who could easily have said Mobius for the Americans' benefit. Furthermore, even if there was no translator and Yuji Naka was speaking English (which there is, to my knowledge, no evidence for), he could have used the word himself, knowing that he was speaking for an American publication. We must bear in mind that Sonic 2 was developed in Palo Alto, California, and his American colleagues perhaps used the name Mobius on a daily basis during development. It would not be hard for Yuji to employ the name himself, without believing it to be Sonic's home at the end of the day.

Remember, in the interview, the name Robotnik (not Eggman) is mentioned as well. Similar to Mobius, the name Robotnik is not canonical in Japan (at least not until Sonic Adventure 2, when they finally capitulated, perhaps because Professor Gerald Eggman and Maria Eggman sounded really stupid).

Yuji Naka, Sega Visions:

We wanted one of the characters in the game to be egg-shaped, so we created Robotnik. It was a great character, but since it couldn't be the main character, we made him the bad guy.

So why did Yuji say "Robotnik"? See above - the same points come to bear on this as why he said "Mobius" - if, again, he even did.

This actually suggests a new, parodical "Robotnik Fallacy":

Hypothetical Theory-tard:

In fact, Robotnik is nothing more than a stupid translation error on Sega of America's part.

What Yuji Naka really was referring to was Metal Sonic. Robot Sonic, Robot-nic, Robotnik! After all, he's a college dropout who can't string two English words together sensibly.

Ever since, mindless buffoons in the West have been parroting the mistake, and they think he's called Robotnik!


As for the whole "translation error" idea (the idea that he was referring to the corkscrews in Emerald Hill, but was somehow misinterpreted), it is certainly possible. But it is not very probable.

Read the interview. Yuji Naka is not vague or ambiguous in any way throughout. The language used is clear, informative, and precise.

Yuji Naka, Sega Visions

...the new Mobius worlds are brighter, crisper, and much more detailed.

The quote itself is crystal-clear (BTW, in ye olden days, it was quite common to call individual levels in a video game, "worlds").

To assume that somehow a reference to an object can be construed into a sentence of that nature reminds me of Bible interpretation. Read with no bias, you'd have a hard time believing that sentence in any way referred to a corkscrew in the first zone.

I hypothesise that, since a screenshot of the corkscrew is featured prominently on the page with the interview, a strong subconscious connection has arisen. When casting the mind's eye back to the only mention of Mobius associated with Yuji Naka, hovering in view is a big ol' page-spanning screenshot of the corkscrew. Check the caption of the screenshot, however, and you'll see it clearly and correctly labeled as a "corkscrew".

Bear in mind that the corkscrews in Emerald Hill bear no legitimate resemblence to a true Mobius strip, either. The very definition of a Mobius strip is an object with one continuous side. The corkscrews in Emerald Hill do not connect to themselves, but are stretched from cliff to cliff, and have two distinct sides. To claim, as Concept Mobius does, that a Mobius strip was their inspiration, is wild speculation, unwisely stated as if it were fact.

Actually, the entire quote from Concept Mobius is arrogant, insulting, and peppered with opinion masqerading as fact:

Concept Mobius:

Yuji Naka was not making a reference to a planet, but instead an obstacle.

This is stated baldly as fact, not as his opinion. Would a simple "perhaps" have killed the guy?

Concept Mobius:

A Mobius strip is a mathematical testament of geometry that is continuous one-sided surface that can be formed from a rectangular strip by rotating one end 180° and attaching it to the other end. Sound familiar? Exactly. Those corkscrew roadways in Emerald Hill Zone were Mobius Strips.

Actually they are clearly not, by the very description just offered! They are twisted far more than 180°, and do not attach to themselves. The corkscrews are no more Mobius strips than the Eiffel Tower is a rabbit - it is incredible that this claim was made by someone who ostensibly has a working understanding of what a Mobius strip is!

Concept Mobius:

The Mobius strip is what the nifty corkscrew highways in Emerald Hill Zone were based off.

This is more fair to say - they are not actually Mobius strips, but could well have been inspired by them. But again, it is stated as bald fact. How does he know what inspired the level artists? Has he spoken with them? Again, this is pure opinion.

Concept Mobius:

Yuji Naka meant to point out the Mobius strips. Because hey, we all know he is bad at English — the only time he uses good English is when he is kissing an American car salesman's ass to haggle down a shiny new Ford GT. But other than that? Bupkes. This little misinterpretation stuck with Sega of America, so it was thus morphed into what we know today as Mobius...

How does he know this is a misinterpretation or a mistranslation? Was he there when the interview was conducted? Does he have a taped recording, does he even speak Japanese? Where is the evidence for these claims?

Also, this is insulting the man who developed the games this person's site is dedicated to. And hey, isn't the site called Concept Mobius?

Moving on....

Why do people feel so strongly about this Mobius Fallacy? Well, there are two sides.

On the one hand, for people who wish to establish Mobius firmly as Sonic's home planet in all regions' canon, this may be (and only may be) the only time the name has been uttered by the original creator's own lips. Believing this lends the name Mobius more credence, and one can see why territorial fans might cling doggedly to it. We know better, of course - Earth is Sonic's home in Japan, and always has been (the Tails Adventure Japanese Manual explicitly mentions the South Pacific, for just one example).

On the other hand, for people who hate the SoA canon and the Archie universe, maintaining that Mobius is just a stupid mistake that doesn't really mean anything probably makes them feel superior. It de-legitimises Mobius and makes the Western canon seem inferior. But we know better about this, also - Mobius is as official as anything in the Japanese canon. Sonic was intended to have a different backstory for each region, so that conflicting cultural preferences wouldn't limit his popularity.

In summation:

1. The corkscrews are demonstrably not Mobius strips.

2. It is extremely unlikely that a mistranslation occured.

3. Sega of America did not mine an interview from the future for ideas on what to name their planet.

A healthy Sonic community must challenge the current views, and overturn them when new evidence comes to light. Continuing to repeat, or support, old, unproven claims only takes our attention from new challenges and mysteries that need to be solved.


There is one clear instance of the corkscrews of Emerald Hill being referred to as Mobius strips. It is from Sega Force, July 1992, talking about Sonic 2 as it was premiered at the CES that year on May 28th. From what is said about it, it sounds like the build that was shown off was the Alpha (just Emerald Hill, with Starlight's BGM), or very similar.

(here's the full scan)

We can be pretty certain that this guy is referring to the corkscrew. "...Must be negotiated at full tilt to keep Sonic from falling off" - the corkscrews are the only thing that fits that description. However, this instance emphatically does not legitimise calling them Mobius strips. Just because one person makes a mistake does not mean that everyone else should copy them.

Why was the mistake made? Here's a bit of a new theory: Instead of, as the Mobius Fallacy suggests, the obstacle name being applied to the whole planet, it's the exact opposite. The Sega Force guy could have heard Mobius said at the show floor and tied it with the corkscrew. I know how confused things can get in the aftermath of a show like CES or E3. Furthermore, gaming magazines of this era are not known for their stellar accuracy or high-quality journalism. This is, of course, only speculation.

Special Thanks:

Sonic Retro, where I posted a topic on this subject

Dean Sitton, for pointing out that Robotnik was mentioned in the interview

and Concept Mobius, for such a vivid example of the fallacy