Machinations Wiki
Advertisement

This all started last December when Jiyoné and myself started poking around in the .tik files to see if we could use the existing character data in new ways. I started to believe that we could in fact do amazing things and so decided to try and make a new animation for the existing insane child character as proof of concept.

Having made the Tove character and successfully imported it into the game engine I realised that once the steps to convert a character, through the 3DSMAX SkelOut plugin and then the MAX2SKL commend line utility, where followed correctly and methodically the process was in fact fairly simple. I started thinking that what with the wealth of fantastic artwork just sitting in the base/models folder it would be great if we could somehow tap into all that and create new content for those characters. If we could make new animations for existing characters we could use their original geometry and existing animations along side brand new animations to put them into all new scenarios. What if we could even create a new model for existing animations? Animation is the most laborious and consuming part of modeling characters and Alice has 222 animations available which would have taken the talented animators at Rogue weeks to produce. If we could this wealth of animations with a new Alice model then we could change Alice's appearance far more dramatically than just a simple re-skin I had to get to the bottom of this!

Child geometry

I took a fairly simple character that I knew I wanted to mod for the Further Down the Rabbit Hole project, The Insane Child, imported him into 3DS MAX using Senkusha's EF2 SKB Import v1.0 BETA MAXScript, then started experimenting with re-importing him into the game engine. My first port of call was to try a direct export of the geometry and bone structure facing me in the view port, unfortunately I was soon to find a problem.

The FAKKTools SkelOut exporter presented no problems in exporting the geometry but when it came to converting the resultant SKL file into the SKB baseframe file needed by the game engine MAX2SKL outputs the following:

Bone #37 (Bip01 L Foot) unused.
Bone #38 (Bip01 L Toe0) unused.
Bone #39 (Bip01 R Thigh) unused.
Bone #40 (Bip01 R Calf) unused.
Bone #41 (Bip01 R Foot) unused.
Bone #42 (Bip01 R Toe0) unused.
removed 35 bones, 9 remain

All the skeleton bones where removed, The nine remaining bones where the tags present in most models for attaching other models, in the case of our Insane Child he has plenty in his head for attaching a brain, a vice or a gimp-strap-bridle-type-thing. I took this all to be good news of a sort, at least the tags survived the round trip. There's only one reason a bone gets removed, if it doesn't have any vertices attached to it. This at first struck me as odd because when importing an existing character you can see Senkusha's script loading in the vertex attachment data from the SKB file and applying this with the skin modifier to the geometry but herein lay the problem. As you can see from the above MAX2SKL output the bones are named "Bip01 R Foot" and suchlike, this is because all the game characters are build using Character Studio and these bone namings are the default biped namings. The other half of Character Studio is the Physique modifier and this is what you have to use in order to successfully re-import the skeleton.

Child with skeleton
Child frame

Ok so now I was getting somewhere, using Character Studio is something I know a bit about. First thing's first, I welded all the different parts of our Insane Child back together into one object, this will make the physiquing easier, and then made sure all the materials IDs where correctly applied using the Insane Child's TIK file as a reference. Senkusha's script imports each material as a separate objects but it is actually the FAKKTools export process that breaks the model up in this way, The FAKKTools export process also makes no distinction between Biped objects and MAX bones so on re-importing a character bones are all you'll see. I decided to replace the existent skeleton of MAX bones with a biped object and went about trying to match it, as closely as possible, to the existent bones. Using a biped object makes the animation process much, much easier but there are a few thing to be aware of. Firstly if your merely trying to make a new animation for an existent character any minute mistakes you make in positioning the Biped bones should simply appear to be part of the animation, this effect should be barely noticeable. Unfortunately this is rarely the case as there seem to be other imperceptible differences between the original skeleton and the new one, enough to make your character appear deeply deformed. As Senkusha's script imports the bones so perfectly my advice to anyone else wanting to try this is to go with the bones, they may be more hassle to animate but you'd be saving yourself a huge headache on the re-import.

Shot0030

Here he is, granted this new animation was simply a duplication of one of his twitches but the fact that I was able to duplicate it so closely is proof of concept.

it's also worth noting that you don't even need to use the existing geometry to make new animations. The only thing you need to be sure of is that the exported skeleton matches the imported one completely. this means you'll have to attach at least one vertex, using the physique modifier to each bone, not including tags, in order to have it export. I have succeeded in making new animations for the Insane Child using this method.

Alice the space cadet

Alice with new geometry.

With all these lessons in mind I decided to jump the gun and go straight for the holy grail, a new Alice model. In fact as I began to think on it I remembered getting several requests from the skinners on the old Asylum board for modifications to the Alice model, at the time I think I told them it was highly improbable we'd be able to do anything, but that was all before Senkusha's EF2 SKB Import v1.0 BETA MAXScript. So first I built her some new geometry. I gave her a derriere underneath that skirt, Aquatarkus had asked me to do this, I think he felt the ubiquitous skirt limiting to his costumiery Practically every other skinner there was had felt the limitations imposed by Alice's "shoulder puffs", as the came to be known, so on went some normal shoulders too. What about a head under the hair, I think someone had requested this also but by now I was starting to think about what all this could mean to the Further Down the Rabbit Hole project and a head and a longer skirt could both be very useful here so on they both went. Any other geometry that doesn't need to bend could be attached later so with the new geometry built and texture coordinates locked in I built in a Biped object. I felt certain I could get the Biped object to work this time, I was in for a bumpy ride. Let the exporting commence.

When using MAX2SKL.exe it's good to use the -verbose switch in order to get useful info about the compilation of you SKL files, even more so when making new animations for existing characters or making a new baseframe for existing animations, this option generates quite a lot of information so it's worth outputting to a log file.

Tip: max2skl alice -baseframe -verbose -force >log.txt

As you can see in the following example I have many extra bones. max2skl considers every object a bone but then removes all bones that are not attached to geometry and are not tags.

Bone #0 (Alice) unused.
Bone #2 (Bip02 Footsteps) unused.
Bone #12 (hair_nub_01) unused.
Bone #17 (hair_nub_04) unused.
Bone #22 (hair_nub_02) unused.
Bone #27 (hair_nub_03) unused.
Bone #32 (hair_nub_07) unused.
Bone #37 (hair_nub_05) unused.
Bone #42 (hair_nub_06) unused.
Bone #51 (Bip01 R Finger02) unused.
Bone #54 (Bip01 R Finger12) unused.
Bone #57 (Bip01 R Finger22) unused.
Bone #64 (Bip01 L Finger02) unused.
Bone #67 (Bip01 L Finger12) unused.
Bone #70 (Bip01 L Finger22) unused.
Bone #74 (Bip01 L Toe0) unused.
Bone #78 (Bip01 R Toe0) unused.
Bone #81 (left_bow_nub) unused.
Bone #83 (right_bow_nub) unused.
Bone #88 (left_bowstrap_nub) unused.
Bone #93 (right_bowstap_nub) unused.
Bone #98 (skirt_nub_01) unused.
Bone #104 (skirt_nub_03) unused.
Bone #110 (skirt_nub_04) unused.
Bone #116 (skirt_nub_05) unused.
Bone #117 (b_skirt06_01) unused.
Bone #122 (skirt_nub_06) unused.
Bone #128 (skirt_nub_07) unused.
Bone #133 (skirt_nub_08) unused.
Bone #138 (skirt_nub_02) unused.
Bone #146 (Bip02 R Toe0Nub) unused.
Bone #147 (Bip02 R Finger2Nub) unused.
Bone #148 (Bip02 R Finger1Nub) unused.
Bone #149 (Bip02 R Finger0Nub) unused.
Bone #150 (Bip02 L Toe0Nub) unused.
Bone #151 (Bip02 L Finger2Nub) unused.
Bone #152 (Bip02 L Finger1Nub) unused.
Bone #153 (Bip02 L Finger0Nub) unused.
Bone #154 (Bip02 HeadNub) unused.
removed 39 bones, 129 remain
Shot0003

Upside-down... boy ya turn me!

Firstly you can see it's removed Alice!!! But don't panic because it's only removed her as a bone, her geometry remains. The Bip02 bits are nubs and footsteps added to the biped by Max these aren't needed. We also have a load of other nubs that I've added myself. the reason for this is, at least with my physiquing practices, max2skl always chops of the last bone in a chain so if you want two finger links you have to add three, if you just want the foot bone you have to add a toe and for all Alice's bow, ribbon, skirt and hair bones you have to add a nub. The bone b_skirt06_01 has also been removed, this is unacceptable as this bone is present in all Alice's animations and her new basefreame must match the bone structure of her animations EXACTLY. Herein lies the importance of using the -verbose switch and capturing the output, this lets us know that we must make sure that at least one vertex is attached to this bone. Every time I needed to add a new link to the physique modifier this meant a complete re-initialisation and the subsequent 2+ hours of reassigning vertices needed each time. All in all I ended up doing this about 5 times!! So after modifying the biped and a complete rephysiquing I had the correct bone hierarchy, I knew this because the new Alice actually appears in the game window, a major milestone, unfortunately she appears upside-down and inside-out.

It turns out this is to do with the order which the bones appear within the SKL and therefore the SKB file. It doesn't matter if the hierarchy is correct if the order is not exactly the same as it is in the SKA files then no cigar.

Shot0002

Most of her old geometry seems in the right place and her new geometry, the technicolour rainbow bits, is all clearly visible.

Shot0001

Alright so her legs are going sideways and she has middle-aged-droop and lockjaw but this is again a milestone and something I could work on... or so I thought.

So as we seem to have relatively little control over which order the SkelOut plugin exports the bones in, I wrote a VBScript that would take a prepared order file and reorder the bones in an SKL file in that order. It worked very well and now I had a partially working Alice.

Shot0005

Alices new geometry in full working order!

Shot0006

Here's original costume mode. Looks just like the original model don't it? That's the idea!

No matter what I did I couldn't set this model right so I decide to ditch the Biped model, in fact I ditched the whole skeleton and brought it all back in from the original alice_baseframe.skb. After all my experimentation I knew exactly what needed doing. I moved my new Alice model into position over the skeleton added on the skirt nubs, the hair nubs, the finger nubs, the toe nubs, the bow nubs, the ribbon nubs and the mouth nub and then began one last round of assigning vertices. Two hours later I put Alice into the correct baseframe posture, with all her joints bent, and tentatively exported.

EUREKA! as a wise and naked man once ran through the streets of Syracuse shouting.

With shaders the new and old geometry can be turned on and off and Alice can change costume mid game! The imported bones do the job perfectly. All hail Senkusha!!!

Advertisement