14 September 2010

Let's Play Sonic the Hedgehog: The One Ring

I had a really great time watching this playthrough of my hack, so I want to share it here.

Playlist with all 19 parts

I want to give a big shout of thanks to 13th Nightmare (aka Horrormaniac13) for making this. I know I've scarred the poor man for life - he'll never be able to see an Orbinaut again without being gripped with dread. =P

13 September 2010

The Nitpicker's Guide to Sonic Genesis - Part II

Hello again, Code Ninjas! It has been quite a while since Part I, but never fear - slowly but surely I will give Sonic Genesis the drubbing it deserves. Welcome to The Nitpicker's Guide to Sonic Genesis - Part II.

Code Flaw #002: The Demos Are Totally Nerfed



The demo is completely different in the GBA version, and obviously much worse (Sonic is hurt twice, seems disoriented, and demonstrates less of the level). Why should this be? If we were uncharitable, we might chalk it up to the GBA team recording new demos which betray their underdeveloped skill level. However it is much more likely that the game is using the same demo data, but changes in the physics have thrown it off.

You see, the demo "movies" in the old Sonic games were not actual videos of the action - that would have taken up so much space it would have been prohibitive. Instead, the game itself is running, but with two changes: 1) the game resets when the player hits the start button or when 30 seconds have elapsed, whichever comes first; 2) the Sonic object isn't receiving input directly from the joypad, but from a chunk of data read sequentially from the ROM. This chunk of data was made by logging the button presses while someone played the level (for more information about recording joypad input "movies", see this post).

So, if the physics or level layout changes, the recording won't be appropriate anymore. It's as if your joypad were simultaneously plugged into two Sega Genesises (Geneses?), one of which contained a Sonic 1 cart, and the other, Sonic 2. You might be playing Sonic 1 beautifully, but anyone watching the Sonic 2 game will wonder why Sonic is suddenly acting like a drunkard. (They won't notice a difference in Tails' behaviour, though - wantonly flinging himself into harm's way is business as usual for him. =P )

The team who made Sonic Genesis should have recorded new demos after the physics were in place to avoid this issue. But, one can hardly blame them for not doing so; it would, after all, have involved playing the game, and I wouldn't wish that on anybody!

Fixing The Problem In Your Own Hack

This issue with screwy demos isn't confined to Sonic Genesis. ROM hacks will have the same problem if the physics, controls, or layout are changed, even slightly. I encountered it myself when making Sonic: The One Ring, and needed to find a way to record new demos that would be compatible with the ROM. I've turned what I learnt into a tutorial and utility - go here for the complete story. See, I'm not just complaining about Sonic Genesis just to be mean - I'm using it to frame programming tips to help you guys out! Aren't I nice?

Well, not that nice since I'm now going to throw in a few freebie Bonus Flaws out of spite!

Bonus Flaw #003: Wrong Credits Footage

In addition to having broken demos, the "demos" seen during the game's credits are broken, too. But none so badly as the Labyrinth Zone one: this time, not only does the control movie not sync up because of different physics, it's totally inapposite because the wrong area of the level has been loaded!

The famous underwater section where Sonic is pulled through the tunnel by the current, catching on to the breakable poles and avoiding spikes, has been inexplicably replaced by some other region of the zone.

Bonus Flaw #004: Marble Zone Button Keeps Turning Up Like A Bad Penny

This is pretty hilarious. It's supposed to load different graphics depending on the zone ID, but they can't even get that right.

Bonus Flaw #005: Underwater Palettes Incorrect

Sonic and the Badniks don't look right...



...but objects like doors and blocks fare even worse.

(And why does Scrap Brain Act 3 have such a horrible dark blue background? It's supposed to be a lovely, rich purple.)

Bonus Flaw #006: Missing/Incorrect Background Tiles

This flaw really does take the cake. This isn't a matter of not being able to properly port a complicated game's physics to a new platform, or something relatively forgivable. It's a simple matter of gratuitous incompetence and unconcern for the product.

Well, try to keep your lunch down, Code Ninjas - I know it's not easy after that rogue's gallery. Until next time!

12 September 2010

Failures of Imaginary Perspective

The human brain has evolved an extraordinary set of software for grappling with its environment. Working with data from multiple sensory inputs, it constructs a highly detailed virtual simulation of our universe.

And it has the ability - perhaps unique in the animal kingdom - to simulate that which is not but might be: imagination.

Using both the experience of past inputs and a toolset of built-in intuitions, the brain makes thousands of little imaginative predictions all the time; to judge distance, calculate consequences of actions, or even "converse" with itself as a second entity. (Most of us have had imagined conversations with persons absent.)

The brain's software for imagining the physical universe (how objects will interact, etc) has been called "folk physics". You can think of these folk physics as a sort of video game physics engine: a recreation of real-world physics, informed by real-world data and accurate to a degree, but still imperfect.

Folk physics aren't quite perfect because the brain has evolved to cope with everyday situations. Our ancestors (and for the most part, modern humans) would usually cope with moderate distances, speeds, sizes, and timespans. When it comes to extreme and unfamiliar situations, the brain's intuitions cease to be useful. For example, at the atomic or astronomic scales, common sense is useless; without tools like science and mathematics, we'd have little hope of ever having a meaningful understanding of realms beyond the mundane.

In other words, the brain can't just grasp this stuff on its own - it needs a lot of help. For instance, great spans of time can be rendered on a graph as visual information. Only then, with the data in a format that the brain understands, can patterns be recognised and useful work be done.

But it's not just the ultimate extremes of our universe that cause the brain to trip up. Oftentimes things much closer to home, only a step or two away from the deeply familiar, can fool our imaginations.

Which brings me to the actual point of this post. Creators of stories have long made their tales exciting by having them take place right on the edges of our experience. In the early days, that meant unexplored caves and mystic forests, peopled by ogres, fairies, gods, and mythical beasts. Today, it means a plethora of science fiction "what ifs". "What if you could read thoughts?" "What if we met aliens?" "What if you could travel back in time?" "What if you could shrink down to the size of an ant?"

These concepts are always fun to explore. They are the best of the human imagination, still hungry to explore that which is not but might be.

Exceedingly often, though, there are catastrophic failures of imaginary perspective. Folk physics fails the storyteller (moviemaker, etc) miserably when they try to picture an unfamiliar perspective.

We've all seen movies where spaceships make noise as they fly by; cartoons where characters can breathe and talk in space without spacesuits; or even movies where the most fundamental of all physical laws - the speed of light - is waived (either for the needs of the story or out of sheer ignorance, it's hard to be certain). This latter faux pas was commited by a Star Trek movie ("Generations"), of all things:

from chuggnutt.com

Point: In what is probably the worst production/science gaffe they could possibly make, Soran launches his missile from the planet towards the sun (to blow it up, remember) just as the Nexus is nearing. Immediately the sun darkens and explodes. Do you see what's wrong with this picture?

The sun should not have appeared to change for at least 8 full minutes. Not even counting the time it would take for the missile to reach the sun — let's suppose it has warp capabilities, to get around that issue — the light (and gravity) from the sun can only travel at the speed of light. And since they were on an Earth-looking planet, which is 8 light-minutes away from the sun, then that means there's no possible way the sun would appear to darken immediately—and the gravitational effect on the Nexus would be similarly delayed.

Huge, huge blunder. Somebody (preferably the writers) should have been fired for that one.

So much for Star Trek's reputation of scientific accuracy!

I've also noticed that there are glaring oversights just about any time a character is depicted as shrinking. In "Honey I Shrunk The Kids" (I find it embarrassing to admit I've ever seen this movie), the shrunken kids tame and befriend an ant, which behaves like a large dog. To the diminutive human characters, the ant is the size of a large animal, and so the screenwriters have it behave as one - growling, whimpering, munching food out of the children's hands. Later, it even shows loyalty, sacrificing itself to protect its newfound friends! The writers seem to forget that the ant is not actually a large animal, it just appears large to the newly shrunken humans.

Of course, "Honey I Shrunk The Kids" is a comedy, and can be excused. However, there's another big problem with just about every "shrunken" sequence I've ever seen - and it's a little harder to notice at first.

When you watch the wind blow through the trees, or stalks of a tall grain crop, they sway smoothly and slowly. But if you watch grass, even in a light breeze, it snaps back and forth super-quickly. This is because, of course, the distances involved are so much smaller.

If you were a shrunken, centimeter-high character on a lawn on a breezy day, you wouldn't see large majestic stalks of green grass waving lazily above your head. You'd see them bending double and flashing back and forth almost faster than your eyes can follow. It would be like the worst hurricane footage you've ever seen. It would probably be too overwhelming to cope with. It's understandable why this has never (to my knowledge) been depicted on film.

Also, you wouldn't see the breeze ripple its way through the blades, either. With every gust, all the grass would react in almost perfect unison. (A 10mph breeze can play through almost 15 feet of grass per second.)

So, next time you watch a movie with an unusual view-point, watch for failures of imaginary perspective. You might be surprised.