Monday, May 25, 2009

Changing heads in World of Padman

This is a copy & paste from a moddb blog entry that's nearly a year old, but I thought I should place it here, too. It's still all true though, especially the "World of Padman 2.0 coming (hopefully) later this year" part, it's just not the same year anymore. ;)

Since we just posted a news about different headmodels on different skins in World of Padman 2.0 coming (hopefully) later this year, I thought I would write a bit about how it's working and why we implemented it.
So the basic concept is, that by chosing a different skin for a model, like Padman for example, you're not only chosing the skinfile but, if the skin is set up accordingly, the head also switches to a different one.

Padman always used many different skins which gave him a totally different appearance and character. Still the geometry of the model only allowed changes to a certain degree. So that was one reason for me to push Ente a bit to get this head feature implemented. ;) I wanted to bring it a step further and bring even more diversity into the skins with not too much extra work. Looking at how important the face/head is to identify a person, this means you can pretty much create a new character without having to animate anything at all. The new character just has to share the body with a previous model, but the body is often enough defined mainly by the skin anyways.

What makes creating just a head over a whole new model much easier, other than the fact that the head is less work to model than is modeling a whole body of course, is the fact that Q3's "md3" format has the playermodel split up in 3 parts anyways. These parts are the head, the upper and the lower body. This was before skeleton animation in games became widely popular, which has some major advantages over the way Q3 handles animations with md3's, but for this case it also means that heads in the md3 format are not animated at all. They are only automaticly rotated by the game into the direction the player watches, they don't have any real animation, which makes it easy for us to create some.

I hope this feature encourages some modellers to create some heads for skinners or skin them themselfs without having to get a grip on Quake 3 animations for that, which I've seen alot of people get annoyed with. ;)

The way the game choses that headmodel is pretty straightforward. My first thought was that we could add a command in the skinfile that defines the head, but as raute, our coder, told me, the skinfile gets actually only loaded after the models. So how we're doing it now is just using the filename. If you select the blue stonepad skin for padman, the game first checks if there is a head_stonepad_blue.md3 in the padman directory, if there is none it goes on to head_stonepad.md3, which in our case exists and gets used, otherwise it would use the head.md3 model like usual which is padmans normal head.

So if you're planning some skins with crazy heads for WoP 2.0 already, you could just start in the current WoP and then test your new head with the /headmodel command and have the skin/head up and running when WoP 2.0 finally comes out.