User Tools

Site Tools


Sidebar

hpl2:tutorials:model_editor:tutorial_2

Model Editor - Creating Ragdoll Entities

This tutorial will detail how to import export models from Amnesia, as well as rigging a model in the model editor to create a ragdoll entity.


To import a model from Amnesia to your own 3D modeling program, simply download OpenCollada for your program, available here. 3DS Max, Maya, and Blender are the typical programs to use. For models without animations, simply import the .dae model into your program using the OpenCollada plugin. Unfortunately, models with animations, such as the Grunt and Brute, are a little more complicated. Due to the fact that the game engine uses the Y axis as up, only Maya (and possibly Blender, unconfirmed) will import the animations properly. 3DS Max will NOT do it properly. It may be possible to rotate the model and animations, but would most likely require some complex tweaking or scripting using MaxScript.

Using Maya as an example, the animated model should be imported like any other model. Once the model is loaded and everything seems okay, the next step is to strip all animations from the model. This is because if the bones of the model have animations attached to them, the Model Editor won't be able to attach bodies to their bones; the model will simply stand in place, even if its body entities are moving around.

To strip the animations from the model in Maya, go to Edit, Select All by Type, Joints. This will select the bones/joints. Then go to Edit, Delete All by Type, Channels. This will remove all keyed animations from the model. The next step is then to export the model back into Amnesia. Choose a different name when exporting! Also, make a new folder for the model with the same name.

After it is exported, open it in the Model Viewer to create .msh and .mat files for the model. Then open the Model Editor, go to File, Import Mesh, and pick your exported .dae model. Now the fun part! In order to get a realistic ragdoll effect, we need to emulate biped style joints.

The realism you want with your model depends on how much work you want to do on it. To get the most realistic effect, we need to make a single body for each corresponding joints (some of them might be redundant because they are not on typical joint locations). You will want to make the body so it is close to the joint you want to connect it to, but close to all other joints that you will be using. For example, for the upper leg, the body will extend from the joint in the knee to the joint in the thigh. To create a body, simply pick the shape icon on the left of the screen, and choose a list of shapes from the top right of the screen. There are only 4 types, so pick one that would best fit the body parts of the model; this is most likely a capsule. We then fit in these shapes over body parts; they do not have to fit perfect, they just have to be in the same place, usually smaller than the body part itself. They will most likely extrude from the model in a lot of places, but that's fine.

Of course, the main issue is choosing the right location for each shape. The first thing you should do is decide what the main parent joint of your model will be. This is usually the root joint (it will probably be named this), and is usually located in the stomach or chest. The first thing you should do is create a shape for that root joint. For example, if the root is in the stomach, create a shape above it that fits around the chest. Try to shape it so that it will be close to other joints that you will be using, such as the shoulder joints and neck joint. Once the shape is created, we need to connect it to its corresponding joint. Select the shape, and on the right, pick the shape tap, and then click on Create Body. This will create a body which will emulate the mass and other physics fo

hpl2/tutorials/model_editor/tutorial_2.txt · Last modified: 2011/07/30 07:49 by mrbigzy