Welcome to the TWC Wiki! You are not logged in. Please log in to the Wiki to vote in polls, change skin preferences, or edit pages. See HERE for details of how to LOG IN.

Difference between revisions of "Building Animations - M2TW"

From TWC Wiki
Jump to navigationJump to search
Line 3: Line 3:
 
==Useage Overview==
 
==Useage Overview==
 
===Walls===
 
===Walls===
Wall objects have a varying number of groups, normally depending on the size of wall.  Town pallisade wall objects only have 4 groups, typical castle wall objects have 6 groups.  Animations are used to show the transition between one group and the next, so for a 4 group wall object you would have 3 transitions.  If animations are not used the view in game simply switches suddenly from one damage state group to the next.
+
Wall objects have a varying number of groups, normally depending on the size of wall.  Town pallisade wall objects only have 4 groups, typical castle wall objects have 6 groups.  Animations are used to show the transition between one group and the next, so for a 4 group wall object you would have 3 transitions.  If animations are not used the view in-game simply switches suddenly from one damage state group to the next.
 
===Towers===
 
===Towers===
 
Arrow Tower objects should be a 2 group object with a damaged and undamaged state.  Animations are used to show the transition.  Tall and complex tower objects in the game that can not be specifically targetted by artillery may also use an animation as above.
 
Arrow Tower objects should be a 2 group object with a damaged and undamaged state.  Animations are used to show the transition.  Tall and complex tower objects in the game that can not be specifically targetted by artillery may also use an animation as above.
If an animation is not used the view in game simply switches suddenly from one damage state group to the next.
+
If an animation is not used the view in-game simply switches suddenly from one damage state group to the next.
 
===Gates===
 
===Gates===
 
The only building animations that are '''essential''' are the gate animation sets, when the gate 'opens' it uses an 'Open' animation to show the opening process, it stays at the end of that animation until troops clear the area, then uses a 'Close' animation to return to the starting position.  Unlike the other transitions this is not a switch from one object-group to another, the temporarily open state is solely shown by the animation, if an animation is not used troops trying to use the gate will get stuck.  This is a peculiarity of gates - for other building items the structure collisions do not actually stop troops.
 
The only building animations that are '''essential''' are the gate animation sets, when the gate 'opens' it uses an 'Open' animation to show the opening process, it stays at the end of that animation until troops clear the area, then uses a 'Close' animation to return to the starting position.  Unlike the other transitions this is not a switch from one object-group to another, the temporarily open state is solely shown by the animation, if an animation is not used troops trying to use the gate will get stuck.  This is a peculiarity of gates - for other building items the structure collisions do not actually stop troops.
Line 17: Line 17:
 
*'''.mesh'''
 
*'''.mesh'''
 
*'''.evt''' - sound effects trigger
 
*'''.evt''' - sound effects trigger
*Textures - which would normally be the same as those used for the object.
+
*'''textures''' - which would normally be the same as those used for the object.
  
 
To activate the animation for a particular instance of an object the .world files for the settlement are used:
 
To activate the animation for a particular instance of an object the .world files for the settlement are used:
Line 23: Line 23:
 
*'''[[.worldcollision]]''' - sets the displacement and rotation from 0,0,0 to where the animation should appear for the specific object.
 
*'''[[.worldcollision]]''' - sets the displacement and rotation from 0,0,0 to where the animation should appear for the specific object.
 
*'''[[.animinstances]]'''  contains packed chunks of compressed information specific to each object.
 
*'''[[.animinstances]]'''  contains packed chunks of compressed information specific to each object.
 +
 +
More detail is given below:
 +
===Common Files===
 +
These are the .anim, .mesh & .evt files which are used for each instance of an object e.g. each northern_european town palisade wall object.  The vanilla files are found in ''data/blockset/culture/animations/animation_type/animation_name/'' folders.  Within each folder there will be sets of the three files for each transition stage. For walls these file names end with _a, _b, _c etc. this is purely a naming convention and the .world files have been set so the first transition uses the files ending _a, second uses _b etc.
 +
 +
The .anim file name and path is the only one listed in the .world files, the .mesh and .evt are called by having the same name and folder location.
 +
 +
There is some overlap in content between the .anim, .mesh and .animinstances files, so not all of the content is used by the game, e.g. uv mapping from the .anim file is not read in-game, vertex positions from the .mesh file are not read in-game.  However, the content of the other files is clearly derived originally from the .anim.
 +
 +
=== .anim ===
 +
The most important content of the .anim is the joint positions, their movements and rotations.  The file also determines which chunks of the animated structure fade away at the end.  The .anim also contains the triggers for any visual effects used by the animation, most usually dust_puff sets, though the effects could theoretically be any set contained within the text files listed in descr_effects.txt (effects that don't have a time limit in the text file will continue after the animation has stopped!)
 +
 +
=== .mesh ===
 +
The most important content of the .mesh is the assignment of each vertex to a bone group number, the uv mapping and the texture name and path - note that only one texture can be used per .mesh file.
 +
 +
=== .evt ===
 +
Contains the triggers for any sound effect applied during the animation.  This file can be edited as a text file.
  
  

Revision as of 09:52, 6 December 2019

Building animations are used in M2TW battle-map buildings to represent gates opening and closing, walls being progressively destroyed, and towers and gates being damaged.

Useage Overview

Walls

Wall objects have a varying number of groups, normally depending on the size of wall. Town pallisade wall objects only have 4 groups, typical castle wall objects have 6 groups. Animations are used to show the transition between one group and the next, so for a 4 group wall object you would have 3 transitions. If animations are not used the view in-game simply switches suddenly from one damage state group to the next.

Towers

Arrow Tower objects should be a 2 group object with a damaged and undamaged state. Animations are used to show the transition. Tall and complex tower objects in the game that can not be specifically targetted by artillery may also use an animation as above. If an animation is not used the view in-game simply switches suddenly from one damage state group to the next.

Gates

The only building animations that are essential are the gate animation sets, when the gate 'opens' it uses an 'Open' animation to show the opening process, it stays at the end of that animation until troops clear the area, then uses a 'Close' animation to return to the starting position. Unlike the other transitions this is not a switch from one object-group to another, the temporarily open state is solely shown by the animation, if an animation is not used troops trying to use the gate will get stuck. This is a peculiarity of gates - for other building items the structure collisions do not actually stop troops.

File Structure

The object itself (wall/gate/tower) and its groups are structures within the .world file.

The animation requires the following files which will be common to all instances of the same wall/gate/tower:

  • .anim
  • .mesh
  • .evt - sound effects trigger
  • textures - which would normally be the same as those used for the object.

To activate the animation for a particular instance of an object the .world files for the settlement are used:

  • .world - contains the file-path and name of the .anim to be used, and the assignment to each object.
  • .worldcollision - sets the displacement and rotation from 0,0,0 to where the animation should appear for the specific object.
  • .animinstances contains packed chunks of compressed information specific to each object.

More detail is given below:

Common Files

These are the .anim, .mesh & .evt files which are used for each instance of an object e.g. each northern_european town palisade wall object. The vanilla files are found in data/blockset/culture/animations/animation_type/animation_name/ folders. Within each folder there will be sets of the three files for each transition stage. For walls these file names end with _a, _b, _c etc. this is purely a naming convention and the .world files have been set so the first transition uses the files ending _a, second uses _b etc.

The .anim file name and path is the only one listed in the .world files, the .mesh and .evt are called by having the same name and folder location.

There is some overlap in content between the .anim, .mesh and .animinstances files, so not all of the content is used by the game, e.g. uv mapping from the .anim file is not read in-game, vertex positions from the .mesh file are not read in-game. However, the content of the other files is clearly derived originally from the .anim.

.anim

The most important content of the .anim is the joint positions, their movements and rotations. The file also determines which chunks of the animated structure fade away at the end. The .anim also contains the triggers for any visual effects used by the animation, most usually dust_puff sets, though the effects could theoretically be any set contained within the text files listed in descr_effects.txt (effects that don't have a time limit in the text file will continue after the animation has stopped!)

.mesh

The most important content of the .mesh is the assignment of each vertex to a bone group number, the uv mapping and the texture name and path - note that only one texture can be used per .mesh file.

.evt

Contains the triggers for any sound effect applied during the animation. This file can be edited as a text file.