Saturday, 12 July 2008

Locomotion in the game 'Spore'

'Spore', for those few who do not yet know, is a long-awaited computer game in which the player must design and guide a creature from life in some warm pond to a space-faring civilization. While there may not be that much overlap between those who play computer games and those who are interested in exobiology, 'Spore' should hold some interest for either party.

A few weeks ago a part of the game was introduced on its own: the 'Creature Creator'. If you type that into Google with 'spore' along, you will find it in no time. There is a free trial version as well as an inexpensive complete version. The 'creator' allows the user to stick various bits and pieces together to design interesting animals. The parts can be rotated, scaled, etc., and the animal can be coloured to great effect. The program works very smoothly. The resulting animals have a characteristic cartoonish shape and mode of movement to them, so I recommend playing with the trial version.

There are many things you cannot control, however. For instance, you can control the thickness of a body segment, but this works fro all dimensions of that segment. It would be hard to depict a very flat animal with this program, at least so it seems to me now. Another thing that had me puzzled was how the programmers dealt with movement: you can stick on predefined limbs, and then the animal will walk all by itself. I was interested in how the programmers had solved the problem of gait. The Furaha site contains a page on various gaits, and those who have read that will know that there are many different gaits, that all depend on the number of limbs. To see what would happen, I designed a simple animal with a sausage-shaped body, and stuck on up to five pairs of limbs.

-------------------------------------------

Let's start with the simplest design, a biped, with just one pair of limbs:


By the way, the video catch mode is built into the program; very neat! As you can see, the phase difference between the legs is exactly 50%, or indeed what you would want a walking bipedsuch as ourselves to do. I haven't sen anythingresembling gait controls, and if there aren't, there will be no way to get a kangaroo-like gait. That's a pity in a way, but I guess the complexity of gait control might confuse many players. To keep the number of videos down, I will not show you a tetrapod gait. It turns out there is only one, and it is a trot: the left fore and the right hind leg move in unison, and opposite to the other pair. Again, only a trot, so no walk, pace or gallop! Perhaps a walk could be added in the future: having a slow and a fast gait might make the species involved more interesting to look at, and it can't be very difficult to put in.

-------------------------------------------------------

Now, let's increase the number of legs to three; what gait will that give us?



It's a tripod walk! Nice one. The right front, left middle and right hind legs move together, in phase opposite the remaining pair. You can also view this as the phase changing by 50% as you go from to first to the second pair of legs, and from the second to the third pair.

----------------------------------------------------------

And now, of course, four or five pairs of legs. The result follows:



Well, well, the programmers decided to stop following that pattern, and now all legs on one side simply move together (except during turns, and designing a neat way of turning must have taken some thought). Using five pairs had exactly the same effect. Again, there is no way to control the gait, so there is no way to obtain the nice rippling effect successive small phase differences have on the general feel of how a centipede moves.

While I would like to see more control over body shapes and gait, let me stress how much fun it is to play around with this program. It really does what it sets out to do extremely well. In fact, the programmers even foresaw that some players would develop animals without any legs at all: even then you get movement of a sort. And oh yes, stride freqency seems to go down as body size goes up. I'm impressed.

2 comments:

eleazar said...

Double-click in test mode to get the creature to run. This generally uses a different gait.

eleazar said...

"And now, of course, four or five pairs of legs. The result follows:
Well, well, the programmers decided to stop following that pattern, and now all legs on one side simply move together..."


Not necessarily. In your example the legs are too close together to move in any way other than in altogether on one side.

By varying the number of joints, the space a leg has to move, the length of the segments, angles, etc. of legs relative to other legs, you can get very different styles of movement.

Also if you are interesting in gaits, you should try some branching limbs and/odd numbers of limbs. Not all the results look good, but it does a remarkable job at dealing with crazy combinations.