This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
modelling:dependenciesamongmodels [2009-07-04 13:40] 127.0.0.1 external edit |
modelling:dependenciesamongmodels [2013-01-07 12:07] (current) |
||
---|---|---|---|
Line 18: | Line 18: | ||
That is, if somebody makes a new human player model and offers it for download, | That is, if somebody makes a new human player model and offers it for download, | ||
you expect it to work exactly like the ones that you already know. | you expect it to work exactly like the ones that you already know. | ||
- | In order to achieve this kind of equivalency, two assumptions must hold: | + | In order to achieve this kind of equivalence, two assumptions must hold: |
The skeleton of the new models must basically match the skeleton of the old models, | The skeleton of the new models must basically match the skeleton of the old models, | ||
and the animation sequence numbers must refer to reasonably identical animations. | and the animation sequence numbers must refer to reasonably identical animations. | ||
- | The animation sequences must match, because the engine has built-in knowledge that, for example, | + | The animation sequences must match, because the game code has built-in knowledge that, for example, |
sequence number 3 refers to an "idle (waiting)" animation, and that sequence number 27 refers to an | sequence number 3 refers to an "idle (waiting)" animation, and that sequence number 27 refers to an | ||
"aiming with a shotgun" animation. It is entirely up to you to animate your model to look at his | "aiming with a shotgun" animation. It is entirely up to you to animate your model to look at his | ||
wrist watch while aiming with the shotgun, or to pick his nose, but it //is// important that | wrist watch while aiming with the shotgun, or to pick his nose, but it //is// important that | ||
sequence number 27 corresponds to some "aiming with a shotgun" animation -- because the same is true | sequence number 27 corresponds to some "aiming with a shotgun" animation -- because the same is true | ||
- | for all other models, and the engine relies on it. | + | for all other models, and the game code relies on it. |
The skeletons must also match, for similar reasons: | The skeletons must also match, for similar reasons: | ||
Line 43: | Line 43: | ||
**World** models are the models that lie around in the world, before someone picked them up. | **World** models are the models that lie around in the world, before someone picked them up. | ||
- | They are usually not animated (or do only have a single animation sequence), | + | They are usually not animated (or only have a single animation sequence), |
are independent from anything else, and are therefore in the same category as the "all others" models, | are independent from anything else, and are therefore in the same category as the "all others" models, | ||
so that we need not be further concerned about them. | so that we need not be further concerned about them. | ||
**Player** models are the weapons that you see in the hands of //other// players who have picked up and are using that weapon. | **Player** models are the weapons that you see in the hands of //other// players who have picked up and are using that weapon. | ||
- | For the following discussion, we'll refer to the "player" weapon model as the "''_p'' model", | + | For the following discussion, we'll refer to the "player" weapon model as the "''_p''" model, |
- | and to the character model of a human player as the "body model". | + | and to the character model of a human player as the "body" model. |
- | First, if you consider the skeleton of a ''_p'' model in a model viewer, you will find that it resembles | + | First, if you consider the skeleton of a ''_p'' model in the Model Editor, you will find that it resembles |
a partial body model (the bones from the pelvis to the shooting arm are there!), before it diverges into additional bones for the actual weapon. | a partial body model (the bones from the pelvis to the shooting arm are there!), before it diverges into additional bones for the actual weapon. | ||
Here is the crucial point: In order for the engine to compute the proper position of the ''_p'' model | Here is the crucial point: In order for the engine to compute the proper position of the ''_p'' model | ||
relative to the body model, it (partially) has to match the skeletons of both models! | relative to the body model, it (partially) has to match the skeletons of both models! | ||
- | That is, it first computes the skeleton of the body model (depending on its current animation sequence and frame). | + | That is, it first computes the skeleton of the body model (depending on its current animation pose). |
- | Then it considers the skeleton of the ''_p'' model, starting at it's root, and tries to match it bone-by-bone | + | Then it considers the skeleton of the ''_p'' model, starting at its root, and tries to match it bone-by-bone |
- | to the previously computed body skeleton. If a match was determined, the engine simply takes the information from the body models bone also | + | to the previously computed body skeleton. If a match was found, the engine simply takes the information from the body model bone also |
for the ''_p'' model bone. Only when the matching breaks for the first time, the engine resumes normal bone computing | for the ''_p'' model bone. Only when the matching breaks for the first time, the engine resumes normal bone computing | ||
- | also for the ''_p'' model. (This way you can for example have a face-hugger (held by //another// player!) that is wagging it's tail.) | + | also for the ''_p'' model. (This way you can for example see a face-hugger in the hands of //another// player that is wagging it's tail.) |
- | Matches are made by comparing the //names// of the concerned bones, by the way. | + | Matches are made by comparing the //names// of the concerned bones. |
As a consequence, if you want to make additional body models for the DeathMatch MOD, and additional weapons, | As a consequence, if you want to make additional body models for the DeathMatch MOD, and additional weapons, | ||
and you want to be able to combine each body model with each weapon, | and you want to be able to combine each body model with each weapon, | ||
- | //then you're forced to make sure that they **all** have a corresponding skeletal structure and bone names!// | + | //then you have to make sure that they **all** have a corresponding skeletal structure and bone names!// |
**View** models are the models that you see in 1st persons view after you have picked up a weapon yourself. | **View** models are the models that you see in 1st persons view after you have picked up a weapon yourself. | ||
- | They are also independent from anything else, but the engine has usually special code for handling them. | + | They are also independent from anything else, but the game has usually special code for handling them. |
- | Thus, you can well make a //replacement// weapon for e.g. the shotgun | + | Thus, you can well make a //replacement// weapon for e.g. the shotgun, |
- | (matching the animation sequences of the existing "view" weapon model, | + | matching the animation sequences of the existing "view" weapon model |
- | according to similar rules as indicated for making replacement human player models), | + | according to similar rules as indicated for making replacement human player models. |
- | but you cannot introduce //entirely new// weapon models without writing additional code for them. | + | You can also introduce //entirely new// weapon models, but be prepared that is requires to augment the game's C++ or script code as well. |
- | ===== Applicability to your own MOD ===== | + | ===== Applicability to your own game ===== |
- | If you create an own MOD, things may or may not be different, of course. | + | If you create an own game, things may or may not be different, of course. |
- | However, please keep in mind that if you want to achieve a high degree of flexibility and ease of maintenance, | + | However, keep in mind that if you want to achieve a high degree of flexibility and ease of maintenance, |
you'll sooner or later probably experience the same rules and dependencies as described here. | you'll sooner or later probably experience the same rules and dependencies as described here. | ||
- | They are the - relatively cheap - price for the ability to combine every human player model with every weapon model. | + | They are the -- relatively cheap -- price for the ability to combine every human player model with every weapon model. |