Greetings! I hope everyone had a great Thanksgiving.
I recently encountered a thread where a modder complained about not being able to mix and match parts of units. Having done just that, I would like to share my knowledge with the rest of the community. I'm sure some of the more experienced modders are already familiar with this process or have their own way of doing it, and I believe my current process will eventually become obsolete. However, I believe it should suffice for now.
I'd like to thank KnightErrant for his wonderful model converter. I appreciate the fact that it converts models into the MilkShape (.ms3d) format and does not require the use of 3ds Max; renewing a 3ds Max license is an expensive investment for a poor history major with a minimum wage job, plus I find Milkshape is much easier to use.
For this tutorial, I will be recreating Sherburne's Additional Regiment from the American Revolution using a Don Troiani painting for reference:
My goal is to mix the body of a line infantry model with the legs, heads, and hats of the minuteman model.
Tools you'll need
LtChamber's Pack File Manager - Let's you open, edit, and extract the contents of the .pack files in Empire's data folder. I'll assume you know how to use it.
KnightErrant's model converter - Converts .variant_weighted_mesh files into the .ms3d format and vice versa.
MilkShape 3D - A simple 3d modeling program. There's a thirty day trial mode, and after that you can register for thirty-five dollars.
Tutorial
Remember to save and make copies of the files you're working with.
(1) We'll start off by opening the models.pack file with the Pack File Manager. Most of Empire's unit models are located in the "unitmodels" folder, while the "textures" subfolder contains the textures, gloss maps, and normal maps.
For my unit, I will extract "euro_line_infantry_lod1.variant_weighted_mesh" as well as "euro_minutemen_lod1.variant_weighted_mesh." The other "lod" variants are lower quality models that Empire uses when you zoom out on the battle map or set your graphics settings to low. Because I'm feeling rather lazy at the moment, I've decided to use the same quality model for every "lod" level.
(2) We can convert the extracted files using KnightErrant's converter. After opening up the converted line infantry model in MilkShape, we see:
You might also see a blue skeleton, but we'll be dealing with that later.
Clicking on the "Groups" tab in the top-right, you will notice that this model is actually made up of separate body parts. The multiple bodies, legs, heads, and hats give variation to the units in-game. For now, you will have to hide the parts that you do not want in the final model. This can be done by using the "Hide" function in the "Groups" tab.
You can take a quick look at the "Joints" tab if you like. If you do not already see the blue skeleton, click on the "Show skeleton" box near the bottom of the right panel. Now double-click on any one of the joints (part or all of the skeleton should turn green) and hit "SelAssigned". This will select several vertices.Every vertex in a model is assigned to a joint, and this relates to the unit's animations. We'll ignore this for now and open up the minuteman model.
(3) Once we've opened up the minuteman in MilkShape, we need to delete the body parts that we do not want merged with the line infantry model. This can be done on individual parts in the "Groups" tab by using the "Delete" function or double-clicking and using the "delete" key. We'll be saving the legs, heads, and one of the hats (because the minuteman's beret just looks silly). At this point, I like to go to the "Joints" tab and delete any joints that are not being used in the current model. This makes things less messy and cluttered in the next step. We can check by using the "SelAssigned" button mentioned earlier. If no vertices get selected, it's probably safe to delete that particular joint. Likewise, keep any joint that has vertices assigned to it, even if it's only two points.
Make sure you work from the bottom of the list to the top; it seems some of the joints are "parents" of other joints, and you might accidentally delete necessary joints if you work from top to bottom. In this tutorial, we will be deleting most of the joints relating to the hands and arms and saving the ones related to the head and legs. We will also go to the "Materials" tab and delete "Figure" and "Attachments" using the "Delete" function. This will save us from having to deal with even more duplicates when we merge the two models. Now save this file under a new name (such as "minutemen_stuff.ms3d") and close it.
(4) We will now merge the line infantry model with the "minutemen_stuff.ms3d" file. This can be done through "File -> Merge...":Milkshape will import everything from the original file. Now go to the "Joints" tab. There are now many duplicate joints, and we need to merge them together. Find the joint that's on the bottom of the list and click of "SelAssigned". This should highlight several vertices. Now find the original joint of the same name somewhere higher on the list, click on it, and hit the "Assign" button.In our case, we will select "Jaw" from the bottom of the list, hit "SelAssigned," select the other "Jaw" joint, and click on "Assign." We can make sure we did it correctly by going back to the original joint and pressing "SelAssigned" again. The joint is safe to delete if no vertices get selected. We will repeat the process for each duplicate item in the joints list.
Head back to the "Groups" tab. We need to rename the body parts we just imported. This is a simple as copy and pasting the names of the equivalent originals (that we hid in Step 2). For example, the "Head01" group from the minuteman model will be renamed as "head_nohair01" in accordance to the line infantry naming conventions. We will delete the unused body parts after we are done.
Our model is now ready to be used in-game. You might, however, want to make some small changes to the unit. For example, I played around with the coat length and made several duplicates of the hat, changing the direction and tilt of each one.
After quickly making a texture and converting the model back into the ".variant_weighted_mesh" format, we get Sherburne's Regiment:
It turns out I made the coats too short.
Feel free to point out any mistakes I may have made in the tutorial. If you found it helpful, I would appreciate a thank you. You don't have to mention me in your mod, though I would be grateful if you did. Happy modding everyone!
God bless.
Jeff C