DeathWish
31st Jan 05, 9:00 AM
I got a PM from Sumillius asking for help with madstate anims. The following is the response I sent him, I figured it might be helpful to others as well.
This tutorial assumes you have Maya 3 with all the RDN Tools plugins fully installed. It also does not explain modeling, texturing, UV Mapping, creation of joints in maya, etc. It only explains animating for Homeworld 2.
Before beginning this tutorial you may find it useful to download MadstateTut.rar (http://www.slothworks.com/MadstateTut/MadstateTut.rar) and follow along step by step. This archive includes source files as well as compiled HW2 ready files.
To take a look at the finished product before beginning put the contents of the data folder in your %HW2_ROOT%/data directory. This replaces your Hiigaran Probe with an impromptu target drone inspired by the Kushan target drone from Homeworld 1. This is the ship we'll be animating in this tutorial. It's not pretty but it functions perfectly.
If you would like to take a look at the finished maya scene before you begin, take a look at hgn_probe_after.ma to get a good idea of what we're aiming for here today.
To follow along with this tutorial, open hgn_probe_before.ma
The process goes something along the lines of this:
Step 1: keyframe your animations; be sure to only move the joints, not the parts of the model. To achieve this place the parts of your model that you want to move below your joint on the hypergraph. Some general rules you'll want to follow:
* Joints should be placed at pivot points
* Parts that move along the same pivot should be on the same joint
* Always make frame 0 look like your idle or rest state because ships always spawn at frame 0. Always start your animations at frame 1 so they will not conflict with this idle state.
*Joints at frame 0 should have x,y, and z rotation of 0.0 and x,y, and z scale of 1.0 to avoid confusion later down the road. It is far easier to simply know that your rest state is at zero than it is to copy and paste every time you want to have a frame at the rest state. Along the same lines I find it helpful to have notepad open in another window so I can copy and paste translation, rotation, and scale values that I know I'll be using in other frames later on.
*Animations in HW2 run at 24 frames per second. If you want your animation to be 1 second long, make it 24 frames long.
Step 2: Keyframe your anim markers. You can create anim markers by clicking any empty area in the hypergraph with nothing selected then press <CTRL> + <G> to create a null marker, then click the matey button with that null marker selected. Create one keyframe with that marker selected at the BEGINNING and another at the END of EACH animation. This is imperative, you can have as many keyframes per animation as you like for the joints but only two for each marker, a beginning and an end. Be sure to name each of your markers the same as the states you plan on using. This is not necessary but it avoids confusion later on and animation is confusing enough as it is.
Step3: Export all to shipname.mad where shipname is the name of your ship.
Step4: Export all to shipname.hod where shipname is the name of your ship.
Step5: Create your shipname.madstate file, look at the vgr_probe.madstate and vgy_heavymissilefrigate.madstate files for good examples of syntax. Look at the Madstate documentation that comes with RDN Tools for a technical description that makes very little practical sense. In our case you may look at the hgn_probe.madstate that is packaged in this archive. It includes all the madstate syntax needed for this ship we've created.
Step6: Add your animations to the shipname.events file, this is necessary if you want sounds to accompany your animations. I'm not certain if it is necessary for the animation itself.
Well, if your file ended up looking like the hgn_probe_after.ma file, you'll be in good shape. Just test it and track down errors in the log file if there are any and you'll be animating in no time at all. Try tweaking these here and there. Try renaming things to other states in the documentation and trying them out. If you want a state that is entered by attacking though you'll probably want to add a weapon hardpoint.
If you have any questions feel free to post them here and I'll update this tutorial as I can.
Moderators please sticky this tutorial as the last two madstate tuts have vanished off the list of active threads. With a little time this will become the definitive madstate documentation. I'm willing to maintain it if someone will make sure it doesn't just disappear.
This tutorial assumes you have Maya 3 with all the RDN Tools plugins fully installed. It also does not explain modeling, texturing, UV Mapping, creation of joints in maya, etc. It only explains animating for Homeworld 2.
Before beginning this tutorial you may find it useful to download MadstateTut.rar (http://www.slothworks.com/MadstateTut/MadstateTut.rar) and follow along step by step. This archive includes source files as well as compiled HW2 ready files.
To take a look at the finished product before beginning put the contents of the data folder in your %HW2_ROOT%/data directory. This replaces your Hiigaran Probe with an impromptu target drone inspired by the Kushan target drone from Homeworld 1. This is the ship we'll be animating in this tutorial. It's not pretty but it functions perfectly.
If you would like to take a look at the finished maya scene before you begin, take a look at hgn_probe_after.ma to get a good idea of what we're aiming for here today.
To follow along with this tutorial, open hgn_probe_before.ma
The process goes something along the lines of this:
Step 1: keyframe your animations; be sure to only move the joints, not the parts of the model. To achieve this place the parts of your model that you want to move below your joint on the hypergraph. Some general rules you'll want to follow:
* Joints should be placed at pivot points
* Parts that move along the same pivot should be on the same joint
* Always make frame 0 look like your idle or rest state because ships always spawn at frame 0. Always start your animations at frame 1 so they will not conflict with this idle state.
*Joints at frame 0 should have x,y, and z rotation of 0.0 and x,y, and z scale of 1.0 to avoid confusion later down the road. It is far easier to simply know that your rest state is at zero than it is to copy and paste every time you want to have a frame at the rest state. Along the same lines I find it helpful to have notepad open in another window so I can copy and paste translation, rotation, and scale values that I know I'll be using in other frames later on.
*Animations in HW2 run at 24 frames per second. If you want your animation to be 1 second long, make it 24 frames long.
Step 2: Keyframe your anim markers. You can create anim markers by clicking any empty area in the hypergraph with nothing selected then press <CTRL> + <G> to create a null marker, then click the matey button with that null marker selected. Create one keyframe with that marker selected at the BEGINNING and another at the END of EACH animation. This is imperative, you can have as many keyframes per animation as you like for the joints but only two for each marker, a beginning and an end. Be sure to name each of your markers the same as the states you plan on using. This is not necessary but it avoids confusion later on and animation is confusing enough as it is.
Step3: Export all to shipname.mad where shipname is the name of your ship.
Step4: Export all to shipname.hod where shipname is the name of your ship.
Step5: Create your shipname.madstate file, look at the vgr_probe.madstate and vgy_heavymissilefrigate.madstate files for good examples of syntax. Look at the Madstate documentation that comes with RDN Tools for a technical description that makes very little practical sense. In our case you may look at the hgn_probe.madstate that is packaged in this archive. It includes all the madstate syntax needed for this ship we've created.
Step6: Add your animations to the shipname.events file, this is necessary if you want sounds to accompany your animations. I'm not certain if it is necessary for the animation itself.
Well, if your file ended up looking like the hgn_probe_after.ma file, you'll be in good shape. Just test it and track down errors in the log file if there are any and you'll be animating in no time at all. Try tweaking these here and there. Try renaming things to other states in the documentation and trying them out. If you want a state that is entered by attacking though you'll probably want to add a weapon hardpoint.
If you have any questions feel free to post them here and I'll update this tutorial as I can.
Moderators please sticky this tutorial as the last two madstate tuts have vanished off the list of active threads. With a little time this will become the definitive madstate documentation. I'm willing to maintain it if someone will make sure it doesn't just disappear.