Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Stridor's Vehicle Animation Tutorial

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [Current Games From Matrix.] >> [Discontinued Games] >> Panzer Command: Kharkov >> Maps, Models and Mods >> Stridor's Vehicle Animation Tutorial Page: [1]
Login
Message << Older Topic   Newer Topic >>
Stridor's Vehicle Animation Tutorial - 5/23/2008 11:11:29 AM   
Stridor


Posts: 5081
Joined: 9/8/2007
Status: offline
Hello Targets!

Well it is time for me to write another tutorial, this time as promised on how to rig and animate a tank in milkshape3D (MS3D) so that it can be exported into the game. Although I will be using MS3D, I hope that this information will be helpful to those using blender.

First a few caveats. This will not be a basic tutorial on 3D concepts or how to use MS3D. You can look to my earlier tutorials to get more information on these topics. Before you continue reading this thread you should probably first read the "Vehicle Animation Addendum.pdf" which can be found in the manuals directory off the root PCK install. Although the pdf was designed for 3DS max, the concepts therein will provide useful. It does unfortunately contain some errors of fact and omission and in those cases I will highlight the corrections as we progress.

Ok now the basics. Each vehicle (tank) in PCK is defined by a named xml entry in the main "Data/ArmouredUnits" directory. This file contains the game statistical data on the tank, gun, attributes, that sort of stuff. However if you look under the <set> tags you will see how the actual in game model files are referenced. For reference let's load up the "Pz Kpfw IIF.xml" in notepad or your favorite xml editor. Notice how there are two <set> hierarchies, on called setid="default" the other setid="summer". These define different models to use depending on the map setid tag in use. If the map is set to "summer" then the "summer" files get loaded. If set to "default" then the default (winter) files get loaded. If the map is set to "spring" then the default will still get loaded as the game can't match the map tag to the setid tag. Keep this in mind when making your own scenarios.

Next look to the models section under each set group. A tank needs a compendium image which is a 238x135 png file which used in the specs and purchase screens. I attach a blank "background.png" target set with this post which you can use with your own vehicle compendium images so you can get a consistent in game look along with the other game vehicles. Then there are 8 other parts of the tank which must be referenced.

1. The "base" - This is the Hull of the vehicle, it is connected to the wheels
2. The "turret" - The Turret which is attached to the "base". If you are modeling a vehicle without a turret you need to link in an "empty" turret file. I will provide one of these in a later post.
3. The "right_tread" - The right hand track. Again if you are doing a non-tracked vehicle you will need to point to an "empty" file (use the empty turret file)
4. The "left_tread" - See 3.
5. The "right_wheels" - Obvious
6. The "left_wheels" - Obvious
7. The "treadMarks" - These are the depression marks a tracked or wheeled vehicle leaves on the landscape as it moves around. More on this later
8. The "commander" - This is the tank commander figure. There are a whole host of German and Russian tank commanders to choose from found in the "Data/Infantry/GERMAN TANK COMMANDER" & "Data/Infantry/GERMAN TANK COMMANDER" directories.

In general you will want to put all these reference files which make up your vehicle inside their own directory off the main ArmouredUnits directory. If we use our "Pz Kpfw IIF" example we would create a directory called "Pz Kpfw IIF" where we then place all our files. Although it is not necessary, I would strongly suggest doing what I do, which is to then create another directory under that for each setid (camo) you wish to define. Example "Pz KpfwIIF/Summer", "Pz KpfwIIF/Winter", etc. There is a good reason for doing this, and a good reason for having a consistent naming scheme for all our tank parts and textures which we will get to in a future post.

Please find attached a blank target background png for compendium images.


Attachment (1)

< Message edited by Stridor -- 5/23/2008 2:23:27 PM >
Post #: 1
RE: Stridor's Vehicle Animation Tutorial - 5/23/2008 11:52:57 AM   
Stridor


Posts: 5081
Joined: 9/8/2007
Status: offline
Now what we need to do next is to decide what vehicle we are going to work on.

Originally I was going to use my new jagdpanther, but as that was a TD with a no turret, I thought it best to do something which was turreted so that you could see how the whole enchilada works.

What I finally decided on doing was re-doing an existing vehicle the (you guessed it) Pz Kpfw IIF. The reason is because many of the older PCOWS vehicles need to be revised. They suffered from numerous issues which I won't go into here. So I figured it would be a good idea to go back and fix up one of the older vehicles and bring it up to PCK standards.

What I am going to do here is attach a fully working rigged and animated Pz IIF which I have saved in MS3D format, so that you can load it up and follow along.

Inside you should find the "Summer" files

body.dds (This is the main texture map)
tread.dds (The texture map for the tracks)
Normal.bmp (The texture normal map, more on this later)
compendium.png
PzIIF_complete.ms3d (This is the M3SD model)

I am not going to show you how to actually make a PzIIF in this tutorial using MS3D. That is something which you can learn from numerous other online tutorials about MS3D. What I want to focus on is how to take your finished model and make it ready for PCK.

EDIT: When you load up the PzIIF model for the first time in MS3D it will be untextured because it will be looking for textures in a place where you probably won't have them on your computer. It is important when you first load the model into MS3D to repath the textures to where you have placed the body.dds and tread.dds textures when you saved the zip file. To do this, go into Materials, select the Body material then click the button which will then be marked "body.dds". Select where you have stored the body.dds file. Do the same thing for Treads as well. You can ignore the Tracks entry for now. It is not 100% essential that you do this, however if you don't you will be working with a untextured vehicle in MS3D. A final note is that MS3D screws up the display of dds files a bit. Don't worry you tank will look fine in the game even if it looks a bit odd (read transparent) in MS3D.

Attachment (1)

< Message edited by Stridor -- 5/23/2008 12:50:28 PM >

(in reply to Stridor)
Post #: 2
RE: Stridor's Vehicle Animation Tutorial - 5/23/2008 12:37:01 PM   
Stridor


Posts: 5081
Joined: 9/8/2007
Status: offline
Lets start very simply.

To begin with we need to get our units right. This is easy. MS3D has no adjustable units. What I recommend that you should view each MS3D default unit as a meter. So if the coordinate display in the bottom right corner says: X 1.961 Y -2.312 Z 4.812 This means that you are 1.961 meters from the origin in the X axis. Use this information to scale your vehicle appropriately. Most online stats for these vehicles are in meters so that makes everything nice and easy.

Next you want to have your vehicle resting its wheels or tracks on the Z Plane (i.e. Y = 0). If you were to trace a line a shell from the main gun would follow, the shell should move progressively along the Z axis toward more *negative* numbers. See the screen shot below. This will correctly orient the tank front/back in the game. As you go up from the ground in height, the Y axis values should also increase (to get correct top/bottom orientation). Once you have oriented your tank along these axis appropriately, the X axis should short itself out (see Top view below).

One final point of note is that you should move your tank so that the turret rotation center overlies the origin. This is very important. In PCK turrets (and vehicle bodies) rotate around the origin. For a tank like the PzII which has an offset turret this creates a problem. If you center the tank hull on the origin then when it rotates in the game it will do so correctly, however as the turret is now off-center, as the turret turns it will appear to "slide off" the hull. Given that it is really hard to tell exactly where the hull is rotating from (even if it is slightly off-center) but really easy to spot a "sliding" turret, I think it is best to center the vehicle over the origin over the turret rotation point. For vehicles which are more symmetrical it is less of a problem.




Attachment (1)

(in reply to Stridor)
Post #: 3
RE: Stridor's Vehicle Animation Tutorial - 5/23/2008 1:23:08 PM   
Stridor


Posts: 5081
Joined: 9/8/2007
Status: offline
The next step now is to group your mesh elements into logical tank pieces. Anything which can move independently of another piece at any stage of the animation cycle should have its own group. If you look under the group tab you will see that I have already done this for you. Double click on a group entry in the list and you will see the corresponding mesh elements highlighted (in the screen shot I have highlighted the body). A really handy shortcut in MS3D is CTRL+SHFT+A which deselects all selections. You will be using this a lot so commit it to memory. Always pay attention to what is selected and what is not. If you double click on another mesh group it won't by default deselect the first, so you have to be aware of this.

What you will do with your tanks is to select your geometry with the selection tools and then come into the groups tab and press the "Regroup" button. This will form a new group which will appear at the bottom of the group list. MS3D will give it some default name which you will want to change by selecting it and then typing in a more helpful name into the rename box, then press the rename button.

With the body example above, you will notice that I have included in the mesh, hull mounted boxes, spare wheels, exhausts, etc. If you wanted to have these things blow off the tank when it dies or jiggle around when it moves, you would need to create separate mesh groups for them. I have kept this example simple, but with respect to animation your imagination is the limit (of course it takes far more work to animate the bling if you so choose).

Have a good look at the Groups list and how I have done it. Double click on each group element to see what it corresponds to on the model. The body, turret, tank commander hatch, each track and each wheel has its own group appropriately name. In general this is how you will want to do your vehicle as well.




Attachment (1)

(in reply to Stridor)
Post #: 4
RE: Stridor's Vehicle Animation Tutorial - 5/23/2008 2:21:35 PM   
Stridor


Posts: 5081
Joined: 9/8/2007
Status: offline
Just a brief note on how animation works in MS3D and PCK. The technique they both use is keyframe animation http://en.wikipedia.org/wiki/Keyframe. There is no concept of time as such in PCK only "frames" (which are defined in the game but probably represent ~ 10 seconds however this is not important). You have 301 separate keyframes to play with.

These are broken down as such:

Frame #
1-61 : Normal Wheel Rotation
200,201,202 : Tank commander hatch Closed, Open, Closed
216-250 : Destruction animation
-301 : End animation frames for a total of 301 frames

I should point out here that this represents a difference to how the animation cycle is defined in 3DS Max and thereby how it is written in the Vehicle Addendum pdf I told you to read at the start. In max animation starts at 0 and ends at 300. In MS3D animation starts at 1 and ends at 301. So if you want to convert one to the other you need to keep this difference in mind.

The basic animation primitive in MS3D is the "joint". This is roughly equivalent to the 3DS max bone. Joints in MS3D can be linked to mesh groups so that you only need to animate the joint to animate the corresponding mesh geometry. Joints can also be linked together in a logical hierarchy so that animation is inherited. For example you link your tank body joint (which is bound to the tank's hull) to the tank turret joint (the body is the parent in this case). What this means is that any animation the body joint does will be inherited by the turret. This makes sense, if the hull rotates left so will the turret. Likewise the Tank commander's hatch is linked to the turret joint, etc. Earlier I mentioned that I could have separated off hull "bling" meshes like boxes, and spares so that when the tank blows up they go flying off. To do that I would need to link their joints to the parent body joint. For most of the animation they will be joined together and move as a logical whole, until which time that the tank blows up, when they will go their separate ways

To control animation in MS3D there is the animation menu (shown top - always ensure Operate On Selected Joints Only is selected) where you can set, delete, copy, paste etc keyframes), The animation timer control which you can drag through time (show bottom). In the bottom right corner is the big Anim button. With this activated you are in animation mode and can do animation things. With it unselected you are back in standard editing mode. The minimum fame (0) the current frame (220.0) the maximum frame (301) and total frames (301) are also shown. You want to make sure that the min fame is set to zero, with the maximum and and total frames set at 301 (all as shown).




Attachment (1)

(in reply to Stridor)
Post #: 5
RE: Stridor's Vehicle Animation Tutorial - 5/23/2008 3:02:03 PM   
Stridor


Posts: 5081
Joined: 9/8/2007
Status: offline
Although in my example file I have already defined all the joints for you, I will tell you how to do it for yourself.

First if you are in animation mode please get out of it. It is a good idea to be out of animation mode for most things (like adding geometry, joints, saving and exporting, etc), except of course unless you are animating .

Now under the Model tab of the tools pane, press Joint. Now click somewhere near the origin in one of the plan views (not the 3D view). You will see a red clircle with a cross appear. This is a joint (as selected joint - unselected joints are blue). Now if you were to click again another joint would be created which would be connected to the first in a standard parent child relationship. At this stage we don't want that so press CTRL+SHIFT+A to deselect all (your joint will turn deselected blue). Now go into the joints panel an you will see that MS3D will have given the joint a default name. Please rename it to "Frame_mesh" (exactly as spelt). This is our top level direct X hierarchy which we need. Ok now select this joint again (you can do that by double clicking in the joint panel or using the selection tools in the Model panel. We want to move this joint to the origin so select move, absolute (ensure all the axis are selected) type 0,0,0 and then press move. If you did it right the Frame_mesh joint should now be centered on the origin. Well done. That is all we need to do for that joint.

Next we are going to create our link joint hierarchy which in this case will be joints

body -> turret -> hatch (tank commander hatch).

Do to this. Deselect all. Click on the add Joint button in the model tab and click three times, once roughly in the center of the body, once roughly on the center of the turret and once roughly over the TC's hatch. Notice how each time you do this you will get a linking arrow between the joints. These joints are now linked. Please go into the joint tab and rename them as follows "Frame_bone_body", "Frame_bone_turret" and "Frame_bone_hatch". Now deselect all (from now on CSA for the keyboard shortcut). Double click on the body joint and then move it to the center of the body mesh as follows. Model -> Move -> Center of Group -> Body. Click move. This will move the body joint to the center of the body. Do the same thing with the turret joint and the hatch joints (remember to CSA after each joint operation). You will want to manually move the hatch joint so that it sits on the hatch rotation point (ie the hatch hinge) as this is where the hatch will "rotate" to open and close. If you did it right it should look like the following screen shot.

You can control how the joints are displayed by selecting the options under the Vertex Weights group. They can often get cluttered so you may want to turn "Show skeleton" off.






Attachment (1)

(in reply to Stridor)
Post #: 6
RE: Stridor's Vehicle Animation Tutorial - 5/23/2008 3:19:56 PM   
Stridor


Posts: 5081
Joined: 9/8/2007
Status: offline
Now we need to assign our mesh groups to our bones.

To do this CSA. Next double click on the Frame_bone_body joint in the joints list. This will select this joint. Now go into the Groups tab and double click on the Body mesh group. You should have the body mesh selected *and* and the body joint selected. Now go back into joints and press the assign button. This will assign the selected geometry to the joint. CSA. Check the Draw Vertex weights check box. Double click back on the body joint and you should see the body mesh now also gets selected. Congratulations you now have a joint-mesh link. CSA!

You now need to repeat the above for the turret and the hatch joints.

As a tip, with a selected joint you can click on the color button and select a color a joint group should be. Then by checking the "Draw vertices with bone colors", you can at a glance see how your joints link to your mesh groups.




Attachment (1)

< Message edited by Stridor -- 5/23/2008 3:20:37 PM >

(in reply to Stridor)
Post #: 7
RE: Stridor's Vehicle Animation Tutorial - 5/23/2008 3:50:08 PM   
Stridor


Posts: 5081
Joined: 9/8/2007
Status: offline
Now it is finally time to start doing some animating. What's more we will start with the best bit, the destruction sequence. This is where you can get really creative.

Ok CSA. Double click on the Frame_bone_body joint. Click the Anim button to change into animation mode and drag the animation time slider to frame 1 (all the way to the left). Time to set our first keyframe. To to this press Model->Move->Relative->Z -1 then press move. The whole body + (turret and hatch as they are linked) will have shifted on the Z axis one meter ?!?!?. Now immediately select Model->Move->Relative->Z +1 then press move. Its all back to normal, what was the point of all that!?!?! Well unless MS3D see some type of movement or rotation of a joint it won't allow you to enter a new keyframe. What I just did was essentially allow me to enter a new initial keyframe by a dummy move. You can now set the keyframe via the Animation menu or by pressing Ctrl + K. Next you need to do exactly the same thing at frames 201 and 216 (or you can just copy and paste the Frame# 1 keyframe from the animation menu). What you have just done is set the body to be in a neutral configuration for these frames. You need to do this!

Ok *NOW* you can have some fun. The death animation starts at 216 with a neutral keyframe which you have already set and run till 250. So do whatever you like with moves and rotations of the body joint. Death is pretty violent and should be over in about 0.5 - 1 second otherwise it looks like it is in slow motion. If you have a look at what I did I gave the hull a rocking motion starting from 216 and running til 230 ~ 0.5 seconds. I did it in ~ 5 frame blocks (216-220-225-230) to allow me to synchronize other bits of animation. So I moved the time slider to 220 and then rotated the body joint back and to the left a bit. Once I was happy with the position I pressed the set keyframe option from the Animate menu (Ctrl + K). Then I moved the time slider to 225 and the "rocked" the body back again, set the keyframe and continued. You can drag the animate time slider back and forwards to see your work in action . Once I saved my final keyframe at 230 I moved the time slider to 301 (max keyframe) and did another move Z -1 / +1 to fix a final "death" keyframe of the body.

CSA.

Now do the exact same for the turret joint and the hatch joint. Remember you need to set netural keyframes at 1,201,216 and a final death keyframe at 301. You can check out what I did with the example file. I kept it simple for the purposes of this tutorial. You can have as much fun as you like.

Remember to ensure that Operate on Selected Joints Only is selected, CSA, get out of animation mode ASAP. Save often. If you totally screw up a keyframe sequence you can also select the joint then choose Remove all keyframes from the Animation menu.

There is no real SS I can do to help show you all this, it is best to just have a play around with the demo tutorial file.

< Message edited by Stridor -- 5/23/2008 3:52:59 PM >

(in reply to Stridor)
Post #: 8
RE: Stridor's Vehicle Animation Tutorial - 5/24/2008 1:14:57 AM   
Stridor


Posts: 5081
Joined: 9/8/2007
Status: offline
Just a little extra point about tank commander hatch animation.

CSA. Double click the hatch joint.

The hatch needs to be keyframed closed at frame 200 and 202. So go and do this now with the Z -1 / +1 trick and set those keyframes. Now at frame 201 you need to rotate the hatch into the open position. Set that keyframe and then slide the time slider to check your work. Frame 200 closed, 201 open, 202 closed. Good. The hatch must also start closed at the beginning of the death sequence frame 216 but you should have already done this. The hatch must then fly open during the destruction sequence. This is because if the TC was unbuttoned when the tank dies what would happen is the hatch would appear to close during death which would look odd. With the hatch flying open it doesn't mater then if it started open or closed to begin with it will all look ok.





Attachment (1)

(in reply to Stridor)
Post #: 9
RE: Stridor's Vehicle Animation Tutorial - 5/24/2008 1:43:49 AM   
Stridor


Posts: 5081
Joined: 9/8/2007
Status: offline
Ok now it is time to animate the tracks (TreadL & TreadR). You do this in exactly the same way as has been described. In this case we don't want to link the main joints to anything (the treads will remain animation independent). So as a summary: Exit animation mode. CSA, add new joint, rename it to Frame_bone_treadL, move it centered to the TreadL mesh. Select the TreadL mesh, assign the joint to the selected mesh. Go into animation mode. Move slider to time 0. Z -1/+1 set keyframe. Move to time 201. Z -1/+1 set keyframe. Move to time 216. Z -1/+1 set keyframe. From 217-230 animate the death of your track (I have it swinging off the wheels you can do whatever you like). Set a final death frame at 230. The move to 301 Z -1/+1 and set the end animation sequence death frame for the treadL. Ok now CSA and do it all again for the right tread .

Strictly speaking you don't need to animate your treads at all if you don't want to, I just think it gives the death animation more flare.

Another point to make on tread animation is that the normal rolling movement of the tread during the actual tank move is not done with keyframes but with a sliding texture technique within the PCK engine itself. For this to work you need to texture you tread in a top / down manner (shown). If you have done it right the tank tread should animate smoothly during the move cycle and in the correct direction! If you find the treads are moving backwards when they should be moving forwards you need to rotate your tread.dds texture 180 degrees in your paint editor and then rotate the tetxure mapping in MS3D 180 degrees to match. That will reverse the tread animation direction so that it is now correct.




Attachment (1)

(in reply to Stridor)
Post #: 10
RE: Stridor's Vehicle Animation Tutorial - 5/24/2008 3:06:31 AM   
Stridor


Posts: 5081
Joined: 9/8/2007
Status: offline
Now it is time to animate the wheels.

Just like for the treads you will need to define joints for each and every wheel mesh you have (all 22, 11 on each side). Please do this now, name the joints Frame_bone_wheelLXX for the left side and Frame_bone_wheelRXX for the right sided wheels. Center and Connect the joints to their respective meshes.

Ok we are going to do the wheel rolling animations now. To do this we need to select all of our wheel joints all 22 of them. It is for this reason it may be helpful to break your MS3D model up into various pieces now to make it easier to work with. For example we should delete all non wheel meshes and joints and save the file as PzII_wheels. You can do the same with the body / turret / treads if you like. Remember if you are going to do this each piece needs to have the Frame_mesh joint saved as well. This makes exporting the various pieces of the tank easier as well, if you are going to split your model it is a good idea to make sure all your final edits/scales/common animation parts are all finalized first. You can re-merge the later again if you wish (in fact that is exactly what I did to make the tutorial file).

So however you want to do it exit animation, CSA, select all the wheel joints only. Now go into animation mode, move to frame 1. Z -1/+1 move, set keyframe. Now we are going to set our first wheel rotation. Move the time slider to frame 16. Next do a rotation with the following settings
Rotate Origin, X = -88.5, Y = 0, Z = 0, Local rotation. Then press the rotate button. All of your wheels will have rotated by -88.5 degrees. Now set the keyframe. Now move to frame 31 and press the rotate button again (total rotation now -177 degress), set the keyframe. Do this again at frame 46 and then again at frame 61 for a total rotation of -354 degrees in 4 steps. Move the time slider to see your wheels rotate smoothly. After frame 61 the PCK engine moves the wheels back to frame 1 so it should loop well (actually there is will a tiny weeny stutter from 61->1 which is a PCK engine thing which you can't do much about and you can't even really see at normal x1 running speed). Now remember to Z -1/+1 set keyframes at 201, 216 and 301 to complete the wheel animation. You could if you liked add a wheel death animation, but I chose not to. Because the wheels are not joint connected to the body they won't move with the body animation during death. That is ok because it is assumed the suspension is working. If they did move it would look silly, That is why they are separate from the body.






Attachment (1)

(in reply to Stridor)
Post #: 11
RE: Stridor's Vehicle Animation Tutorial - 5/24/2008 3:31:58 AM   
Stridor


Posts: 5081
Joined: 9/8/2007
Status: offline
Now we have the all the animation done!

What is left to do now is the rigging points to let the PCK engine know where things should go on the vehicle.

These are:

The muzzle flash and shell direction points for both the main gun and any machine gun.
The tank commander position
The position of any infantry tank riders

These are pretty easy to do. They are all points which get represented by non-connected joints.

So let's start with the main gun muzzle flash. Exit animation, CSA, create a new joint, name it "Frame_bone_firingpoint01" (do this exactly). Next move the joint to be over the site where you want the muzzle flash to fire (see SS). Next create a new joint called "Frame_bone_firingpoint01_dir" (do this exactly). Now move this inline with Frame_bone_firingpoint01 so that it "points" the direction of shell travel (shown).




Attachment (1)

(in reply to Stridor)
Post #: 12
RE: Stridor's Vehicle Animation Tutorial - 5/24/2008 3:42:24 AM   
Stridor


Posts: 5081
Joined: 9/8/2007
Status: offline
You will want to do exactly the same for any hull mounted or turret mounted MG. In this case use the names "Frame_bone_firingpoint02" and "Frame_bone_firingpoint02_dir". After you export these pieces if you are not happy with how they look in the game you can always come back and change their positions and re-export.

Next we will do our tank commander (TC) position. This is the position the TC will assume in an unbuttoned vehicle. Again you make a new joint called "Frame_bone_tankcommander" and this corresponds to the TC model's pelvis. Unless you have the TC model you want to use merged into your tank file it will take some trial and error exporting to get the TC joint just right. You might find that you have set it too low in the game for example and then need to come back and make an adjustment. To make matters worse each TC is slightly different so lots of fun to be had . Check out my example and the SS below for where I placed my TC joint. In the game his right arm clips ever so slightly, but I thought it was ok, you can make changes as you see fit.




Attachment (1)

(in reply to Stridor)
Post #: 13
RE: Stridor's Vehicle Animation Tutorial - 5/24/2008 4:00:14 AM   
Stridor


Posts: 5081
Joined: 9/8/2007
Status: offline
Now you will want to define a squad tank riding position.

A squad is shown riding a tank as a three figure representation.

The joints are to be named "Frame_bone_position01", "Frame_bone_position01_dir", ...02 and ...03. The "_dir" joint is not really used by the game but it must be present for the actual positioning system to work, so include it but its exact position is not all that relevant.

The main position joints represent the foot of the soldier, so you want to put them on the back deck. For a tank with a small uneven back deck like the PzII it will be impossible to get all yours guys on without some form of clipping. It is inevitable so do the best you can. Again this is a trial and error thing. Place the joints where you think the best spots are, export the tank into the game, mount some infantry during the setup phase and then see how it all looks. Keep in mind that mounted infantry can change facing on the back of the tank so you will want to test them in game with different facings to see how it all works, then make MS3D changes as needed.

The SS below shows the Frame_bone_position01 and Frame_bone_position01_dir joints. Also please keep in mind the naming's for these things things muct be exactly as I have described them otherwise PCK won't display them.




Attachment (1)

(in reply to Stridor)
Post #: 14
RE: Stridor's Vehicle Animation Tutorial - 5/24/2008 4:41:23 AM   
Stridor


Posts: 5081
Joined: 9/8/2007
Status: offline
Now it is finally time to take all your work and export it into the game.

So let's start with the body. First get out of animation mode, CSA & save your work. Next you need to mirror your model on the X axis. To do this from the Tools menu select Mirror All... Then choose Mirror Left<->Right and press ok. You need to do this step prior to export so that the tank is oriented correctly in the game. It may be worthwhile saving a "X flipped" version at this point to save time later on.

Now we need to go into the groups and delete *ALL* mesh groups except for the Body mesh. The we need to go into joints and delete all the joints except:

Frame_mesh
Frame_bone_body
Frame_bone_position01
Frame_bone_position01_dir
Frame_bone_position02
Frame_bone_position02_dir
Frame_bone_position03
Frame_bone_position03_dir

As these joints are needed for the body export.

Now go to File->Export->Direct X (JT) ...

You will asked for a direct X name. I suggest the following "<PCK ROOT DIR>/ArmouredUnits/Pz Kpfw IIF/Summer/body.x"

Now set the export settings exactly as I have them shown in the SS. You only need to set them once and they will stick with the exception of the Position Scaling option which always resets to 0.1 for some reason. You must export with all options and number exactly as they appear in the SS otherwise it won't work. The Root Frame Name you can leave as the suggested name by MS3D. Just remember than once you have done it correctly the first time all you will need to do subsequently is change the scaling to 0.3937. Don't forget! Press Ok and you have just exported your first piece of your new tank.






Attachment (1)

(in reply to Stridor)
Post #: 15
RE: Stridor's Vehicle Animation Tutorial - 5/24/2008 5:00:17 AM   
Stridor


Posts: 5081
Joined: 9/8/2007
Status: offline
Next up is the Turret.

Reload your "X flipped version" you will want to delete all of the meshes except the Hatch and Turret meshes. You will also want to delete all joints except the following:

Frame_mesh
Frame_bone_body (*** Note you want to keep this as it is the parent control animator for the turret ***)
Frame_bone_hatch
Frame_bone_turret
Frame_bone_firingpoint01
Frame_bone_firingpoint01_dir
Frame_bone_firingpoint02
Frame_bone_firingpoint02_dir
Frame_bone_tankcommander

Then export as you did for the body. This time call it turret.x (and save it in the same summer directory)

Reload your flipped version, do the same for the left tread delete all non left tread meshes and delete all joints except:

Frame_mesh
Frame_bone_treadL

Export as treadL.x

Do the exact same for the right tread and export as treadR.x

Reload keep all the left wheel meshes. Delete all joints except:

Frame_mesh
Frame_bone_wheelL01 .. 11

Export as wheelsL.x

Rinse and repeat for wheelsR.x

Almost finished.

All we need to do now is export the track marks mesh. Now for some reason you have to do this with the original "non flipped" version, so don't mirror it on the X axis before exporting. Once again delete all joints except Frame_mesh and all mesh groups except Tracks. The Tracks mesh is textured with a default "tank tracks01.png" texture which is found in the Media/Graphics subdirectory. It is not a dds. I designed my own custom tank track texture for my panther, jagdpanther and several other tanks I helped export in the game based on the actual tread pattern (it is a monochrome photo negative of the actual tread texture). You can do this as well, for the Pz IIF I opted to just use the default texture. If you are going to use the Track mesh in your own vehicles (and you should), remember it must sit on the origin and can only be moved and scaled in the X axis *only* otherwise you will get artifacting of the tracks particle in the game.

(in reply to Stridor)
Post #: 16
RE: Stridor's Vehicle Animation Tutorial - 5/24/2008 5:16:02 AM   
Stridor


Posts: 5081
Joined: 9/8/2007
Status: offline
Now all that remains is to make the edits to the Pz Kpfw IIF.xml to reflect the location of our new files. A sample of the file is shown below

<set setid="summer">
		<models compendium="PZ KPFW IIF/Summer/compendium.png">
			<model name="base" filename="Pz Kpfw IIF/Summer/Body.x"/>
			<model name="turret" filename="Pz Kpfw IIF/Summer/Turret.x"/>
			<model name="right_tread" filename="Pz Kpfw IIF/Summer/TreadR.x"/>
			<model name="left_tread" filename="Pz Kpfw IIF/Summer/TreadL.x"/>
			<model name="right_wheels" filename="Pz Kpfw IIF/Summer/wheelsR.x"/>
			<model name="left_wheels" filename="Pz Kpfw IIF/Summer/wheelsL.x"/>
			<model name="treadMarks" filename="Pz Kpfw IIF/Summer/Treads.x"/>
			<model name="commander"
				filename="\..\Infantry\GERMAN TANK COMMANDER\Tankcommander_Comms.x"/>
		</models>
	</set>


The reason why I like every setid to have a common naming structure and subdirectory for the tank parts and texture references is because it is then really easy for someone else to come along and make a new textured version of your tank without having to do any MS3D re-exporting.

If you did everything right you should have this (a real heavy duty battle machine in background for scale reference )

So long future targets!






Attachment (1)

(in reply to Stridor)
Post #: 17
Page:   [1]
All Forums >> [Current Games From Matrix.] >> [Discontinued Games] >> Panzer Command: Kharkov >> Maps, Models and Mods >> Stridor's Vehicle Animation Tutorial Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.799