|Ned Batchelder : Blog | Code | Text | Site|
Spore creature creator and steganography
» Home : Blog : June 2008
Spore is the wildly anticipated new game from Will Wright, and Creature Creator is the first part of it to be released for us to try. It allows you to build creatures, Mr-Potato-Head-style, which will eventually be usable in the full game:
It's fun to put arms and legs and body parts together to make creatures, but the more impressive part of the technology is that once you make your creature, it's fully animated already, with a repertoire of moves like walking, sitting, dancing and greeting. This is no small feat considering you aren't constrained to building a humanoid creature. For example, my tricyclotops has three legs, and that front centered leg participates in the animations in a way that seems very natural, considering I've never seen a creature with legs in that formation.
The developers behind this animation have written up the technology: Real-time Motion Retargeting to Highly Varied User-Created Morphologies. One of the authors, John DeWeese, has a handful of riotously varied creatures on his Spore page.
If you look at the sidebar on the Spore creature pages, you'll see instructions that you can save those PNG files, and drag them into Creator, and you'll have the creature. That interested me: one of the things I did with Aptus was to save the coordinate info for a picture as a tEXt record in the PNG file. Aptus can open a PNG file it saved, and instead of dealing with pixel data, can read the coordinates and recreate the Mandelbrot view directly, allowing you to continue exploring from there.
Looking at the PNGs on the Spore page though, they have not done this. There is no data other than the image. But dragging the PNG into Creator does indeed give you the creature as structured data. Renaming the PNG doesn't affect the data transfer, but any sort of editing of the image does. They're using steganography, hiding one message inside another. In this case, they seem to be using the least significant bits in all the pixels.
Some quick Python shows details. Using PIL, we can examine the numeric values of the pixels:
These pixels are part of the black transparent edge of the image, except it isn't truly black and it isn't truly transparent. There's one bit of information being encoded in each channel, or four bits per pixel.
We can go further and yank out the full 8-bit data:
I had to guess here how to put the bits back together into a byte. The results are full-spectrum 8-bit data, but I don't know how to interpret it:
Nothing jumps out at me here. As an exercise in code-breaking, this one is probably possible, since we have a way to generate as many cases as we need. I looked at other images, and there was no clear pattern.
It's interesting that Spore chose steganography here, since it's usually described as a way to hide a message so that its very existence is a secret. But there's no sensitive data here, and they tipped us off to its presence with their instructions. Perhaps they wanted to save space by using those unneeded low bits? Perhaps they didn't have the tools for manipulating tEXt records?
In any case, Spore is already a fertile breeding ground, both for wild new life forms, and geek interest in its technology.