https://wiki.twcenter.net/api.php?action=feedcontributions&user=Makanyane&feedformat=atomTWC Wiki - User contributions [en]2024-03-19T09:37:10ZUser contributionsMediaWiki 1.32.0https://wiki.twcenter.net/index.php?title=Map_ground_types.tga&diff=86920Map ground types.tga2024-02-12T16:30:16Z<p>Makanyane: /* Impassable Terrain */ added note that the impassable types are M2 only</p>
<hr />
<div>{{DISPLAYTITLE:map_ground_types.tga}}<br />
[[Image:Map_ground_types.jpg|right| Enlarged section of the vanilla M2TW map_ground_types.tga]]<br />
<br />
The map_ground_types.tga is the tga that controls both the type of terrain displayed on the campaign map and on the [[battle map]].<br />
<br />
Map_ground_types.tga will be found in the ''data/world/maps/base'' folder of a [[vanilla]] installation, it may also be placed in the ''data/world/maps/campaign/campaign_name'' folder if the other map files are copied there as well. <br />
<br />
Note that the map_ground_types.tga does not determine the amount or shape of sea shown on the campaign map. The coastline shown in [[map_heights.tga]] is the one that determines where land and sea are placed, if there is any discrepancy between the files a default ground type is used for the incorrectly designated areas. For instance if an island exists in map_heights.tga but is marked as sea in map_ground_types.tga it will still appear on the campaign map but with a default fertile terrain type.<br />
<br />
==Size==<br />
The map_ground_types.tga must be twice the size of map_regions.tga plus one pixel on each axis. So if map_regions.tga is 100 x 100 pixels then map_heights.tga must be 201 x 201 pixels.<br />
<br />
==Key to colours==<br />
The following key is taken from Myrddraal's tutorial [http://forums.totalwar.org/vb/showthread.php?t=50437 Making a New Campaign Map]<br><br />
:Fertile Low - Grey-Blue (0, 128, 128)<br />
:Fertile Medium - Light Green (96, 160, 64)<br />
:Fertile High - Olive (101, 124, 0)<br />
:Wilderness - Black (0, 0, 0)<br />
:Mountains High - Light Brown (196, 128, 128)<br />
:Mountains Low - Brown (98, 65, 65)<br />
:Hills - Olive-Brown (128, 128, 64)<br />
:Forest Dense - Dark Green (0, 64, 0)<br />
:Forest Sparse - Green (0, 128, 0)<br />
:Swamp - Bright Green (0, 255, 128)<br />
:Ocean - Dark Maroon (64, 0, 0)<br />
:Sea Deep - Dark Red (128, 0, 0)<br />
:Sea Shallow - Red (196, 0, 0)<br />
:Beach - White (255, 255, 255)<br />
<br />
==Impassable Terrain==<br />
The following types of terrain are impassable by units.<br />
:Forest Dense - Dark Green (0, 64, 0)<br />
:Mountains High - Light Brown (196, 128, 128)<br />
:Mountains Low - Brown (98, 65, 65)<br />
:Impassable Land - Medium Grey (64, 64, 64) - M2TW only, not available in RTW/RR<br />
:Impassable Sea - Dark Blue (0, 0, 64) - M2TW only, not available in RTW/RR<br />
<br />
City and port positions in map_regions.tga should not coincide with areas of impassable terrain.<br />
Resource, watchtower and starting unit coordinates in descr_strat.txt should also not be located in areas of impassable terrain.<br />
<br />
Use of mountain types effects the way the heights are rendered on the campaign map. Using 'mountains low' gives a smoothing effect and heights will appear lowered. Using 'mountains high' gives a peaked effect making heights appear greater, the .cas model for mountains high also places peaks randomly so they will not necessarily tie up with your highest points. <br />
<br />
(For RTW only: Very large areas of impassable terrain can cause the same '[[Landmass Crash]]' problem as having too large a sea area.)<br />
<br />
==Other Land Ground Types==<br />
:Fertile Low - Grey-Blue (0, 128, 128)<br />
:Fertile Medium - Light Green (96, 160, 64)<br />
:Fertile High - Olive (101, 124, 0)<br />
The above are fairly obviously fertile ground types, a small area of fertile ground is needed for each region. The areas of fertile terrain on the campaign map will be displayed with an overlay of a different tga when farms are built in a region, see [[#Visual_Effects_on_Campaign_Map| Visual Effects on Campaign Map]].<br />
<br />
:Wilderness - Black (0, 0, 0) - uses texture of fertility low<br />
:Hills - Olive-Brown (128, 128, 64)<br />
:Forest Sparse - Green (0, 128, 0)<br />
:Swamp - Bright Green (0, 255, 128)<br />
:Beach - White (0, 0, 0)<br />
Are the passable but non-fertile terrain types. They have various effects on both the campaign and battle maps. Swamp for example drastically slows down armies movement speed on the campaign map.<br />
Use of 'hills' terrain increases the apparent effect of heights on the campaign and battle map.<br />
<br />
==Sea Ground Types==<br />
The different types of sea 'ground type' affect the movement of boats.<br />
:Ocean - Dark Maroon (64, 0, 0)<br />
:Sea Deep - Dark Red (128, 0, 0)<br />
:Sea Shallow - Red (196, 0, 0)<br />
<br />
Sea shallow allows greater movement than sea deep.<br><br />
<br />
In RTW the ocean ground type is impassible by ships and also therefore prevents the spawning of rebel (pirate) ships. For that reason it is best used for small lakes which don't have ports and to block of areas of the map you don't want accessible.<br />
<br />
The area between Europe and America in M2TW is the ocean ground type. Only ship types with the ocean_going tag in descr_ship.txt can traverse ocean tiles.<br />
<br />
==Visual Effects on Campaign Map==<br />
The files used as 'textures' to paint the campaign map when it is rendered are mainly contained in <br />
''data/terrain/aerial_map/ground_types'' folder. These files are referenced from descr_aerial_map_ground_types.txt two short excerpt from that file shows how the climate as defined on [[map_climates.tga]] and the ground type combine to determine which tga is used. <br />
<br />
climate semi_arid<br />
{<br />
cultivated_low middle_east_farm.tga<br />
cultivated_medium middle_east_farm.tga<br />
cultivated_high middle_east_farm.tga<br />
fertility_low fertility_5.tga<br />
Each climate type has a separate list of all the ground types below it. Different tga's can be used for the same ground type under each of the different climates. The tga specified for cultivated_low will replace the one used for fertility_low when farms are built in a region, cultivated_medium replaces fertility_medium etc.<br />
<br />
<br />
[[Category:RTW Campaign Map Modding]]<br />
[[Category:M2TW Campaign Map Modding]]<br />
[[Category:RTW Files]]<br />
[[Category:M2TW Files]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Total_War:_Rome_Remastered_-_Modding&diff=86876Total War: Rome Remastered - Modding2023-12-28T11:40:28Z<p>Makanyane: /* Enhanced Tweaks */ note about an ooops</p>
<hr />
<div>{{Rome Remastered Modding}}<br />
<big>[[Total War: Rome Remastered]] offers modding opportunities similar to the original game although higher quality assets will be needed to match the improved graphics. <br />
<br />
With patch 2.0.4 beta hard-coded limits for factions, cultures, religions, buildings and units have been removed. See [https://github.com/FeralInteractive/romeremastered Rome Remastered github] for more details.</big><br />
<br />
<br />
==Mod Set-up==<br />
<br />
Mods can be uploaded and used from the Steam Workshop, the placing of those mods on your computer will be determined by Steam and your library set-up, for example a mod's file could be in:<br />
:''D:\Steam\steamapps\workshop\content\885970\2471298638''<br />
<br />
Mods in development can be placed in the 'Mods' folder either in Local Mods or My Mods, the full path to these folders is normally:<br />
:''C:\Users\YOURNAME\AppData\Local\Feral Interactive\Total War ROME REMASTERED\Mods\Local Mods\Mods_Name'' etc.<br />
If you have a small C drive and need to relocate this elsewhere you can use a [https://www.howtogeek.com/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/ hard-link] on your computer, hopefully, the launcher options will later allow an easier way to change directory locations!<br />
<br />
Within either Local Mods or My Mods you will then have a folder for Mod_Name. Within '''Mod_Name''' folder you need the mod's '''data''' folder a '''modinfo.json''' and a '''filelist.json'''<br />
<br />
=== modinfo.json ===<br />
This file you write yourself and it gives the name and description of the mod, a sample format is:<br />
{<br />
"Description": "Brief description of you mod goes here",<br />
"Mod Name": "Mod name goes here",<br />
"Supports Alex": false,<br />
"Supports BI": false,<br />
"Supports Rome": true,<br />
"Tags": [ ],<br />
"Visibility": 1,<br />
"Workshop ID": 0<br />
}<br />
<br />
=== filelist.json ===<br />
This is referred to as the 'manifest' for the mod. To generate this file - or regenerate it if you have changed files - select the mod and click the '''"Regenerate Manifest"''' button on the Feral launcher.<br />
<br />
If you add files to the mod and fail to Regenerate Manifest your new files will not be loaded. If you try and run a mod without any manifest you will just get the vanilla game!<br />
<br />
==Errors and Logging==<br />
Version 2.0.2 has introduced a comprehensive error logging system. To activate basic logging to text file use '''enable_logging''' in your Launch Options.<br />
Log files will be generated in:<br />
C:\Users\YOUR_NAME\AppData\Local\Feral Interactive\Total War ROME REMASTERED\VFS\Local\Rome\logs <br />
<br />
You can also use:<br />
:'''-show_err''' - to generate a single pop-up message as in the original game<br />
:'''enable_dialogs''' - to get multiple pop-up messages (this really does generate '''multiple''' messages, you might find it annoying, and the same messages should be available from the text logs)<br />
:'''verbose_script_logging''' - to help debug scripts<br />
<br />
Additionally '''EnableBattleModelInfo''' can be activated from '''Preferences Data''' to view the assets a battle model is using.<br />
<br />
See Feral's [https://github.com/FeralInteractive/romeremastered/blob/main/documentation/feature_guides/logging/logging.md logging.md] for further details.<br />
<br />
<br />
A blank error message with yellow <big><big><big>!</big></big></big> symbol, when you try to launch a mod on your PC appears to be caused by an overall file path length issue. e.g. if you are ending up with file/folder paths that looks like:<br />
''C:\Users\Name\AppData\Local\Feral Interactive\Total War ROME REMASTERED\Mods\My Mods\Mega European Mod Version 5b 2021\data\xdescr_building_battle - copy (2)\''<br />
Try to shorten this! The mod-folder name doesn't have to match the displayed mod name, so re-name that to something with just a few initials! And try not to keep old copies of unecessary files/folder with long names inside the mod-folder...<br />
<br />
==Differences to Rome: Total War==<br />
<br />
'''For text file and folder structure differences see main article:- [[File Differences - Rome Remastered]]'''<br />
<br />
There are numerous small and large changes to the files and file structure of Remastered in comparison to RTW. The changes are centered around:<br />
*Inclusion of higher resolution graphics and environmental effects<br />
*Inclusion of all language options within the same base game (instead of replacement)<br />
*Addition of separate mesh structure for 3D elements of campaign map<br />
*Addition of merchant agent type<br />
*'Duplicate' text files with alternative statistics to suit toggled play-style options <br />
*New methods to override base files<br />
<br />
Feral's [https://github.com/FeralInteractive/romeremastered/blob/main/RomeRemasteredDifferences.md Differences & New Features] page details the changes to date including 2.0.2 patch with information about currently increased limits and targeted changes for version 2.0.3.<br />
<br />
==Scripting==<br />
From version 2.0.2 the scripting possibilities of the game have been greatly increased over RTW. Importantly the game will now load a background script listed at the bottom of descr_strat.txt AND reload it automatically on save game reload. The script can also include persistant counters to store variables during the game and across save/reloads.<br />
<br />
See Feral's [https://github.com/FeralInteractive/romeremastered/blob/main/documentation/feature_guides/scripts/Scripts.md guide to scripts] for details and docudemon files.<br />
<br />
<br />
==Textures==<br />
RR still uses .tga.dds files (e.g. dds files but with the .tga name appended so that text files actually just ask for .tga)<br />
<br />
Some textures are compressed using the LZ4 system, these also have an additional header section which can be ignored. [https://www.twcenter.net/forums/showthread.php?811147-IWTE-texture-decompression-for-Rome-Remastered&p=16020947#post16020947 IWTE] now has an option that will de-compress a directory of these textures back to their starting .dds state.<br />
<br />
Some textures are DX10 type, these you can probably open but not see the correct information, if you have a recent version of Photoshop you can use this [https://software.intel.com/content/www/us/en/develop/articles/intel-texture-works-plugin.html plugin] to open them. Otherwise, you need to convert them to .tga using the [https://github.com/Microsoft/DirectXTex/wiki/Texconv Texconv tool] or similar. The easiest way to use this tool is by writing a .bat file (so you don't have to remember the commands each time!), and example .bat would be:<br />
<br />
@echo off<br />
texconv.exe -r my_folder\*.dds -ft tga -o my_folder<br />
cmd /k<br />
<br />
Fortunately, the game will accept and run happily with non-compressed DXT5 and DXT1 dds textures in the same way as RTW, so you only need to mess about with the above if you need to view or amend some of the existing textures.<br />
<br />
===PBR===<br />
RR has introduced a system of [https://en.wikipedia.org/wiki/Physically_based_rendering Physically Based Rendering] for textures, thus the 'normal' textures that have been introduced with RR work slightly differently from the ones in M2TW:<br />
_pbr contain the _n, _s and _m maps they are rgba textures<br />
r+g = normal<br />
b = metallic<br />
a = roughness<br />
In other places like building textures you will find that the _n, _s, _m are separate<br />
<br />
For battle map units KurdishNomad has produced a pdf guide on how to make PBR textures for RR in GIMP, see [https://www.twcenter.net/forums/showthread.php?812997-Making-PBR-Textures-from-Rome-Remastered-Units&p=16065951 here].<br />
<br />
===.pvr===<br />
A .pvr version of the radar map is used, to open this file download the [https://www.imaginationtech.com/developers/powervr-sdk-tools/installers/ PVRTexTool] or similar.<br />
<br />
===Building Textures===<br />
Normal textures for buildings use _n added to the file name, the blue channel of the normal is usually black.<br />
<br />
The smoothness version of building textures with _s added to the name is a greyscale image, white elements make things appear dark in wet conditions, dark elements make things shiny in sunny conditions.<br />
<br />
The emisivity for glowing textures seem to use _e added to the name ''(the author currently can't get that element to work)''.<br />
<br />
===Settlement Overlay Textures===<br />
Feral have explained that how various special keywords in the MESH names of the overlays work:<br />
<br />
orderedXY<br />
Where XY is a number (00, 01, 02...) the game uses this to sort the rendering of the different meshes. Bigger numbers are rendered last, this is to avoid z-fighting (the annoying flickering) when 2 meshes are at the same distance from the camera.<br />
<br />
gridXY<br />
Again XY is a number. The only possible numbers are the ones defined in descr_landscape_global_uv_grids.txt and this will make the assigned texture tile according to the uv scale defined in the text file. Descr_landscape_global_uv_grids.txt can be included in a mod-folder and amended.<br />
<br />
detailXY_ZW<br />
XY and ZW are numbers (00, 01, 02...) The first number references a tile value in descr_landscape_global_uv_grids.txt as for the grid keyword above. The second number references a texture in descr_landscape_multi_textures.txt. The difference from gridXY is with the ''detail'' keyword the texture referenced by the second number is going to be tiled as referenced by the first number, but it's going to use the alpha of the textures assigned to the mesh without tiling that alpha layer. So the alpha layer of the texture assigned by the standard material naming process to the mesh element can define the whole area of roads to be painted onto a settlement overlay, but the actual texture applied to them can be tiled and maintain a high resolution. Descr_landscape_multi_textures.txt can be included in a mod-folder and amended but only currently supports 15 texture variations the textures defined in it do not work with the winter variant system applied from descr_building_battle.txt.<br />
<br />
An example use of the detail keyword would be a mesh name within the overlay .cas of:<br />
ordered01 - detail04_03 - whatever<br />
*this would be displayed on top of other lower ordered meshes in the same plane<br />
*this would use the tiling for entry 4 in descr_landscape_global_uv_grids.txt<br />
*this would use texture 3 from descr_landscape_multi_textures.txt for the tiled element<br />
<br />
==Campaign Map==<br />
:See main article [[Creating New Campaign Map in Rome Remastered]]<br />
One of the areas modders' have been most worried about was whether the game would support completely redesigned maps now that a model mesh system has been introduced for the campaign map. Although this looks like the vanilla shaped map, it's actually partway through porting a version of the Mundus Magnus large map for RTW (originally by ngr).<br />
<br />
[[File:MundusMagnusMapRR.jpg|300px|Showing new map mesh in Rome Remastered]]<br />
<br />
[[IWTE_-_Rome_Remastered_Functions#Campaign_Mesh_Generation|IWTE]] now supports mesh and texture creation from base .tga files.<br />
<br />
===Maximum size===<br />
Rome Total War and M2TW had a hard coded size limit for map_regions.tga of 510 pixels height and width. The later patches of Rome Remastered allow a larger sized map, although there are likely still some limits the RIS team have achieved a working map with a 1020 x 700 map_regions.tga size.<br />
<br />
===Relationship to battle maps:===<br />
The below picture demonstrates the difference between what you might see on the campaign map and in battle if you don't deliberately align the two:<br />
<br />
[[File:RR-map-demo-Swimming-pool.jpg|300px|Showing lack of connection between campaign and battle map views]]<br />
<br />
The left part shows the campaign map on a modified section of mesh. The area shown in green, where the army can move, is controlled by the map_heights.tga, map_ground_types.tga and map.rwm information. Where he would actually appear to stand is controlled by the heightmap .bin file generated from the mesh, so he will walk up that big lump, but he won't go below 0m (sea level), even though the mesh is below the water surface there. The second part of the picture on the right shows what you actually get at that spot in battle, which is based on the map_heights.tga, map_ground_types.tga and map.rwm information, plus interpretation from the vegetation and geography.db files.<br />
<br />
===Similarities to the original system:===<br />
<br />
A quick look in the data/world/maps folders will reassure RTW and M2TW modders that the map image and text files they are familiar with are still there. If you have a 'pure map' mod you should be able to use your existing map_heights.tga, descr_strat.txt etc to launch a mod for Remastered without much problem. If the mod has modded units, buildings, ancillaries etc, it will take more unravelling, just as porting a map between different mods would. If you try to copy in all of your mod's files you will probably find either some conflicts, or that you have overwritten new features in Remastered such as the addition of traits and ancillaries to support the new Merchant agent type.<br />
<br />
That's the good news... your basic map files are still valid! The basic files drive the campaign map pathfinding, placement of settlements and resources and provide the climate/heights/ground_types information that is translated using the vegetation and geography.db files to make the battle maps.<br />
<br />
The not so good news, if you were after a quick result, is that they don't generate the mesh or textures you view on the campaign map! So if you load a map of a different size or shape the areas not covered by the existing mesh, or already on raised land areas, will just appear as sea! They will function, and the trees and settlements will turn up, and your troops will be able to move on the parts supposed to be land... so if you ever wanted to do a mod based in the Everglades, this could be for you.<br />
<br />
[[File:Everglades.jpg|300px|Screenshot showing area of map without mesh]]<br />
<br />
==Units==<br />
'''To unpack unit models from Rome Remastered packs you need to use the [https://github.com/FeralInteractive/romeremastered/blob/main/tools/unpack_characters/unpack_characters.md unpack_characters] option when launching the game .exe'''<br />
<br />
The .cas files you generate can be converted for editing in Blender or 3dsMax. You can use:<br />
*Feral's cas>fbx>cas tool see [https://github.com/FeralInteractive/romeremastered/tree/main/tools/CasPacker here]<br />
*IWTE which converts cas>dae>cas and can also combine the unit mesh with unpacked animations see: [[IWTE - Units in Blender]]<br />
*possibly older max script coverters<br />
Please be aware that each of the tools may have different default scaling and orientation, so you should not combine import/export across different tools.<br />
<br />
Although still .cas files the RR units use the 'type 3' chunk system previously only used for some shoulder pads and minor elements of RTW units using the model_flexi_m system. The main body of the unit can have vertexes weighted variably between any two bones for the lod0 model, the lod1 model and lower need to have single bone weighting throughout. Primary and secondary weapons must still exist within the .cas as a separate mesh and use only one bone.<br />
<br />
Only the base .cas name is given for the model in the DMB file the game looks for and needs four model .cas files for each model named:<br />
:''base_name_lod0.cas''<br />
:''base_name_lod1.cas''<br />
:''base_name_lod2.cas''<br />
:''base_name_lod3.cas''<br />
If you haven't got 4 different lod level models, copy the closest one you have and re-name it to suit.<br />
<br />
The uv mapping of the units is now used to provide the variation across faces and skin sections to suit ethnicity, details of the uv system and requirements for conversion with the CasPacker tool can be found [https://github.com/FeralInteractive/romeremastered/blob/main/documentation/techart_guides/Characters.md here]<br />
===Animations===<br />
Two additional animations have been added to the packed unit skeletons, and supplementary animations and over-rides have been added via descr_skeleton_feral_overrides.txt see the lists [[Rome:_Total_War's_Animation_Modification#Rome_Remastered_Animation_List|here]].<br />
<br />
===Skin Textures===<br />
The textures used for face hair and body sections are found in data/characters/skin_textures. The naming for males is:<br />
:''ethnicity_m_bodies.dds''<br />
:''ethnicity_m_bodies_pbr.dds''<br />
:''ethnicity_m_faces_serious.dds''<br />
:''ethnicity_m_faces_serious_pbr.dds''<br />
:''ethnicity_m_faces_angry.dds''<br />
:''ethnicity_m_faces_angry_pbr.dds''<br />
For females the same format is used with _f_ replacing the _m_<br />
<br />
Note that the blue channel of the pbr which would create a metallic effect if used elsewhere is not read for skin sections.<br />
<br />
Within the skin textures, there are 5 sections for bodies, and 16 for faces. By experimenting with colours added to them you can see which sections are used for which dmb entries. (The body section shown is from a mod using part of the chest for shields) <br />
<br />
[[File:Experimental blobs.jpg|400px]]<br />
<br />
The first 5 faces (shown with white blobs in the picture above) are used for 'aged' faces, the last 4 faces (shown with green blobs) are used if 'medieval_features yes' is used and the characters are not 'aged'. The central section ones (shown with blue blobs) are used for non-aged characters without medieval features.<br />
<br />
For the body the sections are used as follows:<br />
:Skinny - sections 1, 2<br />
:SkinnyAthletic - sections 1, 2, 3<br />
:Default - sections 2, 3, 4<br />
:Athletic - sections 3, 4, 5<br />
:Bulky - sections 4, 5<br />
NOTE: This does not apply to Culann or Berserker ethnicities which are hard-coded to use all 5 sections regardless of body type (info supplied by Feral).<br />
<br />
====Hair Texture and Styles====<br />
There is only one hair texture ''hair.tga.dds'', this is a normal texture with transparency, the colour of the hair is set in descr_unit_variation.txt and applied to the non-transparent areas. This does not work in the same way as the skin textures. The models contain multiple hair meshes, the ones chosen for use depend on the uv mapping positions, and the texture shown matches the relative uv position.<br />
<br />
==Text Strings and Menu Items==<br />
Some of the text displayed in game isn't read from data/text folders, it's from <br />
:''\Steam\steamapps\common\Total War ROME REMASTERED\Contents\Resources\en.lproj\Localizable_Game.strings'' - (which is plain text)<br />
<br />
these strings can be changed and included in a modfolder @ <br><br />
:''mod-folder\data\string_overrides\en.strings''<br />
example shown is for English the same principle applies on other languages.<br />
<br />
Instructions are contained in the readme.txt inside data/string_overrides:<br />
This folder is used to override strings added to the game by Feral Interactive.<br />
The original files can be found at "<languageCode>.lproj/Localizable_Game.strings"<br />
Override files should be named the language code they correspond with and have the file extension, ".strings"<br />
E.G. English Override: "en.strings"<br />
<br />
As an example the text seen on buttons and on the main menu selection items is in the Localizable_Game.strings, however, other parts of the menu text can be found in data/text/menu_english_stm.txt and language variants.<br />
<br />
==Enhanced Tweaks==<br />
Rome Remastered now has an IMGUI system which allows modders and users to set advanced graphics variables. To enable the feature add<br />
enhanced_tweaks<br />
to the game launch properties.<br />
<br />
Changed settings can be exported and will be found in:<br />
C:\Users\Your_Name\AppData\Local\Feral Interactive\Total War ROME REMASTERED\EnhancedTweaks<br />
this file can be copied and added to your mod-folder, in a folder at<br />
modfolder\data\enhanced_tweaks<br />
If you are publishing the mod be aware that the exported file contains ALL of your settings including resolution and quality settings. To avoid imposing these on other users you should include only the entries for settings you want to override.<br />
<br />
Feral have provided an example mod demonstrating a tweaked tree colour [https://github.com/FeralInteractive/romeremastered/tree/main/example_mods/EnhancedTweaksExample here].<br />
<br />
Note: The game appears to read the contents of any text file in the enhanced_tweaks folder, even if not named .json - beware of trying to keep copies of unwanted tweak files in the folder!<br />
[[Category: Modding]]<br />
[[Category:Rome Remastered Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Spot_fx_animations_and_effects&diff=86869Spot fx animations and effects2023-12-19T17:15:25Z<p>Makanyane: added bit about textures</p>
<hr />
<div>{{DISPLAYTITLE:spot_fx animations and effects}}<br />
Effects such as smoke, or animated effects such as the gatehouse flags are added to RTW and Rome Remastered using the spot_fx system.<br />
<br />
Animated items added by spot_fx will appear in custom and campaign map battles, but are not rendered in the settlement view option launched from campaign without a battle.<br />
<br />
==Spot_fx==<br />
The spot_fx is a .cas model which gives the location and rotation of the effect - the name of the mesh/es inside the .cas match the name of the effect to be called. If you need two versions of the same effect you'd use 'smoke00' and 'smoke01' etc.<br />
<br />
The blacksmiths and armourers have examples of spot_fx using smoke. The .cas is added to the buildings dbb listing after the physical_info line:<br />
barbarian_armourer<br />
{<br />
stat_cat medium_wooden<br />
localised_name barbarian_armourer<br />
level<br />
{<br />
min_health 1<br />
battle_stats<br />
item barbarian_armourer<br />
physical_info info_barbarian_armourer.cas<br />
'''spot_fx ''' barbarian_armourer_spot_fx.CAS<br />
}<br />
<br />
The gatehouse buildings have examples of spot_fx files which call animated 'models_spot' which give the animated flag effects.<br />
<br />
The .cas files for spot_fx are placed in data/models_building/spot_fx.<br />
<br />
===Changing spot_fx cas files===<br />
Versions of [[IWTE]] from v21_11_c.exe onwards will correctly export and import the fx cas files to .dae for Blender/Max.<br />
<br />
The important thing to note is the mesh naming and the transforms. The transforms tell the game where the effect should be moved to.<br />
To add a new mesh create a flat plane at 0,0,0 if you need to include a rotation change the shape in EDIT mode so you can tell which way you've turned the plane. Then in OBJECT mode move and rotate the plane so it is centered where you want the effect. DO NOT apply the transforms, the end result in Blender still needs to show the transform values, see pic below:<br />
<br />
[[File:Spot fx.jpg|200px|How the spot_fx file should look in object mode in Blender]]<br />
<br />
Earlier tools for .cas conversion did not add the transform information in the correct format, this caused the misaligned and huge versions of spot_fx effects.<br />
<br />
===Effects===<br />
Smoke and fire effects are already included in the game (fire is used in BI buildings for the street lamps). A spot_fx cas with a mesh called '''''smoke'''_anything'' will get you the chimney smoke effect, which appears to be hard-coded. <br />
<br />
You can use a mesh called '''''night_fx'''_anything'' to activate a fire effect which will appear at night. The name should correspond to the name of an effect_set included in your descr_effects_torch_fire.txt, for example if you have added an effect called ''new_torch_fire'' you could use it in an effect set as shown below.<br />
<br />
effect_set < 0 1 2 3 4 > night_fx_anything<br />
{<br />
lod 10000<br />
{<br />
new_torch_fire<br />
}<br />
}<br />
<br />
<br />
==Models_spot==<br />
Data/models_building/models_spot/flag_horizontal_large.cas is an example of an animated spot effect. The flag uses an armature and keyframes that are contained in the same file as the model, and does not use an external skeleton.<br />
<br />
The models_spot need to be added to the game in the same way as building items. The existing ones are found in data/descr_items/di_spot_items.txt. The horizontal flag is coded as:<br />
type flag_horizontal_large<br />
lod<br />
max_distance 200<br />
'''model_anim''' models_spot/flag_horizontal_large.CAS<br />
lod<br />
max_distance 4000<br />
model_rigid models_spot/flag_horizontal_large_low.CAS<br />
Note that the model_anim setting is needed for the high lod to use its animation. The model_rigid version is provided to stop the game having to animate the object when out of viewing distance.<br />
<br />
In addition to being added as building items the models_spot need to be added to spot_items in descr_building_battle.txt, the vanilla entries just include:<br />
spot_items<br />
{<br />
flag_vertical_small<br />
{<br />
any flag_vertical_small<br />
}<br />
flag_vertical_large<br />
{<br />
any flag_vertical_small<br />
}<br />
''flag_horizontal_large''<br />
{<br />
any '''flag_horizontal_large'''<br />
}<br />
}<br />
The part in italics is the spot_fx name which needs to be used in the _fx.cas as a mesh name, the part in bold is the models_spot item name.<br />
<br />
You can add additional spot_items. Getting the models_spot.cas to convert to a .item file requires the same procedure as generating other building items (delete your descr_items.db to get a new item added, delete the .item file if you want to use an updated .cas model for an existing item)<br />
<br />
===Faction specific textures===<br />
Spot items such as the flags when added to Gatehouses can use a texture (e.g. ##standard_julii.tga) with faction variants in descr_building_battle.txt, and the texture will change to the faction's that 'owns' the Gatehouse. This only works within the spot model, using the ##standard_julii.tga texture for parts of the regular model will not result in ownership changes being displayed.<br />
<br />
===Changing models_spot cas files===<br />
[[IWTE]] will export the existing flag_horizontal_large.cas to .dae - if you import that to Blender you will see it contains an armature and simple animation. If you want to amend that file you can add bones, more mesh, change the animations etc., there doesn't seem to be a bone limit or any presets required for Rome Remastered models_spot. <br />
<br />
For IWTE dae to cas please leave the first bone of the armature called '''bone_'''something, so it recognises its meant to keep the armature! To get the animation and model in the same cas you will need to use the new button ''''RTW object animation dae to cas''''.<br />
<br />
[[File:Rtw-anim-object.jpg|200px|Location of new combined animation button]]<br />
<br />
If you want to create complex animations that involve some bone movement or large rotations you will need to simplify the Armature structure, the models_spot system does not seem to render parented bone structures with complex movements properly. For example with a horse or human animation the armature should have all the bones de-parented in edit mode, and then have 'child-of' constraints added in pose mode to simulate a similar movement system. The picture below shows a set up for a horse:<br />
<br />
[[File:Horse-with-constraints.jpg|200px|Horse with constrained instead of parented armature]]<br />
<br />
Note: the .dae file will not save the child constraints, it will instead provide keyframes for each bone as if they were independent, this suits the game, but will be hard to edit if you try to work back from it, so SAVE your BLEND file!<br />
<br />
Rome Remastered will only accept meshes that have 1 bone per vertex weighting. If you add a mesh with flexi_m type variable weighting on a vertex the mesh will not be shown in game. Use 'limit_total' in Blender to reduce to single bone weighting.<br />
<br />
== 3ds Max specific ==<br />
Working with 3ds max (importing the .dae created by IWTE and openCOLLADA) will require the attention to the following aspects:<br />
<br />
- Exporting the animated .dae file will require you in max to rotate the object with '''180 degrees'''.<br />
<br />
- IWTE doesn't handle textures, so in order to export the right texture, you need to name the material with the same name as the used texture, like this:<br />
<br />
[[File:3ds Max material naming.png|200px]]<br />
<br />
[[Category:RTW Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Total_War:_Pharaoh&diff=86866Total War: Pharaoh2023-12-18T14:56:04Z<p>Makanyane: /* Reviews and Media */ trying to get the bit about the price reduction in - not sure if that is the right place!?</p>
<hr />
<div><div class="TWCportal_2"><br />
<big><big><big>Welcome to Total War: Pharaoh on the TWC Wiki</big></big></big><br />
----<br />
<br><br />
[[File:Pharaoh-banner.png|center|Banner for Total War: Pharaoh]]<br />
<br><br />
<center><big>'''Total War: Pharaoh is the latest entry of the [[Total War Series]] developed by [[CA|The Creative Assembly]].'''<br><br />
Released released in October 2023, this title focuses on the turbulent days of ancient Egypt, set in the late bronze age much like the thematically similar [[Total War Saga: Troy]].<br />
</big></center><br />
<br />
<br />
</div><br />
<div class="TWCportal_1"><br />
{{TOC right|limit=3}}<br />
== Overview ==<br />
'''Total War: Pharaoh''' is described on Steam:<br />
<br />
:''"In Total War: PHARAOH, the newest entry in the award-winning grand strategy series, immerse yourself in ancient Egypt at the zenith of its power and experience the dramatic events that threaten its destruction. With dynamic real-time battles and incredible turn-based empire management, can you rise above your adversaries to become Egypt’s last great Pharaoh and stand against the collapse of an iconic civilisation?"''<br />
<br />
The game takes a more narrow approach to the campaign than previous games, focusing on the immediate area of Egypt and the territories it expanded to in its zenith. The scale of the map is smaller than most mainline titles and players experienced with Troy report many similar aspects from interface design to the overall feel of the game, however unlike its immediate historical predecessors it moves away from mythology and goes back to a more strictly historically authentic design. Factions are based around characters rather than fully organized states, with each faction vying for political and military influence. While building in power the player can take part in a side game to acquire political office.<br />
<br />
Pharaoh launched with both praise and criticism, beginning with mixed reviews corresponding to other controversies with Creative Assembly in 2023. Critics point to lacking innovation and underwhelming content for a full price flagship entry to the series. Fans of the project highlight its decently polished campaign despite the smaller scale and some of its immersive battle features.<br />
<br />
</div><br />
<div class="TWCRsection TWCRgroup"><br />
<div class="TWCRcol span_2_of_3"><br />
<div class="TWCportal_1"><br />
<br />
==General Information==<br />
===Campaign Map and Mechanics===<br />
Total War: Pharaoh's campaign map covers Egypt, the conventional "Holy Land" and Anatolia. Over the course of the game various challenges are added, including an increase in natural disasters, the arrival Sea People invasions, and other challenges particularly affecting public order to simulate the late Bronze Age collapse. The campaign start is quite customizable with the player able to affect starting positions, the conditions of natural disasters, and resource distribution - a more granular way to set up campaign difficulty than older titles.<br />
<br />
===Battle Mechanics===<br />
Pharaoh brings new combat mechanics to the game including: dynamic weather with consequential effect on the battlefield (such as thunderstorms and sandstorms), indication of degrading armor while in combat, spreading fire if one is set on the battlefield, and unit stances to change how units behave when commanded to move. For example, units in a stance to fall back will move backwards, without exposing their front to attack. Various mechanics included in Pharaoh may be recognized from the late Total War: Arena multiplayer title.<br />
<br />
===Playable Factions===<br />
At launch, the player may choose to command one of eight leaders who represent the three power factions of the time period.<br />
<br />
'''Ancient Egypt'''<br />
* Seti II<br />
* Amenmesse<br />
* Twosret<br />
* Ramesses III<br />
<br />
'''The Canaanites'''<br />
* Bay<br />
* Irsu<br />
<br />
'''Hittite Empire'''<br />
* Suppiluliuma II<br />
* Kurunta<br />
<br />
==Reviews and Media==<br />
Pharaoh has received generally positive critical reviews, but has also been the source of substantial controversy which may be considered a turning point for how Creative Assembly develops its titles. It has received praise for its execution of the grand campaign and some of the interesting mechanics included, but heavy criticism for its limited scope, overall limited innovation and initial high price for what many found to be a Saga-level of content. Subsequent to the launch Creative Assembly reduced the price and arranged partial refunds for original purchasers, they also announced that the first DLC would be issued as a free update.<br />
<br />
Surrounding its launch has been community criticism of Creative Assembly's handling of their games, and heavy turbulence in the studio including the cancellation of an unrelated high-budget project and heavy layoffs. <br />
<br />
Critic reviews:<br />
* [https://www.ign.com/articles/total-war-pharaoh-review IGN]<br />
* [https://www.polygon.com/reviews/23899816/total-war-pharaoh-review-creative-assembly Polygon]<br />
<br />
</div></div><br />
<div class="TWCRcol span_1_of_3"><br />
<div class="TWCportal_2"><br />
<br />
==Pharaoh Community on TWC==<br />
'''Discussion:'''<br />
*[https://www.twcenter.net/forums/forumdisplay.php?1862-Total-War-Pharaoh-General-Discussion General Discussion]<br />
*[https://www.twcenter.net/forums/forumdisplay.php?2311-Total-War-Pharaoh-AARs Create a Pharaoh AAR!] ([[AAR|What's that?]])<br />
<br><br />
</div><br />
<div class="TWCportal_3"><br />
==System Requirements==<br />
As given through the [https://store.steampowered.com/app/1937780/Total_War_PHARAOH/ Steam Store]:<br />
<br />
'''Minimum System Requirements:'''<br />
:OS: Windows 10 64-Bit<br />
:Processor: Intel i3-2100 / AMD FX-4300<br />
:Memory: 6 GB RAM<br />
:Graphics: Nvidia GeForce GTX 660 / AMD R9 270<br />
:Storage: 50 GB available space<br />
<br />
'''Recommended Requirements:'''<br />
:OS: Windows 10 64-Bit<br />
:Processor: Intel i5-6600/Ryzen 5 2600X<br />
:Memory: 8 GB RAM<br />
:Graphics: Nvidia GeForce GTX 1660 Ti / AMD RX 480<br />
:Storage: 50 GB available space<br />
<br />
</div></div></div><br />
----<br />
<br><br />
{{TWPortalsPics}}<br />
<br />
==See also==<br />
* [https://pharaoh.totalwar.com/ Official Pharaoh Site]<br />
* [https://www.totalwar.com/blog/total-war-pharaoh-faq-dec-2023/ Total War Pharaoh FAQ Dec 2023]<br />
<br />
<div style="text-align: center;"><br />
<big></big><br />
</div><br />
[[Category:Total War Series]]<br />
[[Category:Pharaoh Information]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Total_War:_Rome_Remastered_-_Modding&diff=86864Total War: Rome Remastered - Modding2023-12-18T08:41:04Z<p>Makanyane: /* Mod Set-up */ fixed link</p>
<hr />
<div>{{Rome Remastered Modding}}<br />
<big>[[Total War: Rome Remastered]] offers modding opportunities similar to the original game although higher quality assets will be needed to match the improved graphics. <br />
<br />
With patch 2.0.4 beta hard-coded limits for factions, cultures, religions, buildings and units have been removed. See [https://github.com/FeralInteractive/romeremastered Rome Remastered github] for more details.</big><br />
<br />
<br />
==Mod Set-up==<br />
<br />
Mods can be uploaded and used from the Steam Workshop, the placing of those mods on your computer will be determined by Steam and your library set-up, for example a mod's file could be in:<br />
:''D:\Steam\steamapps\workshop\content\885970\2471298638''<br />
<br />
Mods in development can be placed in the 'Mods' folder either in Local Mods or My Mods, the full path to these folders is normally:<br />
:''C:\Users\YOURNAME\AppData\Local\Feral Interactive\Total War ROME REMASTERED\Mods\Local Mods\Mods_Name'' etc.<br />
If you have a small C drive and need to relocate this elsewhere you can use a [https://www.howtogeek.com/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/ hard-link] on your computer, hopefully, the launcher options will later allow an easier way to change directory locations!<br />
<br />
Within either Local Mods or My Mods you will then have a folder for Mod_Name. Within '''Mod_Name''' folder you need the mod's '''data''' folder a '''modinfo.json''' and a '''filelist.json'''<br />
<br />
=== modinfo.json ===<br />
This file you write yourself and it gives the name and description of the mod, a sample format is:<br />
{<br />
"Description": "Brief description of you mod goes here",<br />
"Mod Name": "Mod name goes here",<br />
"Supports Alex": false,<br />
"Supports BI": false,<br />
"Supports Rome": true,<br />
"Tags": [ ],<br />
"Visibility": 1,<br />
"Workshop ID": 0<br />
}<br />
<br />
=== filelist.json ===<br />
This is referred to as the 'manifest' for the mod. To generate this file - or regenerate it if you have changed files - select the mod and click the '''"Regenerate Manifest"''' button on the Feral launcher.<br />
<br />
If you add files to the mod and fail to Regenerate Manifest your new files will not be loaded. If you try and run a mod without any manifest you will just get the vanilla game!<br />
<br />
==Errors and Logging==<br />
Version 2.0.2 has introduced a comprehensive error logging system. To activate basic logging to text file use '''enable_logging''' in your Launch Options.<br />
Log files will be generated in:<br />
C:\Users\YOUR_NAME\AppData\Local\Feral Interactive\Total War ROME REMASTERED\VFS\Local\Rome\logs <br />
<br />
You can also use:<br />
:'''-show_err''' - to generate a single pop-up message as in the original game<br />
:'''enable_dialogs''' - to get multiple pop-up messages (this really does generate '''multiple''' messages, you might find it annoying, and the same messages should be available from the text logs)<br />
:'''verbose_script_logging''' - to help debug scripts<br />
<br />
Additionally '''EnableBattleModelInfo''' can be activated from '''Preferences Data''' to view the assets a battle model is using.<br />
<br />
See Feral's [https://github.com/FeralInteractive/romeremastered/blob/main/documentation/feature_guides/logging/logging.md logging.md] for further details.<br />
<br />
<br />
A blank error message with yellow <big><big><big>!</big></big></big> symbol, when you try to launch a mod on your PC appears to be caused by an overall file path length issue. e.g. if you are ending up with file/folder paths that looks like:<br />
''C:\Users\Name\AppData\Local\Feral Interactive\Total War ROME REMASTERED\Mods\My Mods\Mega European Mod Version 5b 2021\data\xdescr_building_battle - copy (2)\''<br />
Try to shorten this! The mod-folder name doesn't have to match the displayed mod name, so re-name that to something with just a few initials! And try not to keep old copies of unecessary files/folder with long names inside the mod-folder...<br />
<br />
==Differences to Rome: Total War==<br />
<br />
'''For text file and folder structure differences see main article:- [[File Differences - Rome Remastered]]'''<br />
<br />
There are numerous small and large changes to the files and file structure of Remastered in comparison to RTW. The changes are centered around:<br />
*Inclusion of higher resolution graphics and environmental effects<br />
*Inclusion of all language options within the same base game (instead of replacement)<br />
*Addition of separate mesh structure for 3D elements of campaign map<br />
*Addition of merchant agent type<br />
*'Duplicate' text files with alternative statistics to suit toggled play-style options <br />
*New methods to override base files<br />
<br />
Feral's [https://github.com/FeralInteractive/romeremastered/blob/main/RomeRemasteredDifferences.md Differences & New Features] page details the changes to date including 2.0.2 patch with information about currently increased limits and targeted changes for version 2.0.3.<br />
<br />
==Scripting==<br />
From version 2.0.2 the scripting possibilities of the game have been greatly increased over RTW. Importantly the game will now load a background script listed at the bottom of descr_strat.txt AND reload it automatically on save game reload. The script can also include persistant counters to store variables during the game and across save/reloads.<br />
<br />
See Feral's [https://github.com/FeralInteractive/romeremastered/blob/main/documentation/feature_guides/scripts/Scripts.md guide to scripts] for details and docudemon files.<br />
<br />
<br />
==Textures==<br />
RR still uses .tga.dds files (e.g. dds files but with the .tga name appended so that text files actually just ask for .tga)<br />
<br />
Some textures are compressed using the LZ4 system, these also have an additional header section which can be ignored. [https://www.twcenter.net/forums/showthread.php?811147-IWTE-texture-decompression-for-Rome-Remastered&p=16020947#post16020947 IWTE] now has an option that will de-compress a directory of these textures back to their starting .dds state.<br />
<br />
Some textures are DX10 type, these you can probably open but not see the correct information, if you have a recent version of Photoshop you can use this [https://software.intel.com/content/www/us/en/develop/articles/intel-texture-works-plugin.html plugin] to open them. Otherwise, you need to convert them to .tga using the [https://github.com/Microsoft/DirectXTex/wiki/Texconv Texconv tool] or similar. The easiest way to use this tool is by writing a .bat file (so you don't have to remember the commands each time!), and example .bat would be:<br />
<br />
@echo off<br />
texconv.exe -r my_folder\*.dds -ft tga -o my_folder<br />
cmd /k<br />
<br />
Fortunately, the game will accept and run happily with non-compressed DXT5 and DXT1 dds textures in the same way as RTW, so you only need to mess about with the above if you need to view or amend some of the existing textures.<br />
<br />
===PBR===<br />
RR has introduced a system of [https://en.wikipedia.org/wiki/Physically_based_rendering Physically Based Rendering] for textures, thus the 'normal' textures that have been introduced with RR work slightly differently from the ones in M2TW:<br />
_pbr contain the _n, _s and _m maps they are rgba textures<br />
r+g = normal<br />
b = metallic<br />
a = roughness<br />
In other places like building textures you will find that the _n, _s, _m are separate<br />
<br />
For battle map units KurdishNomad has produced a pdf guide on how to make PBR textures for RR in GIMP, see [https://www.twcenter.net/forums/showthread.php?812997-Making-PBR-Textures-from-Rome-Remastered-Units&p=16065951 here].<br />
<br />
===.pvr===<br />
A .pvr version of the radar map is used, to open this file download the [https://www.imaginationtech.com/developers/powervr-sdk-tools/installers/ PVRTexTool] or similar.<br />
<br />
===Building Textures===<br />
Normal textures for buildings use _n added to the file name, the blue channel of the normal is usually black.<br />
<br />
The smoothness version of building textures with _s added to the name is a greyscale image, white elements make things appear dark in wet conditions, dark elements make things shiny in sunny conditions.<br />
<br />
The emisivity for glowing textures seem to use _e added to the name ''(the author currently can't get that element to work)''.<br />
<br />
===Settlement Overlay Textures===<br />
Feral have explained that how various special keywords in the MESH names of the overlays work:<br />
<br />
orderedXY<br />
Where XY is a number (00, 01, 02...) the game uses this to sort the rendering of the different meshes. Bigger numbers are rendered last, this is to avoid z-fighting (the annoying flickering) when 2 meshes are at the same distance from the camera.<br />
<br />
gridXY<br />
Again XY is a number. The only possible numbers are the ones defined in descr_landscape_global_uv_grids.txt and this will make the assigned texture tile according to the uv scale defined in the text file. Descr_landscape_global_uv_grids.txt can be included in a mod-folder and amended.<br />
<br />
detailXY_ZW<br />
XY and ZW are numbers (00, 01, 02...) The first number references a tile value in descr_landscape_global_uv_grids.txt as for the grid keyword above. The second number references a texture in descr_landscape_multi_textures.txt. The difference from gridXY is with the ''detail'' keyword the texture referenced by the second number is going to be tiled as referenced by the first number, but it's going to use the alpha of the textures assigned to the mesh without tiling that alpha layer. So the alpha layer of the texture assigned by the standard material naming process to the mesh element can define the whole area of roads to be painted onto a settlement overlay, but the actual texture applied to them can be tiled and maintain a high resolution. Descr_landscape_multi_textures.txt can be included in a mod-folder and amended but only currently supports 15 texture variations the textures defined in it do not work with the winter variant system applied from descr_building_battle.txt.<br />
<br />
An example use of the detail keyword would be a mesh name within the overlay .cas of:<br />
ordered01 - detail04_03 - whatever<br />
*this would be displayed on top of other lower ordered meshes in the same plane<br />
*this would use the tiling for entry 4 in descr_landscape_global_uv_grids.txt<br />
*this would use texture 3 from descr_landscape_multi_textures.txt for the tiled element<br />
<br />
==Campaign Map==<br />
:See main article [[Creating New Campaign Map in Rome Remastered]]<br />
One of the areas modders' have been most worried about was whether the game would support completely redesigned maps now that a model mesh system has been introduced for the campaign map. Although this looks like the vanilla shaped map, it's actually partway through porting a version of the Mundus Magnus large map for RTW (originally by ngr).<br />
<br />
[[File:MundusMagnusMapRR.jpg|300px|Showing new map mesh in Rome Remastered]]<br />
<br />
[[IWTE_-_Rome_Remastered_Functions#Campaign_Mesh_Generation|IWTE]] now supports mesh and texture creation from base .tga files.<br />
<br />
===Maximum size===<br />
Rome Total War and M2TW had a hard coded size limit for map_regions.tga of 510 pixels height and width. The later patches of Rome Remastered allow a larger sized map, although there are likely still some limits the RIS team have achieved a working map with a 1020 x 700 map_regions.tga size.<br />
<br />
===Relationship to battle maps:===<br />
The below picture demonstrates the difference between what you might see on the campaign map and in battle if you don't deliberately align the two:<br />
<br />
[[File:RR-map-demo-Swimming-pool.jpg|300px|Showing lack of connection between campaign and battle map views]]<br />
<br />
The left part shows the campaign map on a modified section of mesh. The area shown in green, where the army can move, is controlled by the map_heights.tga, map_ground_types.tga and map.rwm information. Where he would actually appear to stand is controlled by the heightmap .bin file generated from the mesh, so he will walk up that big lump, but he won't go below 0m (sea level), even though the mesh is below the water surface there. The second part of the picture on the right shows what you actually get at that spot in battle, which is based on the map_heights.tga, map_ground_types.tga and map.rwm information, plus interpretation from the vegetation and geography.db files.<br />
<br />
===Similarities to the original system:===<br />
<br />
A quick look in the data/world/maps folders will reassure RTW and M2TW modders that the map image and text files they are familiar with are still there. If you have a 'pure map' mod you should be able to use your existing map_heights.tga, descr_strat.txt etc to launch a mod for Remastered without much problem. If the mod has modded units, buildings, ancillaries etc, it will take more unravelling, just as porting a map between different mods would. If you try to copy in all of your mod's files you will probably find either some conflicts, or that you have overwritten new features in Remastered such as the addition of traits and ancillaries to support the new Merchant agent type.<br />
<br />
That's the good news... your basic map files are still valid! The basic files drive the campaign map pathfinding, placement of settlements and resources and provide the climate/heights/ground_types information that is translated using the vegetation and geography.db files to make the battle maps.<br />
<br />
The not so good news, if you were after a quick result, is that they don't generate the mesh or textures you view on the campaign map! So if you load a map of a different size or shape the areas not covered by the existing mesh, or already on raised land areas, will just appear as sea! They will function, and the trees and settlements will turn up, and your troops will be able to move on the parts supposed to be land... so if you ever wanted to do a mod based in the Everglades, this could be for you.<br />
<br />
[[File:Everglades.jpg|300px|Screenshot showing area of map without mesh]]<br />
<br />
==Units==<br />
'''To unpack unit models from Rome Remastered packs you need to use the [https://github.com/FeralInteractive/romeremastered/blob/main/tools/unpack_characters/unpack_characters.md unpack_characters] option when launching the game .exe'''<br />
<br />
The .cas files you generate can be converted for editing in Blender or 3dsMax. You can use:<br />
*Feral's cas>fbx>cas tool see [https://github.com/FeralInteractive/romeremastered/tree/main/tools/CasPacker here]<br />
*IWTE which converts cas>dae>cas and can also combine the unit mesh with unpacked animations see: [[IWTE - Units in Blender]]<br />
*possibly older max script coverters<br />
Please be aware that each of the tools may have different default scaling and orientation, so you should not combine import/export across different tools.<br />
<br />
Although still .cas files the RR units use the 'type 3' chunk system previously only used for some shoulder pads and minor elements of RTW units using the model_flexi_m system. The main body of the unit can have vertexes weighted variably between any two bones for the lod0 model, the lod1 model and lower need to have single bone weighting throughout. Primary and secondary weapons must still exist within the .cas as a separate mesh and use only one bone.<br />
<br />
Only the base .cas name is given for the model in the DMB file the game looks for and needs four model .cas files for each model named:<br />
:''base_name_lod0.cas''<br />
:''base_name_lod1.cas''<br />
:''base_name_lod2.cas''<br />
:''base_name_lod3.cas''<br />
If you haven't got 4 different lod level models, copy the closest one you have and re-name it to suit.<br />
<br />
The uv mapping of the units is now used to provide the variation across faces and skin sections to suit ethnicity, details of the uv system and requirements for conversion with the CasPacker tool can be found [https://github.com/FeralInteractive/romeremastered/blob/main/documentation/techart_guides/Characters.md here]<br />
===Animations===<br />
Two additional animations have been added to the packed unit skeletons, and supplementary animations and over-rides have been added via descr_skeleton_feral_overrides.txt see the lists [[Rome:_Total_War's_Animation_Modification#Rome_Remastered_Animation_List|here]].<br />
<br />
===Skin Textures===<br />
The textures used for face hair and body sections are found in data/characters/skin_textures. The naming for males is:<br />
:''ethnicity_m_bodies.dds''<br />
:''ethnicity_m_bodies_pbr.dds''<br />
:''ethnicity_m_faces_serious.dds''<br />
:''ethnicity_m_faces_serious_pbr.dds''<br />
:''ethnicity_m_faces_angry.dds''<br />
:''ethnicity_m_faces_angry_pbr.dds''<br />
For females the same format is used with _f_ replacing the _m_<br />
<br />
Note that the blue channel of the pbr which would create a metallic effect if used elsewhere is not read for skin sections.<br />
<br />
Within the skin textures, there are 5 sections for bodies, and 16 for faces. By experimenting with colours added to them you can see which sections are used for which dmb entries. (The body section shown is from a mod using part of the chest for shields) <br />
<br />
[[File:Experimental blobs.jpg|400px]]<br />
<br />
The first 5 faces (shown with white blobs in the picture above) are used for 'aged' faces, the last 4 faces (shown with green blobs) are used if 'medieval_features yes' is used and the characters are not 'aged'. The central section ones (shown with blue blobs) are used for non-aged characters without medieval features.<br />
<br />
For the body the sections are used as follows:<br />
:Skinny - sections 1, 2<br />
:SkinnyAthletic - sections 1, 2, 3<br />
:Default - sections 2, 3, 4<br />
:Athletic - sections 3, 4, 5<br />
:Bulky - sections 4, 5<br />
NOTE: This does not apply to Culann or Berserker ethnicities which are hard-coded to use all 5 sections regardless of body type (info supplied by Feral).<br />
<br />
====Hair Texture and Styles====<br />
There is only one hair texture ''hair.tga.dds'', this is a normal texture with transparency, the colour of the hair is set in descr_unit_variation.txt and applied to the non-transparent areas. This does not work in the same way as the skin textures. The models contain multiple hair meshes, the ones chosen for use depend on the uv mapping positions, and the texture shown matches the relative uv position.<br />
<br />
==Text Strings and Menu Items==<br />
Some of the text displayed in game isn't read from data/text folders, it's from <br />
:''\Steam\steamapps\common\Total War ROME REMASTERED\Contents\Resources\en.lproj\Localizable_Game.strings'' - (which is plain text)<br />
<br />
these strings can be changed and included in a modfolder @ <br><br />
:''mod-folder\data\string_overrides\en.strings''<br />
example shown is for English the same principle applies on other languages.<br />
<br />
Instructions are contained in the readme.txt inside data/string_overrides:<br />
This folder is used to override strings added to the game by Feral Interactive.<br />
The original files can be found at "<languageCode>.lproj/Localizable_Game.strings"<br />
Override files should be named the language code they correspond with and have the file extension, ".strings"<br />
E.G. English Override: "en.strings"<br />
<br />
As an example the text seen on buttons and on the main menu selection items is in the Localizable_Game.strings, however, other parts of the menu text can be found in data/text/menu_english_stm.txt and language variants.<br />
<br />
==Enhanced Tweaks==<br />
Rome Remastered now has an IMGUI system which allows modders and users to set advanced graphics variables. To enable the feature add<br />
enhanced_tweaks<br />
to the game launch properties.<br />
<br />
Changed settings can be exported and will be found in:<br />
C:\Users\Your_Name\AppData\Local\Feral Interactive\Total War ROME REMASTERED\EnhancedTweaks<br />
this file can be copied and added to your mod-folder, in a folder at<br />
modfolder\data\enhanced_tweaks<br />
If you are publishing the mod be aware that the exported file contains ALL of your settings including resolution and quality settings. To avoid imposing these on other users you should include only the entries for settings you want to override.<br />
<br />
Feral have provided an example mod demonstrating a tweaked tree colour [https://github.com/FeralInteractive/romeremastered/tree/main/example_mods/EnhancedTweaksExample here].<br />
<br />
[[Category: Modding]]<br />
[[Category:Rome Remastered Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Template:Total_War&diff=86853Template:Total War2023-12-15T21:17:52Z<p>Makanyane: added Pharaoh</p>
<hr />
<div>{| class="infobox bordered" style="text-align:center;border:1px solid black;box-shadow:1px 1px 3px 1px black;"<br />
! '''[[Total War Series]]''' <br />
|-<br />
| style="padding:0.5em;" |<br />
[[File:Total_War_Logo.png|180px|center|link=Total War Series|Total War Series main article]]<br />
'''[[Total War: Pharaoh]]'''<br />
<br />
'''[[Total War Saga: Troy]]'''<br />
<br />
'''[[Total War: Three Kingdoms Portal|Total War: Three Kingdoms - Portal]]'''<br />
*[[Total War: Three Kingdoms]]<br />
<br />
'''[[Total War Saga: Thrones of Britannia]]'''<br />
<br />
'''[[Total War: Warhammer Portal| Total War: Warhammer - Portal]]'''<br />
*[[Total War: Warhammer III]]<br />
*[[Total War: Warhammer II]]<br />
*[[Total War: Warhammer]]<br />
<br />
'''[[Total War: Attila]]'''<br />
<br />
'''[[Total War: Rome II Portal| Total War: Rome II - Portal]]'''<br />
*[[Total War: Rome II]]<br />
<br />
'''[[Total War: Shogun 2 Portal| Total War: Shogun 2 - Portal]]'''<br />
*[[Total War: Shogun 2]]<br />
*[[Total War: Shogun 2: Rise of the Samurai|Shogun 2: Rise of the Samurai]]<br />
*[[Total War: Shogun 2: Fall of the Samurai|Shogun 2: Fall of the Samurai]]<br />
<br />
'''[[Napoleon: Total War]]'''<br />
<br />
'''[[Empire: Total War]]'''<br />
<br />
'''[[Medieval 2: Total War Portal| Medieval II: Total War - Portal]]'''<br />
*[[Medieval II: Total War]]<br />
*[[Medieval II: Total War: Kingdoms|Kingdoms]]<br />
<br />
'''[[Rome: Total War & Remastered Portal|Rome: Total War & Remastered Portal<br />
]]'''<br />
*[[Total War: Rome Remastered]]<br />
*[[Rome: Total War]]<br />
*[[Rome: Total War: Barbarian Invasion|Barbarian Invasion]]<br />
*[[Rome: Total War: Alexander|Alexander]]<br />
<br />
'''[[Medieval: Total War]]'''<br />
*[[Medieval: Total War: Viking Invasion|Viking Invasion]]<br />
<br />
'''[[Shogun: Total War]]'''<br />
*[[Shogun: Total War: Mongol Invasion|Mongol Invasion]]<br />
|}<br />
<br />
<noinclude>[[category:Navigation Template]]</noinclude></div>Makanyanehttps://wiki.twcenter.net/index.php?title=Total_War_Series&diff=86852Total War Series2023-12-15T21:15:53Z<p>Makanyane: /* Main Series */ link to pharaoh</p>
<hr />
<div>[[File:Wiki-series-banner2.jpg|center]]<br><br />
{{Total War}}<br />
'''''Total War''''' is a video game series developed by [[Creative Assembly|The Creative Assembly]]. There are currently 14 mainline entries, 3 Saga titles, and 4 relevant spinoff projects. Creative Assembly has published through [[SEGA]] since the release of Medieval II.<br />
<br />
Total War games are distinguished by combining two forms of gameplay: a battlefield map where armies are pitted against each other directly, and a strategic campaign map to lend the battles context and significance. The series is widely recognized as being the first to introduce large-scale military battlefields in a game and at times has been used to simulate battles in real historic contexts. For example, the [[Rome: Total War]] engine was selected to power the simulations on ''[[Time Commanders]]'' and ''Decisive Battles''. Though Total War began with a strictly historical focus, Creative Assembly began experimenting with the fantastic with their Warhammer series, and brought a heavy mythological influence to the historical titles released around this trilogy. Total War is also known for its extensive, at times revolutionary modding scene.<br />
<br />
For user-made modifications to the Total War Series, see '''[[Total War Mods]]'''.<br />
<br />
For information on how to make your own mods, see the '''[[Modding Portal]]'''. <br />
<br />
==Gameplay==<br />
This section discusses elements of gameplay that are common to each game in the series. Note that the nature of gameplay varies from title to title, and should be explored on a per-game basis. Spinoffs may focus on one aspect, or take a different approach entirely while still connecting to the Total War branding.<br />
<br />
===The Campaign===<br />
A staple of the Total War experience, the campaign tasks the player with managing an (at first) fledgling faction and then their ever expanding empire, eventually achieving military dominance over the map. Total War: Attila is the only major title to meaningfully flip this, demanding the player to recover a declining empire. Players choose from a selection of relevant factions for the setting against a world of computer-controlled rivals. In earlier titles new factions would be unlocked through gameplay, with defeated factions becoming playable. In later titles a selection of relevant powers is available by default, with new ones available through DLC, and the rest of the map unplayable. Aside from maps that allow battles to come to pass, campaigns offer a degree of diplomacy, political management and the development of characters, though the depth handles differently from title to title. The depth is never to the extent of say, Paradox titles, but the combination of fully realized battles is the unique selling point of the series.<br />
<br />
===The Battlefield===<br />
The other key aspect of Total War, each game provides battlefields that can include many thousands of soldiers in a variety of situations. Although reinforcements are possible, there is no base building aspect and no in-battle respawning. Only a fight to the death, or more regularly, until the losing army flees the field. Rome Total War and all later entries include siege battles; the ability to conquer or save a city, castle or other holdout. It should be noted that siege battles are typically viewed as the weaker aspect due to pathfinding and design being difficult to perfect despite this form of battle existing in the series for many years. Some titles include naval battles, and some later titles allow scenarios in which powerful heros duel one on one. The latter is seen in the Warhammer trilogy and entries that came after.<br />
<br />
===Other features and design===<br />
Total War games include multiplayer. Mostly focused on battles, recent titles typically also include the feature to conquer the world with a friend for support or a rival who must ultimately be defeated. Medieval 2 fleshes out a unique feature, [[hotseat]], allowing any faction to be controlled in the same turn. This has been used to allow multiple people to play a campaign on the same computer, to battle competitively in extensive hotseat campaigns, or even to play multiple or every single faction themselves. A feature that was possible in Rome Total War and realized to an extent in Medieval 2, it has never been seen again in the series following the launch of Empire.<br />
<br />
Total War has a long history of modding, ranging from smaller tweaks typically uploaded to the steam workshop to total overhauls of the game which must be uploaded to the workshop in several parts or hosted on other sites altogether. The most comprehensive modding is done in earlier titles where the map is simpler to change and the game can be more convincingly rebranded to another setting, such as in Rome: Total War or Medieval II: Total War. Later titles with greater complexity and restriction tend to have far fewer overhauls of this nature, though advanced retuning of the gameplay can still be found, such as the 1212AD mod for Total War: Attila. This wiki caters heavily to the modding scene of the series.<br />
<br />
Earlier entries of the series focused on historically authentic nations, allowing the player to build and play through many generations while achieving world conquest. Later titles, especially Warhammer but inclusive of some of the games surrounding them, have come to design factions around particular characters in relevant time periods in addition to embracing historic mythology. These titles on the historical side include Three Kingdoms, Troy and excluding the mythological aspect, Pharaoh.<br />
<br />
==Total War Saga Games==<br />
Saga branded titles are standalone spin-offs with the same overall gameplay as a full Total War game, but they concentrate on "flashpoints" with a smaller scope. They are generally cheaper and less extensive than a mainline release. <br />
<br />
===Total War Saga: Troy===<br />
{{Main|Total War Saga: Troy}}<br />
''Total War Saga: Troy'' was released in August 2020. The game is set in the late Bronze Age and focuses on the Trojan War.<br />
<br />
===Total War Saga: Thrones of Britannia===<br />
{{Main|Total War Saga: Thrones of Britannia}}<br />
''Total War Saga: Thrones of Britannia'' was announced in July 2017, and released in May 2018. The game is set in 878 AD and focuses on the British Isles.<br />
<br />
===Total War: Shogun 2: Fall of the Samurai===<br />
{{Main|Total War: Shogun 2: Fall of the Samurai}}<br />
''Total War: Shogun 2: Fall of the Samurai'', the standalone expansion for Shogun 2, was reclassified as a part of the Saga series some years after its release.<br />
<br />
==Main Series==<br />
<!-- needs something here --><br />
<br />
===Total War: Pharaoh===<br />
{{Main|Total War: Pharaoh}}<br />
''Total War: Pharaoh'' was announced in May, 2023 and released October, 2023. It is the latest Total War title and returns to a historically authentic focus, set in ancient Egypt and a handful of relevant territories. Like Three Kingdoms factions are based around powerful individuals rather than organized states. In design it is very reminiscent to its Saga predecessor, Troy.<br />
<br />
===Total War: Three Kingdoms===<br />
{{Main|Total War: Three Kingdoms}}<br />
''Total War: Three Kingdoms'' was announced in January 2018 and released in May 2019. Despite being historical in nature, it introduced a more mythological scenario. It is the first main historical title to focus on characters more than organized states. The main game is set in Ancient China and starts in 190 AD. Various DLCs have been released which provide different campaigns and start dates.<br />
<br />
===Total War: Warhammer III===<br />
{{Main|Total War: Warhammer III}}<br />
''Total War: Warhammer III'' is the third entry of the Warhammer trilogy. It was announced in February, 2021 and released in February, 2022.<br />
<br />
===Total War: Warhammer II===<br />
{{Main|Total War: Warhammer II}}<br />
''Total War: Warhammer II'' is the sequel to Total War: Warhammer. It was announced in March, 2017 and released in September, 2017.<br />
<br />
===Total War: Warhammer===<br />
{{Main|Total War: Warhammer}}<br />
''Total War: Warhammer'' is the first fantasy Total War game. It was announced in April, 2015 and released in May, 2016.<br />
<br />
===Total War: Attila===<br />
{{Main|Total War: Attila}}<br />
''Total War: Attila'' was announced in September 2014, and released on February 2015. Though it has been criticized for performance issues that have persisted over time, the launch was far more smooth than Rome 2. Attila offers a unique campaign scenario, presenting the flagship Roman factions during the fall of the Western Roman Empire and a challenging scenario - or the chance to play one of the many forces that contributed to the fall of Rome.<br />
<br />
===Total War: Rome II===<br />
{{Main|Total War: Rome II}}<br />
''Total War: Rome 2'' was announced in July 2012, and released on September 2013. The announcement and promotion was the subject of great hype and expectations, and Rome 2 was slated to be the largest release of the series yet. The launch was incredibly troubled, the subject to extensive criticism and many bugs that would be addressed over the following years. Updates stalled until resuming again in the late 2010s to introduce a family tree and other mechanics.<br />
<br />
===Total War: Shogun 2===<br />
{{Main|Total War: Shogun 2}}<br />
Shogun 2: Total War was announced in June, 2010 and released in March 2011. In November 2010 shortly after announcement, the naming changed to Total War: Shogun 2. This convention would be applied to the rest of the franchise. Shogun 2 was a smaller title than most in scope, but featured a polished experience that continues to attract fans today.<br />
<br />
===Napoleon: Total War===<br />
{{Main|Napoleon: Total War}}<br />
''Napoleon: Total War'' is the successor of Empire: Total War. The release date for Napoleon: Total War was February 2010 and they delivered on time. The game brings revolutionary new systems to the game, such as attrition, supply lines, plus better Campaign and Battle AI.<br />
<br />
Related reading:<br />
*[https://www.twcenter.net/forums/content.php?458-Napoleon-Total-War-10th-Anniversary-Review Napoleon Total War: 10th Anniversary Review] - by [[Turkafinwë]]<br />
<br />
===Empire: Total War===<br />
{{Main|Empire: Total War}}<br />
''Empire: Total War'' was released in March 2009 and is published by Sega. In late 2009 the expansion [[Warpath Campaign]] was released, which brought a new focus onto the Americas. The game marked very ambitious changes in how the underlying game engine ran, with fundamentals lasting into the latest total war titles. The release of Empire: Total War was considered 'buggy and frustrating' by many users, who wanted more attention to bugs than a new campaign.<br />
<br />
Related reading:<br />
*[https://www.twcenter.net/forums/content.php?431-Empire-Total-War-a-retrospective-on-ten-years-of-potential Empire Total War: a retrospective on ten years of potential] - by [[Alwyn]]<br />
<br />
===Medieval II: Total War===<br />
{{Main|Medieval II: Total War}}<br />
''Medieval II: Total War'' was published in 2006 by Sega and is the indirect sequel to [[Medieval: Total War]]. The [[Medieval II: Total War Kingdoms|Kingdoms]] expansion was released in 2007, adding four new campaigns, a number of factions, several features and fixes and a map extension to include the New World. The game was positively received and developed a modding audience to rival its predecessor, and retains an influential playerbase many years after its release. Around this release, Creative Assembly came under publisher SEGA.<br />
<br />
===Rome: Total War & Rome Remastered===<br />
{{Main|Rome: Total War}}<br />
''Rome: Total War'' was published in 2004 by Activision. It was followed by [[Barbarian Invasion|Rome: Total War Barbarian Invasion]] in 2005, which added a number of features to the game. In the same year, [[Alexander|Rome: Total War Alexander]] was released with distinctly improved AI performance. Rome: Total War radically changed the formula of the franchise, introducing a more freeform campaign map and many features which continue to be seen in the franchise today.<br />
<br />
[[Total War: Rome Remastered]] was released by Feral Interactive in April 2021. The Remaster introduced updated visuals, adjustments and improvements to mechanics, a new UI and various design choices to compliment modders.<br />
<br />
===Medieval: Total War===<br />
{{Main|Medieval: Total War}}<br />
''Medieval: Total War'' was published in 2002 by Activision. Its expansion pack entitled [[Viking Invasion]] was released in 2004, adding a new campaign that encompassed the Viking expansion into Europe.<br />
<br />
===Shogun: Total War===<br />
{{Main|Shogun: Total War}}<br />
''Shogun: Total War'' was published in 2000 by Electronic Arts and is the first original creation by Creative Assembly. Its expansion pack, [[Mongol Invasion]] was released in 2001, placing the player in the midst of a fictionalized invasion of Japan by the Mongol Horde.<br />
<br />
==Free to Play and other Spin-off Games==<br />
===Total War: Arena===<br />
{{Main|Total War: Arena}}<br />
''Total War: Arena'' was a free-to-play team-based multi-player game, it had been in open beta phase since February, 2018 until it was cancelled in February 2019.<br />
<br />
===Total War Battles: Kingdom===<br />
''Total War Battles: Kingdom'' is a free-to-play strategy game including realm building and battles. It was released in March, 2016.<br />
<br />
===Total War Battles: Shogun===<br />
''Total War Battles: Shogun'' was released in April, 2012 for iOS and in August, 2012 for PC and Mac. <br />
<br />
===Spartan: Total Warrior===<br />
''Spartan: Total Warrior'' was released for game consoles in 2005.<br />
<br />
{{TWC Info}}<br />
[[Category: Total War Series]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Total_War:_Pharaoh&diff=86851Total War: Pharaoh2023-12-15T21:13:29Z<p>Makanyane: /* Battle Mechanics */ minor, minor thing</p>
<hr />
<div><div class="TWCportal_2"><br />
<big><big><big>Welcome to Total War: Pharaoh on the TWC Wiki</big></big></big><br />
----<br />
<br><br />
[[File:Pharaoh-banner.png|center|Banner for Total War: Pharaoh]]<br />
<br><br />
<center><big>'''Total War: Pharaoh is the latest entry of the [[Total War Series]] developed by [[CA|The Creative Assembly]].'''<br><br />
Released released in October 2023, this title focuses on the turbulent days of ancient Egypt, set in the late bronze age much like the thematically similar [[Total War Saga: Troy]].<br />
</big></center><br />
<br />
<br />
</div><br />
<div class="TWCportal_1"><br />
{{TOC right|limit=3}}<br />
== Overview ==<br />
'''Total War: Pharaoh''' is described on Steam:<br />
<br />
:''"In Total War: PHARAOH, the newest entry in the award-winning grand strategy series, immerse yourself in ancient Egypt at the zenith of its power and experience the dramatic events that threaten its destruction. With dynamic real-time battles and incredible turn-based empire management, can you rise above your adversaries to become Egypt’s last great Pharaoh and stand against the collapse of an iconic civilisation?"''<br />
<br />
The game takes a more narrow approach to the campaign than previous games, focusing on the immediate area of Egypt and the territories it expanded to in its zenith. The scale of the map is smaller than most mainline titles and players experienced with Troy report many similar aspects from interface design to the overall feel of the game, however unlike its immediate historical predecessors it moves away from mythology and goes back to a more strictly historically authentic design. Factions are based around characters rather than fully organized states, with each faction vying for political and military influence. While building in power the player can take part in a side game to acquire political office.<br />
<br />
Pharaoh launched with both praise and criticism, beginning with mixed reviews corresponding to other controversies with Creative Assembly in 2023. Critics point to lacking innovation and underwhelming content for a full price flagship entry to the series. Fans of the project highlight its decently polished campaign despite the smaller scale and some of its immersive battle features.<br />
<br />
</div><br />
<div class="TWCRsection TWCRgroup"><br />
<div class="TWCRcol span_2_of_3"><br />
<div class="TWCportal_1"><br />
<br />
==General Information==<br />
===Campaign Map and Mechanics===<br />
Total War: Pharaoh's campaign map covers Egypt, the conventional "Holy Land" and Anatolia. Over the course of the game various challenges are added, including an increase in natural disasters, the arrival Sea People invasions, and other challenges particularly affecting public order to simulate the late Bronze Age collapse. The campaign start is quite customizable with the player able to affect starting positions, the conditions of natural disasters, and resource distribution - a more granular way to set up campaign difficulty than older titles.<br />
<br />
===Battle Mechanics===<br />
Pharaoh brings new combat mechanics to the game including: dynamic weather with consequential effect on the battlefield (such as thunderstorms and sandstorms), indication of degrading armor while in combat, spreading fire if one is set on the battlefield, and unit stances to change how units behave when commanded to move. For example, units in a stance to fall back will move backwards, without exposing their front to attack. Various mechanics included in Pharaoh may be recognized from the late Total War: Arena multiplayer title.<br />
<br />
===Playable Factions===<br />
At launch, the player may choose to command one of eight leaders who represent the three power factions of the time period.<br />
<br />
'''Ancient Egypt'''<br />
* Seti II<br />
* Amenmesse<br />
* Twosret<br />
* Ramesses III<br />
<br />
'''The Canaanites'''<br />
* Bay<br />
* Irsu<br />
<br />
'''Hittite Empire'''<br />
* Suppiluliuma II<br />
* Kurunta<br />
<br />
==Reviews and Media==<br />
Pharaoh has received generally positive critical reviews, but has also been the source of substantial controversy which may be considered a turning point for how Creative Assembly develops its titles. It has received praise for its execution of the grand campaign and some of the interesting mechanics included, but heavy criticism for its limited scope, overall limited innovation and high price for what many find to be a Saga-level of content. Surrounding its launch has been community criticism of Creative Assembly's handling of their games, and heavy turbulence in the studio including the cancellation of an unrelated high-budget project and heavy layoffs. <br />
<br />
Critic reviews:<br />
* [https://www.ign.com/articles/total-war-pharaoh-review IGN]<br />
* [https://www.polygon.com/reviews/23899816/total-war-pharaoh-review-creative-assembly Polygon]<br />
<br />
</div></div><br />
<div class="TWCRcol span_1_of_3"><br />
<div class="TWCportal_2"><br />
<br />
==Pharaoh Community on TWC==<br />
'''Discussion:'''<br />
*[https://www.twcenter.net/forums/forumdisplay.php?1862-Total-War-Pharaoh-General-Discussion General Discussion]<br />
*[https://www.twcenter.net/forums/forumdisplay.php?2311-Total-War-Pharaoh-AARs Create a Pharaoh AAR!] ([[AAR|What's that?]])<br />
<br><br />
</div><br />
<div class="TWCportal_3"><br />
==System Requirements==<br />
As given through the [https://store.steampowered.com/app/1937780/Total_War_PHARAOH/ Steam Store]:<br />
<br />
'''Minimum System Requirements:'''<br />
:OS: Windows 10 64-Bit<br />
:Processor: Intel i3-2100 / AMD FX-4300<br />
:Memory: 6 GB RAM<br />
:Graphics: Nvidia GeForce GTX 660 / AMD R9 270<br />
:Storage: 50 GB available space<br />
<br />
'''Recommended Requirements:'''<br />
:OS: Windows 10 64-Bit<br />
:Processor: Intel i5-6600/Ryzen 5 2600X<br />
:Memory: 8 GB RAM<br />
:Graphics: Nvidia GeForce GTX 1660 Ti / AMD RX 480<br />
:Storage: 50 GB available space<br />
<br />
</div></div></div><br />
----<br />
<br><br />
{{TWPortalsPics}}<br />
<br />
==See also==<br />
* [https://pharaoh.totalwar.com/ Official Pharaoh Site]<br />
* [https://www.totalwar.com/blog/total-war-pharaoh-faq-dec-2023/ Total War Pharaoh FAQ Dec 2023]<br />
<br />
<div style="text-align: center;"><br />
<big></big><br />
</div><br />
[[Category:Total War Series]]<br />
[[Category:Pharaoh Information]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Ground_types_settlement_plan&diff=86797Ground types settlement plan2023-11-05T16:38:07Z<p>Makanyane: added logo and to clarify this applies to RTW and RR</p>
<hr />
<div>{{DISPLAYTITLE:settlement plan ground_types}}<br />
{{RTW Modding Logo}} <br />
This article is about '''ground_types''' that are used inside settlements in Rome Total War and Rome Total War: Remastered.<br />
<br />
==ground_types==<br />
A settlement plan ground_type file can be found under '''''data\settlement_plans\ground_types'''''. It is a .tga file that is used inside a settlement plan, and tells the game what sounds to produce when a soldier walks/runs over that given section. It will also disable/enable grass render for certain ground types.<br />
<br />
Most of the example images are sized '''512x512''', but I suspect any size of factor 2 will work.<br><br />
The .tga file is being referenced inside a settlement plan. It has its own line after the '''floor'''.<br />
<br />
<code>ground_types roman_town_ground.tga -288 -288 288 288</code><br />
<br />
<br><br />
The ''-288 -288 288 288'' is the positioning of this file and the scale. You can use this in your 3d editor and create a plane with length and width being 576, and applying this .tga<br />
<br />
<br><br />
<br />
<br />
[[File:Roman town ground.tga.jpg|500px|Roman town ground.tga]]<br />
<br><br />
<br />
You can paint different colours in here, but thanks to Feral we know what each color means. <br />
<br />
{| class="wikitable sortable"<br />
|-<br />
! Type !! RGB !! Color<br />
|-<br />
| Use Underlay|| { 255, 255, 255 }|| <div style="background-color:#ffffff; height: 100%; width:100%">&nbsp;</div><br />
|-<br />
| Short Grass|| { 0, 255, 0 }|| <div style="background-color:#00ff00; height: 100%; width:100%">&nbsp;</div><br />
|-<br />
| Long Grass || { 0, 166, 0 } || <div style="background-color:#00a600; height: 100%; width:100%">&nbsp;</div><br />
|-<br />
| Mud|| { 255, 0, 255 }|| <div style="background-color:#ff00ff; height: 100%; width:100%">&nbsp;</div><br />
|-<br />
| Sand|| { 171, 160, 0 }|| <div style="background-color:#aba000; height: 100%; width:100%">&nbsp;</div><br />
|-<br />
| Stone Road|| { 0, 255, 255 }|| <div style="background-color:#00ffff; height: 100%; width:100%">&nbsp;</div><br />
|-<br />
| Stone Road (Walls)|| { 198, 156, 109 }|| <div style="background-color:#c69c6d; height: 100%; width:100%">&nbsp;</div><br />
|-<br />
| Stone Road (Pavement)|| { 0, 174, 239 }|| <div style="background-color:#00aeef; height: 100%; width:100%">&nbsp;</div><br />
|-<br />
| Grass Short (Wheat Field)|| { 255, 255, 0 }|| <div style="background-color:#ffff00; height: 100%; width:100%">&nbsp;</div><br />
|-<br />
| Grass Short (Vegetation)|| { 0, 166, 81 }|| <div style="background-color:#00a651; height: 100%; width:100%">&nbsp;</div><br />
|-<br />
| Stone Road (Building)|| { 0, 0, 0, }|| <div style="background-color:#000000; height: 100%; width:100%">&nbsp;</div><br />
|-<br />
| Underlay Topographical (uses underlying topographical type?)|| { 255, 127, 255 }|| <div style="background-color:#ff7fff; height: 100%; width:100%">&nbsp;</div><br />
|}<br />
<br />
[[Category:RTW Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=IWTE_-_Units_in_Blender/Milkshape&diff=86527IWTE - Units in Blender/Milkshape2023-06-17T14:12:24Z<p>Makanyane: /* Export and Import RTW Units & RTW/M2TW Strat Characters */ note on engine animations</p>
<hr />
<div>{{RTW M2TW Modding Logo}}<br />
{{IWTE}} <br />
__TOC__<br />
<br />
<big>Tips and instructions for working with RTW and M2TW battle map units and strat map characters via '''[[IWTE]]''' and '''[[Blender]]''' using the .dae format.</big> <br />
<br />
''The .dae files used for the Collada import/export can also be used with '''3ds Max''', however, max users absolutely have to use the [https://github.com/KhronosGroup/OpenCOLLADA/wiki/OpenCOLLADA-Tools '''OpenCollada plugin'''] and file format when importing/exporting files, max comes with the AutodeskCollada file format by default which neither imports nor exports files from the game correctly.''<br />
<br />
*IWTE download [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 here] - please use the latest version, early versions do not have this functionality.<br />
*For queries about these functions please ask [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing here].<br />
*For information on working on M2TW Settlements in Blender see [[IWTE - Settlements in Blender]]<br />
*For general tips on working with Blender see [[Blender hints and tips]]<br />
*For related info about .cas file structure see [[Cas Files|here]]<br />
<br />
<br />
==Export and Import M2TW .mesh Units==<br />
The most useful method of export involves matching the unit .mesh with its skeleton basepose and one or more animations. <br />
<br />
The drop-down menu in IWTE allows a unit .mesh to be merged with its basepose skeleton and one animation. A task file is needed to allow combining of animations and is the only way to also incorporate weapon animations.<br />
<br />
The drop-down menu options, and alternative IWTE Task button options are described below:<br />
<br />
[[File:Export-mesh-in-IWTE.jpg]]<br />
<br />
1. For Blender select the 'Unit mesh/skel/casanim to dae' option if you have the skeleton and animation versions unpacked using XIDX etc.<br><br />
2. For Blender select 'Unit mesh to dae' if you have the "full" version of the .cas basepose and animations (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br><br />
3. For Milkshape select the 'Unit mesh/skel/casanim to ms3d' option if you have the skeleton and animation versions unpacked using XIDX.<br><br />
4. For Blender select 'Unit mesh to ms3d' if you have the "full" version of the .cas basepose and animations (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br><br />
<br />
For all of the above options select the Double Textured option for unit meshes that have both a main and attachment texture. Select the Single Textured option for most other cases (e.g. standard mounts). <br />
<br />
You will be prompted to select the model .mesh first, then the basepose.cas for the skeleton (full cas version) or the unpacked skeleton file (unpacked version), and then an animation.cas file that is compatible with that skeleton (this should be in the same format as the skeleton, full or unpacked). <br />
<br />
===Export/Import by Task Process===<br />
To generate a .dae or .ms3d file from .mesh and .anims via the task process you will need a text file ending in _task.txt which starts with the mesh to dae command, run the task file by selecting the 'IWTE Task' > 'Select Task File' buttons. See example below for mesh_to_dae (the extra line breaks have been included just to show the body/weapon pairing):<br />
<br />
<task_id> mesh_to_extract <br />
<mesh_file_full_path_in> C:\M2TW\mods\devkit\data\animations\EB_Slinger\numidian_slinger_lod0.mesh <br />
<mesh_type> unit # line can be omitted if not also adding mount<br />
<mesh_double_texture> yes # or 'no' for single texture<br />
<cas_file_types_in_list> body weapon <br />
<br />
<directory_out> C:\M2TW\mods\devkit\data\animations\EB_Slinger <br />
<extract_file_name_out> EBslingerAnims.ms3d <br />
<extract_file_type> ms3d # or 'dae' for Blender<br />
<create_text_file> no # or 'yes' for summary files, 'full' for detailed files<br />
<task_file_full_path_out> C:\IWTE/IWTE_tasks/ms3d_to_mesh_slinger_task.txt # name for your return task file <br />
<br />
<cas_file_full_path_in_default_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_basepose.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas<br />
<br />
<cas_file_full_path_in_action_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_stand_A_idle.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas <br />
<br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_attack_missile_ready.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_attack_missile_ready.cas <br />
<br />
Please see the IWTE example control processes.txt file that ships with IWTE for further details/instructions. <br />
<br />
Running the task will generate you a .ms3d or .dae file with the animations joined together with an additional 'basepose' frame added at frame 0, to aid editing. The task will also auto-generate for a reverse dae/ms3d_to_mesh_****_task.txt file for you, this will list the start and end frame positions of all included animations and the names of all the files that will be re-created from your file. The names and frame positions can be edited to suit any changes you may require before running the return task.<br />
<br />
When creating the task files it is common to make minor errors in the file names/paths that mean IWTE cannot find all the elements! If you get an error message whilst running the task you'll get a chance to read the error message <br />
(which is easier in the command window) - you can then click "Ignore" to keep IWTE open, fix the name/path/file issue in the .txt file and try running the task again. The error message should indicate which file it couldn't find. If you forget to add the file extension and try and get it to open a folder you'll get an 'access violation' type message. <br />
<br />
For unit models that do not have any elements weighted to the 'weapon bones' you only need to run the process with <br />
<br />
<code> <cas_file_types_in_list> body </code> <br />
<br />
and supply the main skeleton basepose and animation.<br />
<br />
If the mesh has a weapon weighted to weapon bones use the ''body weapon'' example shown above.<br />
<br />
If the mesh has both a weapon weighted to weapon bones and a shield weighted to bone_shield etc use<br />
<br />
<code> <cas_file_types_in_list> body weapon shield</code> <br />
<br />
and supply the main skeleton, weapon animation and shield animation baseposes and animations in sets of three in order.<br />
<br />
Note: a lot of models that are apparently using ''fs_test_shield'' according to their [[battle_models.modeldb]] entry don't actually have anything weighted to bone_shield, making the shield 'anim' irrelevant.<br />
<br />
===UV Mapping for Double Texture Units===<br />
The mesh format for both double and singled textured units in M2TW is actually exactly the same with just one set of uv's that should range from 0 to 1.0 in both horizontal and vertical axis.<br />
<br />
If you assign two textures to a unit in the [[battle_models.modeldb]] then the game expands out the horizontal axis of the uv maps so that the area from 0 to 0.5 is used to cover 0 to 1 on the first texture, and the uv's from 0.5 to 1.0 on the horizontal axis are used to cover 0 to 1 on the second texture.<br />
<br />
Milkshape/.mesh converters use the texture (Main or Attachment) assigned to a mesh group to determine which section of the uv map the group's uv coordinates will be moved to. On write back the Main texture co-ordinates are compressed into the 0>0.5 area and Attachment texture co-ordinates compressed into the 0.5>1.0 section.<br />
<br />
The IWTE mesh to .dae for Blender process works differently. The texture assignment process is used purely so you can view the mesh groups with the correct relevant texture. The 0>1.0 horizontal uvs are expanded to 0>2.0 if you use the process for 'double textures' and then compressed back to 0>1.0 on the return to .mesh.<br />
<br />
In Blender the uv mapping to the two textures will look like the image below.<br />
<br />
[[File:Uvs for double textured units.jpg|400px]]<br />
<br />
To see the 2nd texture under its uv's open the sidebar (n) in the uv screen and select the 'repeat texture' button.<br />
In Blender it is possible to partially assign some triangles from a group to the 1st texture and some triangles to the 2nd texture, if you do that please remember to also move the uv's to the appropriate zone.<br />
<br />
===Scaling of Anims===<br />
The 'full' cas animations as supplied by Caliban should be regarded as scale 1.0. If you need to load from them to suit a skeleton that will be scaled by the game you need to give IWTE the skeleton scale in the mesh_to_extract task using the appropriate tag e.g.<br><br />
<skeleton_scale> <br><br />
<mount_skeleton_scale><br />
<br />
If you load from the unpacked skeleton and unpacked animation the scale will be read from the skeleton, so you do not need to add any further information.<br />
<br />
==Export and Import RTW Units & RTW/M2TW Strat Characters==<br />
<big>'''NOTE:''' IWTE now supports the full weighting allowed in Rome Remastered by default - to ensure you do not create RTW/M2TW cas files that exceed their games capabilities add '''<cas_mesh_format> rtw''' (or M2) to the task file.</big><br />
<br />
<br />
The process for this is similar to the .mesh Export/Import process described above, the button locations are shown in the below image: <br><br />
[[File:Export-cas-to-dae.jpg|Exporting animated cas to date with IWTE]]<br />
<br />
1. For Blender to convert cas model with skeleton and animations unpacked from the RTW/RR animation pack files. The first file requested will again be the .cas 'mesh', e.g. model. The second file requested will be the skeleton file (as produced by XIDX/tool using extract_skeletons). The third file requested will be the .cas animation file (as produced by XIDX/tool using extract_animations).<br><br />
2. For Blender to convert cas model with skeleton and animations unpacked from the M2TW animation pack files. Works as above.<br><br />
3. For Blender to convert cas model if you have the full versions of the animation files, e.g the type supplied by Caliban that M2TW itself re-packs or engine animations. The first file requested will be the .cas 'mesh', e.g. the one with the body model in it. The second file requested will be an animation file, if you do not have a suitable animation file just click 'Cancel' to close the selection screen. You can use the 'Animated cas/dae' button for all unit/character .cas files even if you aren't going to load an animation.<br><br />
4. For Blender this button is designed for converting static cas models.<br><br />
5. For Milkshape as option 2 above.<br><br />
6. For Milkshape as option 3 above.<br><br />
7. For Milkshape as option 4 above.<br><br />
A. Can be used for writing back to .cas model/animations but task file method is prefered.<br> <br />
B. Must be used if you need the model AND animation in one .cas file (applicable to RTW/RR spot effects only).<br><br />
<br />
Processes 1-7 will generate a .dae/.ms3d file in a to_dae/ms3d sub-folder where your IWTE.exe is located. You will also have two task files generated in the /iwte_tasks sub-folder. The ms3d/dae_to_cas one provides a default task file for reversing the process and generating new .cas files. The cas_to_dae/ms3d one allows you to repeat the process you just did by simply running the IWTE Task, you can also adapt that task file to load multiple animations. The following is an example task file for cas_to_dae with multiple anims, and using rtw skeleton and anims, note that if the file path/name has spaces the entire path needs to be inside " ", also note the skeleton name does not have a file extension, direction of \ or / doesn't matter:<br />
<task_id> cas_to_extract <br />
<cas_mesh_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\to_dae/from_dae/ALEX_companion_cavalry_lod_1.cas <br />
<directory_out> I:\M2TW\M2TWcopy\mods\IWTE/to_dae <br />
<extract_file_name_out> ALEX_companion_cavalry_taunt.dae<br />
<extract_file_type> dae <br />
<cas_animation_file_format> rtw <br />
<create_text_file> no <br />
<create_task_file_from_input> yes <br />
<task_file_full_path_out> I:\M2TW\M2TWcopy\mods\IWTE/IWTE_tasks/dae_to_cas_alextaunt_task.txt <br />
<skeleton_unpacked_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\testthings\animations\rome_animations/fs_swordsman<br />
<cas_file_full_path_in_action_list> <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_04 taunt 2.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_06 taunt 1.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_07 taunt 3.cas" <br />
<br />
To get amended units/anims back into game you will need to 'export' 'collada' from Blender or 3dsMax, or save as .ms3d from Milkshape. The .dae/.ms3d file created will have the same structure whether you're converting to Mesh/Cas model, and Full/XIDX packable anims, so you need to use a task file to specify the format to be returned. The automatically generated return task file will have assumed you want the same format that went in, so the task file above will have generated this return file:<br />
<task_id> dae_to_cas # to read dae file and generate *.cas files<br />
<dae_file_full_path_in> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/ALEX_companion_cavalry_taunt.dae # *.dae file to read in. i.e. change to collada name exported from Blender<br />
<directory_out> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/from_dae # directory to put new created files<br />
<cas_mesh_file_name_out> alex_companion_cavalry_lod_1.cas # *.cas file to be created<br />
<cas_animation_file_format> rr # format of cas to be created by dae (rr, m2 or full) <br />
<cas_unpacked_skeleton_scale> 1.0000 # cas unpacked skeleton scaling<br />
<overlap_frames> no # overlap frames selection used to create the dae (not used on import)<br />
<cas_file_name_out_anim_split_list> # cas anim files start and end frames<br />
"lid_57_04 taunt 2.cas" 1 79 <br />
"lid_57_06 taunt 1.cas" 80 162 <br />
"lid_57_07 taunt 3.cas" 163 237 <br />
#<end_frame> 237 # Last animated frame (use to see full animation in blender)<br />
<br />
If you're trying to convert format, instead of rr you need to use:<br />
<cas_animation_file_format> '''m2''' #for M2TW anims re-packable by XIDX<br />
<br />
<cas_animation_file_format> '''full''' #for M2TW anims re-packable by '''the game''' and ALL ENGINE ANIMATIONS<br />
<br />
If you want an M2TW mesh back instead of a .cas model use the <br />
<task_id> '''dae_to_mesh'''<br />
instead of dae_to_cas<br />
<br />
Using the 'Animated dae to cas_mesh' ('''4''') button will generate a separate cas model file and a full version anim called _action. See below for animation file type details.<br />
<br />
Using the 'RTW object animation dae to cas' ('''5''') will produce a cas which includes both the model and the animation together, these are used only for [[Spot fx animations and effects|spot_fx]] items in RTW/RR.<br />
<br />
===Bone Weighting===<br />
RTW battle map units and strat models and M2TW strat models will generally have vertexes weighted to only one bone per vertex.<br />
<br />
If you convert a dae with multiple bone weights per vertex to cas with IWTE it will generate one cas with vertexes weighted to up to two bones, and one cas with the suffix "_lod1". The _lod1 cas can be renamed and used for RTW/M2TW. Ideally however you should limit the bone weight totals yourself so you can check how the model will behave in game when posed. See [[Blender_hints_and_tips#Bone_Assignment|Blender hints and tips]].<br />
<br />
For details on optionally creating a simple multi-weighted Section see: [[Model_flexi_m in RTW]]<br />
<br />
===Cas animation types===<br />
IWTE supports the full (never packed) versions of [[Cas Files|.cas files]], as supplied by Caliban and also the ones that have been generated from Pack files by XIDX, IWTE or similar tools. PLEASE NOTE: The RTW and M2TW anims generated from the pack files use a different format - DO NOT pack RTW types into M2TW packs or vice-versa - check that you are generating the correct type for the game you are going to use them in! Also do not attempt to re-pack the full type (where you can see the bone names) with XIDX or IWTE, they will only work if you have a full set including .evt files and let M2TW repack them from descr_skeleton.txt.<br />
<br />
NB: All engine animations for RTW, RR and M2TW are the 'full' type.<br />
<br />
===Recreating full .cas and .evt files from packs===<br />
IWTE will generate full versions of .cas and .evt files from M2TW skeleton and animation packs, and will also generate for you a descr_skeleton.txt file to use to allow the game to re-pack the created animation and event files. Please note that if the animation files were originally packed from a mod-folder then the skeleton text file will be generated assuming that they will be replaced and packed from the same named folder.<br />
<br />
Use the button shown below to start the extraction process. To allow the game to re-pack the files they must be copied and moved to the appropriate mod-folder locations.<br />
<br />
[[File:Iwte-cas-evt-extraction.jpg]]<br />
<br />
==Units - General Tips==<br />
*Seams - To avoid seams in the finished model you CAN 'weld' vertexes that have disconnected uvs, in Blender use Mesh> Clean Up> Merge by Distance (without uvs ticked), and Shading> Smooth Faces. That will get you a shared normal that allows the area to look smooth. For the game IWTE will generate two vertexes at that point to preserve the uvs and set that normal as a custom normal for each.<br />
<br />
*Anims/skeletons - In Blender you can make any alteration you like to the 'Pose Mode' this will only affect the animation frames. Do NOT, unless you know what you are doing... move or edit the bones in the 'Armature' edit mode, this will affect the bone positions in the model/anim.cas produced, and will need to be matched to a skeleton with the same bone positions. If using the "full" M2TW cas anims that the game re-packs you can adjust the bone positions for a folder of .cas anims by using the skeleton replacement method detailed below. If using XIDX unpacked/packed anims you will need to change the skeleton using other tools.<br />
<br />
==Animations - General Tips==<br />
*Blender must be set to 20fps BEFORE importing a .dae with animation created by IWTE. To do this use the custom setting and type in 20. When you import a .dae file you should then see the keyframes neatly aligned with the time markers. See below:<br />
<br />
[[File:20fps.jpg|200px]]<br />
<br />
==Mesh Names/Comments==<br />
The Blender .dae interface does not support comments, so all the information about the mesh sections (primary/secondary weapons etc.) needs to go in the mesh name:<br />
<br />
*Section Naming - For Blender the full details of the group names are stored in the name itself. There isn't a comment section like milkshape. Things that need to go back into the game as separate sections, e.g. to denote primary weapons, or alternate versions, need a double underscore __ to show where the name should be split or a space included. For M2TW mesh sections that you want to be optional, use __opt at the end of the group name.<br />
<br />
==Siege/Artillery Engines==<br />
Siege/Artillery for both RTW and M2TW use the "full" cas anim versions (not packed/unpacked at any stage). For M2TW use the dedicated Model Files > Mesh Models > Siege Engine mesh to date for export and IWTE Task import process. For RTW use the Model Files > Cas Models > Animated cas_mesh to date, the RTW process seems to be quite straightforward as there isn't the mis-alignment between bone names and start poses that is present in M2TW.<br />
===M2TW Siege Engine Skeleton Alteration Example Process===<br />
*In top menu bar go to Model Files > Siege Engine mesh to dae > select mesh, then default cas then anim cas.<br />
:Check that the default .cas is actually the one listed as anim-default in descr_engine_skeleton.txt<br />
:also check that you're using an anim that is in use in game - some of the anims in the folder don't work.<br />
<br />
*IWTE will have written a .dae file in "to_dae" sub-folder below your .mesh model location.<br />
<br />
*Load in Blender by using 'file' 'import' 'collada'<br />
<br />
*Add bones as required to the Armature - note there should only be one top level bone, e.g bone_body add all other bones as child of this, or of existing bones.<br />
<br />
*Use 'weight paint' to assign vertices to bones as required.<br />
:Note - the .mesh file will only accept vertexes weighted to a max of 2 bones<br />
:use 'limit total' in 'weights' menu and set to 2 to avoid any verts weighted to 3 or more bones - (this is applied to selected verts only)<br />
:use 'normalise all' to make sure verts are fully weighted, use 'auto normalise' option whilst working also<br />
<br />
*change animation by switching to 'animation' layout in top bar<br />
:trigger Pose mode by clicking pose running man symbol within the Armature<br />
:if you can't see bones, or the summary when you click them, in main sidebar click the pose (running man) button, select "viewport display" and select the "in front" option<br />
:when you move a bone in the pose mode use shortcut "i" in main window to open keyframe dialogue and select "LocRot"<br />
:you can delete copy or move keyframes around for selected bones in the Dope Sheet section<br />
<br />
*Export collada - in settings check Anim is on Matrix option and 'keep keyframes' and 'all keyed curves' are selected.<br />
'''DO NOT USE IWTE Model Files > Siege Engine dae to mesh to convert back''' the dae doesn't include enough info to retain the three textures named in the mesh .<br />
<br />
*USE the "dae_to_mesh_*****_task.txt" that IWTE has written into the "IWTE_Tasks" sub-folder where your IWTE.exe is<br />
:change the .dae name you're reading in to the one you've just saved - change any other output names IF you need to<br />
:check the number of frames listed ties up with the end frame you set in collada.<br />
<br />
*Run the task file from the IWTE Task button in top menu bar, the separate files will be saved where specified in the task file.<br />
<br />
*If you have changed the number of bones used or their positions you will need to align all the other .cas anims used by the mesh, to do this use the skeleton replacement process explained below.<br />
<br />
==Skeleton Replacement (M2TW)==<br />
''RTW and packed M2TW skeletons can not be changed via this method.'' <br><br />
To replace the skeleton in M2TW where you have the set of full .cas anims that the game re-packs in the IWTE top menu bar go to:<br />
:Model Files > Cas Models > Skeleton Replacement<br />
<br />
*On the first prompt select the .cas file containing the bones in the basepose positions you want (probably the default or basepose .cas)<br />
*On the second prompt select the FOLDER that contains all the .cas files you want to change.<br />
<br />
The revised files will be saved in a sub folder of that folder called "updateskeletons" they will have the same names as the original .cas files and can be used to directly replace them. Please back-up your original files before doing this, and remember that other .cas/.mesh models may be using the same files, so you may need to create a separate folder and separate entry in descr_skeleton.txt etc.<br />
<br />
Adding bones should be straightforward, if you delete bones that had child bones then the result may be unpredictable and the resulting animations may need editing. <br />
<br />
===Bone Renaming Task===<br />
To rename the bones throughout a folder of full .cas animations use a task file. If you want to swap the names of bones you need to add an additional stage to re-name one bone to a temporary name, the example below shows how to swap bone_H_Saddle and bone_Spine names with each other:<br />
<task_id> cas_bone_name_change <br />
<directory_in> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka <br />
<directory_out> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka\changedbones <br />
<bone_name_change_list> <br />
bone_H_Saddle bone_H_Saddlex<br />
bone_Spine bone_H_Saddle<br />
bone_H_Saddlex bone_Spine<br />
<br />
* The task cas_bone_name_change changes a bone name (the NEW name must not already exist in a skeleton this is being applied to)<br />
* Directory in is optional, alternatively the task file can be placed in the directory and launched from there<br />
* Directory out is optional, if not given a sub-folder /updateskeletons will be created<br />
<br />
===Fixing Floating Units===<br />
For how to create the new basepose see [[Blender_hints_and_tips#Fixing_Floating_Units|Blender Hints and Tips]]<br />
<br />
Once you have the new basepose.cas you need to use it as the source to replace the bone positions in ALL of the animations the unit uses. For strat_models if you haven't already edited the .cas files of all the effected models include them in the skeleton replacement process too.<br />
<br />
==Weapon Animations (M2TW)==<br />
M2TW includes the possibility of having 'add-on' animations for weapons/shields. These are commonly listed in the model db file but rarely actually used.<br />
<br />
The advantage of properly using the weapon bones and anims instead of adding additional 'normal' bones to the skeleton is that the main skeleton remains 'standard' and does not cause the victim death anim bug when in battle with units whose skeletons have different numbers of bones!<br />
<br />
==IWTE Task File Options==<br />
===Text File Output===<br />
using <create_text_file> you can optionally generate .txt files that show, '''for information purposes only''', the content of the incoming .mesh/.cas files, the default option is <br />
<create_text_file> no #stops any text file being created <br />
<create_text_file> yes #creates a summary text file with header/trailer info, numbers of verts, texture and mesh names etc.<br />
<create_text_file> full #creates a full text file showing the interpretation of all the ints/floats etc in the file, with comments<br />
<br />
<br />
==External Links==<br />
* [https://www.blender.org/ Blender]<br />
* [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 IWTE Download]<br />
* [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing Discussion thread].<br />
<br />
[[Category:M2TW Modding]]<br />
[[Category:Blender]]<br />
[[Category:RTW Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=IWTE_-_Units_in_Blender/Milkshape&diff=86522IWTE - Units in Blender/Milkshape2023-06-09T11:08:43Z<p>Makanyane: section added for cas/evt</p>
<hr />
<div>{{RTW M2TW Modding Logo}}<br />
{{IWTE}} <br />
__TOC__<br />
<br />
<big>Tips and instructions for working with RTW and M2TW battle map units and strat map characters via '''[[IWTE]]''' and '''[[Blender]]''' using the .dae format.</big> <br />
<br />
''The .dae files used for the Collada import/export can also be used with '''3ds Max''', however, max users absolutely have to use the [https://github.com/KhronosGroup/OpenCOLLADA/wiki/OpenCOLLADA-Tools '''OpenCollada plugin'''] and file format when importing/exporting files, max comes with the AutodeskCollada file format by default which neither imports nor exports files from the game correctly.''<br />
<br />
*IWTE download [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 here] - please use the latest version, early versions do not have this functionality.<br />
*For queries about these functions please ask [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing here].<br />
*For information on working on M2TW Settlements in Blender see [[IWTE - Settlements in Blender]]<br />
*For general tips on working with Blender see [[Blender hints and tips]]<br />
*For related info about .cas file structure see [[Cas Files|here]]<br />
<br />
<br />
==Export and Import M2TW .mesh Units==<br />
The most useful method of export involves matching the unit .mesh with its skeleton basepose and one or more animations. <br />
<br />
The drop-down menu in IWTE allows a unit .mesh to be merged with its basepose skeleton and one animation. A task file is needed to allow combining of animations and is the only way to also incorporate weapon animations.<br />
<br />
The drop-down menu options, and alternative IWTE Task button options are described below:<br />
<br />
[[File:Export-mesh-in-IWTE.jpg]]<br />
<br />
1. For Blender select the 'Unit mesh/skel/casanim to dae' option if you have the skeleton and animation versions unpacked using XIDX etc.<br><br />
2. For Blender select 'Unit mesh to dae' if you have the "full" version of the .cas basepose and animations (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br><br />
3. For Milkshape select the 'Unit mesh/skel/casanim to ms3d' option if you have the skeleton and animation versions unpacked using XIDX.<br><br />
4. For Blender select 'Unit mesh to ms3d' if you have the "full" version of the .cas basepose and animations (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br><br />
<br />
For all of the above options select the Double Textured option for unit meshes that have both a main and attachment texture. Select the Single Textured option for most other cases (e.g. standard mounts). <br />
<br />
You will be prompted to select the model .mesh first, then the basepose.cas for the skeleton (full cas version) or the unpacked skeleton file (unpacked version), and then an animation.cas file that is compatible with that skeleton (this should be in the same format as the skeleton, full or unpacked). <br />
<br />
===Export/Import by Task Process===<br />
To generate a .dae or .ms3d file from .mesh and .anims via the task process you will need a text file ending in _task.txt which starts with the mesh to dae command, run the task file by selecting the 'IWTE Task' > 'Select Task File' buttons. See example below for mesh_to_dae (the extra line breaks have been included just to show the body/weapon pairing):<br />
<br />
<task_id> mesh_to_extract <br />
<mesh_file_full_path_in> C:\M2TW\mods\devkit\data\animations\EB_Slinger\numidian_slinger_lod0.mesh <br />
<mesh_type> unit # line can be omitted if not also adding mount<br />
<mesh_double_texture> yes # or 'no' for single texture<br />
<cas_file_types_in_list> body weapon <br />
<br />
<directory_out> C:\M2TW\mods\devkit\data\animations\EB_Slinger <br />
<extract_file_name_out> EBslingerAnims.ms3d <br />
<extract_file_type> ms3d # or 'dae' for Blender<br />
<create_text_file> no # or 'yes' for summary files, 'full' for detailed files<br />
<task_file_full_path_out> C:\IWTE/IWTE_tasks/ms3d_to_mesh_slinger_task.txt # name for your return task file <br />
<br />
<cas_file_full_path_in_default_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_basepose.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas<br />
<br />
<cas_file_full_path_in_action_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_stand_A_idle.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas <br />
<br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_attack_missile_ready.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_attack_missile_ready.cas <br />
<br />
Please see the IWTE example control processes.txt file that ships with IWTE for further details/instructions. <br />
<br />
Running the task will generate you a .ms3d or .dae file with the animations joined together with an additional 'basepose' frame added at frame 0, to aid editing. The task will also auto-generate for a reverse dae/ms3d_to_mesh_****_task.txt file for you, this will list the start and end frame positions of all included animations and the names of all the files that will be re-created from your file. The names and frame positions can be edited to suit any changes you may require before running the return task.<br />
<br />
When creating the task files it is common to make minor errors in the file names/paths that mean IWTE cannot find all the elements! If you get an error message whilst running the task you'll get a chance to read the error message <br />
(which is easier in the command window) - you can then click "Ignore" to keep IWTE open, fix the name/path/file issue in the .txt file and try running the task again. The error message should indicate which file it couldn't find. If you forget to add the file extension and try and get it to open a folder you'll get an 'access violation' type message. <br />
<br />
For unit models that do not have any elements weighted to the 'weapon bones' you only need to run the process with <br />
<br />
<code> <cas_file_types_in_list> body </code> <br />
<br />
and supply the main skeleton basepose and animation.<br />
<br />
If the mesh has a weapon weighted to weapon bones use the ''body weapon'' example shown above.<br />
<br />
If the mesh has both a weapon weighted to weapon bones and a shield weighted to bone_shield etc use<br />
<br />
<code> <cas_file_types_in_list> body weapon shield</code> <br />
<br />
and supply the main skeleton, weapon animation and shield animation baseposes and animations in sets of three in order.<br />
<br />
Note: a lot of models that are apparently using ''fs_test_shield'' according to their [[battle_models.modeldb]] entry don't actually have anything weighted to bone_shield, making the shield 'anim' irrelevant.<br />
<br />
===UV Mapping for Double Texture Units===<br />
The mesh format for both double and singled textured units in M2TW is actually exactly the same with just one set of uv's that should range from 0 to 1.0 in both horizontal and vertical axis.<br />
<br />
If you assign two textures to a unit in the [[battle_models.modeldb]] then the game expands out the horizontal axis of the uv maps so that the area from 0 to 0.5 is used to cover 0 to 1 on the first texture, and the uv's from 0.5 to 1.0 on the horizontal axis are used to cover 0 to 1 on the second texture.<br />
<br />
Milkshape/.mesh converters use the texture (Main or Attachment) assigned to a mesh group to determine which section of the uv map the group's uv coordinates will be moved to. On write back the Main texture co-ordinates are compressed into the 0>0.5 area and Attachment texture co-ordinates compressed into the 0.5>1.0 section.<br />
<br />
The IWTE mesh to .dae for Blender process works differently. The texture assignment process is used purely so you can view the mesh groups with the correct relevant texture. The 0>1.0 horizontal uvs are expanded to 0>2.0 if you use the process for 'double textures' and then compressed back to 0>1.0 on the return to .mesh.<br />
<br />
In Blender the uv mapping to the two textures will look like the image below.<br />
<br />
[[File:Uvs for double textured units.jpg|400px]]<br />
<br />
To see the 2nd texture under its uv's open the sidebar (n) in the uv screen and select the 'repeat texture' button.<br />
In Blender it is possible to partially assign some triangles from a group to the 1st texture and some triangles to the 2nd texture, if you do that please remember to also move the uv's to the appropriate zone.<br />
<br />
===Scaling of Anims===<br />
The 'full' cas animations as supplied by Caliban should be regarded as scale 1.0. If you need to load from them to suit a skeleton that will be scaled by the game you need to give IWTE the skeleton scale in the mesh_to_extract task using the appropriate tag e.g.<br><br />
<skeleton_scale> <br><br />
<mount_skeleton_scale><br />
<br />
If you load from the unpacked skeleton and unpacked animation the scale will be read from the skeleton, so you do not need to add any further information.<br />
<br />
==Export and Import RTW Units & RTW/M2TW Strat Characters==<br />
<big>'''NOTE:''' IWTE now supports the full weighting allowed in Rome Remastered by default - to ensure you do not create RTW/M2TW cas files that exceed their games capabilities add '''<cas_mesh_format> rtw''' (or M2) to the task file.</big><br />
<br />
<br />
The process for this is similar to the .mesh Export/Import process described above, the button locations are shown in the below image: <br><br />
[[File:Export-cas-to-dae.jpg|Exporting animated cas to date with IWTE]]<br />
<br />
1. For Blender to convert cas model with skeleton and animations unpacked from the RTW/RR animation pack files. The first file requested will again be the .cas 'mesh', e.g. model. The second file requested will be the skeleton file (as produced by XIDX/tool using extract_skeletons). The third file requested will be the .cas animation file (as produced by XIDX/tool using extract_animations).<br><br />
2. For Blender to convert cas model with skeleton and animations unpacked from the M2TW animation pack files. Works as above.<br><br />
3. For Blender to convert cas model if you have the full versions of the animation files, e.g the type supplied by Caliban that M2TW itself re-packs. The first file requested will be the .cas 'mesh', e.g. the one with the body model in it. The second file requested will be an animation file, if you do not have a suitable animation file just click 'Cancel' to close the selection screen. You can use the 'Animated cas/dae' button for all unit/character .cas files even if you aren't going to load an animation.<br><br />
4. For Blender this button is designed for converting static cas models.<br><br />
5. For Milkshape as option 2 above.<br><br />
6. For Milkshape as option 3 above.<br><br />
7. For Milkshape as option 4 above.<br><br />
A. Can be used for writing back to .cas model/animations but task file method is prefered.<br> <br />
B. Must be used if you need the model AND animation in one .cas file (applicable to RTW/RR spot effects only).<br><br />
<br />
Processes 1-7 will generate a .dae/.ms3d file in a to_dae/ms3d sub-folder where your IWTE.exe is located. You will also have two task files generated in the /iwte_tasks sub-folder. The ms3d/dae_to_cas one provides a default task file for reversing the process and generating new .cas files. The cas_to_dae/ms3d one allows you to repeat the process you just did by simply running the IWTE Task, you can also adapt that task file to load multiple animations. The following is an example task file for cas_to_dae with multiple anims, and using rtw skeleton and anims, note that if the file path/name has spaces the entire path needs to be inside " ", also note the skeleton name does not have a file extension, direction of \ or / doesn't matter:<br />
<task_id> cas_to_extract <br />
<cas_mesh_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\to_dae/from_dae/ALEX_companion_cavalry_lod_1.cas <br />
<directory_out> I:\M2TW\M2TWcopy\mods\IWTE/to_dae <br />
<extract_file_name_out> ALEX_companion_cavalry_taunt.dae<br />
<extract_file_type> dae <br />
<cas_animation_file_format> rtw <br />
<create_text_file> no <br />
<create_task_file_from_input> yes <br />
<task_file_full_path_out> I:\M2TW\M2TWcopy\mods\IWTE/IWTE_tasks/dae_to_cas_alextaunt_task.txt <br />
<skeleton_unpacked_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\testthings\animations\rome_animations/fs_swordsman<br />
<cas_file_full_path_in_action_list> <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_04 taunt 2.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_06 taunt 1.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_07 taunt 3.cas" <br />
<br />
To get amended units/anims back into game you will need to 'export' 'collada' from Blender or 3dsMax, or save as .ms3d from Milkshape. The .dae/.ms3d file created will have the same structure whether you're converting to Mesh/Cas model, and Full/XIDX packable anims, so you need to use a task file to specify the format to be returned. The automatically generated return task file will have assumed you want the same format that went in, so the task file above will have generated this return file:<br />
<task_id> dae_to_cas # to read dae file and generate *.cas files<br />
<dae_file_full_path_in> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/ALEX_companion_cavalry_taunt.dae # *.dae file to read in. i.e. change to collada name exported from Blender<br />
<directory_out> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/from_dae # directory to put new created files<br />
<cas_mesh_file_name_out> alex_companion_cavalry_lod_1.cas # *.cas file to be created<br />
<cas_animation_file_format> rr # format of cas to be created by dae (rtw or full) <br />
<cas_unpacked_skeleton_scale> 1.0000 # cas unpacked skeleton scaling<br />
<overlap_frames> no # overlap frames selection used to create the dae (not used on import)<br />
<cas_file_name_out_anim_split_list> # cas anim files start and end frames<br />
"lid_57_04 taunt 2.cas" 1 79 <br />
"lid_57_06 taunt 1.cas" 80 162 <br />
"lid_57_07 taunt 3.cas" 163 237 <br />
#<end_frame> 237 # Last animated frame (use to see full animation in blender)<br />
<br />
If you're trying to convert format, instead of rr you need to use:<br />
<cas_animation_file_format> '''m2''' #for M2TW anims re-packable by XIDX<br />
<br />
<cas_animation_file_format> '''full''' #for M2TW anims re-packable by '''the game'''<br />
<br />
If you want an M2TW mesh back instead of a .cas model use the <br />
<task_id> '''dae_to_mesh'''<br />
instead of dae_to_cas<br />
<br />
Using the 'Animated dae to cas_mesh' ('''4''') button will generate a separate cas model file and a full version anim called _action. See below for animation file type details.<br />
<br />
Using the 'RTW object animation dae to cas' ('''5''') will produce a cas which includes both the model and the animation together, these are used only for [[Spot fx animations and effects|spot_fx]] items in RTW/RR.<br />
<br />
===Bone Weighting===<br />
RTW battle map units and strat models and M2TW strat models will generally have vertexes weighted to only one bone per vertex.<br />
<br />
If you convert a dae with multiple bone weights per vertex to cas with IWTE it will generate one cas with vertexes weighted to up to two bones, and one cas with the suffix "_lod1". The _lod1 cas can be renamed and used for RTW/M2TW. Ideally however you should limit the bone weight totals yourself so you can check how the model will behave in game when posed. See [[Blender_hints_and_tips#Bone_Assignment|Blender hints and tips]].<br />
<br />
For details on optionally creating a simple multi-weighted Section see: [[Model_flexi_m in RTW]]<br />
<br />
===Cas animation types===<br />
IWTE supports the full (never packed) versions of [[Cas Files|.cas files]], as supplied by Caliban and also the ones that have been generated from Pack files by XIDX, IWTE or similar tools. PLEASE NOTE: The RTW and M2TW anims generated from the pack files use a different format - DO NOT pack RTW types into M2TW packs or vice-versa - check that you are generating the correct type for the game you are going to use them in! Also do not attempt to re-pack the full type (where you can see the bone names) with XIDX or IWTE, they will only work if you have a full set including .evt files and let M2TW repack them from descr_skeleton.txt.<br />
<br />
===Recreating full .cas and .evt files from packs===<br />
IWTE will generate full versions of .cas and .evt files from M2TW skeleton and animation packs, and will also generate for you a descr_skeleton.txt file to use to allow the game to re-pack the created animation and event files. Please note that if the animation files were originally packed from a mod-folder then the skeleton text file will be generated assuming that they will be replaced and packed from the same named folder.<br />
<br />
Use the button shown below to start the extraction process. To allow the game to re-pack the files they must be copied and moved to the appropriate mod-folder locations.<br />
<br />
[[File:Iwte-cas-evt-extraction.jpg]]<br />
<br />
==Units - General Tips==<br />
*Seams - To avoid seams in the finished model you CAN 'weld' vertexes that have disconnected uvs, in Blender use Mesh> Clean Up> Merge by Distance (without uvs ticked), and Shading> Smooth Faces. That will get you a shared normal that allows the area to look smooth. For the game IWTE will generate two vertexes at that point to preserve the uvs and set that normal as a custom normal for each.<br />
<br />
*Anims/skeletons - In Blender you can make any alteration you like to the 'Pose Mode' this will only affect the animation frames. Do NOT, unless you know what you are doing... move or edit the bones in the 'Armature' edit mode, this will affect the bone positions in the model/anim.cas produced, and will need to be matched to a skeleton with the same bone positions. If using the "full" M2TW cas anims that the game re-packs you can adjust the bone positions for a folder of .cas anims by using the skeleton replacement method detailed below. If using XIDX unpacked/packed anims you will need to change the skeleton using other tools.<br />
<br />
==Animations - General Tips==<br />
*Blender must be set to 20fps BEFORE importing a .dae with animation created by IWTE. To do this use the custom setting and type in 20. When you import a .dae file you should then see the keyframes neatly aligned with the time markers. See below:<br />
<br />
[[File:20fps.jpg|200px]]<br />
<br />
==Mesh Names/Comments==<br />
The Blender .dae interface does not support comments, so all the information about the mesh sections (primary/secondary weapons etc.) needs to go in the mesh name:<br />
<br />
*Section Naming - For Blender the full details of the group names are stored in the name itself. There isn't a comment section like milkshape. Things that need to go back into the game as separate sections, e.g. to denote primary weapons, or alternate versions, need a double underscore __ to show where the name should be split or a space included. For M2TW mesh sections that you want to be optional, use __opt at the end of the group name.<br />
<br />
==Siege/Artillery Engines==<br />
Siege/Artillery for both RTW and M2TW use the "full" cas anim versions (not packed/unpacked at any stage). For M2TW use the dedicated Model Files > Mesh Models > Siege Engine mesh to date for export and IWTE Task import process. For RTW use the Model Files > Cas Models > Animated cas_mesh to date, the RTW process seems to be quite straightforward as there isn't the mis-alignment between bone names and start poses that is present in M2TW.<br />
===M2TW Siege Engine Skeleton Alteration Example Process===<br />
*In top menu bar go to Model Files > Siege Engine mesh to dae > select mesh, then default cas then anim cas.<br />
:Check that the default .cas is actually the one listed as anim-default in descr_engine_skeleton.txt<br />
:also check that you're using an anim that is in use in game - some of the anims in the folder don't work.<br />
<br />
*IWTE will have written a .dae file in "to_dae" sub-folder below your .mesh model location.<br />
<br />
*Load in Blender by using 'file' 'import' 'collada'<br />
<br />
*Add bones as required to the Armature - note there should only be one top level bone, e.g bone_body add all other bones as child of this, or of existing bones.<br />
<br />
*Use 'weight paint' to assign vertices to bones as required.<br />
:Note - the .mesh file will only accept vertexes weighted to a max of 2 bones<br />
:use 'limit total' in 'weights' menu and set to 2 to avoid any verts weighted to 3 or more bones - (this is applied to selected verts only)<br />
:use 'normalise all' to make sure verts are fully weighted, use 'auto normalise' option whilst working also<br />
<br />
*change animation by switching to 'animation' layout in top bar<br />
:trigger Pose mode by clicking pose running man symbol within the Armature<br />
:if you can't see bones, or the summary when you click them, in main sidebar click the pose (running man) button, select "viewport display" and select the "in front" option<br />
:when you move a bone in the pose mode use shortcut "i" in main window to open keyframe dialogue and select "LocRot"<br />
:you can delete copy or move keyframes around for selected bones in the Dope Sheet section<br />
<br />
*Export collada - in settings check Anim is on Matrix option and 'keep keyframes' and 'all keyed curves' are selected.<br />
'''DO NOT USE IWTE Model Files > Siege Engine dae to mesh to convert back''' the dae doesn't include enough info to retain the three textures named in the mesh .<br />
<br />
*USE the "dae_to_mesh_*****_task.txt" that IWTE has written into the "IWTE_Tasks" sub-folder where your IWTE.exe is<br />
:change the .dae name you're reading in to the one you've just saved - change any other output names IF you need to<br />
:check the number of frames listed ties up with the end frame you set in collada.<br />
<br />
*Run the task file from the IWTE Task button in top menu bar, the separate files will be saved where specified in the task file.<br />
<br />
*If you have changed the number of bones used or their positions you will need to align all the other .cas anims used by the mesh, to do this use the skeleton replacement process explained below.<br />
<br />
==Skeleton Replacement (M2TW)==<br />
''RTW and packed M2TW skeletons can not be changed via this method.'' <br><br />
To replace the skeleton in M2TW where you have the set of full .cas anims that the game re-packs in the IWTE top menu bar go to:<br />
:Model Files > Cas Models > Skeleton Replacement<br />
<br />
*On the first prompt select the .cas file containing the bones in the basepose positions you want (probably the default or basepose .cas)<br />
*On the second prompt select the FOLDER that contains all the .cas files you want to change.<br />
<br />
The revised files will be saved in a sub folder of that folder called "updateskeletons" they will have the same names as the original .cas files and can be used to directly replace them. Please back-up your original files before doing this, and remember that other .cas/.mesh models may be using the same files, so you may need to create a separate folder and separate entry in descr_skeleton.txt etc.<br />
<br />
Adding bones should be straightforward, if you delete bones that had child bones then the result may be unpredictable and the resulting animations may need editing. <br />
<br />
===Bone Renaming Task===<br />
To rename the bones throughout a folder of full .cas animations use a task file. If you want to swap the names of bones you need to add an additional stage to re-name one bone to a temporary name, the example below shows how to swap bone_H_Saddle and bone_Spine names with each other:<br />
<task_id> cas_bone_name_change <br />
<directory_in> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka <br />
<directory_out> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka\changedbones <br />
<bone_name_change_list> <br />
bone_H_Saddle bone_H_Saddlex<br />
bone_Spine bone_H_Saddle<br />
bone_H_Saddlex bone_Spine<br />
<br />
* The task cas_bone_name_change changes a bone name (the NEW name must not already exist in a skeleton this is being applied to)<br />
* Directory in is optional, alternatively the task file can be placed in the directory and launched from there<br />
* Directory out is optional, if not given a sub-folder /updateskeletons will be created<br />
<br />
===Fixing Floating Units===<br />
For how to create the new basepose see [[Blender_hints_and_tips#Fixing_Floating_Units|Blender Hints and Tips]]<br />
<br />
Once you have the new basepose.cas you need to use it as the source to replace the bone positions in ALL of the animations the unit uses. For strat_models if you haven't already edited the .cas files of all the effected models include them in the skeleton replacement process too.<br />
<br />
==Weapon Animations (M2TW)==<br />
M2TW includes the possibility of having 'add-on' animations for weapons/shields. These are commonly listed in the model db file but rarely actually used.<br />
<br />
The advantage of properly using the weapon bones and anims instead of adding additional 'normal' bones to the skeleton is that the main skeleton remains 'standard' and does not cause the victim death anim bug when in battle with units whose skeletons have different numbers of bones!<br />
<br />
==IWTE Task File Options==<br />
===Text File Output===<br />
using <create_text_file> you can optionally generate .txt files that show, '''for information purposes only''', the content of the incoming .mesh/.cas files, the default option is <br />
<create_text_file> no #stops any text file being created <br />
<create_text_file> yes #creates a summary text file with header/trailer info, numbers of verts, texture and mesh names etc.<br />
<create_text_file> full #creates a full text file showing the interpretation of all the ints/floats etc in the file, with comments<br />
<br />
<br />
==External Links==<br />
* [https://www.blender.org/ Blender]<br />
* [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 IWTE Download]<br />
* [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing Discussion thread].<br />
<br />
[[Category:M2TW Modding]]<br />
[[Category:Blender]]<br />
[[Category:RTW Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=File:Iwte-cas-evt-extraction.jpg&diff=86521File:Iwte-cas-evt-extraction.jpg2023-06-09T11:03:52Z<p>Makanyane: extracting full cas/evt files with IWTE
Category:M2TW Modding Images</p>
<hr />
<div>== Summary ==<br />
extracting full cas/evt files with IWTE<br />
[[Category:M2TW Modding Images]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=IWTE_-_Units_in_Blender/Milkshape&diff=86520IWTE - Units in Blender/Milkshape2023-06-09T10:53:45Z<p>Makanyane: /* Export and Import RTW Units & RTW/M2TW Strat Characters */</p>
<hr />
<div>{{RTW M2TW Modding Logo}}<br />
{{IWTE}} <br />
__TOC__<br />
<br />
<big>Tips and instructions for working with RTW and M2TW battle map units and strat map characters via '''[[IWTE]]''' and '''[[Blender]]''' using the .dae format.</big> <br />
<br />
''The .dae files used for the Collada import/export can also be used with '''3ds Max''', however, max users absolutely have to use the [https://github.com/KhronosGroup/OpenCOLLADA/wiki/OpenCOLLADA-Tools '''OpenCollada plugin'''] and file format when importing/exporting files, max comes with the AutodeskCollada file format by default which neither imports nor exports files from the game correctly.''<br />
<br />
*IWTE download [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 here] - please use the latest version, early versions do not have this functionality.<br />
*For queries about these functions please ask [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing here].<br />
*For information on working on M2TW Settlements in Blender see [[IWTE - Settlements in Blender]]<br />
*For general tips on working with Blender see [[Blender hints and tips]]<br />
*For related info about .cas file structure see [[Cas Files|here]]<br />
<br />
<br />
==Export and Import M2TW .mesh Units==<br />
The most useful method of export involves matching the unit .mesh with its skeleton basepose and one or more animations. <br />
<br />
The drop-down menu in IWTE allows a unit .mesh to be merged with its basepose skeleton and one animation. A task file is needed to allow combining of animations and is the only way to also incorporate weapon animations.<br />
<br />
The drop-down menu options, and alternative IWTE Task button options are described below:<br />
<br />
[[File:Export-mesh-in-IWTE.jpg]]<br />
<br />
1. For Blender select the 'Unit mesh/skel/casanim to dae' option if you have the skeleton and animation versions unpacked using XIDX etc.<br><br />
2. For Blender select 'Unit mesh to dae' if you have the "full" version of the .cas basepose and animations (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br><br />
3. For Milkshape select the 'Unit mesh/skel/casanim to ms3d' option if you have the skeleton and animation versions unpacked using XIDX.<br><br />
4. For Blender select 'Unit mesh to ms3d' if you have the "full" version of the .cas basepose and animations (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br><br />
<br />
For all of the above options select the Double Textured option for unit meshes that have both a main and attachment texture. Select the Single Textured option for most other cases (e.g. standard mounts). <br />
<br />
You will be prompted to select the model .mesh first, then the basepose.cas for the skeleton (full cas version) or the unpacked skeleton file (unpacked version), and then an animation.cas file that is compatible with that skeleton (this should be in the same format as the skeleton, full or unpacked). <br />
<br />
===Export/Import by Task Process===<br />
To generate a .dae or .ms3d file from .mesh and .anims via the task process you will need a text file ending in _task.txt which starts with the mesh to dae command, run the task file by selecting the 'IWTE Task' > 'Select Task File' buttons. See example below for mesh_to_dae (the extra line breaks have been included just to show the body/weapon pairing):<br />
<br />
<task_id> mesh_to_extract <br />
<mesh_file_full_path_in> C:\M2TW\mods\devkit\data\animations\EB_Slinger\numidian_slinger_lod0.mesh <br />
<mesh_type> unit # line can be omitted if not also adding mount<br />
<mesh_double_texture> yes # or 'no' for single texture<br />
<cas_file_types_in_list> body weapon <br />
<br />
<directory_out> C:\M2TW\mods\devkit\data\animations\EB_Slinger <br />
<extract_file_name_out> EBslingerAnims.ms3d <br />
<extract_file_type> ms3d # or 'dae' for Blender<br />
<create_text_file> no # or 'yes' for summary files, 'full' for detailed files<br />
<task_file_full_path_out> C:\IWTE/IWTE_tasks/ms3d_to_mesh_slinger_task.txt # name for your return task file <br />
<br />
<cas_file_full_path_in_default_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_basepose.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas<br />
<br />
<cas_file_full_path_in_action_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_stand_A_idle.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas <br />
<br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_attack_missile_ready.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_attack_missile_ready.cas <br />
<br />
Please see the IWTE example control processes.txt file that ships with IWTE for further details/instructions. <br />
<br />
Running the task will generate you a .ms3d or .dae file with the animations joined together with an additional 'basepose' frame added at frame 0, to aid editing. The task will also auto-generate for a reverse dae/ms3d_to_mesh_****_task.txt file for you, this will list the start and end frame positions of all included animations and the names of all the files that will be re-created from your file. The names and frame positions can be edited to suit any changes you may require before running the return task.<br />
<br />
When creating the task files it is common to make minor errors in the file names/paths that mean IWTE cannot find all the elements! If you get an error message whilst running the task you'll get a chance to read the error message <br />
(which is easier in the command window) - you can then click "Ignore" to keep IWTE open, fix the name/path/file issue in the .txt file and try running the task again. The error message should indicate which file it couldn't find. If you forget to add the file extension and try and get it to open a folder you'll get an 'access violation' type message. <br />
<br />
For unit models that do not have any elements weighted to the 'weapon bones' you only need to run the process with <br />
<br />
<code> <cas_file_types_in_list> body </code> <br />
<br />
and supply the main skeleton basepose and animation.<br />
<br />
If the mesh has a weapon weighted to weapon bones use the ''body weapon'' example shown above.<br />
<br />
If the mesh has both a weapon weighted to weapon bones and a shield weighted to bone_shield etc use<br />
<br />
<code> <cas_file_types_in_list> body weapon shield</code> <br />
<br />
and supply the main skeleton, weapon animation and shield animation baseposes and animations in sets of three in order.<br />
<br />
Note: a lot of models that are apparently using ''fs_test_shield'' according to their [[battle_models.modeldb]] entry don't actually have anything weighted to bone_shield, making the shield 'anim' irrelevant.<br />
<br />
===UV Mapping for Double Texture Units===<br />
The mesh format for both double and singled textured units in M2TW is actually exactly the same with just one set of uv's that should range from 0 to 1.0 in both horizontal and vertical axis.<br />
<br />
If you assign two textures to a unit in the [[battle_models.modeldb]] then the game expands out the horizontal axis of the uv maps so that the area from 0 to 0.5 is used to cover 0 to 1 on the first texture, and the uv's from 0.5 to 1.0 on the horizontal axis are used to cover 0 to 1 on the second texture.<br />
<br />
Milkshape/.mesh converters use the texture (Main or Attachment) assigned to a mesh group to determine which section of the uv map the group's uv coordinates will be moved to. On write back the Main texture co-ordinates are compressed into the 0>0.5 area and Attachment texture co-ordinates compressed into the 0.5>1.0 section.<br />
<br />
The IWTE mesh to .dae for Blender process works differently. The texture assignment process is used purely so you can view the mesh groups with the correct relevant texture. The 0>1.0 horizontal uvs are expanded to 0>2.0 if you use the process for 'double textures' and then compressed back to 0>1.0 on the return to .mesh.<br />
<br />
In Blender the uv mapping to the two textures will look like the image below.<br />
<br />
[[File:Uvs for double textured units.jpg|400px]]<br />
<br />
To see the 2nd texture under its uv's open the sidebar (n) in the uv screen and select the 'repeat texture' button.<br />
In Blender it is possible to partially assign some triangles from a group to the 1st texture and some triangles to the 2nd texture, if you do that please remember to also move the uv's to the appropriate zone.<br />
<br />
===Scaling of Anims===<br />
The 'full' cas animations as supplied by Caliban should be regarded as scale 1.0. If you need to load from them to suit a skeleton that will be scaled by the game you need to give IWTE the skeleton scale in the mesh_to_extract task using the appropriate tag e.g.<br><br />
<skeleton_scale> <br><br />
<mount_skeleton_scale><br />
<br />
If you load from the unpacked skeleton and unpacked animation the scale will be read from the skeleton, so you do not need to add any further information.<br />
<br />
==Export and Import RTW Units & RTW/M2TW Strat Characters==<br />
<big>'''NOTE:''' IWTE now supports the full weighting allowed in Rome Remastered by default - to ensure you do not create RTW/M2TW cas files that exceed their games capabilities add '''<cas_mesh_format> rtw''' (or M2) to the task file.</big><br />
<br />
<br />
The process for this is similar to the .mesh Export/Import process described above, the button locations are shown in the below image: <br><br />
[[File:Export-cas-to-dae.jpg|Exporting animated cas to date with IWTE]]<br />
<br />
1. For Blender to convert cas model with skeleton and animations unpacked from the RTW/RR animation pack files. The first file requested will again be the .cas 'mesh', e.g. model. The second file requested will be the skeleton file (as produced by XIDX/tool using extract_skeletons). The third file requested will be the .cas animation file (as produced by XIDX/tool using extract_animations).<br><br />
2. For Blender to convert cas model with skeleton and animations unpacked from the M2TW animation pack files. Works as above.<br><br />
3. For Blender to convert cas model if you have the full versions of the animation files, e.g the type supplied by Caliban that M2TW itself re-packs. The first file requested will be the .cas 'mesh', e.g. the one with the body model in it. The second file requested will be an animation file, if you do not have a suitable animation file just click 'Cancel' to close the selection screen. You can use the 'Animated cas/dae' button for all unit/character .cas files even if you aren't going to load an animation.<br><br />
4. For Blender this button is designed for converting static cas models.<br><br />
5. For Milkshape as option 2 above.<br><br />
6. For Milkshape as option 3 above.<br><br />
7. For Milkshape as option 4 above.<br><br />
A. Can be used for writing back to .cas model/animations but task file method is prefered.<br> <br />
B. Must be used if you need the model AND animation in one .cas file (applicable to RTW/RR spot effects only).<br><br />
<br />
Processes 1-7 will generate a .dae/.ms3d file in a to_dae/ms3d sub-folder where your IWTE.exe is located. You will also have two task files generated in the /iwte_tasks sub-folder. The ms3d/dae_to_cas one provides a default task file for reversing the process and generating new .cas files. The cas_to_dae/ms3d one allows you to repeat the process you just did by simply running the IWTE Task, you can also adapt that task file to load multiple animations. The following is an example task file for cas_to_dae with multiple anims, and using rtw skeleton and anims, note that if the file path/name has spaces the entire path needs to be inside " ", also note the skeleton name does not have a file extension, direction of \ or / doesn't matter:<br />
<task_id> cas_to_extract <br />
<cas_mesh_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\to_dae/from_dae/ALEX_companion_cavalry_lod_1.cas <br />
<directory_out> I:\M2TW\M2TWcopy\mods\IWTE/to_dae <br />
<extract_file_name_out> ALEX_companion_cavalry_taunt.dae<br />
<extract_file_type> dae <br />
<cas_animation_file_format> rtw <br />
<create_text_file> no <br />
<create_task_file_from_input> yes <br />
<task_file_full_path_out> I:\M2TW\M2TWcopy\mods\IWTE/IWTE_tasks/dae_to_cas_alextaunt_task.txt <br />
<skeleton_unpacked_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\testthings\animations\rome_animations/fs_swordsman<br />
<cas_file_full_path_in_action_list> <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_04 taunt 2.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_06 taunt 1.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_07 taunt 3.cas" <br />
<br />
To get amended units/anims back into game you will need to 'export' 'collada' from Blender or 3dsMax, or save as .ms3d from Milkshape. The .dae/.ms3d file created will have the same structure whether you're converting to Mesh/Cas model, and Full/XIDX packable anims, so you need to use a task file to specify the format to be returned. The automatically generated return task file will have assumed you want the same format that went in, so the task file above will have generated this return file:<br />
<task_id> dae_to_cas # to read dae file and generate *.cas files<br />
<dae_file_full_path_in> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/ALEX_companion_cavalry_taunt.dae # *.dae file to read in. i.e. change to collada name exported from Blender<br />
<directory_out> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/from_dae # directory to put new created files<br />
<cas_mesh_file_name_out> alex_companion_cavalry_lod_1.cas # *.cas file to be created<br />
<cas_animation_file_format> rr # format of cas to be created by dae (rtw or full) <br />
<cas_unpacked_skeleton_scale> 1.0000 # cas unpacked skeleton scaling<br />
<overlap_frames> no # overlap frames selection used to create the dae (not used on import)<br />
<cas_file_name_out_anim_split_list> # cas anim files start and end frames<br />
"lid_57_04 taunt 2.cas" 1 79 <br />
"lid_57_06 taunt 1.cas" 80 162 <br />
"lid_57_07 taunt 3.cas" 163 237 <br />
#<end_frame> 237 # Last animated frame (use to see full animation in blender)<br />
<br />
If you're trying to convert format, instead of rr you need to use:<br />
<cas_animation_file_format> '''m2''' #for M2TW anims re-packable by XIDX<br />
<br />
<cas_animation_file_format> '''full''' #for M2TW anims re-packable by '''the game'''<br />
<br />
If you want an M2TW mesh back instead of a .cas model use the <br />
<task_id> '''dae_to_mesh'''<br />
instead of dae_to_cas<br />
<br />
Using the 'Animated dae to cas_mesh' ('''4''') button will generate a separate cas model file and a full version anim called _action. See below for animation file type details.<br />
<br />
Using the 'RTW object animation dae to cas' ('''5''') will produce a cas which includes both the model and the animation together, these are used only for [[Spot fx animations and effects|spot_fx]] items in RTW/RR.<br />
<br />
===Bone Weighting===<br />
RTW battle map units and strat models and M2TW strat models will generally have vertexes weighted to only one bone per vertex.<br />
<br />
If you convert a dae with multiple bone weights per vertex to cas with IWTE it will generate one cas with vertexes weighted to up to two bones, and one cas with the suffix "_lod1". The _lod1 cas can be renamed and used for RTW/M2TW. Ideally however you should limit the bone weight totals yourself so you can check how the model will behave in game when posed. See [[Blender_hints_and_tips#Bone_Assignment|Blender hints and tips]].<br />
<br />
For details on optionally creating a simple multi-weighted Section see: [[Model_flexi_m in RTW]]<br />
<br />
===Cas animation types===<br />
IWTE supports the full (never packed) versions of [[Cas Files|.cas files]], as supplied by Caliban and also the ones that have been generated from Pack files by XIDX, IWTE or similar tools. PLEASE NOTE: The RTW and M2TW anims generated from the pack files use a different format - DO NOT pack RTW types into M2TW packs or vice-versa - check that you are generating the correct type for the game you are going to use them in! Also do not attempt to re-pack the full type (where you can see the bone names) with XIDX or IWTE, they will only work if you have a full set including .evt files and let M2TW repack them from descr_skeleton.txt.<br />
<br />
==Units - General Tips==<br />
*Seams - To avoid seams in the finished model you CAN 'weld' vertexes that have disconnected uvs, in Blender use Mesh> Clean Up> Merge by Distance (without uvs ticked), and Shading> Smooth Faces. That will get you a shared normal that allows the area to look smooth. For the game IWTE will generate two vertexes at that point to preserve the uvs and set that normal as a custom normal for each.<br />
<br />
*Anims/skeletons - In Blender you can make any alteration you like to the 'Pose Mode' this will only affect the animation frames. Do NOT, unless you know what you are doing... move or edit the bones in the 'Armature' edit mode, this will affect the bone positions in the model/anim.cas produced, and will need to be matched to a skeleton with the same bone positions. If using the "full" M2TW cas anims that the game re-packs you can adjust the bone positions for a folder of .cas anims by using the skeleton replacement method detailed below. If using XIDX unpacked/packed anims you will need to change the skeleton using other tools.<br />
<br />
==Animations - General Tips==<br />
*Blender must be set to 20fps BEFORE importing a .dae with animation created by IWTE. To do this use the custom setting and type in 20. When you import a .dae file you should then see the keyframes neatly aligned with the time markers. See below:<br />
<br />
[[File:20fps.jpg|200px]]<br />
<br />
==Mesh Names/Comments==<br />
The Blender .dae interface does not support comments, so all the information about the mesh sections (primary/secondary weapons etc.) needs to go in the mesh name:<br />
<br />
*Section Naming - For Blender the full details of the group names are stored in the name itself. There isn't a comment section like milkshape. Things that need to go back into the game as separate sections, e.g. to denote primary weapons, or alternate versions, need a double underscore __ to show where the name should be split or a space included. For M2TW mesh sections that you want to be optional, use __opt at the end of the group name.<br />
<br />
==Siege/Artillery Engines==<br />
Siege/Artillery for both RTW and M2TW use the "full" cas anim versions (not packed/unpacked at any stage). For M2TW use the dedicated Model Files > Mesh Models > Siege Engine mesh to date for export and IWTE Task import process. For RTW use the Model Files > Cas Models > Animated cas_mesh to date, the RTW process seems to be quite straightforward as there isn't the mis-alignment between bone names and start poses that is present in M2TW.<br />
===M2TW Siege Engine Skeleton Alteration Example Process===<br />
*In top menu bar go to Model Files > Siege Engine mesh to dae > select mesh, then default cas then anim cas.<br />
:Check that the default .cas is actually the one listed as anim-default in descr_engine_skeleton.txt<br />
:also check that you're using an anim that is in use in game - some of the anims in the folder don't work.<br />
<br />
*IWTE will have written a .dae file in "to_dae" sub-folder below your .mesh model location.<br />
<br />
*Load in Blender by using 'file' 'import' 'collada'<br />
<br />
*Add bones as required to the Armature - note there should only be one top level bone, e.g bone_body add all other bones as child of this, or of existing bones.<br />
<br />
*Use 'weight paint' to assign vertices to bones as required.<br />
:Note - the .mesh file will only accept vertexes weighted to a max of 2 bones<br />
:use 'limit total' in 'weights' menu and set to 2 to avoid any verts weighted to 3 or more bones - (this is applied to selected verts only)<br />
:use 'normalise all' to make sure verts are fully weighted, use 'auto normalise' option whilst working also<br />
<br />
*change animation by switching to 'animation' layout in top bar<br />
:trigger Pose mode by clicking pose running man symbol within the Armature<br />
:if you can't see bones, or the summary when you click them, in main sidebar click the pose (running man) button, select "viewport display" and select the "in front" option<br />
:when you move a bone in the pose mode use shortcut "i" in main window to open keyframe dialogue and select "LocRot"<br />
:you can delete copy or move keyframes around for selected bones in the Dope Sheet section<br />
<br />
*Export collada - in settings check Anim is on Matrix option and 'keep keyframes' and 'all keyed curves' are selected.<br />
'''DO NOT USE IWTE Model Files > Siege Engine dae to mesh to convert back''' the dae doesn't include enough info to retain the three textures named in the mesh .<br />
<br />
*USE the "dae_to_mesh_*****_task.txt" that IWTE has written into the "IWTE_Tasks" sub-folder where your IWTE.exe is<br />
:change the .dae name you're reading in to the one you've just saved - change any other output names IF you need to<br />
:check the number of frames listed ties up with the end frame you set in collada.<br />
<br />
*Run the task file from the IWTE Task button in top menu bar, the separate files will be saved where specified in the task file.<br />
<br />
*If you have changed the number of bones used or their positions you will need to align all the other .cas anims used by the mesh, to do this use the skeleton replacement process explained below.<br />
<br />
==Skeleton Replacement (M2TW)==<br />
''RTW and packed M2TW skeletons can not be changed via this method.'' <br><br />
To replace the skeleton in M2TW where you have the set of full .cas anims that the game re-packs in the IWTE top menu bar go to:<br />
:Model Files > Cas Models > Skeleton Replacement<br />
<br />
*On the first prompt select the .cas file containing the bones in the basepose positions you want (probably the default or basepose .cas)<br />
*On the second prompt select the FOLDER that contains all the .cas files you want to change.<br />
<br />
The revised files will be saved in a sub folder of that folder called "updateskeletons" they will have the same names as the original .cas files and can be used to directly replace them. Please back-up your original files before doing this, and remember that other .cas/.mesh models may be using the same files, so you may need to create a separate folder and separate entry in descr_skeleton.txt etc.<br />
<br />
Adding bones should be straightforward, if you delete bones that had child bones then the result may be unpredictable and the resulting animations may need editing. <br />
<br />
===Bone Renaming Task===<br />
To rename the bones throughout a folder of full .cas animations use a task file. If you want to swap the names of bones you need to add an additional stage to re-name one bone to a temporary name, the example below shows how to swap bone_H_Saddle and bone_Spine names with each other:<br />
<task_id> cas_bone_name_change <br />
<directory_in> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka <br />
<directory_out> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka\changedbones <br />
<bone_name_change_list> <br />
bone_H_Saddle bone_H_Saddlex<br />
bone_Spine bone_H_Saddle<br />
bone_H_Saddlex bone_Spine<br />
<br />
* The task cas_bone_name_change changes a bone name (the NEW name must not already exist in a skeleton this is being applied to)<br />
* Directory in is optional, alternatively the task file can be placed in the directory and launched from there<br />
* Directory out is optional, if not given a sub-folder /updateskeletons will be created<br />
<br />
===Fixing Floating Units===<br />
For how to create the new basepose see [[Blender_hints_and_tips#Fixing_Floating_Units|Blender Hints and Tips]]<br />
<br />
Once you have the new basepose.cas you need to use it as the source to replace the bone positions in ALL of the animations the unit uses. For strat_models if you haven't already edited the .cas files of all the effected models include them in the skeleton replacement process too.<br />
<br />
==Weapon Animations (M2TW)==<br />
M2TW includes the possibility of having 'add-on' animations for weapons/shields. These are commonly listed in the model db file but rarely actually used.<br />
<br />
The advantage of properly using the weapon bones and anims instead of adding additional 'normal' bones to the skeleton is that the main skeleton remains 'standard' and does not cause the victim death anim bug when in battle with units whose skeletons have different numbers of bones!<br />
<br />
==IWTE Task File Options==<br />
===Text File Output===<br />
using <create_text_file> you can optionally generate .txt files that show, '''for information purposes only''', the content of the incoming .mesh/.cas files, the default option is <br />
<create_text_file> no #stops any text file being created <br />
<create_text_file> yes #creates a summary text file with header/trailer info, numbers of verts, texture and mesh names etc.<br />
<create_text_file> full #creates a full text file showing the interpretation of all the ints/floats etc in the file, with comments<br />
<br />
<br />
==External Links==<br />
* [https://www.blender.org/ Blender]<br />
* [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 IWTE Download]<br />
* [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing Discussion thread].<br />
<br />
[[Category:M2TW Modding]]<br />
[[Category:Blender]]<br />
[[Category:RTW Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=IWTE_-_Units_in_Blender/Milkshape&diff=86519IWTE - Units in Blender/Milkshape2023-06-09T10:48:23Z<p>Makanyane: /* Export and Import RTW Units & RTW/M2TW Strat Characters */</p>
<hr />
<div>{{RTW M2TW Modding Logo}}<br />
{{IWTE}} <br />
__TOC__<br />
<br />
<big>Tips and instructions for working with RTW and M2TW battle map units and strat map characters via '''[[IWTE]]''' and '''[[Blender]]''' using the .dae format.</big> <br />
<br />
''The .dae files used for the Collada import/export can also be used with '''3ds Max''', however, max users absolutely have to use the [https://github.com/KhronosGroup/OpenCOLLADA/wiki/OpenCOLLADA-Tools '''OpenCollada plugin'''] and file format when importing/exporting files, max comes with the AutodeskCollada file format by default which neither imports nor exports files from the game correctly.''<br />
<br />
*IWTE download [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 here] - please use the latest version, early versions do not have this functionality.<br />
*For queries about these functions please ask [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing here].<br />
*For information on working on M2TW Settlements in Blender see [[IWTE - Settlements in Blender]]<br />
*For general tips on working with Blender see [[Blender hints and tips]]<br />
*For related info about .cas file structure see [[Cas Files|here]]<br />
<br />
<br />
==Export and Import M2TW .mesh Units==<br />
The most useful method of export involves matching the unit .mesh with its skeleton basepose and one or more animations. <br />
<br />
The drop-down menu in IWTE allows a unit .mesh to be merged with its basepose skeleton and one animation. A task file is needed to allow combining of animations and is the only way to also incorporate weapon animations.<br />
<br />
The drop-down menu options, and alternative IWTE Task button options are described below:<br />
<br />
[[File:Export-mesh-in-IWTE.jpg]]<br />
<br />
1. For Blender select the 'Unit mesh/skel/casanim to dae' option if you have the skeleton and animation versions unpacked using XIDX etc.<br><br />
2. For Blender select 'Unit mesh to dae' if you have the "full" version of the .cas basepose and animations (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br><br />
3. For Milkshape select the 'Unit mesh/skel/casanim to ms3d' option if you have the skeleton and animation versions unpacked using XIDX.<br><br />
4. For Blender select 'Unit mesh to ms3d' if you have the "full" version of the .cas basepose and animations (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br><br />
<br />
For all of the above options select the Double Textured option for unit meshes that have both a main and attachment texture. Select the Single Textured option for most other cases (e.g. standard mounts). <br />
<br />
You will be prompted to select the model .mesh first, then the basepose.cas for the skeleton (full cas version) or the unpacked skeleton file (unpacked version), and then an animation.cas file that is compatible with that skeleton (this should be in the same format as the skeleton, full or unpacked). <br />
<br />
===Export/Import by Task Process===<br />
To generate a .dae or .ms3d file from .mesh and .anims via the task process you will need a text file ending in _task.txt which starts with the mesh to dae command, run the task file by selecting the 'IWTE Task' > 'Select Task File' buttons. See example below for mesh_to_dae (the extra line breaks have been included just to show the body/weapon pairing):<br />
<br />
<task_id> mesh_to_extract <br />
<mesh_file_full_path_in> C:\M2TW\mods\devkit\data\animations\EB_Slinger\numidian_slinger_lod0.mesh <br />
<mesh_type> unit # line can be omitted if not also adding mount<br />
<mesh_double_texture> yes # or 'no' for single texture<br />
<cas_file_types_in_list> body weapon <br />
<br />
<directory_out> C:\M2TW\mods\devkit\data\animations\EB_Slinger <br />
<extract_file_name_out> EBslingerAnims.ms3d <br />
<extract_file_type> ms3d # or 'dae' for Blender<br />
<create_text_file> no # or 'yes' for summary files, 'full' for detailed files<br />
<task_file_full_path_out> C:\IWTE/IWTE_tasks/ms3d_to_mesh_slinger_task.txt # name for your return task file <br />
<br />
<cas_file_full_path_in_default_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_basepose.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas<br />
<br />
<cas_file_full_path_in_action_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_stand_A_idle.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas <br />
<br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_attack_missile_ready.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_attack_missile_ready.cas <br />
<br />
Please see the IWTE example control processes.txt file that ships with IWTE for further details/instructions. <br />
<br />
Running the task will generate you a .ms3d or .dae file with the animations joined together with an additional 'basepose' frame added at frame 0, to aid editing. The task will also auto-generate for a reverse dae/ms3d_to_mesh_****_task.txt file for you, this will list the start and end frame positions of all included animations and the names of all the files that will be re-created from your file. The names and frame positions can be edited to suit any changes you may require before running the return task.<br />
<br />
When creating the task files it is common to make minor errors in the file names/paths that mean IWTE cannot find all the elements! If you get an error message whilst running the task you'll get a chance to read the error message <br />
(which is easier in the command window) - you can then click "Ignore" to keep IWTE open, fix the name/path/file issue in the .txt file and try running the task again. The error message should indicate which file it couldn't find. If you forget to add the file extension and try and get it to open a folder you'll get an 'access violation' type message. <br />
<br />
For unit models that do not have any elements weighted to the 'weapon bones' you only need to run the process with <br />
<br />
<code> <cas_file_types_in_list> body </code> <br />
<br />
and supply the main skeleton basepose and animation.<br />
<br />
If the mesh has a weapon weighted to weapon bones use the ''body weapon'' example shown above.<br />
<br />
If the mesh has both a weapon weighted to weapon bones and a shield weighted to bone_shield etc use<br />
<br />
<code> <cas_file_types_in_list> body weapon shield</code> <br />
<br />
and supply the main skeleton, weapon animation and shield animation baseposes and animations in sets of three in order.<br />
<br />
Note: a lot of models that are apparently using ''fs_test_shield'' according to their [[battle_models.modeldb]] entry don't actually have anything weighted to bone_shield, making the shield 'anim' irrelevant.<br />
<br />
===UV Mapping for Double Texture Units===<br />
The mesh format for both double and singled textured units in M2TW is actually exactly the same with just one set of uv's that should range from 0 to 1.0 in both horizontal and vertical axis.<br />
<br />
If you assign two textures to a unit in the [[battle_models.modeldb]] then the game expands out the horizontal axis of the uv maps so that the area from 0 to 0.5 is used to cover 0 to 1 on the first texture, and the uv's from 0.5 to 1.0 on the horizontal axis are used to cover 0 to 1 on the second texture.<br />
<br />
Milkshape/.mesh converters use the texture (Main or Attachment) assigned to a mesh group to determine which section of the uv map the group's uv coordinates will be moved to. On write back the Main texture co-ordinates are compressed into the 0>0.5 area and Attachment texture co-ordinates compressed into the 0.5>1.0 section.<br />
<br />
The IWTE mesh to .dae for Blender process works differently. The texture assignment process is used purely so you can view the mesh groups with the correct relevant texture. The 0>1.0 horizontal uvs are expanded to 0>2.0 if you use the process for 'double textures' and then compressed back to 0>1.0 on the return to .mesh.<br />
<br />
In Blender the uv mapping to the two textures will look like the image below.<br />
<br />
[[File:Uvs for double textured units.jpg|400px]]<br />
<br />
To see the 2nd texture under its uv's open the sidebar (n) in the uv screen and select the 'repeat texture' button.<br />
In Blender it is possible to partially assign some triangles from a group to the 1st texture and some triangles to the 2nd texture, if you do that please remember to also move the uv's to the appropriate zone.<br />
<br />
===Scaling of Anims===<br />
The 'full' cas animations as supplied by Caliban should be regarded as scale 1.0. If you need to load from them to suit a skeleton that will be scaled by the game you need to give IWTE the skeleton scale in the mesh_to_extract task using the appropriate tag e.g.<br><br />
<skeleton_scale> <br><br />
<mount_skeleton_scale><br />
<br />
If you load from the unpacked skeleton and unpacked animation the scale will be read from the skeleton, so you do not need to add any further information.<br />
<br />
==Export and Import RTW Units & RTW/M2TW Strat Characters==<br />
<big>'''NOTE:''' IWTE now supports the full weighting allowed in Rome Remastered by default - to ensure you do not create RTW/M2TW cas files that exceed their games capabilities add '''<cas_mesh_format> rtw''' (or M2) to the task file.</big><br />
<br />
<br />
The process for this is similar to the .mesh Export/Import process described above, the button locations are shown in the below image: <br><br />
[[File:Export-cas-to-dae.jpg|Exporting animated cas to date with IWTE]]<br />
<br />
1. For Blender to convert cas model with skeleton and animations unpacked from the RTW/RR animation pack files. The first file requested will again be the .cas 'mesh', e.g. model. The second file requested will be the skeleton file (as produced by XIDX/tool using extract_skeletons). The third file requested will be the .cas animation file (as produced by XIDX/tool using extract_animations).<br><br />
2. For Blender to convert cas model with skeleton and animations unpacked from the M2TW animation pack files. Works as above.<br><br />
3. For Blender to convert cas model if you have the full versions of the animation files, e.g the type supplied by Caliban that M2TW itself re-packs. The first file requested will be the .cas 'mesh', e.g. the one with the body model in it. The second file requested will be an animation file, if you do not have a suitable animation file just click 'Cancel' to close the selection screen. You can use the 'Animated cas/dae' button for all unit/character .cas files even if you aren't going to load an animation.<br><br />
4. For Blender this button is designed for converting static cas models.<br><br />
5. For Milkshape as option 2 above.<br><br />
6. For Milkshape as option 3 above.<br><br />
7. For Milkshape as option 4 above.<br><br />
A. Can be used for writing back to .cas model/animations but task file method is prefered.<br> <br />
B. Must be used if you need the model AND animation in one .cas file (applicable to RTW/RR spot effects only).<br><br />
<br />
These processes will generate a .dae/.ms3d file in a to_dae/ms3d sub-folder where your IWTE.exe is located. You will also have two task files generated in the /iwte_tasks sub-folder. The ms3d/dae_to_cas one provides a default task file for reversing the process and generating new .cas files. The cas_to_dae/ms3d one allows you to repeat the process you just did by simply running the IWTE Task, you can also adapt that task file to load multiple animations. The following is an example task file for cas_to_dae with multiple anims, and using rtw skeleton and anims, note that if the file path/name has spaces the entire path needs to be inside " ", also note the skeleton name does not have a file extension, direction of \ or / doesn't matter:<br />
<task_id> cas_to_extract <br />
<cas_mesh_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\to_dae/from_dae/ALEX_companion_cavalry_lod_1.cas <br />
<directory_out> I:\M2TW\M2TWcopy\mods\IWTE/to_dae <br />
<extract_file_name_out> ALEX_companion_cavalry_taunt.dae<br />
<extract_file_type> dae <br />
<cas_animation_file_format> rtw <br />
<create_text_file> no <br />
<create_task_file_from_input> yes <br />
<task_file_full_path_out> I:\M2TW\M2TWcopy\mods\IWTE/IWTE_tasks/dae_to_cas_alextaunt_task.txt <br />
<skeleton_unpacked_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\testthings\animations\rome_animations/fs_swordsman<br />
<cas_file_full_path_in_action_list> <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_04 taunt 2.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_06 taunt 1.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_07 taunt 3.cas" <br />
<br />
To get amended units/anims back into game you will need to 'export' 'collada' from Blender or 3dsMax. The .dae file created will have the same structure whether you're converting to Mesh/Cas model, and Full/XIDX packable anims, so you need to use a task file to specify the format to be returned. The automatically generated return task file will have assumed you want the same format that went in, so the task file above will have generated this return file:<br />
<task_id> dae_to_cas # to read dae file and generate *.cas files<br />
<dae_file_full_path_in> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/ALEX_companion_cavalry_taunt.dae # *.dae file to read in. i.e. change to collada name exported from Blender<br />
<directory_out> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/from_dae # directory to put new created files<br />
<cas_mesh_file_name_out> alex_companion_cavalry_lod_1.cas # *.cas file to be created<br />
<cas_animation_file_format> rr # format of cas to be created by dae (rtw or full) <br />
<cas_unpacked_skeleton_scale> 1.0000 # cas unpacked skeleton scaling<br />
<overlap_frames> no # overlap frames selection used to create the dae (not used on import)<br />
<cas_file_name_out_anim_split_list> # cas anim files start and end frames<br />
"lid_57_04 taunt 2.cas" 1 79 <br />
"lid_57_06 taunt 1.cas" 80 162 <br />
"lid_57_07 taunt 3.cas" 163 237 <br />
#<end_frame> 237 # Last animated frame (use to see full animation in blender)<br />
<br />
If you're trying to convert format, instead of rr you need to use:<br />
<cas_animation_file_format> '''m2''' #for M2TW anims re-packable by XIDX<br />
<br />
<cas_animation_file_format> '''full''' #for M2TW anims re-packable by '''the game'''<br />
<br />
If you want an M2TW mesh back instead of a .cas model use the <br />
<task_id> '''dae_to_mesh'''<br />
instead of dae_to_cas<br />
<br />
Using the 'Animated dae to cas_mesh' ('''4''') button will generate a separate cas model file and a full version anim called _action. See below for animation file type details.<br />
<br />
Using the 'RTW object animation dae to cas' ('''5''') will produce a cas which includes both the model and the animation together, these are used only for [[Spot fx animations and effects|spot_fx]] items in RTW/RR.<br />
<br />
===Bone Weighting===<br />
RTW battle map units and strat models and M2TW strat models will generally have vertexes weighted to only one bone per vertex.<br />
<br />
If you convert a dae with multiple bone weights per vertex to cas with IWTE it will generate one cas with vertexes weighted to up to two bones, and one cas with the suffix "_lod1". The _lod1 cas can be renamed and used for RTW/M2TW. Ideally however you should limit the bone weight totals yourself so you can check how the model will behave in game when posed. See [[Blender_hints_and_tips#Bone_Assignment|Blender hints and tips]].<br />
<br />
For details on optionally creating a simple multi-weighted Section see: [[Model_flexi_m in RTW]]<br />
<br />
===Cas animation types===<br />
IWTE supports the full (never packed) versions of [[Cas Files|.cas files]], as supplied by Caliban and also the ones that have been generated from Pack files by XIDX, IWTE or similar tools. PLEASE NOTE: The RTW and M2TW anims generated from the pack files use a different format - DO NOT pack RTW types into M2TW packs or vice-versa - check that you are generating the correct type for the game you are going to use them in! Also do not attempt to re-pack the full type (where you can see the bone names) with XIDX or IWTE, they will only work if you have a full set including .evt files and let M2TW repack them from descr_skeleton.txt.<br />
<br />
==Units - General Tips==<br />
*Seams - To avoid seams in the finished model you CAN 'weld' vertexes that have disconnected uvs, in Blender use Mesh> Clean Up> Merge by Distance (without uvs ticked), and Shading> Smooth Faces. That will get you a shared normal that allows the area to look smooth. For the game IWTE will generate two vertexes at that point to preserve the uvs and set that normal as a custom normal for each.<br />
<br />
*Anims/skeletons - In Blender you can make any alteration you like to the 'Pose Mode' this will only affect the animation frames. Do NOT, unless you know what you are doing... move or edit the bones in the 'Armature' edit mode, this will affect the bone positions in the model/anim.cas produced, and will need to be matched to a skeleton with the same bone positions. If using the "full" M2TW cas anims that the game re-packs you can adjust the bone positions for a folder of .cas anims by using the skeleton replacement method detailed below. If using XIDX unpacked/packed anims you will need to change the skeleton using other tools.<br />
<br />
==Animations - General Tips==<br />
*Blender must be set to 20fps BEFORE importing a .dae with animation created by IWTE. To do this use the custom setting and type in 20. When you import a .dae file you should then see the keyframes neatly aligned with the time markers. See below:<br />
<br />
[[File:20fps.jpg|200px]]<br />
<br />
==Mesh Names/Comments==<br />
The Blender .dae interface does not support comments, so all the information about the mesh sections (primary/secondary weapons etc.) needs to go in the mesh name:<br />
<br />
*Section Naming - For Blender the full details of the group names are stored in the name itself. There isn't a comment section like milkshape. Things that need to go back into the game as separate sections, e.g. to denote primary weapons, or alternate versions, need a double underscore __ to show where the name should be split or a space included. For M2TW mesh sections that you want to be optional, use __opt at the end of the group name.<br />
<br />
==Siege/Artillery Engines==<br />
Siege/Artillery for both RTW and M2TW use the "full" cas anim versions (not packed/unpacked at any stage). For M2TW use the dedicated Model Files > Mesh Models > Siege Engine mesh to date for export and IWTE Task import process. For RTW use the Model Files > Cas Models > Animated cas_mesh to date, the RTW process seems to be quite straightforward as there isn't the mis-alignment between bone names and start poses that is present in M2TW.<br />
===M2TW Siege Engine Skeleton Alteration Example Process===<br />
*In top menu bar go to Model Files > Siege Engine mesh to dae > select mesh, then default cas then anim cas.<br />
:Check that the default .cas is actually the one listed as anim-default in descr_engine_skeleton.txt<br />
:also check that you're using an anim that is in use in game - some of the anims in the folder don't work.<br />
<br />
*IWTE will have written a .dae file in "to_dae" sub-folder below your .mesh model location.<br />
<br />
*Load in Blender by using 'file' 'import' 'collada'<br />
<br />
*Add bones as required to the Armature - note there should only be one top level bone, e.g bone_body add all other bones as child of this, or of existing bones.<br />
<br />
*Use 'weight paint' to assign vertices to bones as required.<br />
:Note - the .mesh file will only accept vertexes weighted to a max of 2 bones<br />
:use 'limit total' in 'weights' menu and set to 2 to avoid any verts weighted to 3 or more bones - (this is applied to selected verts only)<br />
:use 'normalise all' to make sure verts are fully weighted, use 'auto normalise' option whilst working also<br />
<br />
*change animation by switching to 'animation' layout in top bar<br />
:trigger Pose mode by clicking pose running man symbol within the Armature<br />
:if you can't see bones, or the summary when you click them, in main sidebar click the pose (running man) button, select "viewport display" and select the "in front" option<br />
:when you move a bone in the pose mode use shortcut "i" in main window to open keyframe dialogue and select "LocRot"<br />
:you can delete copy or move keyframes around for selected bones in the Dope Sheet section<br />
<br />
*Export collada - in settings check Anim is on Matrix option and 'keep keyframes' and 'all keyed curves' are selected.<br />
'''DO NOT USE IWTE Model Files > Siege Engine dae to mesh to convert back''' the dae doesn't include enough info to retain the three textures named in the mesh .<br />
<br />
*USE the "dae_to_mesh_*****_task.txt" that IWTE has written into the "IWTE_Tasks" sub-folder where your IWTE.exe is<br />
:change the .dae name you're reading in to the one you've just saved - change any other output names IF you need to<br />
:check the number of frames listed ties up with the end frame you set in collada.<br />
<br />
*Run the task file from the IWTE Task button in top menu bar, the separate files will be saved where specified in the task file.<br />
<br />
*If you have changed the number of bones used or their positions you will need to align all the other .cas anims used by the mesh, to do this use the skeleton replacement process explained below.<br />
<br />
==Skeleton Replacement (M2TW)==<br />
''RTW and packed M2TW skeletons can not be changed via this method.'' <br><br />
To replace the skeleton in M2TW where you have the set of full .cas anims that the game re-packs in the IWTE top menu bar go to:<br />
:Model Files > Cas Models > Skeleton Replacement<br />
<br />
*On the first prompt select the .cas file containing the bones in the basepose positions you want (probably the default or basepose .cas)<br />
*On the second prompt select the FOLDER that contains all the .cas files you want to change.<br />
<br />
The revised files will be saved in a sub folder of that folder called "updateskeletons" they will have the same names as the original .cas files and can be used to directly replace them. Please back-up your original files before doing this, and remember that other .cas/.mesh models may be using the same files, so you may need to create a separate folder and separate entry in descr_skeleton.txt etc.<br />
<br />
Adding bones should be straightforward, if you delete bones that had child bones then the result may be unpredictable and the resulting animations may need editing. <br />
<br />
===Bone Renaming Task===<br />
To rename the bones throughout a folder of full .cas animations use a task file. If you want to swap the names of bones you need to add an additional stage to re-name one bone to a temporary name, the example below shows how to swap bone_H_Saddle and bone_Spine names with each other:<br />
<task_id> cas_bone_name_change <br />
<directory_in> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka <br />
<directory_out> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka\changedbones <br />
<bone_name_change_list> <br />
bone_H_Saddle bone_H_Saddlex<br />
bone_Spine bone_H_Saddle<br />
bone_H_Saddlex bone_Spine<br />
<br />
* The task cas_bone_name_change changes a bone name (the NEW name must not already exist in a skeleton this is being applied to)<br />
* Directory in is optional, alternatively the task file can be placed in the directory and launched from there<br />
* Directory out is optional, if not given a sub-folder /updateskeletons will be created<br />
<br />
===Fixing Floating Units===<br />
For how to create the new basepose see [[Blender_hints_and_tips#Fixing_Floating_Units|Blender Hints and Tips]]<br />
<br />
Once you have the new basepose.cas you need to use it as the source to replace the bone positions in ALL of the animations the unit uses. For strat_models if you haven't already edited the .cas files of all the effected models include them in the skeleton replacement process too.<br />
<br />
==Weapon Animations (M2TW)==<br />
M2TW includes the possibility of having 'add-on' animations for weapons/shields. These are commonly listed in the model db file but rarely actually used.<br />
<br />
The advantage of properly using the weapon bones and anims instead of adding additional 'normal' bones to the skeleton is that the main skeleton remains 'standard' and does not cause the victim death anim bug when in battle with units whose skeletons have different numbers of bones!<br />
<br />
==IWTE Task File Options==<br />
===Text File Output===<br />
using <create_text_file> you can optionally generate .txt files that show, '''for information purposes only''', the content of the incoming .mesh/.cas files, the default option is <br />
<create_text_file> no #stops any text file being created <br />
<create_text_file> yes #creates a summary text file with header/trailer info, numbers of verts, texture and mesh names etc.<br />
<create_text_file> full #creates a full text file showing the interpretation of all the ints/floats etc in the file, with comments<br />
<br />
<br />
==External Links==<br />
* [https://www.blender.org/ Blender]<br />
* [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 IWTE Download]<br />
* [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing Discussion thread].<br />
<br />
[[Category:M2TW Modding]]<br />
[[Category:Blender]]<br />
[[Category:RTW Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=File:Export-cas-to-dae.jpg&diff=86518File:Export-cas-to-dae.jpg2023-06-09T10:35:20Z<p>Makanyane: Makanyane uploaded a new version of File:Export-cas-to-dae.jpg</p>
<hr />
<div>== Summary ==<br />
Buttons for exporting cas to dae in IWTE<br />
[[Category:M2TW Modding Images]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=IWTE_-_Units_in_Blender/Milkshape&diff=86517IWTE - Units in Blender/Milkshape2023-06-09T10:29:02Z<p>Makanyane: /* Export and Import M2TW .mesh Units */</p>
<hr />
<div>{{RTW M2TW Modding Logo}}<br />
{{IWTE}} <br />
__TOC__<br />
<br />
<big>Tips and instructions for working with RTW and M2TW battle map units and strat map characters via '''[[IWTE]]''' and '''[[Blender]]''' using the .dae format.</big> <br />
<br />
''The .dae files used for the Collada import/export can also be used with '''3ds Max''', however, max users absolutely have to use the [https://github.com/KhronosGroup/OpenCOLLADA/wiki/OpenCOLLADA-Tools '''OpenCollada plugin'''] and file format when importing/exporting files, max comes with the AutodeskCollada file format by default which neither imports nor exports files from the game correctly.''<br />
<br />
*IWTE download [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 here] - please use the latest version, early versions do not have this functionality.<br />
*For queries about these functions please ask [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing here].<br />
*For information on working on M2TW Settlements in Blender see [[IWTE - Settlements in Blender]]<br />
*For general tips on working with Blender see [[Blender hints and tips]]<br />
*For related info about .cas file structure see [[Cas Files|here]]<br />
<br />
<br />
==Export and Import M2TW .mesh Units==<br />
The most useful method of export involves matching the unit .mesh with its skeleton basepose and one or more animations. <br />
<br />
The drop-down menu in IWTE allows a unit .mesh to be merged with its basepose skeleton and one animation. A task file is needed to allow combining of animations and is the only way to also incorporate weapon animations.<br />
<br />
The drop-down menu options, and alternative IWTE Task button options are described below:<br />
<br />
[[File:Export-mesh-in-IWTE.jpg]]<br />
<br />
1. For Blender select the 'Unit mesh/skel/casanim to dae' option if you have the skeleton and animation versions unpacked using XIDX etc.<br><br />
2. For Blender select 'Unit mesh to dae' if you have the "full" version of the .cas basepose and animations (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br><br />
3. For Milkshape select the 'Unit mesh/skel/casanim to ms3d' option if you have the skeleton and animation versions unpacked using XIDX.<br><br />
4. For Blender select 'Unit mesh to ms3d' if you have the "full" version of the .cas basepose and animations (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br><br />
<br />
For all of the above options select the Double Textured option for unit meshes that have both a main and attachment texture. Select the Single Textured option for most other cases (e.g. standard mounts). <br />
<br />
You will be prompted to select the model .mesh first, then the basepose.cas for the skeleton (full cas version) or the unpacked skeleton file (unpacked version), and then an animation.cas file that is compatible with that skeleton (this should be in the same format as the skeleton, full or unpacked). <br />
<br />
===Export/Import by Task Process===<br />
To generate a .dae or .ms3d file from .mesh and .anims via the task process you will need a text file ending in _task.txt which starts with the mesh to dae command, run the task file by selecting the 'IWTE Task' > 'Select Task File' buttons. See example below for mesh_to_dae (the extra line breaks have been included just to show the body/weapon pairing):<br />
<br />
<task_id> mesh_to_extract <br />
<mesh_file_full_path_in> C:\M2TW\mods\devkit\data\animations\EB_Slinger\numidian_slinger_lod0.mesh <br />
<mesh_type> unit # line can be omitted if not also adding mount<br />
<mesh_double_texture> yes # or 'no' for single texture<br />
<cas_file_types_in_list> body weapon <br />
<br />
<directory_out> C:\M2TW\mods\devkit\data\animations\EB_Slinger <br />
<extract_file_name_out> EBslingerAnims.ms3d <br />
<extract_file_type> ms3d # or 'dae' for Blender<br />
<create_text_file> no # or 'yes' for summary files, 'full' for detailed files<br />
<task_file_full_path_out> C:\IWTE/IWTE_tasks/ms3d_to_mesh_slinger_task.txt # name for your return task file <br />
<br />
<cas_file_full_path_in_default_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_basepose.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas<br />
<br />
<cas_file_full_path_in_action_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_stand_A_idle.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas <br />
<br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_attack_missile_ready.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_attack_missile_ready.cas <br />
<br />
Please see the IWTE example control processes.txt file that ships with IWTE for further details/instructions. <br />
<br />
Running the task will generate you a .ms3d or .dae file with the animations joined together with an additional 'basepose' frame added at frame 0, to aid editing. The task will also auto-generate for a reverse dae/ms3d_to_mesh_****_task.txt file for you, this will list the start and end frame positions of all included animations and the names of all the files that will be re-created from your file. The names and frame positions can be edited to suit any changes you may require before running the return task.<br />
<br />
When creating the task files it is common to make minor errors in the file names/paths that mean IWTE cannot find all the elements! If you get an error message whilst running the task you'll get a chance to read the error message <br />
(which is easier in the command window) - you can then click "Ignore" to keep IWTE open, fix the name/path/file issue in the .txt file and try running the task again. The error message should indicate which file it couldn't find. If you forget to add the file extension and try and get it to open a folder you'll get an 'access violation' type message. <br />
<br />
For unit models that do not have any elements weighted to the 'weapon bones' you only need to run the process with <br />
<br />
<code> <cas_file_types_in_list> body </code> <br />
<br />
and supply the main skeleton basepose and animation.<br />
<br />
If the mesh has a weapon weighted to weapon bones use the ''body weapon'' example shown above.<br />
<br />
If the mesh has both a weapon weighted to weapon bones and a shield weighted to bone_shield etc use<br />
<br />
<code> <cas_file_types_in_list> body weapon shield</code> <br />
<br />
and supply the main skeleton, weapon animation and shield animation baseposes and animations in sets of three in order.<br />
<br />
Note: a lot of models that are apparently using ''fs_test_shield'' according to their [[battle_models.modeldb]] entry don't actually have anything weighted to bone_shield, making the shield 'anim' irrelevant.<br />
<br />
===UV Mapping for Double Texture Units===<br />
The mesh format for both double and singled textured units in M2TW is actually exactly the same with just one set of uv's that should range from 0 to 1.0 in both horizontal and vertical axis.<br />
<br />
If you assign two textures to a unit in the [[battle_models.modeldb]] then the game expands out the horizontal axis of the uv maps so that the area from 0 to 0.5 is used to cover 0 to 1 on the first texture, and the uv's from 0.5 to 1.0 on the horizontal axis are used to cover 0 to 1 on the second texture.<br />
<br />
Milkshape/.mesh converters use the texture (Main or Attachment) assigned to a mesh group to determine which section of the uv map the group's uv coordinates will be moved to. On write back the Main texture co-ordinates are compressed into the 0>0.5 area and Attachment texture co-ordinates compressed into the 0.5>1.0 section.<br />
<br />
The IWTE mesh to .dae for Blender process works differently. The texture assignment process is used purely so you can view the mesh groups with the correct relevant texture. The 0>1.0 horizontal uvs are expanded to 0>2.0 if you use the process for 'double textures' and then compressed back to 0>1.0 on the return to .mesh.<br />
<br />
In Blender the uv mapping to the two textures will look like the image below.<br />
<br />
[[File:Uvs for double textured units.jpg|400px]]<br />
<br />
To see the 2nd texture under its uv's open the sidebar (n) in the uv screen and select the 'repeat texture' button.<br />
In Blender it is possible to partially assign some triangles from a group to the 1st texture and some triangles to the 2nd texture, if you do that please remember to also move the uv's to the appropriate zone.<br />
<br />
===Scaling of Anims===<br />
The 'full' cas animations as supplied by Caliban should be regarded as scale 1.0. If you need to load from them to suit a skeleton that will be scaled by the game you need to give IWTE the skeleton scale in the mesh_to_extract task using the appropriate tag e.g.<br><br />
<skeleton_scale> <br><br />
<mount_skeleton_scale><br />
<br />
If you load from the unpacked skeleton and unpacked animation the scale will be read from the skeleton, so you do not need to add any further information.<br />
<br />
==Export and Import RTW Units & RTW/M2TW Strat Characters==<br />
<big>'''NOTE:''' IWTE now supports the full weighting allowed in Rome Remastered by default - to ensure you do not create RTW/M2TW cas files that exceed their games capabilities add '''<cas_mesh_format> rtw''' (or M2) to the task file.</big><br />
<br />
<br />
The process for this is similar to the .mesh Export/Import process described above, the button locations are shown in the below image: <br><br />
[[File:Export-cas-to-dae.jpg|Exporting animated cas to date with IWTE]]<br />
<br />
Use the 'Animated cas_mesh to dae' ('''3''') button if you have the full versions of the animation files, e.g the type supplied by Caliban that M2TW itself re-packs. The first file requested will be the .cas 'mesh', e.g. the one with the body model in it. The second file requested will be an animation file, if you do not have a suitable animation file just click 'Cancel' to close the selection screen. You can use the 'Animated cas/dae' button for all unit/character .cas files even if you aren't going to load an animation.<br />
<br />
If you are using RTW or are using M2TW but only have the skeleton/cas files unpacked using XIDX or other tools use the appropriate '* casmesh,skel,casanim to dae' button ('''1''' or '''2'''). The first file requested will again be the .cas 'mesh', e.g. model. The second file requested will be the skeleton file (as produced by XIDX/tool using extract_skeletons). The third file requested will be the .cas animation file (as produced by XIDX/tool using extract_animations). For Rome Remastered use the RTW button.<br />
<br />
These processes will generate a .dae file in a /to_dae sub-folder where your IWTE.exe is located. You will also have two task files generated in the /iwte_tasks sub-folder. The dae_to_cas one provides a default task file for reversing the process and generating new .cas files. The cas_to_dae one allows you to repeat the process you just did by simply running the IWTE Task, you can also adapt that task file to load multiple animations. The following is an example task file for cas_to_dae with multiple anims, and using rtw skeleton and anims, note that if the file path/name has spaces the entire path needs to be inside " ", also note the skeleton name does not have a file extension, direction of \ or / doesn't matter:<br />
<task_id> cas_to_dae <br />
<cas_mesh_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\to_dae/from_dae/ALEX_companion_cavalry_lod_1.cas <br />
<directory_out> I:\M2TW\M2TWcopy\mods\IWTE/to_dae <br />
<dae_file_name_out> ALEX_companion_cavalry_taunt.dae <br />
<cas_animation_file_format> rtw <br />
<create_text_file> yes <br />
<create_task_file_from_input> yes <br />
<task_file_full_path_out> I:\M2TW\M2TWcopy\mods\IWTE/IWTE_tasks/dae_to_cas_alextaunt_task.txt <br />
<skeleton_unpacked_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\testthings\animations\rome_animations/fs_swordsman<br />
<cas_file_full_path_in_action_list> <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_04 taunt 2.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_06 taunt 1.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_07 taunt 3.cas" <br />
<br />
To get amended units/anims back into game you will need to 'export' 'collada' from Blender or 3dsMax. The .dae file created will have the same structure whether you're converting to Mesh/Cas model, and Full/XIDX packable anims, so you need to use a task file to specify the format to be returned. The automatically generated return task file will have assumed you want the same format that went in, so the task file above will have generated this return file:<br />
<task_id> dae_to_cas # to read dae file and generate *.cas files<br />
<dae_file_full_path_in> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/ALEX_companion_cavalry_taunt.dae # *.dae file to read in. i.e. change to collada name exported from Blender<br />
<directory_out> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/from_dae # directory to put new created files<br />
<cas_mesh_file_name_out> alex_companion_cavalry_lod_1.cas # *.cas file to be created<br />
<cas_animation_file_format> rr # format of cas to be created by dae (rtw or full) <br />
<cas_unpacked_skeleton_scale> 1.0000 # cas unpacked skeleton scaling<br />
<overlap_frames> no # overlap frames selection used to create the dae (not used on import)<br />
<cas_file_name_out_anim_split_list> # cas anim files start and end frames<br />
"lid_57_04 taunt 2.cas" 1 79 <br />
"lid_57_06 taunt 1.cas" 80 162 <br />
"lid_57_07 taunt 3.cas" 163 237 <br />
#<end_frame> 237 # Last animated frame (use to see full animation in blender)<br />
<br />
If you're trying to convert format, instead of rr you need to use:<br />
<cas_animation_file_format> '''m2''' #for M2TW anims re-packable by XIDX<br />
<br />
<cas_animation_file_format> '''full''' #for M2TW anims re-packable by '''the game'''<br />
<br />
If you want an M2TW mesh back instead of a .cas model use the <br />
<task_id> '''dae_to_mesh'''<br />
instead of dae_to_cas<br />
<br />
Using the 'Animated dae to cas_mesh' ('''4''') button will generate a separate cas model file and a full version anim called _action. See below for animation file type details.<br />
<br />
Using the 'RTW object animation dae to cas' ('''5''') will produce a cas which includes both the model and the animation together, these are used only for [[Spot fx animations and effects|spot_fx]] items in RTW/RR.<br />
<br />
===Bone Weighting===<br />
RTW battle map units and strat models and M2TW strat models will generally have vertexes weighted to only one bone per vertex.<br />
<br />
If you convert a dae with multiple bone weights per vertex to cas with IWTE it will generate one cas with vertexes weighted to up to two bones, and one cas with the suffix "_lod1". The _lod1 cas can be renamed and used for RTW/M2TW. Ideally however you should limit the bone weight totals yourself so you can check how the model will behave in game when posed. See [[Blender_hints_and_tips#Bone_Assignment|Blender hints and tips]].<br />
<br />
For details on optionally creating a simple multi-weighted Section see: [[Model_flexi_m in RTW]]<br />
<br />
===Cas animation types===<br />
IWTE supports the full (never packed) versions of [[Cas Files|.cas files]], as supplied by Caliban and also the ones that have been generated from Pack files by XIDX, IWTE or similar tools. PLEASE NOTE: The RTW and M2TW anims generated from the pack files use a different format - DO NOT pack RTW types into M2TW packs or vice-versa - check that you are generating the correct type for the game you are going to use them in! Also do not attempt to re-pack the full type (where you can see the bone names) with XIDX or IWTE, they will only work if you have a full set including .evt files and let M2TW repack them from descr_skeleton.txt.<br />
<br />
==Units - General Tips==<br />
*Seams - To avoid seams in the finished model you CAN 'weld' vertexes that have disconnected uvs, in Blender use Mesh> Clean Up> Merge by Distance (without uvs ticked), and Shading> Smooth Faces. That will get you a shared normal that allows the area to look smooth. For the game IWTE will generate two vertexes at that point to preserve the uvs and set that normal as a custom normal for each.<br />
<br />
*Anims/skeletons - In Blender you can make any alteration you like to the 'Pose Mode' this will only affect the animation frames. Do NOT, unless you know what you are doing... move or edit the bones in the 'Armature' edit mode, this will affect the bone positions in the model/anim.cas produced, and will need to be matched to a skeleton with the same bone positions. If using the "full" M2TW cas anims that the game re-packs you can adjust the bone positions for a folder of .cas anims by using the skeleton replacement method detailed below. If using XIDX unpacked/packed anims you will need to change the skeleton using other tools.<br />
<br />
==Animations - General Tips==<br />
*Blender must be set to 20fps BEFORE importing a .dae with animation created by IWTE. To do this use the custom setting and type in 20. When you import a .dae file you should then see the keyframes neatly aligned with the time markers. See below:<br />
<br />
[[File:20fps.jpg|200px]]<br />
<br />
==Mesh Names/Comments==<br />
The Blender .dae interface does not support comments, so all the information about the mesh sections (primary/secondary weapons etc.) needs to go in the mesh name:<br />
<br />
*Section Naming - For Blender the full details of the group names are stored in the name itself. There isn't a comment section like milkshape. Things that need to go back into the game as separate sections, e.g. to denote primary weapons, or alternate versions, need a double underscore __ to show where the name should be split or a space included. For M2TW mesh sections that you want to be optional, use __opt at the end of the group name.<br />
<br />
==Siege/Artillery Engines==<br />
Siege/Artillery for both RTW and M2TW use the "full" cas anim versions (not packed/unpacked at any stage). For M2TW use the dedicated Model Files > Mesh Models > Siege Engine mesh to date for export and IWTE Task import process. For RTW use the Model Files > Cas Models > Animated cas_mesh to date, the RTW process seems to be quite straightforward as there isn't the mis-alignment between bone names and start poses that is present in M2TW.<br />
===M2TW Siege Engine Skeleton Alteration Example Process===<br />
*In top menu bar go to Model Files > Siege Engine mesh to dae > select mesh, then default cas then anim cas.<br />
:Check that the default .cas is actually the one listed as anim-default in descr_engine_skeleton.txt<br />
:also check that you're using an anim that is in use in game - some of the anims in the folder don't work.<br />
<br />
*IWTE will have written a .dae file in "to_dae" sub-folder below your .mesh model location.<br />
<br />
*Load in Blender by using 'file' 'import' 'collada'<br />
<br />
*Add bones as required to the Armature - note there should only be one top level bone, e.g bone_body add all other bones as child of this, or of existing bones.<br />
<br />
*Use 'weight paint' to assign vertices to bones as required.<br />
:Note - the .mesh file will only accept vertexes weighted to a max of 2 bones<br />
:use 'limit total' in 'weights' menu and set to 2 to avoid any verts weighted to 3 or more bones - (this is applied to selected verts only)<br />
:use 'normalise all' to make sure verts are fully weighted, use 'auto normalise' option whilst working also<br />
<br />
*change animation by switching to 'animation' layout in top bar<br />
:trigger Pose mode by clicking pose running man symbol within the Armature<br />
:if you can't see bones, or the summary when you click them, in main sidebar click the pose (running man) button, select "viewport display" and select the "in front" option<br />
:when you move a bone in the pose mode use shortcut "i" in main window to open keyframe dialogue and select "LocRot"<br />
:you can delete copy or move keyframes around for selected bones in the Dope Sheet section<br />
<br />
*Export collada - in settings check Anim is on Matrix option and 'keep keyframes' and 'all keyed curves' are selected.<br />
'''DO NOT USE IWTE Model Files > Siege Engine dae to mesh to convert back''' the dae doesn't include enough info to retain the three textures named in the mesh .<br />
<br />
*USE the "dae_to_mesh_*****_task.txt" that IWTE has written into the "IWTE_Tasks" sub-folder where your IWTE.exe is<br />
:change the .dae name you're reading in to the one you've just saved - change any other output names IF you need to<br />
:check the number of frames listed ties up with the end frame you set in collada.<br />
<br />
*Run the task file from the IWTE Task button in top menu bar, the separate files will be saved where specified in the task file.<br />
<br />
*If you have changed the number of bones used or their positions you will need to align all the other .cas anims used by the mesh, to do this use the skeleton replacement process explained below.<br />
<br />
==Skeleton Replacement (M2TW)==<br />
''RTW and packed M2TW skeletons can not be changed via this method.'' <br><br />
To replace the skeleton in M2TW where you have the set of full .cas anims that the game re-packs in the IWTE top menu bar go to:<br />
:Model Files > Cas Models > Skeleton Replacement<br />
<br />
*On the first prompt select the .cas file containing the bones in the basepose positions you want (probably the default or basepose .cas)<br />
*On the second prompt select the FOLDER that contains all the .cas files you want to change.<br />
<br />
The revised files will be saved in a sub folder of that folder called "updateskeletons" they will have the same names as the original .cas files and can be used to directly replace them. Please back-up your original files before doing this, and remember that other .cas/.mesh models may be using the same files, so you may need to create a separate folder and separate entry in descr_skeleton.txt etc.<br />
<br />
Adding bones should be straightforward, if you delete bones that had child bones then the result may be unpredictable and the resulting animations may need editing. <br />
<br />
===Bone Renaming Task===<br />
To rename the bones throughout a folder of full .cas animations use a task file. If you want to swap the names of bones you need to add an additional stage to re-name one bone to a temporary name, the example below shows how to swap bone_H_Saddle and bone_Spine names with each other:<br />
<task_id> cas_bone_name_change <br />
<directory_in> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka <br />
<directory_out> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka\changedbones <br />
<bone_name_change_list> <br />
bone_H_Saddle bone_H_Saddlex<br />
bone_Spine bone_H_Saddle<br />
bone_H_Saddlex bone_Spine<br />
<br />
* The task cas_bone_name_change changes a bone name (the NEW name must not already exist in a skeleton this is being applied to)<br />
* Directory in is optional, alternatively the task file can be placed in the directory and launched from there<br />
* Directory out is optional, if not given a sub-folder /updateskeletons will be created<br />
<br />
===Fixing Floating Units===<br />
For how to create the new basepose see [[Blender_hints_and_tips#Fixing_Floating_Units|Blender Hints and Tips]]<br />
<br />
Once you have the new basepose.cas you need to use it as the source to replace the bone positions in ALL of the animations the unit uses. For strat_models if you haven't already edited the .cas files of all the effected models include them in the skeleton replacement process too.<br />
<br />
==Weapon Animations (M2TW)==<br />
M2TW includes the possibility of having 'add-on' animations for weapons/shields. These are commonly listed in the model db file but rarely actually used.<br />
<br />
The advantage of properly using the weapon bones and anims instead of adding additional 'normal' bones to the skeleton is that the main skeleton remains 'standard' and does not cause the victim death anim bug when in battle with units whose skeletons have different numbers of bones!<br />
<br />
==IWTE Task File Options==<br />
===Text File Output===<br />
using <create_text_file> you can optionally generate .txt files that show, '''for information purposes only''', the content of the incoming .mesh/.cas files, the default option is <br />
<create_text_file> no #stops any text file being created <br />
<create_text_file> yes #creates a summary text file with header/trailer info, numbers of verts, texture and mesh names etc.<br />
<create_text_file> full #creates a full text file showing the interpretation of all the ints/floats etc in the file, with comments<br />
<br />
<br />
==External Links==<br />
* [https://www.blender.org/ Blender]<br />
* [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 IWTE Download]<br />
* [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing Discussion thread].<br />
<br />
[[Category:M2TW Modding]]<br />
[[Category:Blender]]<br />
[[Category:RTW Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=IWTE_-_Units_in_Blender/Milkshape&diff=86516IWTE - Units in Blender/Milkshape2023-06-09T10:17:46Z<p>Makanyane: /* UV Mapping for Double Texture Units */</p>
<hr />
<div>{{RTW M2TW Modding Logo}}<br />
{{IWTE}} <br />
__TOC__<br />
<br />
<big>Tips and instructions for working with RTW and M2TW battle map units and strat map characters via '''[[IWTE]]''' and '''[[Blender]]''' using the .dae format.</big> <br />
<br />
''The .dae files used for the Collada import/export can also be used with '''3ds Max''', however, max users absolutely have to use the [https://github.com/KhronosGroup/OpenCOLLADA/wiki/OpenCOLLADA-Tools '''OpenCollada plugin'''] and file format when importing/exporting files, max comes with the AutodeskCollada file format by default which neither imports nor exports files from the game correctly.''<br />
<br />
*IWTE download [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 here] - please use the latest version, early versions do not have this functionality.<br />
*For queries about these functions please ask [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing here].<br />
*For information on working on M2TW Settlements in Blender see [[IWTE - Settlements in Blender]]<br />
*For general tips on working with Blender see [[Blender hints and tips]]<br />
*For related info about .cas file structure see [[Cas Files|here]]<br />
<br />
<br />
==Export and Import M2TW .mesh Units==<br />
The most useful method of export involves matching the unit .mesh with its skeleton basepose and one or more animations. <br />
<br />
The drop-down menu in IWTE allows a unit .mesh to be merged with its basepose skeleton and one animation. A task file is needed to allow combining of animations and is the only way to also incorporate weapon animations.<br />
<br />
The drop-down menu options, and alternative IWTE Task button options are described below:<br />
<br />
[[File:Export-mesh-in-IWTE.jpg]]<br />
<br />
1. For Blender select the 'Unit mesh/skel/casanim to dae' option if you have the versions unpacked using XIDX.<br><br />
2. For Blender select 'Unit mesh to dae' if you have the "full" version of the .cas anims (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br><br />
3. For Milkshape select the 'Unit mesh/skel/casanim to ms3d' option if you have the versions unpacked using XIDX.<br><br />
4. For Blender select 'Unit mesh to ms3d' if you have the "full" version of the .cas anims (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br><br />
<br />
For all of the above options select the Double Textured option for unit meshes that have both a main and attachment texture. Select the Single Textured option for most other cases (e.g. standard mounts). <br />
<br />
You will be prompted to select the model .mesh first, then the basepose.cas for the skeleton (full cas version) or the unpacked skeleton file (unpacked version), and then an animation.cas file that is compatible with that skeleton (this should be in the same format as the skeleton, full or unpacked). <br />
<br />
===Export/Import by Task Process===<br />
To generate a .dae or .ms3d file from .mesh and .anims via the task process you will need a text file ending in _task.txt which starts with the mesh to dae command, run the task file by selecting the 'IWTE Task' > 'Select Task File' buttons. See example below for mesh_to_dae (the extra line breaks have been included just to show the body/weapon pairing):<br />
<br />
<task_id> mesh_to_extract <br />
<mesh_file_full_path_in> C:\M2TW\mods\devkit\data\animations\EB_Slinger\numidian_slinger_lod0.mesh <br />
<mesh_type> unit # line can be omitted if not also adding mount<br />
<mesh_double_texture> yes # or 'no' for single texture<br />
<cas_file_types_in_list> body weapon <br />
<br />
<directory_out> C:\M2TW\mods\devkit\data\animations\EB_Slinger <br />
<extract_file_name_out> EBslingerAnims.ms3d <br />
<extract_file_type> ms3d # or 'dae' for Blender<br />
<create_text_file> no # or 'yes' for summary files, 'full' for detailed files<br />
<task_file_full_path_out> C:\IWTE/IWTE_tasks/ms3d_to_mesh_slinger_task.txt # name for your return task file <br />
<br />
<cas_file_full_path_in_default_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_basepose.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas<br />
<br />
<cas_file_full_path_in_action_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_stand_A_idle.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas <br />
<br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_attack_missile_ready.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_attack_missile_ready.cas <br />
<br />
Please see the IWTE example control processes.txt file that ships with IWTE for further details/instructions. <br />
<br />
Running the task will generate you a .ms3d or .dae file with the animations joined together with an additional 'basepose' frame added at frame 0, to aid editing. The task will also auto-generate for a reverse dae/ms3d_to_mesh_****_task.txt file for you, this will list the start and end frame positions of all included animations and the names of all the files that will be re-created from your file. The names and frame positions can be edited to suit any changes you may require before running the return task.<br />
<br />
When creating the task files it is common to make minor errors in the file names/paths that mean IWTE cannot find all the elements! If you get an error message whilst running the task you'll get a chance to read the error message <br />
(which is easier in the command window) - you can then click "Ignore" to keep IWTE open, fix the name/path/file issue in the .txt file and try running the task again. The error message should indicate which file it couldn't find. If you forget to add the file extension and try and get it to open a folder you'll get an 'access violation' type message. <br />
<br />
For unit models that do not have any elements weighted to the 'weapon bones' you only need to run the process with <br />
<br />
<code> <cas_file_types_in_list> body </code> <br />
<br />
and supply the main skeleton basepose and animation.<br />
<br />
If the mesh has a weapon weighted to weapon bones use the ''body weapon'' example shown above.<br />
<br />
If the mesh has both a weapon weighted to weapon bones and a shield weighted to bone_shield etc use<br />
<br />
<code> <cas_file_types_in_list> body weapon shield</code> <br />
<br />
and supply the main skeleton, weapon animation and shield animation baseposes and animations in sets of three in order.<br />
<br />
Note: a lot of models that are apparently using ''fs_test_shield'' according to their [[battle_models.modeldb]] entry don't actually have anything weighted to bone_shield, making the shield 'anim' irrelevant.<br />
<br />
===UV Mapping for Double Texture Units===<br />
The mesh format for both double and singled textured units in M2TW is actually exactly the same with just one set of uv's that should range from 0 to 1.0 in both horizontal and vertical axis.<br />
<br />
If you assign two textures to a unit in the [[battle_models.modeldb]] then the game expands out the horizontal axis of the uv maps so that the area from 0 to 0.5 is used to cover 0 to 1 on the first texture, and the uv's from 0.5 to 1.0 on the horizontal axis are used to cover 0 to 1 on the second texture.<br />
<br />
Milkshape/.mesh converters use the texture (Main or Attachment) assigned to a mesh group to determine which section of the uv map the group's uv coordinates will be moved to. On write back the Main texture co-ordinates are compressed into the 0>0.5 area and Attachment texture co-ordinates compressed into the 0.5>1.0 section.<br />
<br />
The IWTE mesh to .dae for Blender process works differently. The texture assignment process is used purely so you can view the mesh groups with the correct relevant texture. The 0>1.0 horizontal uvs are expanded to 0>2.0 if you use the process for 'double textures' and then compressed back to 0>1.0 on the return to .mesh.<br />
<br />
In Blender the uv mapping to the two textures will look like the image below.<br />
<br />
[[File:Uvs for double textured units.jpg|400px]]<br />
<br />
To see the 2nd texture under its uv's open the sidebar (n) in the uv screen and select the 'repeat texture' button.<br />
In Blender it is possible to partially assign some triangles from a group to the 1st texture and some triangles to the 2nd texture, if you do that please remember to also move the uv's to the appropriate zone.<br />
<br />
===Scaling of Anims===<br />
The 'full' cas animations as supplied by Caliban should be regarded as scale 1.0. If you need to load from them to suit a skeleton that will be scaled by the game you need to give IWTE the skeleton scale in the mesh_to_extract task using the appropriate tag e.g.<br><br />
<skeleton_scale> <br><br />
<mount_skeleton_scale><br />
<br />
If you load from the unpacked skeleton and unpacked animation the scale will be read from the skeleton, so you do not need to add any further information.<br />
<br />
==Export and Import RTW Units & RTW/M2TW Strat Characters==<br />
<big>'''NOTE:''' IWTE now supports the full weighting allowed in Rome Remastered by default - to ensure you do not create RTW/M2TW cas files that exceed their games capabilities add '''<cas_mesh_format> rtw''' (or M2) to the task file.</big><br />
<br />
<br />
The process for this is similar to the .mesh Export/Import process described above, the button locations are shown in the below image: <br><br />
[[File:Export-cas-to-dae.jpg|Exporting animated cas to date with IWTE]]<br />
<br />
Use the 'Animated cas_mesh to dae' ('''3''') button if you have the full versions of the animation files, e.g the type supplied by Caliban that M2TW itself re-packs. The first file requested will be the .cas 'mesh', e.g. the one with the body model in it. The second file requested will be an animation file, if you do not have a suitable animation file just click 'Cancel' to close the selection screen. You can use the 'Animated cas/dae' button for all unit/character .cas files even if you aren't going to load an animation.<br />
<br />
If you are using RTW or are using M2TW but only have the skeleton/cas files unpacked using XIDX or other tools use the appropriate '* casmesh,skel,casanim to dae' button ('''1''' or '''2'''). The first file requested will again be the .cas 'mesh', e.g. model. The second file requested will be the skeleton file (as produced by XIDX/tool using extract_skeletons). The third file requested will be the .cas animation file (as produced by XIDX/tool using extract_animations). For Rome Remastered use the RTW button.<br />
<br />
These processes will generate a .dae file in a /to_dae sub-folder where your IWTE.exe is located. You will also have two task files generated in the /iwte_tasks sub-folder. The dae_to_cas one provides a default task file for reversing the process and generating new .cas files. The cas_to_dae one allows you to repeat the process you just did by simply running the IWTE Task, you can also adapt that task file to load multiple animations. The following is an example task file for cas_to_dae with multiple anims, and using rtw skeleton and anims, note that if the file path/name has spaces the entire path needs to be inside " ", also note the skeleton name does not have a file extension, direction of \ or / doesn't matter:<br />
<task_id> cas_to_dae <br />
<cas_mesh_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\to_dae/from_dae/ALEX_companion_cavalry_lod_1.cas <br />
<directory_out> I:\M2TW\M2TWcopy\mods\IWTE/to_dae <br />
<dae_file_name_out> ALEX_companion_cavalry_taunt.dae <br />
<cas_animation_file_format> rtw <br />
<create_text_file> yes <br />
<create_task_file_from_input> yes <br />
<task_file_full_path_out> I:\M2TW\M2TWcopy\mods\IWTE/IWTE_tasks/dae_to_cas_alextaunt_task.txt <br />
<skeleton_unpacked_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\testthings\animations\rome_animations/fs_swordsman<br />
<cas_file_full_path_in_action_list> <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_04 taunt 2.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_06 taunt 1.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_07 taunt 3.cas" <br />
<br />
To get amended units/anims back into game you will need to 'export' 'collada' from Blender or 3dsMax. The .dae file created will have the same structure whether you're converting to Mesh/Cas model, and Full/XIDX packable anims, so you need to use a task file to specify the format to be returned. The automatically generated return task file will have assumed you want the same format that went in, so the task file above will have generated this return file:<br />
<task_id> dae_to_cas # to read dae file and generate *.cas files<br />
<dae_file_full_path_in> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/ALEX_companion_cavalry_taunt.dae # *.dae file to read in. i.e. change to collada name exported from Blender<br />
<directory_out> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/from_dae # directory to put new created files<br />
<cas_mesh_file_name_out> alex_companion_cavalry_lod_1.cas # *.cas file to be created<br />
<cas_animation_file_format> rr # format of cas to be created by dae (rtw or full) <br />
<cas_unpacked_skeleton_scale> 1.0000 # cas unpacked skeleton scaling<br />
<overlap_frames> no # overlap frames selection used to create the dae (not used on import)<br />
<cas_file_name_out_anim_split_list> # cas anim files start and end frames<br />
"lid_57_04 taunt 2.cas" 1 79 <br />
"lid_57_06 taunt 1.cas" 80 162 <br />
"lid_57_07 taunt 3.cas" 163 237 <br />
#<end_frame> 237 # Last animated frame (use to see full animation in blender)<br />
<br />
If you're trying to convert format, instead of rr you need to use:<br />
<cas_animation_file_format> '''m2''' #for M2TW anims re-packable by XIDX<br />
<br />
<cas_animation_file_format> '''full''' #for M2TW anims re-packable by '''the game'''<br />
<br />
If you want an M2TW mesh back instead of a .cas model use the <br />
<task_id> '''dae_to_mesh'''<br />
instead of dae_to_cas<br />
<br />
Using the 'Animated dae to cas_mesh' ('''4''') button will generate a separate cas model file and a full version anim called _action. See below for animation file type details.<br />
<br />
Using the 'RTW object animation dae to cas' ('''5''') will produce a cas which includes both the model and the animation together, these are used only for [[Spot fx animations and effects|spot_fx]] items in RTW/RR.<br />
<br />
===Bone Weighting===<br />
RTW battle map units and strat models and M2TW strat models will generally have vertexes weighted to only one bone per vertex.<br />
<br />
If you convert a dae with multiple bone weights per vertex to cas with IWTE it will generate one cas with vertexes weighted to up to two bones, and one cas with the suffix "_lod1". The _lod1 cas can be renamed and used for RTW/M2TW. Ideally however you should limit the bone weight totals yourself so you can check how the model will behave in game when posed. See [[Blender_hints_and_tips#Bone_Assignment|Blender hints and tips]].<br />
<br />
For details on optionally creating a simple multi-weighted Section see: [[Model_flexi_m in RTW]]<br />
<br />
===Cas animation types===<br />
IWTE supports the full (never packed) versions of [[Cas Files|.cas files]], as supplied by Caliban and also the ones that have been generated from Pack files by XIDX, IWTE or similar tools. PLEASE NOTE: The RTW and M2TW anims generated from the pack files use a different format - DO NOT pack RTW types into M2TW packs or vice-versa - check that you are generating the correct type for the game you are going to use them in! Also do not attempt to re-pack the full type (where you can see the bone names) with XIDX or IWTE, they will only work if you have a full set including .evt files and let M2TW repack them from descr_skeleton.txt.<br />
<br />
==Units - General Tips==<br />
*Seams - To avoid seams in the finished model you CAN 'weld' vertexes that have disconnected uvs, in Blender use Mesh> Clean Up> Merge by Distance (without uvs ticked), and Shading> Smooth Faces. That will get you a shared normal that allows the area to look smooth. For the game IWTE will generate two vertexes at that point to preserve the uvs and set that normal as a custom normal for each.<br />
<br />
*Anims/skeletons - In Blender you can make any alteration you like to the 'Pose Mode' this will only affect the animation frames. Do NOT, unless you know what you are doing... move or edit the bones in the 'Armature' edit mode, this will affect the bone positions in the model/anim.cas produced, and will need to be matched to a skeleton with the same bone positions. If using the "full" M2TW cas anims that the game re-packs you can adjust the bone positions for a folder of .cas anims by using the skeleton replacement method detailed below. If using XIDX unpacked/packed anims you will need to change the skeleton using other tools.<br />
<br />
==Animations - General Tips==<br />
*Blender must be set to 20fps BEFORE importing a .dae with animation created by IWTE. To do this use the custom setting and type in 20. When you import a .dae file you should then see the keyframes neatly aligned with the time markers. See below:<br />
<br />
[[File:20fps.jpg|200px]]<br />
<br />
==Mesh Names/Comments==<br />
The Blender .dae interface does not support comments, so all the information about the mesh sections (primary/secondary weapons etc.) needs to go in the mesh name:<br />
<br />
*Section Naming - For Blender the full details of the group names are stored in the name itself. There isn't a comment section like milkshape. Things that need to go back into the game as separate sections, e.g. to denote primary weapons, or alternate versions, need a double underscore __ to show where the name should be split or a space included. For M2TW mesh sections that you want to be optional, use __opt at the end of the group name.<br />
<br />
==Siege/Artillery Engines==<br />
Siege/Artillery for both RTW and M2TW use the "full" cas anim versions (not packed/unpacked at any stage). For M2TW use the dedicated Model Files > Mesh Models > Siege Engine mesh to date for export and IWTE Task import process. For RTW use the Model Files > Cas Models > Animated cas_mesh to date, the RTW process seems to be quite straightforward as there isn't the mis-alignment between bone names and start poses that is present in M2TW.<br />
===M2TW Siege Engine Skeleton Alteration Example Process===<br />
*In top menu bar go to Model Files > Siege Engine mesh to dae > select mesh, then default cas then anim cas.<br />
:Check that the default .cas is actually the one listed as anim-default in descr_engine_skeleton.txt<br />
:also check that you're using an anim that is in use in game - some of the anims in the folder don't work.<br />
<br />
*IWTE will have written a .dae file in "to_dae" sub-folder below your .mesh model location.<br />
<br />
*Load in Blender by using 'file' 'import' 'collada'<br />
<br />
*Add bones as required to the Armature - note there should only be one top level bone, e.g bone_body add all other bones as child of this, or of existing bones.<br />
<br />
*Use 'weight paint' to assign vertices to bones as required.<br />
:Note - the .mesh file will only accept vertexes weighted to a max of 2 bones<br />
:use 'limit total' in 'weights' menu and set to 2 to avoid any verts weighted to 3 or more bones - (this is applied to selected verts only)<br />
:use 'normalise all' to make sure verts are fully weighted, use 'auto normalise' option whilst working also<br />
<br />
*change animation by switching to 'animation' layout in top bar<br />
:trigger Pose mode by clicking pose running man symbol within the Armature<br />
:if you can't see bones, or the summary when you click them, in main sidebar click the pose (running man) button, select "viewport display" and select the "in front" option<br />
:when you move a bone in the pose mode use shortcut "i" in main window to open keyframe dialogue and select "LocRot"<br />
:you can delete copy or move keyframes around for selected bones in the Dope Sheet section<br />
<br />
*Export collada - in settings check Anim is on Matrix option and 'keep keyframes' and 'all keyed curves' are selected.<br />
'''DO NOT USE IWTE Model Files > Siege Engine dae to mesh to convert back''' the dae doesn't include enough info to retain the three textures named in the mesh .<br />
<br />
*USE the "dae_to_mesh_*****_task.txt" that IWTE has written into the "IWTE_Tasks" sub-folder where your IWTE.exe is<br />
:change the .dae name you're reading in to the one you've just saved - change any other output names IF you need to<br />
:check the number of frames listed ties up with the end frame you set in collada.<br />
<br />
*Run the task file from the IWTE Task button in top menu bar, the separate files will be saved where specified in the task file.<br />
<br />
*If you have changed the number of bones used or their positions you will need to align all the other .cas anims used by the mesh, to do this use the skeleton replacement process explained below.<br />
<br />
==Skeleton Replacement (M2TW)==<br />
''RTW and packed M2TW skeletons can not be changed via this method.'' <br><br />
To replace the skeleton in M2TW where you have the set of full .cas anims that the game re-packs in the IWTE top menu bar go to:<br />
:Model Files > Cas Models > Skeleton Replacement<br />
<br />
*On the first prompt select the .cas file containing the bones in the basepose positions you want (probably the default or basepose .cas)<br />
*On the second prompt select the FOLDER that contains all the .cas files you want to change.<br />
<br />
The revised files will be saved in a sub folder of that folder called "updateskeletons" they will have the same names as the original .cas files and can be used to directly replace them. Please back-up your original files before doing this, and remember that other .cas/.mesh models may be using the same files, so you may need to create a separate folder and separate entry in descr_skeleton.txt etc.<br />
<br />
Adding bones should be straightforward, if you delete bones that had child bones then the result may be unpredictable and the resulting animations may need editing. <br />
<br />
===Bone Renaming Task===<br />
To rename the bones throughout a folder of full .cas animations use a task file. If you want to swap the names of bones you need to add an additional stage to re-name one bone to a temporary name, the example below shows how to swap bone_H_Saddle and bone_Spine names with each other:<br />
<task_id> cas_bone_name_change <br />
<directory_in> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka <br />
<directory_out> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka\changedbones <br />
<bone_name_change_list> <br />
bone_H_Saddle bone_H_Saddlex<br />
bone_Spine bone_H_Saddle<br />
bone_H_Saddlex bone_Spine<br />
<br />
* The task cas_bone_name_change changes a bone name (the NEW name must not already exist in a skeleton this is being applied to)<br />
* Directory in is optional, alternatively the task file can be placed in the directory and launched from there<br />
* Directory out is optional, if not given a sub-folder /updateskeletons will be created<br />
<br />
===Fixing Floating Units===<br />
For how to create the new basepose see [[Blender_hints_and_tips#Fixing_Floating_Units|Blender Hints and Tips]]<br />
<br />
Once you have the new basepose.cas you need to use it as the source to replace the bone positions in ALL of the animations the unit uses. For strat_models if you haven't already edited the .cas files of all the effected models include them in the skeleton replacement process too.<br />
<br />
==Weapon Animations (M2TW)==<br />
M2TW includes the possibility of having 'add-on' animations for weapons/shields. These are commonly listed in the model db file but rarely actually used.<br />
<br />
The advantage of properly using the weapon bones and anims instead of adding additional 'normal' bones to the skeleton is that the main skeleton remains 'standard' and does not cause the victim death anim bug when in battle with units whose skeletons have different numbers of bones!<br />
<br />
==IWTE Task File Options==<br />
===Text File Output===<br />
using <create_text_file> you can optionally generate .txt files that show, '''for information purposes only''', the content of the incoming .mesh/.cas files, the default option is <br />
<create_text_file> no #stops any text file being created <br />
<create_text_file> yes #creates a summary text file with header/trailer info, numbers of verts, texture and mesh names etc.<br />
<create_text_file> full #creates a full text file showing the interpretation of all the ints/floats etc in the file, with comments<br />
<br />
<br />
==External Links==<br />
* [https://www.blender.org/ Blender]<br />
* [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 IWTE Download]<br />
* [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing Discussion thread].<br />
<br />
[[Category:M2TW Modding]]<br />
[[Category:Blender]]<br />
[[Category:RTW Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=IWTE_-_Units_in_Blender/Milkshape&diff=86515IWTE - Units in Blender/Milkshape2023-06-09T10:15:27Z<p>Makanyane: /* Export/Import by Task Process */</p>
<hr />
<div>{{RTW M2TW Modding Logo}}<br />
{{IWTE}} <br />
__TOC__<br />
<br />
<big>Tips and instructions for working with RTW and M2TW battle map units and strat map characters via '''[[IWTE]]''' and '''[[Blender]]''' using the .dae format.</big> <br />
<br />
''The .dae files used for the Collada import/export can also be used with '''3ds Max''', however, max users absolutely have to use the [https://github.com/KhronosGroup/OpenCOLLADA/wiki/OpenCOLLADA-Tools '''OpenCollada plugin'''] and file format when importing/exporting files, max comes with the AutodeskCollada file format by default which neither imports nor exports files from the game correctly.''<br />
<br />
*IWTE download [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 here] - please use the latest version, early versions do not have this functionality.<br />
*For queries about these functions please ask [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing here].<br />
*For information on working on M2TW Settlements in Blender see [[IWTE - Settlements in Blender]]<br />
*For general tips on working with Blender see [[Blender hints and tips]]<br />
*For related info about .cas file structure see [[Cas Files|here]]<br />
<br />
<br />
==Export and Import M2TW .mesh Units==<br />
The most useful method of export involves matching the unit .mesh with its skeleton basepose and one or more animations. <br />
<br />
The drop-down menu in IWTE allows a unit .mesh to be merged with its basepose skeleton and one animation. A task file is needed to allow combining of animations and is the only way to also incorporate weapon animations.<br />
<br />
The drop-down menu options, and alternative IWTE Task button options are described below:<br />
<br />
[[File:Export-mesh-in-IWTE.jpg]]<br />
<br />
1. For Blender select the 'Unit mesh/skel/casanim to dae' option if you have the versions unpacked using XIDX.<br><br />
2. For Blender select 'Unit mesh to dae' if you have the "full" version of the .cas anims (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br><br />
3. For Milkshape select the 'Unit mesh/skel/casanim to ms3d' option if you have the versions unpacked using XIDX.<br><br />
4. For Blender select 'Unit mesh to ms3d' if you have the "full" version of the .cas anims (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br><br />
<br />
For all of the above options select the Double Textured option for unit meshes that have both a main and attachment texture. Select the Single Textured option for most other cases (e.g. standard mounts). <br />
<br />
You will be prompted to select the model .mesh first, then the basepose.cas for the skeleton (full cas version) or the unpacked skeleton file (unpacked version), and then an animation.cas file that is compatible with that skeleton (this should be in the same format as the skeleton, full or unpacked). <br />
<br />
===Export/Import by Task Process===<br />
To generate a .dae or .ms3d file from .mesh and .anims via the task process you will need a text file ending in _task.txt which starts with the mesh to dae command, run the task file by selecting the 'IWTE Task' > 'Select Task File' buttons. See example below for mesh_to_dae (the extra line breaks have been included just to show the body/weapon pairing):<br />
<br />
<task_id> mesh_to_extract <br />
<mesh_file_full_path_in> C:\M2TW\mods\devkit\data\animations\EB_Slinger\numidian_slinger_lod0.mesh <br />
<mesh_type> unit # line can be omitted if not also adding mount<br />
<mesh_double_texture> yes # or 'no' for single texture<br />
<cas_file_types_in_list> body weapon <br />
<br />
<directory_out> C:\M2TW\mods\devkit\data\animations\EB_Slinger <br />
<extract_file_name_out> EBslingerAnims.ms3d <br />
<extract_file_type> ms3d # or 'dae' for Blender<br />
<create_text_file> no # or 'yes' for summary files, 'full' for detailed files<br />
<task_file_full_path_out> C:\IWTE/IWTE_tasks/ms3d_to_mesh_slinger_task.txt # name for your return task file <br />
<br />
<cas_file_full_path_in_default_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_basepose.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas<br />
<br />
<cas_file_full_path_in_action_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_stand_A_idle.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas <br />
<br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_attack_missile_ready.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_attack_missile_ready.cas <br />
<br />
Please see the IWTE example control processes.txt file that ships with IWTE for further details/instructions. <br />
<br />
Running the task will generate you a .ms3d or .dae file with the animations joined together with an additional 'basepose' frame added at frame 0, to aid editing. The task will also auto-generate for a reverse dae/ms3d_to_mesh_****_task.txt file for you, this will list the start and end frame positions of all included animations and the names of all the files that will be re-created from your file. The names and frame positions can be edited to suit any changes you may require before running the return task.<br />
<br />
When creating the task files it is common to make minor errors in the file names/paths that mean IWTE cannot find all the elements! If you get an error message whilst running the task you'll get a chance to read the error message <br />
(which is easier in the command window) - you can then click "Ignore" to keep IWTE open, fix the name/path/file issue in the .txt file and try running the task again. The error message should indicate which file it couldn't find. If you forget to add the file extension and try and get it to open a folder you'll get an 'access violation' type message. <br />
<br />
For unit models that do not have any elements weighted to the 'weapon bones' you only need to run the process with <br />
<br />
<code> <cas_file_types_in_list> body </code> <br />
<br />
and supply the main skeleton basepose and animation.<br />
<br />
If the mesh has a weapon weighted to weapon bones use the ''body weapon'' example shown above.<br />
<br />
If the mesh has both a weapon weighted to weapon bones and a shield weighted to bone_shield etc use<br />
<br />
<code> <cas_file_types_in_list> body weapon shield</code> <br />
<br />
and supply the main skeleton, weapon animation and shield animation baseposes and animations in sets of three in order.<br />
<br />
Note: a lot of models that are apparently using ''fs_test_shield'' according to their [[battle_models.modeldb]] entry don't actually have anything weighted to bone_shield, making the shield 'anim' irrelevant.<br />
<br />
===UV Mapping for Double Texture Units===<br />
The mesh format for both double and singled textured units in M2TW is actually exactly the same with just one set of uv's that should range from 0 to 1.0 in both horizontal and vertical axis.<br />
<br />
If you assign two textures to a unit in the [[battle_models.modeldb]] then the game expands out the horizontal axis of the uv maps so that the area from 0 to 0.5 is used to cover 0 to 1 on the first texture, and the uv's from 0.5 to 1.0 on the horizontal axis are used to cover 0 to 1 on the second texture.<br />
<br />
Milkshape/.mesh converters use the texture (Main or Attachment) assigned to a mesh group to determine which section of the uv map the group's uv coordinates will be moved to, with Main texture co-ordinates compressed into the 0>0.5 area and Attachment texture co-ordinates compressed into the 0.75>1.0 section.<br />
<br />
The IWTE mesh to .dae for Blender process works differently. The texture assignment process is used purely so you can view the mesh groups with the correct relevant texture. The 0>1.0 horizontal uvs are expanded to 0>2.0 if you use the process for 'double textures' and then compressed back to 0>1.0 on the return to .mesh.<br />
<br />
In Blender the uv mapping to the two textures will look like the image below.<br />
<br />
[[File:Uvs for double textured units.jpg|400px]]<br />
<br />
To see the 2nd texture under its uv's open the sidebar (n) in the uv screen and select the 'repeat texture' button.<br />
In Blender it is possible to partially assign some triangles from a group to the 1st texture and some triangles to the 2nd texture, if you do that please remember to also move the uv's to the appropriate zone.<br />
<br />
===Scaling of Anims===<br />
The 'full' cas animations as supplied by Caliban should be regarded as scale 1.0. If you need to load from them to suit a skeleton that will be scaled by the game you need to give IWTE the skeleton scale in the mesh_to_extract task using the appropriate tag e.g.<br><br />
<skeleton_scale> <br><br />
<mount_skeleton_scale><br />
<br />
If you load from the unpacked skeleton and unpacked animation the scale will be read from the skeleton, so you do not need to add any further information.<br />
<br />
==Export and Import RTW Units & RTW/M2TW Strat Characters==<br />
<big>'''NOTE:''' IWTE now supports the full weighting allowed in Rome Remastered by default - to ensure you do not create RTW/M2TW cas files that exceed their games capabilities add '''<cas_mesh_format> rtw''' (or M2) to the task file.</big><br />
<br />
<br />
The process for this is similar to the .mesh Export/Import process described above, the button locations are shown in the below image: <br><br />
[[File:Export-cas-to-dae.jpg|Exporting animated cas to date with IWTE]]<br />
<br />
Use the 'Animated cas_mesh to dae' ('''3''') button if you have the full versions of the animation files, e.g the type supplied by Caliban that M2TW itself re-packs. The first file requested will be the .cas 'mesh', e.g. the one with the body model in it. The second file requested will be an animation file, if you do not have a suitable animation file just click 'Cancel' to close the selection screen. You can use the 'Animated cas/dae' button for all unit/character .cas files even if you aren't going to load an animation.<br />
<br />
If you are using RTW or are using M2TW but only have the skeleton/cas files unpacked using XIDX or other tools use the appropriate '* casmesh,skel,casanim to dae' button ('''1''' or '''2'''). The first file requested will again be the .cas 'mesh', e.g. model. The second file requested will be the skeleton file (as produced by XIDX/tool using extract_skeletons). The third file requested will be the .cas animation file (as produced by XIDX/tool using extract_animations). For Rome Remastered use the RTW button.<br />
<br />
These processes will generate a .dae file in a /to_dae sub-folder where your IWTE.exe is located. You will also have two task files generated in the /iwte_tasks sub-folder. The dae_to_cas one provides a default task file for reversing the process and generating new .cas files. The cas_to_dae one allows you to repeat the process you just did by simply running the IWTE Task, you can also adapt that task file to load multiple animations. The following is an example task file for cas_to_dae with multiple anims, and using rtw skeleton and anims, note that if the file path/name has spaces the entire path needs to be inside " ", also note the skeleton name does not have a file extension, direction of \ or / doesn't matter:<br />
<task_id> cas_to_dae <br />
<cas_mesh_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\to_dae/from_dae/ALEX_companion_cavalry_lod_1.cas <br />
<directory_out> I:\M2TW\M2TWcopy\mods\IWTE/to_dae <br />
<dae_file_name_out> ALEX_companion_cavalry_taunt.dae <br />
<cas_animation_file_format> rtw <br />
<create_text_file> yes <br />
<create_task_file_from_input> yes <br />
<task_file_full_path_out> I:\M2TW\M2TWcopy\mods\IWTE/IWTE_tasks/dae_to_cas_alextaunt_task.txt <br />
<skeleton_unpacked_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\testthings\animations\rome_animations/fs_swordsman<br />
<cas_file_full_path_in_action_list> <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_04 taunt 2.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_06 taunt 1.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_07 taunt 3.cas" <br />
<br />
To get amended units/anims back into game you will need to 'export' 'collada' from Blender or 3dsMax. The .dae file created will have the same structure whether you're converting to Mesh/Cas model, and Full/XIDX packable anims, so you need to use a task file to specify the format to be returned. The automatically generated return task file will have assumed you want the same format that went in, so the task file above will have generated this return file:<br />
<task_id> dae_to_cas # to read dae file and generate *.cas files<br />
<dae_file_full_path_in> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/ALEX_companion_cavalry_taunt.dae # *.dae file to read in. i.e. change to collada name exported from Blender<br />
<directory_out> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/from_dae # directory to put new created files<br />
<cas_mesh_file_name_out> alex_companion_cavalry_lod_1.cas # *.cas file to be created<br />
<cas_animation_file_format> rr # format of cas to be created by dae (rtw or full) <br />
<cas_unpacked_skeleton_scale> 1.0000 # cas unpacked skeleton scaling<br />
<overlap_frames> no # overlap frames selection used to create the dae (not used on import)<br />
<cas_file_name_out_anim_split_list> # cas anim files start and end frames<br />
"lid_57_04 taunt 2.cas" 1 79 <br />
"lid_57_06 taunt 1.cas" 80 162 <br />
"lid_57_07 taunt 3.cas" 163 237 <br />
#<end_frame> 237 # Last animated frame (use to see full animation in blender)<br />
<br />
If you're trying to convert format, instead of rr you need to use:<br />
<cas_animation_file_format> '''m2''' #for M2TW anims re-packable by XIDX<br />
<br />
<cas_animation_file_format> '''full''' #for M2TW anims re-packable by '''the game'''<br />
<br />
If you want an M2TW mesh back instead of a .cas model use the <br />
<task_id> '''dae_to_mesh'''<br />
instead of dae_to_cas<br />
<br />
Using the 'Animated dae to cas_mesh' ('''4''') button will generate a separate cas model file and a full version anim called _action. See below for animation file type details.<br />
<br />
Using the 'RTW object animation dae to cas' ('''5''') will produce a cas which includes both the model and the animation together, these are used only for [[Spot fx animations and effects|spot_fx]] items in RTW/RR.<br />
<br />
===Bone Weighting===<br />
RTW battle map units and strat models and M2TW strat models will generally have vertexes weighted to only one bone per vertex.<br />
<br />
If you convert a dae with multiple bone weights per vertex to cas with IWTE it will generate one cas with vertexes weighted to up to two bones, and one cas with the suffix "_lod1". The _lod1 cas can be renamed and used for RTW/M2TW. Ideally however you should limit the bone weight totals yourself so you can check how the model will behave in game when posed. See [[Blender_hints_and_tips#Bone_Assignment|Blender hints and tips]].<br />
<br />
For details on optionally creating a simple multi-weighted Section see: [[Model_flexi_m in RTW]]<br />
<br />
===Cas animation types===<br />
IWTE supports the full (never packed) versions of [[Cas Files|.cas files]], as supplied by Caliban and also the ones that have been generated from Pack files by XIDX, IWTE or similar tools. PLEASE NOTE: The RTW and M2TW anims generated from the pack files use a different format - DO NOT pack RTW types into M2TW packs or vice-versa - check that you are generating the correct type for the game you are going to use them in! Also do not attempt to re-pack the full type (where you can see the bone names) with XIDX or IWTE, they will only work if you have a full set including .evt files and let M2TW repack them from descr_skeleton.txt.<br />
<br />
==Units - General Tips==<br />
*Seams - To avoid seams in the finished model you CAN 'weld' vertexes that have disconnected uvs, in Blender use Mesh> Clean Up> Merge by Distance (without uvs ticked), and Shading> Smooth Faces. That will get you a shared normal that allows the area to look smooth. For the game IWTE will generate two vertexes at that point to preserve the uvs and set that normal as a custom normal for each.<br />
<br />
*Anims/skeletons - In Blender you can make any alteration you like to the 'Pose Mode' this will only affect the animation frames. Do NOT, unless you know what you are doing... move or edit the bones in the 'Armature' edit mode, this will affect the bone positions in the model/anim.cas produced, and will need to be matched to a skeleton with the same bone positions. If using the "full" M2TW cas anims that the game re-packs you can adjust the bone positions for a folder of .cas anims by using the skeleton replacement method detailed below. If using XIDX unpacked/packed anims you will need to change the skeleton using other tools.<br />
<br />
==Animations - General Tips==<br />
*Blender must be set to 20fps BEFORE importing a .dae with animation created by IWTE. To do this use the custom setting and type in 20. When you import a .dae file you should then see the keyframes neatly aligned with the time markers. See below:<br />
<br />
[[File:20fps.jpg|200px]]<br />
<br />
==Mesh Names/Comments==<br />
The Blender .dae interface does not support comments, so all the information about the mesh sections (primary/secondary weapons etc.) needs to go in the mesh name:<br />
<br />
*Section Naming - For Blender the full details of the group names are stored in the name itself. There isn't a comment section like milkshape. Things that need to go back into the game as separate sections, e.g. to denote primary weapons, or alternate versions, need a double underscore __ to show where the name should be split or a space included. For M2TW mesh sections that you want to be optional, use __opt at the end of the group name.<br />
<br />
==Siege/Artillery Engines==<br />
Siege/Artillery for both RTW and M2TW use the "full" cas anim versions (not packed/unpacked at any stage). For M2TW use the dedicated Model Files > Mesh Models > Siege Engine mesh to date for export and IWTE Task import process. For RTW use the Model Files > Cas Models > Animated cas_mesh to date, the RTW process seems to be quite straightforward as there isn't the mis-alignment between bone names and start poses that is present in M2TW.<br />
===M2TW Siege Engine Skeleton Alteration Example Process===<br />
*In top menu bar go to Model Files > Siege Engine mesh to dae > select mesh, then default cas then anim cas.<br />
:Check that the default .cas is actually the one listed as anim-default in descr_engine_skeleton.txt<br />
:also check that you're using an anim that is in use in game - some of the anims in the folder don't work.<br />
<br />
*IWTE will have written a .dae file in "to_dae" sub-folder below your .mesh model location.<br />
<br />
*Load in Blender by using 'file' 'import' 'collada'<br />
<br />
*Add bones as required to the Armature - note there should only be one top level bone, e.g bone_body add all other bones as child of this, or of existing bones.<br />
<br />
*Use 'weight paint' to assign vertices to bones as required.<br />
:Note - the .mesh file will only accept vertexes weighted to a max of 2 bones<br />
:use 'limit total' in 'weights' menu and set to 2 to avoid any verts weighted to 3 or more bones - (this is applied to selected verts only)<br />
:use 'normalise all' to make sure verts are fully weighted, use 'auto normalise' option whilst working also<br />
<br />
*change animation by switching to 'animation' layout in top bar<br />
:trigger Pose mode by clicking pose running man symbol within the Armature<br />
:if you can't see bones, or the summary when you click them, in main sidebar click the pose (running man) button, select "viewport display" and select the "in front" option<br />
:when you move a bone in the pose mode use shortcut "i" in main window to open keyframe dialogue and select "LocRot"<br />
:you can delete copy or move keyframes around for selected bones in the Dope Sheet section<br />
<br />
*Export collada - in settings check Anim is on Matrix option and 'keep keyframes' and 'all keyed curves' are selected.<br />
'''DO NOT USE IWTE Model Files > Siege Engine dae to mesh to convert back''' the dae doesn't include enough info to retain the three textures named in the mesh .<br />
<br />
*USE the "dae_to_mesh_*****_task.txt" that IWTE has written into the "IWTE_Tasks" sub-folder where your IWTE.exe is<br />
:change the .dae name you're reading in to the one you've just saved - change any other output names IF you need to<br />
:check the number of frames listed ties up with the end frame you set in collada.<br />
<br />
*Run the task file from the IWTE Task button in top menu bar, the separate files will be saved where specified in the task file.<br />
<br />
*If you have changed the number of bones used or their positions you will need to align all the other .cas anims used by the mesh, to do this use the skeleton replacement process explained below.<br />
<br />
==Skeleton Replacement (M2TW)==<br />
''RTW and packed M2TW skeletons can not be changed via this method.'' <br><br />
To replace the skeleton in M2TW where you have the set of full .cas anims that the game re-packs in the IWTE top menu bar go to:<br />
:Model Files > Cas Models > Skeleton Replacement<br />
<br />
*On the first prompt select the .cas file containing the bones in the basepose positions you want (probably the default or basepose .cas)<br />
*On the second prompt select the FOLDER that contains all the .cas files you want to change.<br />
<br />
The revised files will be saved in a sub folder of that folder called "updateskeletons" they will have the same names as the original .cas files and can be used to directly replace them. Please back-up your original files before doing this, and remember that other .cas/.mesh models may be using the same files, so you may need to create a separate folder and separate entry in descr_skeleton.txt etc.<br />
<br />
Adding bones should be straightforward, if you delete bones that had child bones then the result may be unpredictable and the resulting animations may need editing. <br />
<br />
===Bone Renaming Task===<br />
To rename the bones throughout a folder of full .cas animations use a task file. If you want to swap the names of bones you need to add an additional stage to re-name one bone to a temporary name, the example below shows how to swap bone_H_Saddle and bone_Spine names with each other:<br />
<task_id> cas_bone_name_change <br />
<directory_in> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka <br />
<directory_out> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka\changedbones <br />
<bone_name_change_list> <br />
bone_H_Saddle bone_H_Saddlex<br />
bone_Spine bone_H_Saddle<br />
bone_H_Saddlex bone_Spine<br />
<br />
* The task cas_bone_name_change changes a bone name (the NEW name must not already exist in a skeleton this is being applied to)<br />
* Directory in is optional, alternatively the task file can be placed in the directory and launched from there<br />
* Directory out is optional, if not given a sub-folder /updateskeletons will be created<br />
<br />
===Fixing Floating Units===<br />
For how to create the new basepose see [[Blender_hints_and_tips#Fixing_Floating_Units|Blender Hints and Tips]]<br />
<br />
Once you have the new basepose.cas you need to use it as the source to replace the bone positions in ALL of the animations the unit uses. For strat_models if you haven't already edited the .cas files of all the effected models include them in the skeleton replacement process too.<br />
<br />
==Weapon Animations (M2TW)==<br />
M2TW includes the possibility of having 'add-on' animations for weapons/shields. These are commonly listed in the model db file but rarely actually used.<br />
<br />
The advantage of properly using the weapon bones and anims instead of adding additional 'normal' bones to the skeleton is that the main skeleton remains 'standard' and does not cause the victim death anim bug when in battle with units whose skeletons have different numbers of bones!<br />
<br />
==IWTE Task File Options==<br />
===Text File Output===<br />
using <create_text_file> you can optionally generate .txt files that show, '''for information purposes only''', the content of the incoming .mesh/.cas files, the default option is <br />
<create_text_file> no #stops any text file being created <br />
<create_text_file> yes #creates a summary text file with header/trailer info, numbers of verts, texture and mesh names etc.<br />
<create_text_file> full #creates a full text file showing the interpretation of all the ints/floats etc in the file, with comments<br />
<br />
<br />
==External Links==<br />
* [https://www.blender.org/ Blender]<br />
* [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 IWTE Download]<br />
* [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing Discussion thread].<br />
<br />
[[Category:M2TW Modding]]<br />
[[Category:Blender]]<br />
[[Category:RTW Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=IWTE_-_Units_in_Blender/Milkshape&diff=86514IWTE - Units in Blender/Milkshape2023-06-09T10:09:57Z<p>Makanyane: /* Export/Import by Task Process */</p>
<hr />
<div>{{RTW M2TW Modding Logo}}<br />
{{IWTE}} <br />
__TOC__<br />
<br />
<big>Tips and instructions for working with RTW and M2TW battle map units and strat map characters via '''[[IWTE]]''' and '''[[Blender]]''' using the .dae format.</big> <br />
<br />
''The .dae files used for the Collada import/export can also be used with '''3ds Max''', however, max users absolutely have to use the [https://github.com/KhronosGroup/OpenCOLLADA/wiki/OpenCOLLADA-Tools '''OpenCollada plugin'''] and file format when importing/exporting files, max comes with the AutodeskCollada file format by default which neither imports nor exports files from the game correctly.''<br />
<br />
*IWTE download [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 here] - please use the latest version, early versions do not have this functionality.<br />
*For queries about these functions please ask [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing here].<br />
*For information on working on M2TW Settlements in Blender see [[IWTE - Settlements in Blender]]<br />
*For general tips on working with Blender see [[Blender hints and tips]]<br />
*For related info about .cas file structure see [[Cas Files|here]]<br />
<br />
<br />
==Export and Import M2TW .mesh Units==<br />
The most useful method of export involves matching the unit .mesh with its skeleton basepose and one or more animations. <br />
<br />
The drop-down menu in IWTE allows a unit .mesh to be merged with its basepose skeleton and one animation. A task file is needed to allow combining of animations and is the only way to also incorporate weapon animations.<br />
<br />
The drop-down menu options, and alternative IWTE Task button options are described below:<br />
<br />
[[File:Export-mesh-in-IWTE.jpg]]<br />
<br />
1. For Blender select the 'Unit mesh/skel/casanim to dae' option if you have the versions unpacked using XIDX.<br><br />
2. For Blender select 'Unit mesh to dae' if you have the "full" version of the .cas anims (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br><br />
3. For Milkshape select the 'Unit mesh/skel/casanim to ms3d' option if you have the versions unpacked using XIDX.<br><br />
4. For Blender select 'Unit mesh to ms3d' if you have the "full" version of the .cas anims (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br><br />
<br />
For all of the above options select the Double Textured option for unit meshes that have both a main and attachment texture. Select the Single Textured option for most other cases (e.g. standard mounts). <br />
<br />
You will be prompted to select the model .mesh first, then the basepose.cas for the skeleton (full cas version) or the unpacked skeleton file (unpacked version), and then an animation.cas file that is compatible with that skeleton (this should be in the same format as the skeleton, full or unpacked). <br />
<br />
===Export/Import by Task Process===<br />
To generate a .dae or .ms3d file from .mesh and .anims via the task process you will need a text file ending in _task.txt which starts with the mesh to dae command, run the task file by selecting the 'IWTE Task' > 'Select Task File' buttons. See example below for mesh_to_dae (the extra line breaks have been included just to show the body/weapon pairing):<br />
<br />
<task_id> mesh_to_extract <br />
<mesh_file_full_path_in> C:\M2TW\mods\devkit\data\animations\EB_Slinger\numidian_slinger_lod0.mesh <br />
<mesh_type> unit # line can be omitted if not also adding mount<br />
<mesh_double_texture> yes # or 'no' for single texture<br />
<cas_file_types_in_list> body weapon # line can be omitted for 'body' only<br />
<br />
<directory_out> C:\M2TW\mods\devkit\data\animations\EB_Slinger <br />
<extract_file_name_out> EBslingerAnims.ms3d <br />
<extract_file_type> ms3d # or 'dae' for Blender<br />
<create_text_file> no # or 'yes' for summary files, 'full' for detailed files<br />
<task_file_full_path_out> C:\IWTE/IWTE_tasks/ms3d_to_mesh_slinger_task.txt # name for your return task file <br />
<br />
<cas_file_full_path_in_default_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_basepose.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas<br />
<br />
<cas_file_full_path_in_action_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_stand_A_idle.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas <br />
<br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_attack_missile_ready.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_attack_missile_ready.cas <br />
<br />
Please see the IWTE example control processes.txt file that ships with IWTE for further details/instructions. <br />
<br />
Running the task will generate you a .ms3d or .dae file with the animations joined together with an additional 'basepose' frame added at frame 0, to aid editing. The task will also auto-generate for a reverse dae/ms3d_to_mesh_****_task.txt file for you, this will list the start and end frame positions of all included animations and the names of all the files that will be re-created from your file. The names and frame positions can be edited to suit any changes you may require before running the return task.<br />
<br />
When creating the task files it is common to make minor errors in the file names/paths that mean IWTE cannot find all the elements! If you get an error message whilst running the task you'll get a chance to read the error message <br />
(which is easier in the command window) - you can then click "Ignore" to keep IWTE open, fix the name/path/file issue in the .txt file and try running the task again. The error message should indicate which file it couldn't find. If you forget to add the file extension and try and get it to open a folder you'll get an 'access violation' type message. <br />
<br />
For unit models that do not have any elements weighted to the 'weapon bones' you only need to run the process with <br />
<br />
<code> <cas_file_types_in_list> body </code> <br />
<br />
and supply the main skeleton basepose and animation.<br />
<br />
If the mesh has a weapon weighted to weapon bones use the ''body weapon'' example shown above.<br />
<br />
If the mesh has both a weapon weighted to weapon bones and a shield weighted to bone_shield etc use<br />
<br />
<code> <cas_file_types_in_list> body weapon shield</code> <br />
<br />
and supply the main skeleton, weapon animation and shield animation baseposes and animations in sets of three in order.<br />
<br />
Note: a lot of models that are apparently using ''fs_test_shield'' according to their [[battle_models.modeldb]] entry don't actually have anything weighted to bone_shield, making the shield 'anim' irrelevant.<br />
<br />
===UV Mapping for Double Texture Units===<br />
The mesh format for both double and singled textured units in M2TW is actually exactly the same with just one set of uv's that should range from 0 to 1.0 in both horizontal and vertical axis.<br />
<br />
If you assign two textures to a unit in the [[battle_models.modeldb]] then the game expands out the horizontal axis of the uv maps so that the area from 0 to 0.5 is used to cover 0 to 1 on the first texture, and the uv's from 0.5 to 1.0 on the horizontal axis are used to cover 0 to 1 on the second texture.<br />
<br />
Milkshape/.mesh converters use the texture (Main or Attachment) assigned to a mesh group to determine which section of the uv map the group's uv coordinates will be moved to, with Main texture co-ordinates compressed into the 0>0.5 area and Attachment texture co-ordinates compressed into the 0.75>1.0 section.<br />
<br />
The IWTE mesh to .dae for Blender process works differently. The texture assignment process is used purely so you can view the mesh groups with the correct relevant texture. The 0>1.0 horizontal uvs are expanded to 0>2.0 if you use the process for 'double textures' and then compressed back to 0>1.0 on the return to .mesh.<br />
<br />
In Blender the uv mapping to the two textures will look like the image below.<br />
<br />
[[File:Uvs for double textured units.jpg|400px]]<br />
<br />
To see the 2nd texture under its uv's open the sidebar (n) in the uv screen and select the 'repeat texture' button.<br />
In Blender it is possible to partially assign some triangles from a group to the 1st texture and some triangles to the 2nd texture, if you do that please remember to also move the uv's to the appropriate zone.<br />
<br />
===Scaling of Anims===<br />
The 'full' cas animations as supplied by Caliban should be regarded as scale 1.0. If you need to load from them to suit a skeleton that will be scaled by the game you need to give IWTE the skeleton scale in the mesh_to_extract task using the appropriate tag e.g.<br><br />
<skeleton_scale> <br><br />
<mount_skeleton_scale><br />
<br />
If you load from the unpacked skeleton and unpacked animation the scale will be read from the skeleton, so you do not need to add any further information.<br />
<br />
==Export and Import RTW Units & RTW/M2TW Strat Characters==<br />
<big>'''NOTE:''' IWTE now supports the full weighting allowed in Rome Remastered by default - to ensure you do not create RTW/M2TW cas files that exceed their games capabilities add '''<cas_mesh_format> rtw''' (or M2) to the task file.</big><br />
<br />
<br />
The process for this is similar to the .mesh Export/Import process described above, the button locations are shown in the below image: <br><br />
[[File:Export-cas-to-dae.jpg|Exporting animated cas to date with IWTE]]<br />
<br />
Use the 'Animated cas_mesh to dae' ('''3''') button if you have the full versions of the animation files, e.g the type supplied by Caliban that M2TW itself re-packs. The first file requested will be the .cas 'mesh', e.g. the one with the body model in it. The second file requested will be an animation file, if you do not have a suitable animation file just click 'Cancel' to close the selection screen. You can use the 'Animated cas/dae' button for all unit/character .cas files even if you aren't going to load an animation.<br />
<br />
If you are using RTW or are using M2TW but only have the skeleton/cas files unpacked using XIDX or other tools use the appropriate '* casmesh,skel,casanim to dae' button ('''1''' or '''2'''). The first file requested will again be the .cas 'mesh', e.g. model. The second file requested will be the skeleton file (as produced by XIDX/tool using extract_skeletons). The third file requested will be the .cas animation file (as produced by XIDX/tool using extract_animations). For Rome Remastered use the RTW button.<br />
<br />
These processes will generate a .dae file in a /to_dae sub-folder where your IWTE.exe is located. You will also have two task files generated in the /iwte_tasks sub-folder. The dae_to_cas one provides a default task file for reversing the process and generating new .cas files. The cas_to_dae one allows you to repeat the process you just did by simply running the IWTE Task, you can also adapt that task file to load multiple animations. The following is an example task file for cas_to_dae with multiple anims, and using rtw skeleton and anims, note that if the file path/name has spaces the entire path needs to be inside " ", also note the skeleton name does not have a file extension, direction of \ or / doesn't matter:<br />
<task_id> cas_to_dae <br />
<cas_mesh_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\to_dae/from_dae/ALEX_companion_cavalry_lod_1.cas <br />
<directory_out> I:\M2TW\M2TWcopy\mods\IWTE/to_dae <br />
<dae_file_name_out> ALEX_companion_cavalry_taunt.dae <br />
<cas_animation_file_format> rtw <br />
<create_text_file> yes <br />
<create_task_file_from_input> yes <br />
<task_file_full_path_out> I:\M2TW\M2TWcopy\mods\IWTE/IWTE_tasks/dae_to_cas_alextaunt_task.txt <br />
<skeleton_unpacked_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\testthings\animations\rome_animations/fs_swordsman<br />
<cas_file_full_path_in_action_list> <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_04 taunt 2.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_06 taunt 1.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_07 taunt 3.cas" <br />
<br />
To get amended units/anims back into game you will need to 'export' 'collada' from Blender or 3dsMax. The .dae file created will have the same structure whether you're converting to Mesh/Cas model, and Full/XIDX packable anims, so you need to use a task file to specify the format to be returned. The automatically generated return task file will have assumed you want the same format that went in, so the task file above will have generated this return file:<br />
<task_id> dae_to_cas # to read dae file and generate *.cas files<br />
<dae_file_full_path_in> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/ALEX_companion_cavalry_taunt.dae # *.dae file to read in. i.e. change to collada name exported from Blender<br />
<directory_out> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/from_dae # directory to put new created files<br />
<cas_mesh_file_name_out> alex_companion_cavalry_lod_1.cas # *.cas file to be created<br />
<cas_animation_file_format> rr # format of cas to be created by dae (rtw or full) <br />
<cas_unpacked_skeleton_scale> 1.0000 # cas unpacked skeleton scaling<br />
<overlap_frames> no # overlap frames selection used to create the dae (not used on import)<br />
<cas_file_name_out_anim_split_list> # cas anim files start and end frames<br />
"lid_57_04 taunt 2.cas" 1 79 <br />
"lid_57_06 taunt 1.cas" 80 162 <br />
"lid_57_07 taunt 3.cas" 163 237 <br />
#<end_frame> 237 # Last animated frame (use to see full animation in blender)<br />
<br />
If you're trying to convert format, instead of rr you need to use:<br />
<cas_animation_file_format> '''m2''' #for M2TW anims re-packable by XIDX<br />
<br />
<cas_animation_file_format> '''full''' #for M2TW anims re-packable by '''the game'''<br />
<br />
If you want an M2TW mesh back instead of a .cas model use the <br />
<task_id> '''dae_to_mesh'''<br />
instead of dae_to_cas<br />
<br />
Using the 'Animated dae to cas_mesh' ('''4''') button will generate a separate cas model file and a full version anim called _action. See below for animation file type details.<br />
<br />
Using the 'RTW object animation dae to cas' ('''5''') will produce a cas which includes both the model and the animation together, these are used only for [[Spot fx animations and effects|spot_fx]] items in RTW/RR.<br />
<br />
===Bone Weighting===<br />
RTW battle map units and strat models and M2TW strat models will generally have vertexes weighted to only one bone per vertex.<br />
<br />
If you convert a dae with multiple bone weights per vertex to cas with IWTE it will generate one cas with vertexes weighted to up to two bones, and one cas with the suffix "_lod1". The _lod1 cas can be renamed and used for RTW/M2TW. Ideally however you should limit the bone weight totals yourself so you can check how the model will behave in game when posed. See [[Blender_hints_and_tips#Bone_Assignment|Blender hints and tips]].<br />
<br />
For details on optionally creating a simple multi-weighted Section see: [[Model_flexi_m in RTW]]<br />
<br />
===Cas animation types===<br />
IWTE supports the full (never packed) versions of [[Cas Files|.cas files]], as supplied by Caliban and also the ones that have been generated from Pack files by XIDX, IWTE or similar tools. PLEASE NOTE: The RTW and M2TW anims generated from the pack files use a different format - DO NOT pack RTW types into M2TW packs or vice-versa - check that you are generating the correct type for the game you are going to use them in! Also do not attempt to re-pack the full type (where you can see the bone names) with XIDX or IWTE, they will only work if you have a full set including .evt files and let M2TW repack them from descr_skeleton.txt.<br />
<br />
==Units - General Tips==<br />
*Seams - To avoid seams in the finished model you CAN 'weld' vertexes that have disconnected uvs, in Blender use Mesh> Clean Up> Merge by Distance (without uvs ticked), and Shading> Smooth Faces. That will get you a shared normal that allows the area to look smooth. For the game IWTE will generate two vertexes at that point to preserve the uvs and set that normal as a custom normal for each.<br />
<br />
*Anims/skeletons - In Blender you can make any alteration you like to the 'Pose Mode' this will only affect the animation frames. Do NOT, unless you know what you are doing... move or edit the bones in the 'Armature' edit mode, this will affect the bone positions in the model/anim.cas produced, and will need to be matched to a skeleton with the same bone positions. If using the "full" M2TW cas anims that the game re-packs you can adjust the bone positions for a folder of .cas anims by using the skeleton replacement method detailed below. If using XIDX unpacked/packed anims you will need to change the skeleton using other tools.<br />
<br />
==Animations - General Tips==<br />
*Blender must be set to 20fps BEFORE importing a .dae with animation created by IWTE. To do this use the custom setting and type in 20. When you import a .dae file you should then see the keyframes neatly aligned with the time markers. See below:<br />
<br />
[[File:20fps.jpg|200px]]<br />
<br />
==Mesh Names/Comments==<br />
The Blender .dae interface does not support comments, so all the information about the mesh sections (primary/secondary weapons etc.) needs to go in the mesh name:<br />
<br />
*Section Naming - For Blender the full details of the group names are stored in the name itself. There isn't a comment section like milkshape. Things that need to go back into the game as separate sections, e.g. to denote primary weapons, or alternate versions, need a double underscore __ to show where the name should be split or a space included. For M2TW mesh sections that you want to be optional, use __opt at the end of the group name.<br />
<br />
==Siege/Artillery Engines==<br />
Siege/Artillery for both RTW and M2TW use the "full" cas anim versions (not packed/unpacked at any stage). For M2TW use the dedicated Model Files > Mesh Models > Siege Engine mesh to date for export and IWTE Task import process. For RTW use the Model Files > Cas Models > Animated cas_mesh to date, the RTW process seems to be quite straightforward as there isn't the mis-alignment between bone names and start poses that is present in M2TW.<br />
===M2TW Siege Engine Skeleton Alteration Example Process===<br />
*In top menu bar go to Model Files > Siege Engine mesh to dae > select mesh, then default cas then anim cas.<br />
:Check that the default .cas is actually the one listed as anim-default in descr_engine_skeleton.txt<br />
:also check that you're using an anim that is in use in game - some of the anims in the folder don't work.<br />
<br />
*IWTE will have written a .dae file in "to_dae" sub-folder below your .mesh model location.<br />
<br />
*Load in Blender by using 'file' 'import' 'collada'<br />
<br />
*Add bones as required to the Armature - note there should only be one top level bone, e.g bone_body add all other bones as child of this, or of existing bones.<br />
<br />
*Use 'weight paint' to assign vertices to bones as required.<br />
:Note - the .mesh file will only accept vertexes weighted to a max of 2 bones<br />
:use 'limit total' in 'weights' menu and set to 2 to avoid any verts weighted to 3 or more bones - (this is applied to selected verts only)<br />
:use 'normalise all' to make sure verts are fully weighted, use 'auto normalise' option whilst working also<br />
<br />
*change animation by switching to 'animation' layout in top bar<br />
:trigger Pose mode by clicking pose running man symbol within the Armature<br />
:if you can't see bones, or the summary when you click them, in main sidebar click the pose (running man) button, select "viewport display" and select the "in front" option<br />
:when you move a bone in the pose mode use shortcut "i" in main window to open keyframe dialogue and select "LocRot"<br />
:you can delete copy or move keyframes around for selected bones in the Dope Sheet section<br />
<br />
*Export collada - in settings check Anim is on Matrix option and 'keep keyframes' and 'all keyed curves' are selected.<br />
'''DO NOT USE IWTE Model Files > Siege Engine dae to mesh to convert back''' the dae doesn't include enough info to retain the three textures named in the mesh .<br />
<br />
*USE the "dae_to_mesh_*****_task.txt" that IWTE has written into the "IWTE_Tasks" sub-folder where your IWTE.exe is<br />
:change the .dae name you're reading in to the one you've just saved - change any other output names IF you need to<br />
:check the number of frames listed ties up with the end frame you set in collada.<br />
<br />
*Run the task file from the IWTE Task button in top menu bar, the separate files will be saved where specified in the task file.<br />
<br />
*If you have changed the number of bones used or their positions you will need to align all the other .cas anims used by the mesh, to do this use the skeleton replacement process explained below.<br />
<br />
==Skeleton Replacement (M2TW)==<br />
''RTW and packed M2TW skeletons can not be changed via this method.'' <br><br />
To replace the skeleton in M2TW where you have the set of full .cas anims that the game re-packs in the IWTE top menu bar go to:<br />
:Model Files > Cas Models > Skeleton Replacement<br />
<br />
*On the first prompt select the .cas file containing the bones in the basepose positions you want (probably the default or basepose .cas)<br />
*On the second prompt select the FOLDER that contains all the .cas files you want to change.<br />
<br />
The revised files will be saved in a sub folder of that folder called "updateskeletons" they will have the same names as the original .cas files and can be used to directly replace them. Please back-up your original files before doing this, and remember that other .cas/.mesh models may be using the same files, so you may need to create a separate folder and separate entry in descr_skeleton.txt etc.<br />
<br />
Adding bones should be straightforward, if you delete bones that had child bones then the result may be unpredictable and the resulting animations may need editing. <br />
<br />
===Bone Renaming Task===<br />
To rename the bones throughout a folder of full .cas animations use a task file. If you want to swap the names of bones you need to add an additional stage to re-name one bone to a temporary name, the example below shows how to swap bone_H_Saddle and bone_Spine names with each other:<br />
<task_id> cas_bone_name_change <br />
<directory_in> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka <br />
<directory_out> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka\changedbones <br />
<bone_name_change_list> <br />
bone_H_Saddle bone_H_Saddlex<br />
bone_Spine bone_H_Saddle<br />
bone_H_Saddlex bone_Spine<br />
<br />
* The task cas_bone_name_change changes a bone name (the NEW name must not already exist in a skeleton this is being applied to)<br />
* Directory in is optional, alternatively the task file can be placed in the directory and launched from there<br />
* Directory out is optional, if not given a sub-folder /updateskeletons will be created<br />
<br />
===Fixing Floating Units===<br />
For how to create the new basepose see [[Blender_hints_and_tips#Fixing_Floating_Units|Blender Hints and Tips]]<br />
<br />
Once you have the new basepose.cas you need to use it as the source to replace the bone positions in ALL of the animations the unit uses. For strat_models if you haven't already edited the .cas files of all the effected models include them in the skeleton replacement process too.<br />
<br />
==Weapon Animations (M2TW)==<br />
M2TW includes the possibility of having 'add-on' animations for weapons/shields. These are commonly listed in the model db file but rarely actually used.<br />
<br />
The advantage of properly using the weapon bones and anims instead of adding additional 'normal' bones to the skeleton is that the main skeleton remains 'standard' and does not cause the victim death anim bug when in battle with units whose skeletons have different numbers of bones!<br />
<br />
==IWTE Task File Options==<br />
===Text File Output===<br />
using <create_text_file> you can optionally generate .txt files that show, '''for information purposes only''', the content of the incoming .mesh/.cas files, the default option is <br />
<create_text_file> no #stops any text file being created <br />
<create_text_file> yes #creates a summary text file with header/trailer info, numbers of verts, texture and mesh names etc.<br />
<create_text_file> full #creates a full text file showing the interpretation of all the ints/floats etc in the file, with comments<br />
<br />
<br />
==External Links==<br />
* [https://www.blender.org/ Blender]<br />
* [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 IWTE Download]<br />
* [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing Discussion thread].<br />
<br />
[[Category:M2TW Modding]]<br />
[[Category:Blender]]<br />
[[Category:RTW Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=IWTE_-_Units_in_Blender/Milkshape&diff=86513IWTE - Units in Blender/Milkshape2023-06-09T09:50:37Z<p>Makanyane: /* Export/Import by Task Process */</p>
<hr />
<div>{{RTW M2TW Modding Logo}}<br />
{{IWTE}} <br />
__TOC__<br />
<br />
<big>Tips and instructions for working with RTW and M2TW battle map units and strat map characters via '''[[IWTE]]''' and '''[[Blender]]''' using the .dae format.</big> <br />
<br />
''The .dae files used for the Collada import/export can also be used with '''3ds Max''', however, max users absolutely have to use the [https://github.com/KhronosGroup/OpenCOLLADA/wiki/OpenCOLLADA-Tools '''OpenCollada plugin'''] and file format when importing/exporting files, max comes with the AutodeskCollada file format by default which neither imports nor exports files from the game correctly.''<br />
<br />
*IWTE download [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 here] - please use the latest version, early versions do not have this functionality.<br />
*For queries about these functions please ask [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing here].<br />
*For information on working on M2TW Settlements in Blender see [[IWTE - Settlements in Blender]]<br />
*For general tips on working with Blender see [[Blender hints and tips]]<br />
*For related info about .cas file structure see [[Cas Files|here]]<br />
<br />
<br />
==Export and Import M2TW .mesh Units==<br />
The most useful method of export involves matching the unit .mesh with its skeleton basepose and one or more animations. <br />
<br />
The drop-down menu in IWTE allows a unit .mesh to be merged with its basepose skeleton and one animation. A task file is needed to allow combining of animations and is the only way to also incorporate weapon animations.<br />
<br />
The drop-down menu options, and alternative IWTE Task button options are described below:<br />
<br />
[[File:Export-mesh-in-IWTE.jpg]]<br />
<br />
1. For Blender select the 'Unit mesh/skel/casanim to dae' option if you have the versions unpacked using XIDX.<br><br />
2. For Blender select 'Unit mesh to dae' if you have the "full" version of the .cas anims (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br><br />
3. For Milkshape select the 'Unit mesh/skel/casanim to ms3d' option if you have the versions unpacked using XIDX.<br><br />
4. For Blender select 'Unit mesh to ms3d' if you have the "full" version of the .cas anims (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br><br />
<br />
For all of the above options select the Double Textured option for unit meshes that have both a main and attachment texture. Select the Single Textured option for most other cases (e.g. standard mounts). <br />
<br />
You will be prompted to select the model .mesh first, then the basepose.cas for the skeleton (full cas version) or the unpacked skeleton file (unpacked version), and then an animation.cas file that is compatible with that skeleton (this should be in the same format as the skeleton, full or unpacked). <br />
<br />
===Export/Import by Task Process===<br />
To generate a .dae or .ms3d file from .mesh and .anims via the task process you will need a text file ending in _task.txt which starts with the mesh to dae command, run the task file by selecting the 'IWTE Task' > 'Select Task File' buttons. See example below for mesh_to_dae (the extra line breaks have been included just to show the body/weapon pairing):<br />
<br />
<task_id> mesh_to_extract <br />
<mesh_file_full_path_in> C:\M2TW\mods\devkit\data\animations\EB_Slinger\numidian_slinger_lod0.mesh <br />
<mesh_type> unit # line can be omitted if not also adding mount<br />
<mesh_double_texture> yes # or no for single texture<br />
<cas_file_types_in_list> body weapon # line can be omitted for body only<br />
<br />
<directory_out> C:\M2TW\mods\devkit\data\animations\EB_Slinger <br />
<extract_file_name_out> EBslingerAnims.ms3d <br />
<extract_file_type> ms3d # or dae for Blender<br />
<create_text_file> yes <br />
<br />
<cas_file_full_path_in_default_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_basepose.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas<br />
<br />
<cas_file_full_path_in_action_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_stand_A_idle.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas <br />
<br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_attack_missile_ready.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_attack_missile_ready.cas <br />
<br />
Please see the IWTE example control processes.txt file that ships with IWTE for further details/instructions. <br />
<br />
Running the task will generate you a .ms3d or .dae file with the animations joined together with an additional 'basepose' frame added at frame 0, to aid editing. The task will also auto-generate for a reverse dae/ms3d_to_mesh_****_task.txt file for you, this will list the start and end frame positions of all included animations and the names of all the files that will be re-created from your file. The names and frame positions can be edited to suit any changes you may require before running the return task.<br />
<br />
When creating the task files it is common to make minor errors in the file names/paths that mean IWTE cannot find all the elements! If you get an error message whilst running the task you'll get a chance to read the error message <br />
(which is easier in the command window) - you can then click "Ignore" to keep IWTE open, fix the name/path/file issue in the .txt file and try running the task again. The error message should indicate which file it couldn't find. If you forget to add the file extension and try and get it to open a folder you'll get an 'access violation' type message. <br />
<br />
For unit models that do not have any elements weighted to the 'weapon bones' you only need to run the process with <br />
<br />
<code> <cas_file_types_in_list> body </code> <br />
<br />
and supply the main skeleton basepose and animation.<br />
<br />
If the mesh has a weapon weighted to weapon bones use the ''body weapon'' example shown above.<br />
<br />
If the mesh has both a weapon weighted to weapon bones and a shield weighted to bone_shield etc use<br />
<br />
<code> <cas_file_types_in_list> body weapon shield</code> <br />
<br />
and supply the main skeleton, weapon animation and shield animation baseposes and animations in sets of three in order.<br />
<br />
Note: a lot of models that are apparently using ''fs_test_shield'' according to their [[battle_models.modeldb]] entry don't actually have anything weighted to bone_shield, making the shield 'anim' irrelevant.<br />
<br />
===UV Mapping for Double Texture Units===<br />
The mesh format for both double and singled textured units in M2TW is actually exactly the same with just one set of uv's that should range from 0 to 1.0 in both horizontal and vertical axis.<br />
<br />
If you assign two textures to a unit in the [[battle_models.modeldb]] then the game expands out the horizontal axis of the uv maps so that the area from 0 to 0.5 is used to cover 0 to 1 on the first texture, and the uv's from 0.5 to 1.0 on the horizontal axis are used to cover 0 to 1 on the second texture.<br />
<br />
Milkshape/.mesh converters use the texture (Main or Attachment) assigned to a mesh group to determine which section of the uv map the group's uv coordinates will be moved to, with Main texture co-ordinates compressed into the 0>0.5 area and Attachment texture co-ordinates compressed into the 0.75>1.0 section.<br />
<br />
The IWTE mesh to .dae for Blender process works differently. The texture assignment process is used purely so you can view the mesh groups with the correct relevant texture. The 0>1.0 horizontal uvs are expanded to 0>2.0 if you use the process for 'double textures' and then compressed back to 0>1.0 on the return to .mesh.<br />
<br />
In Blender the uv mapping to the two textures will look like the image below.<br />
<br />
[[File:Uvs for double textured units.jpg|400px]]<br />
<br />
To see the 2nd texture under its uv's open the sidebar (n) in the uv screen and select the 'repeat texture' button.<br />
In Blender it is possible to partially assign some triangles from a group to the 1st texture and some triangles to the 2nd texture, if you do that please remember to also move the uv's to the appropriate zone.<br />
<br />
===Scaling of Anims===<br />
The 'full' cas animations as supplied by Caliban should be regarded as scale 1.0. If you need to load from them to suit a skeleton that will be scaled by the game you need to give IWTE the skeleton scale in the mesh_to_extract task using the appropriate tag e.g.<br><br />
<skeleton_scale> <br><br />
<mount_skeleton_scale><br />
<br />
If you load from the unpacked skeleton and unpacked animation the scale will be read from the skeleton, so you do not need to add any further information.<br />
<br />
==Export and Import RTW Units & RTW/M2TW Strat Characters==<br />
<big>'''NOTE:''' IWTE now supports the full weighting allowed in Rome Remastered by default - to ensure you do not create RTW/M2TW cas files that exceed their games capabilities add '''<cas_mesh_format> rtw''' (or M2) to the task file.</big><br />
<br />
<br />
The process for this is similar to the .mesh Export/Import process described above, the button locations are shown in the below image: <br><br />
[[File:Export-cas-to-dae.jpg|Exporting animated cas to date with IWTE]]<br />
<br />
Use the 'Animated cas_mesh to dae' ('''3''') button if you have the full versions of the animation files, e.g the type supplied by Caliban that M2TW itself re-packs. The first file requested will be the .cas 'mesh', e.g. the one with the body model in it. The second file requested will be an animation file, if you do not have a suitable animation file just click 'Cancel' to close the selection screen. You can use the 'Animated cas/dae' button for all unit/character .cas files even if you aren't going to load an animation.<br />
<br />
If you are using RTW or are using M2TW but only have the skeleton/cas files unpacked using XIDX or other tools use the appropriate '* casmesh,skel,casanim to dae' button ('''1''' or '''2'''). The first file requested will again be the .cas 'mesh', e.g. model. The second file requested will be the skeleton file (as produced by XIDX/tool using extract_skeletons). The third file requested will be the .cas animation file (as produced by XIDX/tool using extract_animations). For Rome Remastered use the RTW button.<br />
<br />
These processes will generate a .dae file in a /to_dae sub-folder where your IWTE.exe is located. You will also have two task files generated in the /iwte_tasks sub-folder. The dae_to_cas one provides a default task file for reversing the process and generating new .cas files. The cas_to_dae one allows you to repeat the process you just did by simply running the IWTE Task, you can also adapt that task file to load multiple animations. The following is an example task file for cas_to_dae with multiple anims, and using rtw skeleton and anims, note that if the file path/name has spaces the entire path needs to be inside " ", also note the skeleton name does not have a file extension, direction of \ or / doesn't matter:<br />
<task_id> cas_to_dae <br />
<cas_mesh_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\to_dae/from_dae/ALEX_companion_cavalry_lod_1.cas <br />
<directory_out> I:\M2TW\M2TWcopy\mods\IWTE/to_dae <br />
<dae_file_name_out> ALEX_companion_cavalry_taunt.dae <br />
<cas_animation_file_format> rtw <br />
<create_text_file> yes <br />
<create_task_file_from_input> yes <br />
<task_file_full_path_out> I:\M2TW\M2TWcopy\mods\IWTE/IWTE_tasks/dae_to_cas_alextaunt_task.txt <br />
<skeleton_unpacked_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\testthings\animations\rome_animations/fs_swordsman<br />
<cas_file_full_path_in_action_list> <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_04 taunt 2.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_06 taunt 1.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_07 taunt 3.cas" <br />
<br />
To get amended units/anims back into game you will need to 'export' 'collada' from Blender or 3dsMax. The .dae file created will have the same structure whether you're converting to Mesh/Cas model, and Full/XIDX packable anims, so you need to use a task file to specify the format to be returned. The automatically generated return task file will have assumed you want the same format that went in, so the task file above will have generated this return file:<br />
<task_id> dae_to_cas # to read dae file and generate *.cas files<br />
<dae_file_full_path_in> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/ALEX_companion_cavalry_taunt.dae # *.dae file to read in. i.e. change to collada name exported from Blender<br />
<directory_out> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/from_dae # directory to put new created files<br />
<cas_mesh_file_name_out> alex_companion_cavalry_lod_1.cas # *.cas file to be created<br />
<cas_animation_file_format> rr # format of cas to be created by dae (rtw or full) <br />
<cas_unpacked_skeleton_scale> 1.0000 # cas unpacked skeleton scaling<br />
<overlap_frames> no # overlap frames selection used to create the dae (not used on import)<br />
<cas_file_name_out_anim_split_list> # cas anim files start and end frames<br />
"lid_57_04 taunt 2.cas" 1 79 <br />
"lid_57_06 taunt 1.cas" 80 162 <br />
"lid_57_07 taunt 3.cas" 163 237 <br />
#<end_frame> 237 # Last animated frame (use to see full animation in blender)<br />
<br />
If you're trying to convert format, instead of rr you need to use:<br />
<cas_animation_file_format> '''m2''' #for M2TW anims re-packable by XIDX<br />
<br />
<cas_animation_file_format> '''full''' #for M2TW anims re-packable by '''the game'''<br />
<br />
If you want an M2TW mesh back instead of a .cas model use the <br />
<task_id> '''dae_to_mesh'''<br />
instead of dae_to_cas<br />
<br />
Using the 'Animated dae to cas_mesh' ('''4''') button will generate a separate cas model file and a full version anim called _action. See below for animation file type details.<br />
<br />
Using the 'RTW object animation dae to cas' ('''5''') will produce a cas which includes both the model and the animation together, these are used only for [[Spot fx animations and effects|spot_fx]] items in RTW/RR.<br />
<br />
===Bone Weighting===<br />
RTW battle map units and strat models and M2TW strat models will generally have vertexes weighted to only one bone per vertex.<br />
<br />
If you convert a dae with multiple bone weights per vertex to cas with IWTE it will generate one cas with vertexes weighted to up to two bones, and one cas with the suffix "_lod1". The _lod1 cas can be renamed and used for RTW/M2TW. Ideally however you should limit the bone weight totals yourself so you can check how the model will behave in game when posed. See [[Blender_hints_and_tips#Bone_Assignment|Blender hints and tips]].<br />
<br />
For details on optionally creating a simple multi-weighted Section see: [[Model_flexi_m in RTW]]<br />
<br />
===Cas animation types===<br />
IWTE supports the full (never packed) versions of [[Cas Files|.cas files]], as supplied by Caliban and also the ones that have been generated from Pack files by XIDX, IWTE or similar tools. PLEASE NOTE: The RTW and M2TW anims generated from the pack files use a different format - DO NOT pack RTW types into M2TW packs or vice-versa - check that you are generating the correct type for the game you are going to use them in! Also do not attempt to re-pack the full type (where you can see the bone names) with XIDX or IWTE, they will only work if you have a full set including .evt files and let M2TW repack them from descr_skeleton.txt.<br />
<br />
==Units - General Tips==<br />
*Seams - To avoid seams in the finished model you CAN 'weld' vertexes that have disconnected uvs, in Blender use Mesh> Clean Up> Merge by Distance (without uvs ticked), and Shading> Smooth Faces. That will get you a shared normal that allows the area to look smooth. For the game IWTE will generate two vertexes at that point to preserve the uvs and set that normal as a custom normal for each.<br />
<br />
*Anims/skeletons - In Blender you can make any alteration you like to the 'Pose Mode' this will only affect the animation frames. Do NOT, unless you know what you are doing... move or edit the bones in the 'Armature' edit mode, this will affect the bone positions in the model/anim.cas produced, and will need to be matched to a skeleton with the same bone positions. If using the "full" M2TW cas anims that the game re-packs you can adjust the bone positions for a folder of .cas anims by using the skeleton replacement method detailed below. If using XIDX unpacked/packed anims you will need to change the skeleton using other tools.<br />
<br />
==Animations - General Tips==<br />
*Blender must be set to 20fps BEFORE importing a .dae with animation created by IWTE. To do this use the custom setting and type in 20. When you import a .dae file you should then see the keyframes neatly aligned with the time markers. See below:<br />
<br />
[[File:20fps.jpg|200px]]<br />
<br />
==Mesh Names/Comments==<br />
The Blender .dae interface does not support comments, so all the information about the mesh sections (primary/secondary weapons etc.) needs to go in the mesh name:<br />
<br />
*Section Naming - For Blender the full details of the group names are stored in the name itself. There isn't a comment section like milkshape. Things that need to go back into the game as separate sections, e.g. to denote primary weapons, or alternate versions, need a double underscore __ to show where the name should be split or a space included. For M2TW mesh sections that you want to be optional, use __opt at the end of the group name.<br />
<br />
==Siege/Artillery Engines==<br />
Siege/Artillery for both RTW and M2TW use the "full" cas anim versions (not packed/unpacked at any stage). For M2TW use the dedicated Model Files > Mesh Models > Siege Engine mesh to date for export and IWTE Task import process. For RTW use the Model Files > Cas Models > Animated cas_mesh to date, the RTW process seems to be quite straightforward as there isn't the mis-alignment between bone names and start poses that is present in M2TW.<br />
===M2TW Siege Engine Skeleton Alteration Example Process===<br />
*In top menu bar go to Model Files > Siege Engine mesh to dae > select mesh, then default cas then anim cas.<br />
:Check that the default .cas is actually the one listed as anim-default in descr_engine_skeleton.txt<br />
:also check that you're using an anim that is in use in game - some of the anims in the folder don't work.<br />
<br />
*IWTE will have written a .dae file in "to_dae" sub-folder below your .mesh model location.<br />
<br />
*Load in Blender by using 'file' 'import' 'collada'<br />
<br />
*Add bones as required to the Armature - note there should only be one top level bone, e.g bone_body add all other bones as child of this, or of existing bones.<br />
<br />
*Use 'weight paint' to assign vertices to bones as required.<br />
:Note - the .mesh file will only accept vertexes weighted to a max of 2 bones<br />
:use 'limit total' in 'weights' menu and set to 2 to avoid any verts weighted to 3 or more bones - (this is applied to selected verts only)<br />
:use 'normalise all' to make sure verts are fully weighted, use 'auto normalise' option whilst working also<br />
<br />
*change animation by switching to 'animation' layout in top bar<br />
:trigger Pose mode by clicking pose running man symbol within the Armature<br />
:if you can't see bones, or the summary when you click them, in main sidebar click the pose (running man) button, select "viewport display" and select the "in front" option<br />
:when you move a bone in the pose mode use shortcut "i" in main window to open keyframe dialogue and select "LocRot"<br />
:you can delete copy or move keyframes around for selected bones in the Dope Sheet section<br />
<br />
*Export collada - in settings check Anim is on Matrix option and 'keep keyframes' and 'all keyed curves' are selected.<br />
'''DO NOT USE IWTE Model Files > Siege Engine dae to mesh to convert back''' the dae doesn't include enough info to retain the three textures named in the mesh .<br />
<br />
*USE the "dae_to_mesh_*****_task.txt" that IWTE has written into the "IWTE_Tasks" sub-folder where your IWTE.exe is<br />
:change the .dae name you're reading in to the one you've just saved - change any other output names IF you need to<br />
:check the number of frames listed ties up with the end frame you set in collada.<br />
<br />
*Run the task file from the IWTE Task button in top menu bar, the separate files will be saved where specified in the task file.<br />
<br />
*If you have changed the number of bones used or their positions you will need to align all the other .cas anims used by the mesh, to do this use the skeleton replacement process explained below.<br />
<br />
==Skeleton Replacement (M2TW)==<br />
''RTW and packed M2TW skeletons can not be changed via this method.'' <br><br />
To replace the skeleton in M2TW where you have the set of full .cas anims that the game re-packs in the IWTE top menu bar go to:<br />
:Model Files > Cas Models > Skeleton Replacement<br />
<br />
*On the first prompt select the .cas file containing the bones in the basepose positions you want (probably the default or basepose .cas)<br />
*On the second prompt select the FOLDER that contains all the .cas files you want to change.<br />
<br />
The revised files will be saved in a sub folder of that folder called "updateskeletons" they will have the same names as the original .cas files and can be used to directly replace them. Please back-up your original files before doing this, and remember that other .cas/.mesh models may be using the same files, so you may need to create a separate folder and separate entry in descr_skeleton.txt etc.<br />
<br />
Adding bones should be straightforward, if you delete bones that had child bones then the result may be unpredictable and the resulting animations may need editing. <br />
<br />
===Bone Renaming Task===<br />
To rename the bones throughout a folder of full .cas animations use a task file. If you want to swap the names of bones you need to add an additional stage to re-name one bone to a temporary name, the example below shows how to swap bone_H_Saddle and bone_Spine names with each other:<br />
<task_id> cas_bone_name_change <br />
<directory_in> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka <br />
<directory_out> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka\changedbones <br />
<bone_name_change_list> <br />
bone_H_Saddle bone_H_Saddlex<br />
bone_Spine bone_H_Saddle<br />
bone_H_Saddlex bone_Spine<br />
<br />
* The task cas_bone_name_change changes a bone name (the NEW name must not already exist in a skeleton this is being applied to)<br />
* Directory in is optional, alternatively the task file can be placed in the directory and launched from there<br />
* Directory out is optional, if not given a sub-folder /updateskeletons will be created<br />
<br />
===Fixing Floating Units===<br />
For how to create the new basepose see [[Blender_hints_and_tips#Fixing_Floating_Units|Blender Hints and Tips]]<br />
<br />
Once you have the new basepose.cas you need to use it as the source to replace the bone positions in ALL of the animations the unit uses. For strat_models if you haven't already edited the .cas files of all the effected models include them in the skeleton replacement process too.<br />
<br />
==Weapon Animations (M2TW)==<br />
M2TW includes the possibility of having 'add-on' animations for weapons/shields. These are commonly listed in the model db file but rarely actually used.<br />
<br />
The advantage of properly using the weapon bones and anims instead of adding additional 'normal' bones to the skeleton is that the main skeleton remains 'standard' and does not cause the victim death anim bug when in battle with units whose skeletons have different numbers of bones!<br />
<br />
==IWTE Task File Options==<br />
===Text File Output===<br />
using <create_text_file> you can optionally generate .txt files that show, '''for information purposes only''', the content of the incoming .mesh/.cas files, the default option is <br />
<create_text_file> no #stops any text file being created <br />
<create_text_file> yes #creates a summary text file with header/trailer info, numbers of verts, texture and mesh names etc.<br />
<create_text_file> full #creates a full text file showing the interpretation of all the ints/floats etc in the file, with comments<br />
<br />
<br />
==External Links==<br />
* [https://www.blender.org/ Blender]<br />
* [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 IWTE Download]<br />
* [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing Discussion thread].<br />
<br />
[[Category:M2TW Modding]]<br />
[[Category:Blender]]<br />
[[Category:RTW Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=IWTE_-_Units_in_Blender/Milkshape&diff=86512IWTE - Units in Blender/Milkshape2023-06-09T09:49:53Z<p>Makanyane: /* Export and Import M2TW .mesh Units */</p>
<hr />
<div>{{RTW M2TW Modding Logo}}<br />
{{IWTE}} <br />
__TOC__<br />
<br />
<big>Tips and instructions for working with RTW and M2TW battle map units and strat map characters via '''[[IWTE]]''' and '''[[Blender]]''' using the .dae format.</big> <br />
<br />
''The .dae files used for the Collada import/export can also be used with '''3ds Max''', however, max users absolutely have to use the [https://github.com/KhronosGroup/OpenCOLLADA/wiki/OpenCOLLADA-Tools '''OpenCollada plugin'''] and file format when importing/exporting files, max comes with the AutodeskCollada file format by default which neither imports nor exports files from the game correctly.''<br />
<br />
*IWTE download [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 here] - please use the latest version, early versions do not have this functionality.<br />
*For queries about these functions please ask [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing here].<br />
*For information on working on M2TW Settlements in Blender see [[IWTE - Settlements in Blender]]<br />
*For general tips on working with Blender see [[Blender hints and tips]]<br />
*For related info about .cas file structure see [[Cas Files|here]]<br />
<br />
<br />
==Export and Import M2TW .mesh Units==<br />
The most useful method of export involves matching the unit .mesh with its skeleton basepose and one or more animations. <br />
<br />
The drop-down menu in IWTE allows a unit .mesh to be merged with its basepose skeleton and one animation. A task file is needed to allow combining of animations and is the only way to also incorporate weapon animations.<br />
<br />
The drop-down menu options, and alternative IWTE Task button options are described below:<br />
<br />
[[File:Export-mesh-in-IWTE.jpg]]<br />
<br />
1. For Blender select the 'Unit mesh/skel/casanim to dae' option if you have the versions unpacked using XIDX.<br><br />
2. For Blender select 'Unit mesh to dae' if you have the "full" version of the .cas anims (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br><br />
3. For Milkshape select the 'Unit mesh/skel/casanim to ms3d' option if you have the versions unpacked using XIDX.<br><br />
4. For Blender select 'Unit mesh to ms3d' if you have the "full" version of the .cas anims (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br><br />
<br />
For all of the above options select the Double Textured option for unit meshes that have both a main and attachment texture. Select the Single Textured option for most other cases (e.g. standard mounts). <br />
<br />
You will be prompted to select the model .mesh first, then the basepose.cas for the skeleton (full cas version) or the unpacked skeleton file (unpacked version), and then an animation.cas file that is compatible with that skeleton (this should be in the same format as the skeleton, full or unpacked). <br />
<br />
===Export/Import by Task Process===<br />
To generate a .dae or .ms3d file from .mesh and .anims via the task process you will need a text file ending in _task.txt which starts with the mesh to dae command, run the task file by selecting the 'IWTE Task' > 'Select Task File' buttons. See example below for mesh_to_dae (the extra line breaks have been included just to show the body/weapon pairing):<br />
<br />
<task_id> mesh_to_extract <br />
<mesh_file_full_path_in> C:\M2TW\mods\devkit\data\animations\EB_Slinger\numidian_slinger_lod0.mesh <br />
<mesh_type> unit # line can be omitted if not also adding mount<br />
<mesh_double_texture> yes # or no for single texture<br />
<cas_file_types_in_list> body weapon # line can be omitted for body only<br />
<br />
<directory_out> C:\M2TW\mods\devkit\data\animations\EB_Slinger <br />
<extract_file_name_out> EBslingerAnims.ms3d <br />
<extract_file_type> ms3d # or dae for Blender<br />
<create_text_file> yes <br />
<br />
<cas_file_full_path_in_default_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_basepose.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas<br />
<br />
<cas_file_full_path_in_action_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_stand_A_idle.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas <br />
<br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_attack_missile_ready.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_attack_missile_ready.cas <br />
<br />
Please see the IWTE example control processes.txt file that ships with IWTE for further details/instructions. <br />
<br />
Running the task will generate you a .ms3d or .dae file with the animations joined together with an additional 'basepose' frame added at frame 0, to aid editing. The task will also auto-generate for a reverse dae/ms3d_to_mesh_****_task.txt file for you, this will list the start and end frame positions of all included animations and the names of all the files that will be re-created from your file. The names and frame positions can be edited to suit any changes you may require before running the return task.<br />
<br />
When creating the task files it is common to make minor errors in the file names/paths that mean IWTE cannot find all the elements! If you get an error message whilst running the task you'll get a chance to read the error message <br />
(which is easier in the command window) - you can then click "Ignore" to keep IWTE open, fix the name/path/file issue in the .txt file and try running the task again. The error message should indicate which file it couldn't find. If you forget to add the file extension and try and get it to open a folder you'll get an 'access violation' type message. <br />
<br />
For unit models that do not have any elements weighted to the 'weapon bones' you only need to run the process with <br />
<br />
<code> <cas_file_types_in_list> body </code> <br />
<br />
and supply the main skeleton basepose and animation.<br />
<br />
If the mesh has a weapon weighted to weapon bones use the ''body weapon'' example shown above.<br />
<br />
If the mesh has both a weapon weighted to weapon bones and a shield weighted to bone_shield etc use<br />
<br />
<code> <cas_file_types_in_list> body weapon shield</code> <br />
<br />
and supply the main skeleton, weapon animation and shield animation baseposes and animations in sets of three in order.<br />
<br />
Note: a lot of models that are apparently using ''fs_test_shield'' according to their [[battle_models.modeldb]] entry don't actually have anything weighted to bone_shield, making the shield 'anim' irrelevant.<br />
<br />
===UV Mapping for Double Texture Units===<br />
The mesh format for both double and singled textured units in M2TW is actually exactly the same with just one set of uv's that should range from 0 to 1.0 in both horizontal and vertical axis.<br />
<br />
If you assign two textures to a unit in the [[battle_models.modeldb]] then the game expands out the horizontal axis of the uv maps so that the area from 0 to 0.5 is used to cover 0 to 1 on the first texture, and the uv's from 0.5 to 1.0 on the horizontal axis are used to cover 0 to 1 on the second texture.<br />
<br />
Milkshape/.mesh converters use the texture (Main or Attachment) assigned to a mesh group to determine which section of the uv map the group's uv coordinates will be moved to, with Main texture co-ordinates compressed into the 0>0.5 area and Attachment texture co-ordinates compressed into the 0.75>1.0 section.<br />
<br />
The IWTE mesh to .dae for Blender process works differently. The texture assignment process is used purely so you can view the mesh groups with the correct relevant texture. The 0>1.0 horizontal uvs are expanded to 0>2.0 if you use the process for 'double textures' and then compressed back to 0>1.0 on the return to .mesh.<br />
<br />
In Blender the uv mapping to the two textures will look like the image below.<br />
<br />
[[File:Uvs for double textured units.jpg|400px]]<br />
<br />
To see the 2nd texture under its uv's open the sidebar (n) in the uv screen and select the 'repeat texture' button.<br />
In Blender it is possible to partially assign some triangles from a group to the 1st texture and some triangles to the 2nd texture, if you do that please remember to also move the uv's to the appropriate zone.<br />
<br />
===Scaling of Anims===<br />
The 'full' cas animations as supplied by Caliban should be regarded as scale 1.0. If you need to load from them to suit a skeleton that will be scaled by the game you need to give IWTE the skeleton scale in the mesh_to_extract task using the appropriate tag e.g.<br><br />
<skeleton_scale> <br><br />
<mount_skeleton_scale><br />
<br />
If you load from the unpacked skeleton and unpacked animation the scale will be read from the skeleton, so you do not need to add any further information.<br />
<br />
==Export and Import RTW Units & RTW/M2TW Strat Characters==<br />
<big>'''NOTE:''' IWTE now supports the full weighting allowed in Rome Remastered by default - to ensure you do not create RTW/M2TW cas files that exceed their games capabilities add '''<cas_mesh_format> rtw''' (or M2) to the task file.</big><br />
<br />
<br />
The process for this is similar to the .mesh Export/Import process described above, the button locations are shown in the below image: <br><br />
[[File:Export-cas-to-dae.jpg|Exporting animated cas to date with IWTE]]<br />
<br />
Use the 'Animated cas_mesh to dae' ('''3''') button if you have the full versions of the animation files, e.g the type supplied by Caliban that M2TW itself re-packs. The first file requested will be the .cas 'mesh', e.g. the one with the body model in it. The second file requested will be an animation file, if you do not have a suitable animation file just click 'Cancel' to close the selection screen. You can use the 'Animated cas/dae' button for all unit/character .cas files even if you aren't going to load an animation.<br />
<br />
If you are using RTW or are using M2TW but only have the skeleton/cas files unpacked using XIDX or other tools use the appropriate '* casmesh,skel,casanim to dae' button ('''1''' or '''2'''). The first file requested will again be the .cas 'mesh', e.g. model. The second file requested will be the skeleton file (as produced by XIDX/tool using extract_skeletons). The third file requested will be the .cas animation file (as produced by XIDX/tool using extract_animations). For Rome Remastered use the RTW button.<br />
<br />
These processes will generate a .dae file in a /to_dae sub-folder where your IWTE.exe is located. You will also have two task files generated in the /iwte_tasks sub-folder. The dae_to_cas one provides a default task file for reversing the process and generating new .cas files. The cas_to_dae one allows you to repeat the process you just did by simply running the IWTE Task, you can also adapt that task file to load multiple animations. The following is an example task file for cas_to_dae with multiple anims, and using rtw skeleton and anims, note that if the file path/name has spaces the entire path needs to be inside " ", also note the skeleton name does not have a file extension, direction of \ or / doesn't matter:<br />
<task_id> cas_to_dae <br />
<cas_mesh_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\to_dae/from_dae/ALEX_companion_cavalry_lod_1.cas <br />
<directory_out> I:\M2TW\M2TWcopy\mods\IWTE/to_dae <br />
<dae_file_name_out> ALEX_companion_cavalry_taunt.dae <br />
<cas_animation_file_format> rtw <br />
<create_text_file> yes <br />
<create_task_file_from_input> yes <br />
<task_file_full_path_out> I:\M2TW\M2TWcopy\mods\IWTE/IWTE_tasks/dae_to_cas_alextaunt_task.txt <br />
<skeleton_unpacked_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\testthings\animations\rome_animations/fs_swordsman<br />
<cas_file_full_path_in_action_list> <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_04 taunt 2.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_06 taunt 1.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_07 taunt 3.cas" <br />
<br />
To get amended units/anims back into game you will need to 'export' 'collada' from Blender or 3dsMax. The .dae file created will have the same structure whether you're converting to Mesh/Cas model, and Full/XIDX packable anims, so you need to use a task file to specify the format to be returned. The automatically generated return task file will have assumed you want the same format that went in, so the task file above will have generated this return file:<br />
<task_id> dae_to_cas # to read dae file and generate *.cas files<br />
<dae_file_full_path_in> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/ALEX_companion_cavalry_taunt.dae # *.dae file to read in. i.e. change to collada name exported from Blender<br />
<directory_out> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/from_dae # directory to put new created files<br />
<cas_mesh_file_name_out> alex_companion_cavalry_lod_1.cas # *.cas file to be created<br />
<cas_animation_file_format> rr # format of cas to be created by dae (rtw or full) <br />
<cas_unpacked_skeleton_scale> 1.0000 # cas unpacked skeleton scaling<br />
<overlap_frames> no # overlap frames selection used to create the dae (not used on import)<br />
<cas_file_name_out_anim_split_list> # cas anim files start and end frames<br />
"lid_57_04 taunt 2.cas" 1 79 <br />
"lid_57_06 taunt 1.cas" 80 162 <br />
"lid_57_07 taunt 3.cas" 163 237 <br />
#<end_frame> 237 # Last animated frame (use to see full animation in blender)<br />
<br />
If you're trying to convert format, instead of rr you need to use:<br />
<cas_animation_file_format> '''m2''' #for M2TW anims re-packable by XIDX<br />
<br />
<cas_animation_file_format> '''full''' #for M2TW anims re-packable by '''the game'''<br />
<br />
If you want an M2TW mesh back instead of a .cas model use the <br />
<task_id> '''dae_to_mesh'''<br />
instead of dae_to_cas<br />
<br />
Using the 'Animated dae to cas_mesh' ('''4''') button will generate a separate cas model file and a full version anim called _action. See below for animation file type details.<br />
<br />
Using the 'RTW object animation dae to cas' ('''5''') will produce a cas which includes both the model and the animation together, these are used only for [[Spot fx animations and effects|spot_fx]] items in RTW/RR.<br />
<br />
===Bone Weighting===<br />
RTW battle map units and strat models and M2TW strat models will generally have vertexes weighted to only one bone per vertex.<br />
<br />
If you convert a dae with multiple bone weights per vertex to cas with IWTE it will generate one cas with vertexes weighted to up to two bones, and one cas with the suffix "_lod1". The _lod1 cas can be renamed and used for RTW/M2TW. Ideally however you should limit the bone weight totals yourself so you can check how the model will behave in game when posed. See [[Blender_hints_and_tips#Bone_Assignment|Blender hints and tips]].<br />
<br />
For details on optionally creating a simple multi-weighted Section see: [[Model_flexi_m in RTW]]<br />
<br />
===Cas animation types===<br />
IWTE supports the full (never packed) versions of [[Cas Files|.cas files]], as supplied by Caliban and also the ones that have been generated from Pack files by XIDX, IWTE or similar tools. PLEASE NOTE: The RTW and M2TW anims generated from the pack files use a different format - DO NOT pack RTW types into M2TW packs or vice-versa - check that you are generating the correct type for the game you are going to use them in! Also do not attempt to re-pack the full type (where you can see the bone names) with XIDX or IWTE, they will only work if you have a full set including .evt files and let M2TW repack them from descr_skeleton.txt.<br />
<br />
==Units - General Tips==<br />
*Seams - To avoid seams in the finished model you CAN 'weld' vertexes that have disconnected uvs, in Blender use Mesh> Clean Up> Merge by Distance (without uvs ticked), and Shading> Smooth Faces. That will get you a shared normal that allows the area to look smooth. For the game IWTE will generate two vertexes at that point to preserve the uvs and set that normal as a custom normal for each.<br />
<br />
*Anims/skeletons - In Blender you can make any alteration you like to the 'Pose Mode' this will only affect the animation frames. Do NOT, unless you know what you are doing... move or edit the bones in the 'Armature' edit mode, this will affect the bone positions in the model/anim.cas produced, and will need to be matched to a skeleton with the same bone positions. If using the "full" M2TW cas anims that the game re-packs you can adjust the bone positions for a folder of .cas anims by using the skeleton replacement method detailed below. If using XIDX unpacked/packed anims you will need to change the skeleton using other tools.<br />
<br />
==Animations - General Tips==<br />
*Blender must be set to 20fps BEFORE importing a .dae with animation created by IWTE. To do this use the custom setting and type in 20. When you import a .dae file you should then see the keyframes neatly aligned with the time markers. See below:<br />
<br />
[[File:20fps.jpg|200px]]<br />
<br />
==Mesh Names/Comments==<br />
The Blender .dae interface does not support comments, so all the information about the mesh sections (primary/secondary weapons etc.) needs to go in the mesh name:<br />
<br />
*Section Naming - For Blender the full details of the group names are stored in the name itself. There isn't a comment section like milkshape. Things that need to go back into the game as separate sections, e.g. to denote primary weapons, or alternate versions, need a double underscore __ to show where the name should be split or a space included. For M2TW mesh sections that you want to be optional, use __opt at the end of the group name.<br />
<br />
==Siege/Artillery Engines==<br />
Siege/Artillery for both RTW and M2TW use the "full" cas anim versions (not packed/unpacked at any stage). For M2TW use the dedicated Model Files > Mesh Models > Siege Engine mesh to date for export and IWTE Task import process. For RTW use the Model Files > Cas Models > Animated cas_mesh to date, the RTW process seems to be quite straightforward as there isn't the mis-alignment between bone names and start poses that is present in M2TW.<br />
===M2TW Siege Engine Skeleton Alteration Example Process===<br />
*In top menu bar go to Model Files > Siege Engine mesh to dae > select mesh, then default cas then anim cas.<br />
:Check that the default .cas is actually the one listed as anim-default in descr_engine_skeleton.txt<br />
:also check that you're using an anim that is in use in game - some of the anims in the folder don't work.<br />
<br />
*IWTE will have written a .dae file in "to_dae" sub-folder below your .mesh model location.<br />
<br />
*Load in Blender by using 'file' 'import' 'collada'<br />
<br />
*Add bones as required to the Armature - note there should only be one top level bone, e.g bone_body add all other bones as child of this, or of existing bones.<br />
<br />
*Use 'weight paint' to assign vertices to bones as required.<br />
:Note - the .mesh file will only accept vertexes weighted to a max of 2 bones<br />
:use 'limit total' in 'weights' menu and set to 2 to avoid any verts weighted to 3 or more bones - (this is applied to selected verts only)<br />
:use 'normalise all' to make sure verts are fully weighted, use 'auto normalise' option whilst working also<br />
<br />
*change animation by switching to 'animation' layout in top bar<br />
:trigger Pose mode by clicking pose running man symbol within the Armature<br />
:if you can't see bones, or the summary when you click them, in main sidebar click the pose (running man) button, select "viewport display" and select the "in front" option<br />
:when you move a bone in the pose mode use shortcut "i" in main window to open keyframe dialogue and select "LocRot"<br />
:you can delete copy or move keyframes around for selected bones in the Dope Sheet section<br />
<br />
*Export collada - in settings check Anim is on Matrix option and 'keep keyframes' and 'all keyed curves' are selected.<br />
'''DO NOT USE IWTE Model Files > Siege Engine dae to mesh to convert back''' the dae doesn't include enough info to retain the three textures named in the mesh .<br />
<br />
*USE the "dae_to_mesh_*****_task.txt" that IWTE has written into the "IWTE_Tasks" sub-folder where your IWTE.exe is<br />
:change the .dae name you're reading in to the one you've just saved - change any other output names IF you need to<br />
:check the number of frames listed ties up with the end frame you set in collada.<br />
<br />
*Run the task file from the IWTE Task button in top menu bar, the separate files will be saved where specified in the task file.<br />
<br />
*If you have changed the number of bones used or their positions you will need to align all the other .cas anims used by the mesh, to do this use the skeleton replacement process explained below.<br />
<br />
==Skeleton Replacement (M2TW)==<br />
''RTW and packed M2TW skeletons can not be changed via this method.'' <br><br />
To replace the skeleton in M2TW where you have the set of full .cas anims that the game re-packs in the IWTE top menu bar go to:<br />
:Model Files > Cas Models > Skeleton Replacement<br />
<br />
*On the first prompt select the .cas file containing the bones in the basepose positions you want (probably the default or basepose .cas)<br />
*On the second prompt select the FOLDER that contains all the .cas files you want to change.<br />
<br />
The revised files will be saved in a sub folder of that folder called "updateskeletons" they will have the same names as the original .cas files and can be used to directly replace them. Please back-up your original files before doing this, and remember that other .cas/.mesh models may be using the same files, so you may need to create a separate folder and separate entry in descr_skeleton.txt etc.<br />
<br />
Adding bones should be straightforward, if you delete bones that had child bones then the result may be unpredictable and the resulting animations may need editing. <br />
<br />
===Bone Renaming Task===<br />
To rename the bones throughout a folder of full .cas animations use a task file. If you want to swap the names of bones you need to add an additional stage to re-name one bone to a temporary name, the example below shows how to swap bone_H_Saddle and bone_Spine names with each other:<br />
<task_id> cas_bone_name_change <br />
<directory_in> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka <br />
<directory_out> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka\changedbones <br />
<bone_name_change_list> <br />
bone_H_Saddle bone_H_Saddlex<br />
bone_Spine bone_H_Saddle<br />
bone_H_Saddlex bone_Spine<br />
<br />
* The task cas_bone_name_change changes a bone name (the NEW name must not already exist in a skeleton this is being applied to)<br />
* Directory in is optional, alternatively the task file can be placed in the directory and launched from there<br />
* Directory out is optional, if not given a sub-folder /updateskeletons will be created<br />
<br />
===Fixing Floating Units===<br />
For how to create the new basepose see [[Blender_hints_and_tips#Fixing_Floating_Units|Blender Hints and Tips]]<br />
<br />
Once you have the new basepose.cas you need to use it as the source to replace the bone positions in ALL of the animations the unit uses. For strat_models if you haven't already edited the .cas files of all the effected models include them in the skeleton replacement process too.<br />
<br />
==Weapon Animations (M2TW)==<br />
M2TW includes the possibility of having 'add-on' animations for weapons/shields. These are commonly listed in the model db file but rarely actually used.<br />
<br />
The advantage of properly using the weapon bones and anims instead of adding additional 'normal' bones to the skeleton is that the main skeleton remains 'standard' and does not cause the victim death anim bug when in battle with units whose skeletons have different numbers of bones!<br />
<br />
==IWTE Task File Options==<br />
===Text File Output===<br />
using <create_text_file> you can optionally generate .txt files that show, '''for information purposes only''', the content of the incoming .mesh/.cas files, the default option is <br />
<create_text_file> no #stops any text file being created <br />
<create_text_file> yes #creates a summary text file with header/trailer info, numbers of verts, texture and mesh names etc.<br />
<create_text_file> full #creates a full text file showing the interpretation of all the ints/floats etc in the file, with comments<br />
<br />
<br />
==External Links==<br />
* [https://www.blender.org/ Blender]<br />
* [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 IWTE Download]<br />
* [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing Discussion thread].<br />
<br />
[[Category:M2TW Modding]]<br />
[[Category:Blender]]<br />
[[Category:RTW Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=IWTE_-_Units_in_Blender/Milkshape&diff=86511IWTE - Units in Blender/Milkshape2023-06-09T09:49:21Z<p>Makanyane: /* Export and Import M2TW .mesh Units */ starting to add ms3d stuff</p>
<hr />
<div>{{RTW M2TW Modding Logo}}<br />
{{IWTE}} <br />
__TOC__<br />
<br />
<big>Tips and instructions for working with RTW and M2TW battle map units and strat map characters via '''[[IWTE]]''' and '''[[Blender]]''' using the .dae format.</big> <br />
<br />
''The .dae files used for the Collada import/export can also be used with '''3ds Max''', however, max users absolutely have to use the [https://github.com/KhronosGroup/OpenCOLLADA/wiki/OpenCOLLADA-Tools '''OpenCollada plugin'''] and file format when importing/exporting files, max comes with the AutodeskCollada file format by default which neither imports nor exports files from the game correctly.''<br />
<br />
*IWTE download [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 here] - please use the latest version, early versions do not have this functionality.<br />
*For queries about these functions please ask [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing here].<br />
*For information on working on M2TW Settlements in Blender see [[IWTE - Settlements in Blender]]<br />
*For general tips on working with Blender see [[Blender hints and tips]]<br />
*For related info about .cas file structure see [[Cas Files|here]]<br />
<br />
<br />
==Export and Import M2TW .mesh Units==<br />
The most useful method of export involves matching the unit .mesh with its skeleton basepose and one or more animations. <br />
<br />
The drop-down menu in IWTE allows a unit .mesh to be merged with its basepose skeleton and one animation. A task file is needed to allow combining of animations and is the only way to also incorporate weapon animations.<br />
<br />
The drop-down menu options, and alternative IWTE Task button options are described below:<br />
<br />
[[File:Export-mesh-in-IWTE.jpg]]<br />
<br />
1. For Blender select the 'Unit mesh/skel/casanim to dae' option if you have the versions unpacked using XIDX.<br />
2. For Blender select 'Unit mesh to dae' if you have the "full" version of the .cas anims (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br />
3. For Milkshape select the 'Unit mesh/skel/casanim to ms3d' option if you have the versions unpacked using XIDX.<br />
4. For Blender select 'Unit mesh to ms3d' if you have the "full" version of the .cas anims (the ones the game re-packs as supplied by Caliban/Devkit/IWTE).<br />
<br />
For all of the above options select the Double Textured option for unit meshes that have both a main and attachment texture. Select the Single Textured option for most other cases (e.g. standard mounts). <br />
<br />
You will be prompted to select the model .mesh first, then the basepose.cas for the skeleton (full cas version) or the unpacked skeleton file (unpacked version), and then an animation.cas file that is compatible with that skeleton (this should be in the same format as the skeleton, full or unpacked). <br />
<br />
===Export/Import by Task Process===<br />
To generate a .dae or .ms3d file from .mesh and .anims via the task process you will need a text file ending in _task.txt which starts with the mesh to dae command, run the task file by selecting the 'IWTE Task' > 'Select Task File' buttons. See example below for mesh_to_dae (the extra line breaks have been included just to show the body/weapon pairing):<br />
<br />
<task_id> mesh_to_extract <br />
<mesh_file_full_path_in> C:\M2TW\mods\devkit\data\animations\EB_Slinger\numidian_slinger_lod0.mesh <br />
<mesh_type> unit # line can be omitted if not also adding mount<br />
<mesh_double_texture> yes # or no for single texture<br />
<cas_file_types_in_list> body weapon # line can be omitted for body only<br />
<br />
<directory_out> C:\M2TW\mods\devkit\data\animations\EB_Slinger <br />
<extract_file_name_out> EBslingerAnims.ms3d <br />
<extract_file_type> ms3d # or dae for Blender<br />
<create_text_file> yes <br />
<br />
<cas_file_full_path_in_default_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_basepose.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas<br />
<br />
<cas_file_full_path_in_action_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_stand_A_idle.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas <br />
<br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_attack_missile_ready.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_attack_missile_ready.cas <br />
<br />
Please see the IWTE example control processes.txt file that ships with IWTE for further details/instructions. <br />
<br />
Running the task will generate you a .ms3d or .dae file with the animations joined together with an additional 'basepose' frame added at frame 0, to aid editing. The task will also auto-generate for a reverse dae/ms3d_to_mesh_****_task.txt file for you, this will list the start and end frame positions of all included animations and the names of all the files that will be re-created from your file. The names and frame positions can be edited to suit any changes you may require before running the return task.<br />
<br />
When creating the task files it is common to make minor errors in the file names/paths that mean IWTE cannot find all the elements! If you get an error message whilst running the task you'll get a chance to read the error message <br />
(which is easier in the command window) - you can then click "Ignore" to keep IWTE open, fix the name/path/file issue in the .txt file and try running the task again. The error message should indicate which file it couldn't find. If you forget to add the file extension and try and get it to open a folder you'll get an 'access violation' type message. <br />
<br />
For unit models that do not have any elements weighted to the 'weapon bones' you only need to run the process with <br />
<br />
<code> <cas_file_types_in_list> body </code> <br />
<br />
and supply the main skeleton basepose and animation.<br />
<br />
If the mesh has a weapon weighted to weapon bones use the ''body weapon'' example shown above.<br />
<br />
If the mesh has both a weapon weighted to weapon bones and a shield weighted to bone_shield etc use<br />
<br />
<code> <cas_file_types_in_list> body weapon shield</code> <br />
<br />
and supply the main skeleton, weapon animation and shield animation baseposes and animations in sets of three in order.<br />
<br />
Note: a lot of models that are apparently using ''fs_test_shield'' according to their [[battle_models.modeldb]] entry don't actually have anything weighted to bone_shield, making the shield 'anim' irrelevant.<br />
<br />
===UV Mapping for Double Texture Units===<br />
The mesh format for both double and singled textured units in M2TW is actually exactly the same with just one set of uv's that should range from 0 to 1.0 in both horizontal and vertical axis.<br />
<br />
If you assign two textures to a unit in the [[battle_models.modeldb]] then the game expands out the horizontal axis of the uv maps so that the area from 0 to 0.5 is used to cover 0 to 1 on the first texture, and the uv's from 0.5 to 1.0 on the horizontal axis are used to cover 0 to 1 on the second texture.<br />
<br />
Milkshape/.mesh converters use the texture (Main or Attachment) assigned to a mesh group to determine which section of the uv map the group's uv coordinates will be moved to, with Main texture co-ordinates compressed into the 0>0.5 area and Attachment texture co-ordinates compressed into the 0.75>1.0 section.<br />
<br />
The IWTE mesh to .dae for Blender process works differently. The texture assignment process is used purely so you can view the mesh groups with the correct relevant texture. The 0>1.0 horizontal uvs are expanded to 0>2.0 if you use the process for 'double textures' and then compressed back to 0>1.0 on the return to .mesh.<br />
<br />
In Blender the uv mapping to the two textures will look like the image below.<br />
<br />
[[File:Uvs for double textured units.jpg|400px]]<br />
<br />
To see the 2nd texture under its uv's open the sidebar (n) in the uv screen and select the 'repeat texture' button.<br />
In Blender it is possible to partially assign some triangles from a group to the 1st texture and some triangles to the 2nd texture, if you do that please remember to also move the uv's to the appropriate zone.<br />
<br />
===Scaling of Anims===<br />
The 'full' cas animations as supplied by Caliban should be regarded as scale 1.0. If you need to load from them to suit a skeleton that will be scaled by the game you need to give IWTE the skeleton scale in the mesh_to_extract task using the appropriate tag e.g.<br><br />
<skeleton_scale> <br><br />
<mount_skeleton_scale><br />
<br />
If you load from the unpacked skeleton and unpacked animation the scale will be read from the skeleton, so you do not need to add any further information.<br />
<br />
==Export and Import RTW Units & RTW/M2TW Strat Characters==<br />
<big>'''NOTE:''' IWTE now supports the full weighting allowed in Rome Remastered by default - to ensure you do not create RTW/M2TW cas files that exceed their games capabilities add '''<cas_mesh_format> rtw''' (or M2) to the task file.</big><br />
<br />
<br />
The process for this is similar to the .mesh Export/Import process described above, the button locations are shown in the below image: <br><br />
[[File:Export-cas-to-dae.jpg|Exporting animated cas to date with IWTE]]<br />
<br />
Use the 'Animated cas_mesh to dae' ('''3''') button if you have the full versions of the animation files, e.g the type supplied by Caliban that M2TW itself re-packs. The first file requested will be the .cas 'mesh', e.g. the one with the body model in it. The second file requested will be an animation file, if you do not have a suitable animation file just click 'Cancel' to close the selection screen. You can use the 'Animated cas/dae' button for all unit/character .cas files even if you aren't going to load an animation.<br />
<br />
If you are using RTW or are using M2TW but only have the skeleton/cas files unpacked using XIDX or other tools use the appropriate '* casmesh,skel,casanim to dae' button ('''1''' or '''2'''). The first file requested will again be the .cas 'mesh', e.g. model. The second file requested will be the skeleton file (as produced by XIDX/tool using extract_skeletons). The third file requested will be the .cas animation file (as produced by XIDX/tool using extract_animations). For Rome Remastered use the RTW button.<br />
<br />
These processes will generate a .dae file in a /to_dae sub-folder where your IWTE.exe is located. You will also have two task files generated in the /iwte_tasks sub-folder. The dae_to_cas one provides a default task file for reversing the process and generating new .cas files. The cas_to_dae one allows you to repeat the process you just did by simply running the IWTE Task, you can also adapt that task file to load multiple animations. The following is an example task file for cas_to_dae with multiple anims, and using rtw skeleton and anims, note that if the file path/name has spaces the entire path needs to be inside " ", also note the skeleton name does not have a file extension, direction of \ or / doesn't matter:<br />
<task_id> cas_to_dae <br />
<cas_mesh_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\to_dae/from_dae/ALEX_companion_cavalry_lod_1.cas <br />
<directory_out> I:\M2TW\M2TWcopy\mods\IWTE/to_dae <br />
<dae_file_name_out> ALEX_companion_cavalry_taunt.dae <br />
<cas_animation_file_format> rtw <br />
<create_text_file> yes <br />
<create_task_file_from_input> yes <br />
<task_file_full_path_out> I:\M2TW\M2TWcopy\mods\IWTE/IWTE_tasks/dae_to_cas_alextaunt_task.txt <br />
<skeleton_unpacked_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\testthings\animations\rome_animations/fs_swordsman<br />
<cas_file_full_path_in_action_list> <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_04 taunt 2.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_06 taunt 1.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_07 taunt 3.cas" <br />
<br />
To get amended units/anims back into game you will need to 'export' 'collada' from Blender or 3dsMax. The .dae file created will have the same structure whether you're converting to Mesh/Cas model, and Full/XIDX packable anims, so you need to use a task file to specify the format to be returned. The automatically generated return task file will have assumed you want the same format that went in, so the task file above will have generated this return file:<br />
<task_id> dae_to_cas # to read dae file and generate *.cas files<br />
<dae_file_full_path_in> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/ALEX_companion_cavalry_taunt.dae # *.dae file to read in. i.e. change to collada name exported from Blender<br />
<directory_out> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/from_dae # directory to put new created files<br />
<cas_mesh_file_name_out> alex_companion_cavalry_lod_1.cas # *.cas file to be created<br />
<cas_animation_file_format> rr # format of cas to be created by dae (rtw or full) <br />
<cas_unpacked_skeleton_scale> 1.0000 # cas unpacked skeleton scaling<br />
<overlap_frames> no # overlap frames selection used to create the dae (not used on import)<br />
<cas_file_name_out_anim_split_list> # cas anim files start and end frames<br />
"lid_57_04 taunt 2.cas" 1 79 <br />
"lid_57_06 taunt 1.cas" 80 162 <br />
"lid_57_07 taunt 3.cas" 163 237 <br />
#<end_frame> 237 # Last animated frame (use to see full animation in blender)<br />
<br />
If you're trying to convert format, instead of rr you need to use:<br />
<cas_animation_file_format> '''m2''' #for M2TW anims re-packable by XIDX<br />
<br />
<cas_animation_file_format> '''full''' #for M2TW anims re-packable by '''the game'''<br />
<br />
If you want an M2TW mesh back instead of a .cas model use the <br />
<task_id> '''dae_to_mesh'''<br />
instead of dae_to_cas<br />
<br />
Using the 'Animated dae to cas_mesh' ('''4''') button will generate a separate cas model file and a full version anim called _action. See below for animation file type details.<br />
<br />
Using the 'RTW object animation dae to cas' ('''5''') will produce a cas which includes both the model and the animation together, these are used only for [[Spot fx animations and effects|spot_fx]] items in RTW/RR.<br />
<br />
===Bone Weighting===<br />
RTW battle map units and strat models and M2TW strat models will generally have vertexes weighted to only one bone per vertex.<br />
<br />
If you convert a dae with multiple bone weights per vertex to cas with IWTE it will generate one cas with vertexes weighted to up to two bones, and one cas with the suffix "_lod1". The _lod1 cas can be renamed and used for RTW/M2TW. Ideally however you should limit the bone weight totals yourself so you can check how the model will behave in game when posed. See [[Blender_hints_and_tips#Bone_Assignment|Blender hints and tips]].<br />
<br />
For details on optionally creating a simple multi-weighted Section see: [[Model_flexi_m in RTW]]<br />
<br />
===Cas animation types===<br />
IWTE supports the full (never packed) versions of [[Cas Files|.cas files]], as supplied by Caliban and also the ones that have been generated from Pack files by XIDX, IWTE or similar tools. PLEASE NOTE: The RTW and M2TW anims generated from the pack files use a different format - DO NOT pack RTW types into M2TW packs or vice-versa - check that you are generating the correct type for the game you are going to use them in! Also do not attempt to re-pack the full type (where you can see the bone names) with XIDX or IWTE, they will only work if you have a full set including .evt files and let M2TW repack them from descr_skeleton.txt.<br />
<br />
==Units - General Tips==<br />
*Seams - To avoid seams in the finished model you CAN 'weld' vertexes that have disconnected uvs, in Blender use Mesh> Clean Up> Merge by Distance (without uvs ticked), and Shading> Smooth Faces. That will get you a shared normal that allows the area to look smooth. For the game IWTE will generate two vertexes at that point to preserve the uvs and set that normal as a custom normal for each.<br />
<br />
*Anims/skeletons - In Blender you can make any alteration you like to the 'Pose Mode' this will only affect the animation frames. Do NOT, unless you know what you are doing... move or edit the bones in the 'Armature' edit mode, this will affect the bone positions in the model/anim.cas produced, and will need to be matched to a skeleton with the same bone positions. If using the "full" M2TW cas anims that the game re-packs you can adjust the bone positions for a folder of .cas anims by using the skeleton replacement method detailed below. If using XIDX unpacked/packed anims you will need to change the skeleton using other tools.<br />
<br />
==Animations - General Tips==<br />
*Blender must be set to 20fps BEFORE importing a .dae with animation created by IWTE. To do this use the custom setting and type in 20. When you import a .dae file you should then see the keyframes neatly aligned with the time markers. See below:<br />
<br />
[[File:20fps.jpg|200px]]<br />
<br />
==Mesh Names/Comments==<br />
The Blender .dae interface does not support comments, so all the information about the mesh sections (primary/secondary weapons etc.) needs to go in the mesh name:<br />
<br />
*Section Naming - For Blender the full details of the group names are stored in the name itself. There isn't a comment section like milkshape. Things that need to go back into the game as separate sections, e.g. to denote primary weapons, or alternate versions, need a double underscore __ to show where the name should be split or a space included. For M2TW mesh sections that you want to be optional, use __opt at the end of the group name.<br />
<br />
==Siege/Artillery Engines==<br />
Siege/Artillery for both RTW and M2TW use the "full" cas anim versions (not packed/unpacked at any stage). For M2TW use the dedicated Model Files > Mesh Models > Siege Engine mesh to date for export and IWTE Task import process. For RTW use the Model Files > Cas Models > Animated cas_mesh to date, the RTW process seems to be quite straightforward as there isn't the mis-alignment between bone names and start poses that is present in M2TW.<br />
===M2TW Siege Engine Skeleton Alteration Example Process===<br />
*In top menu bar go to Model Files > Siege Engine mesh to dae > select mesh, then default cas then anim cas.<br />
:Check that the default .cas is actually the one listed as anim-default in descr_engine_skeleton.txt<br />
:also check that you're using an anim that is in use in game - some of the anims in the folder don't work.<br />
<br />
*IWTE will have written a .dae file in "to_dae" sub-folder below your .mesh model location.<br />
<br />
*Load in Blender by using 'file' 'import' 'collada'<br />
<br />
*Add bones as required to the Armature - note there should only be one top level bone, e.g bone_body add all other bones as child of this, or of existing bones.<br />
<br />
*Use 'weight paint' to assign vertices to bones as required.<br />
:Note - the .mesh file will only accept vertexes weighted to a max of 2 bones<br />
:use 'limit total' in 'weights' menu and set to 2 to avoid any verts weighted to 3 or more bones - (this is applied to selected verts only)<br />
:use 'normalise all' to make sure verts are fully weighted, use 'auto normalise' option whilst working also<br />
<br />
*change animation by switching to 'animation' layout in top bar<br />
:trigger Pose mode by clicking pose running man symbol within the Armature<br />
:if you can't see bones, or the summary when you click them, in main sidebar click the pose (running man) button, select "viewport display" and select the "in front" option<br />
:when you move a bone in the pose mode use shortcut "i" in main window to open keyframe dialogue and select "LocRot"<br />
:you can delete copy or move keyframes around for selected bones in the Dope Sheet section<br />
<br />
*Export collada - in settings check Anim is on Matrix option and 'keep keyframes' and 'all keyed curves' are selected.<br />
'''DO NOT USE IWTE Model Files > Siege Engine dae to mesh to convert back''' the dae doesn't include enough info to retain the three textures named in the mesh .<br />
<br />
*USE the "dae_to_mesh_*****_task.txt" that IWTE has written into the "IWTE_Tasks" sub-folder where your IWTE.exe is<br />
:change the .dae name you're reading in to the one you've just saved - change any other output names IF you need to<br />
:check the number of frames listed ties up with the end frame you set in collada.<br />
<br />
*Run the task file from the IWTE Task button in top menu bar, the separate files will be saved where specified in the task file.<br />
<br />
*If you have changed the number of bones used or their positions you will need to align all the other .cas anims used by the mesh, to do this use the skeleton replacement process explained below.<br />
<br />
==Skeleton Replacement (M2TW)==<br />
''RTW and packed M2TW skeletons can not be changed via this method.'' <br><br />
To replace the skeleton in M2TW where you have the set of full .cas anims that the game re-packs in the IWTE top menu bar go to:<br />
:Model Files > Cas Models > Skeleton Replacement<br />
<br />
*On the first prompt select the .cas file containing the bones in the basepose positions you want (probably the default or basepose .cas)<br />
*On the second prompt select the FOLDER that contains all the .cas files you want to change.<br />
<br />
The revised files will be saved in a sub folder of that folder called "updateskeletons" they will have the same names as the original .cas files and can be used to directly replace them. Please back-up your original files before doing this, and remember that other .cas/.mesh models may be using the same files, so you may need to create a separate folder and separate entry in descr_skeleton.txt etc.<br />
<br />
Adding bones should be straightforward, if you delete bones that had child bones then the result may be unpredictable and the resulting animations may need editing. <br />
<br />
===Bone Renaming Task===<br />
To rename the bones throughout a folder of full .cas animations use a task file. If you want to swap the names of bones you need to add an additional stage to re-name one bone to a temporary name, the example below shows how to swap bone_H_Saddle and bone_Spine names with each other:<br />
<task_id> cas_bone_name_change <br />
<directory_in> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka <br />
<directory_out> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka\changedbones <br />
<bone_name_change_list> <br />
bone_H_Saddle bone_H_Saddlex<br />
bone_Spine bone_H_Saddle<br />
bone_H_Saddlex bone_Spine<br />
<br />
* The task cas_bone_name_change changes a bone name (the NEW name must not already exist in a skeleton this is being applied to)<br />
* Directory in is optional, alternatively the task file can be placed in the directory and launched from there<br />
* Directory out is optional, if not given a sub-folder /updateskeletons will be created<br />
<br />
===Fixing Floating Units===<br />
For how to create the new basepose see [[Blender_hints_and_tips#Fixing_Floating_Units|Blender Hints and Tips]]<br />
<br />
Once you have the new basepose.cas you need to use it as the source to replace the bone positions in ALL of the animations the unit uses. For strat_models if you haven't already edited the .cas files of all the effected models include them in the skeleton replacement process too.<br />
<br />
==Weapon Animations (M2TW)==<br />
M2TW includes the possibility of having 'add-on' animations for weapons/shields. These are commonly listed in the model db file but rarely actually used.<br />
<br />
The advantage of properly using the weapon bones and anims instead of adding additional 'normal' bones to the skeleton is that the main skeleton remains 'standard' and does not cause the victim death anim bug when in battle with units whose skeletons have different numbers of bones!<br />
<br />
==IWTE Task File Options==<br />
===Text File Output===<br />
using <create_text_file> you can optionally generate .txt files that show, '''for information purposes only''', the content of the incoming .mesh/.cas files, the default option is <br />
<create_text_file> no #stops any text file being created <br />
<create_text_file> yes #creates a summary text file with header/trailer info, numbers of verts, texture and mesh names etc.<br />
<create_text_file> full #creates a full text file showing the interpretation of all the ints/floats etc in the file, with comments<br />
<br />
<br />
==External Links==<br />
* [https://www.blender.org/ Blender]<br />
* [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 IWTE Download]<br />
* [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing Discussion thread].<br />
<br />
[[Category:M2TW Modding]]<br />
[[Category:Blender]]<br />
[[Category:RTW Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Template:IWTE&diff=86510Template:IWTE2023-06-09T09:34:48Z<p>Makanyane: changed name</p>
<hr />
<div>{| class="infobox bordered" style="box-shadow:1px 1px 3px 1px black;"<br />
! '''[[IWTE]]''' <br />
|-<br />
| style="padding:0.5em;" |<br />
<center><div style="opacity:0.65; padding-bottom: 1em;">[[File:Wilddog.jpg|center|link=IWTE|IWTE main page]]</div></center><br />
<br />
*'''[[IWTE|Main Article]]''' <br />
*[[IWTE - Settlements in Blender| M2TW Settlements in Blender]]<br />
**[[Building Animations - M2TW]]<br />
*[[IWTE - Units in Blender/Milkshape]]<br />
**[[IWTE - convert M2TW siege engine to RTW|Convert M2TW siege engine to RTW]]<br />
**[[Model_flexi_m in RTW]]<br />
*[[IWTE - Rome Remastered Functions]]<br />
**[[Creating New Campaign Map in Rome Remastered|Creating a New Campaign Map]]<br />
----<br />
'''Useful Reference:'''<br><br />
*[[Cas Files]]<br />
*[[Blender hints and tips]]<br />
*[[:Category:M2TW Battle Map Modding|M2TW Battle Map Modding]]<br />
|}<br />
<br />
<noinclude>[[category:Navigation Template]]</noinclude></div>Makanyanehttps://wiki.twcenter.net/index.php?title=IWTE_-_Units_in_Blender&diff=86509IWTE - Units in Blender2023-06-09T09:33:31Z<p>Makanyane: Makanyane moved page IWTE - Units in Blender to IWTE - Units in Blender/Milkshape: new function to milkshape included</p>
<hr />
<div>#REDIRECT [[IWTE - Units in Blender/Milkshape]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=IWTE_-_Units_in_Blender/Milkshape&diff=86508IWTE - Units in Blender/Milkshape2023-06-09T09:33:30Z<p>Makanyane: Makanyane moved page IWTE - Units in Blender to IWTE - Units in Blender/Milkshape: new function to milkshape included</p>
<hr />
<div>{{RTW M2TW Modding Logo}}<br />
{{IWTE}} <br />
__TOC__<br />
<br />
<big>Tips and instructions for working with RTW and M2TW battle map units and strat map characters via '''[[IWTE]]''' and '''[[Blender]]''' using the .dae format.</big> <br />
<br />
''The .dae files used for the Collada import/export can also be used with '''3ds Max''', however, max users absolutely have to use the [https://github.com/KhronosGroup/OpenCOLLADA/wiki/OpenCOLLADA-Tools '''OpenCollada plugin'''] and file format when importing/exporting files, max comes with the AutodeskCollada file format by default which neither imports nor exports files from the game correctly.''<br />
<br />
*IWTE download [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 here] - please use the latest version, early versions do not have this functionality.<br />
*For queries about these functions please ask [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing here].<br />
*For information on working on M2TW Settlements in Blender see [[IWTE - Settlements in Blender]]<br />
*For general tips on working with Blender see [[Blender hints and tips]]<br />
*For related info about .cas file structure see [[Cas Files|here]]<br />
<br />
<br />
==Export and Import M2TW .mesh Units==<br />
The most useful method of export involves matching the unit .mesh with its skeleton basepose and one or more animations. <br />
<br />
The drop-down menu in IWTE allows a unit .mesh to be merged with its basepose skeleton and one animation. A task file is needed to allow combining of animations and is the only way to also incorporate weapon animations.<br />
<br />
The drop-down menu options, and alternative IWTE Task button positions are shown below:<br />
<br />
[[File:Export-mesh-in-IWTE.jpg]]<br />
<br />
Select 'Unit mesh to date' if you have the "full" version of the .cas anims (the ones the game re-packs). Select the 'Unit mesh/skel/casanim to dae' option if you have the versions unpacked using XIDX.<br />
<br />
Select the double mesh option for unit meshes that have both a main and attachment texture. Select the single mesh option for most other cases (e.g. standard mounts). <br />
<br />
You will be prompted to select the model .mesh first, then the basepose.cas for the skeleton (full cas version) or the unpacked skeleton file (unpacked version), and then an animation.cas file that is compatible with that skeleton (this will need to be in the same format as the skeleton, full or unpacked). <br />
<br />
===Export/Import by Task Process===<br />
To generate a .dae file from .mesh and .anims via the task process you will need a text file ending in _task.txt which starts with the mesh to dae command, run the task file by selecting the 'IWTE Task' > 'Select Task File' buttons. See example below for mesh_to_dae (the extra line breaks have been included just to show the body/weapon pairing):<br />
<br />
<task_id> mesh_to_dae <br />
<mesh_file_full_path_in> C:\M2TW\mods\devkit\data\animations\EB_Slinger\numidian_slinger_lod0.mesh <br />
<mesh_double_texture> yes <br />
<cas_file_types_in_list> body weapon<br />
<br />
<cas_file_full_path_in_default_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_basepose.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas<br />
<br />
<cas_file_full_path_in_action_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_stand_A_idle.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas <br />
<br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_attack_missile_ready.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_attack_missile_ready.cas <br />
<br />
<directory_out> C:\M2TW\mods\devkit\data\animations\EB_Slinger <br />
<dae_file_name_out> EBslingerAnims.dae <br />
<create_text_file> yes <br />
<br />
Please see the IWTE example control processes.txt file that ships with IWTE for further details/instructions. <br />
<br />
Running the task will generate you a .dae file with the animations joined together with an additional 'basepose' frame added at frame 0, to aid editing. The task will also auto-generate for a reverse dae_to_mesh_****_task.txt file for you, this will list the start and end frame positions of all included animations and the names of all the files that will be re-created from the .dae. The names and frame positions can be edited to suit any changes you may require before running the return task.<br />
<br />
When creating the task files it is common to make minor errors in the file names/paths that mean IWTE cannot find all the elements! If you get an error message whilst running the task you'll get a chance to read the error message <br />
(which is easier in the command window) - you can then click "Ignore" to keep IWTE open, fix the name/path/file issue in the .txt file and try running the task again. The error message should indicate which file it couldn't find. If you forget to add the file extension and try and get it to open a folder you'll get an 'access violation' type message. <br />
<br />
For unit models that do not have any elements weighted to the 'weapon bones' you only need to run the process with <br />
<br />
<code> <cas_file_types_in_list> body </code> <br />
<br />
and supply the main skeleton basepose and animation.<br />
<br />
If the mesh has a weapon weighted to weapon bones use the ''body weapon'' example shown above.<br />
<br />
If the mesh has both a weapon weighted to weapon bones and a shield weighted to bone_shield etc use<br />
<br />
<code> <cas_file_types_in_list> body weapon shield</code> <br />
<br />
and supply the main skeleton, weapon animation and shield animation baseposes and animations in sets of three in order.<br />
<br />
Note: a lot of models that are apparently using ''fs_test_shield'' according to their [[battle_models.modeldb]] entry don't actually have anything weighted to bone_shield, making the shield 'anim' irrelevant.<br />
<br />
===UV Mapping for Double Texture Units===<br />
The mesh format for both double and singled textured units in M2TW is actually exactly the same with just one set of uv's that should range from 0 to 1.0 in both horizontal and vertical axis.<br />
<br />
If you assign two textures to a unit in the [[battle_models.modeldb]] then the game expands out the horizontal axis of the uv maps so that the area from 0 to 0.5 is used to cover 0 to 1 on the first texture, and the uv's from 0.5 to 1.0 on the horizontal axis are used to cover 0 to 1 on the second texture.<br />
<br />
Milkshape/.mesh converters use the texture (Main or Attachment) assigned to a mesh group to determine which section of the uv map the group's uv coordinates will be moved to, with Main texture co-ordinates compressed into the 0>0.5 area and Attachment texture co-ordinates compressed into the 0.75>1.0 section.<br />
<br />
The IWTE mesh to .dae for Blender process works differently. The texture assignment process is used purely so you can view the mesh groups with the correct relevant texture. The 0>1.0 horizontal uvs are expanded to 0>2.0 if you use the process for 'double textures' and then compressed back to 0>1.0 on the return to .mesh.<br />
<br />
In Blender the uv mapping to the two textures will look like the image below.<br />
<br />
[[File:Uvs for double textured units.jpg|400px]]<br />
<br />
To see the 2nd texture under its uv's open the sidebar (n) in the uv screen and select the 'repeat texture' button.<br />
In Blender it is possible to partially assign some triangles from a group to the 1st texture and some triangles to the 2nd texture, if you do that please remember to also move the uv's to the appropriate zone.<br />
<br />
===Scaling of Anims===<br />
The 'full' cas animations as supplied by Caliban should be regarded as scale 1.0. If you need to load from them to suit a skeleton that will be scaled by the game you need to give IWTE the skeleton scale in the mesh_to_extract task using the appropriate tag e.g.<br><br />
<skeleton_scale> <br><br />
<mount_skeleton_scale><br />
<br />
If you load from the unpacked skeleton and unpacked animation the scale will be read from the skeleton, so you do not need to add any further information.<br />
<br />
==Export and Import RTW Units & RTW/M2TW Strat Characters==<br />
<big>'''NOTE:''' IWTE now supports the full weighting allowed in Rome Remastered by default - to ensure you do not create RTW/M2TW cas files that exceed their games capabilities add '''<cas_mesh_format> rtw''' (or M2) to the task file.</big><br />
<br />
<br />
The process for this is similar to the .mesh Export/Import process described above, the button locations are shown in the below image: <br><br />
[[File:Export-cas-to-dae.jpg|Exporting animated cas to date with IWTE]]<br />
<br />
Use the 'Animated cas_mesh to dae' ('''3''') button if you have the full versions of the animation files, e.g the type supplied by Caliban that M2TW itself re-packs. The first file requested will be the .cas 'mesh', e.g. the one with the body model in it. The second file requested will be an animation file, if you do not have a suitable animation file just click 'Cancel' to close the selection screen. You can use the 'Animated cas/dae' button for all unit/character .cas files even if you aren't going to load an animation.<br />
<br />
If you are using RTW or are using M2TW but only have the skeleton/cas files unpacked using XIDX or other tools use the appropriate '* casmesh,skel,casanim to dae' button ('''1''' or '''2'''). The first file requested will again be the .cas 'mesh', e.g. model. The second file requested will be the skeleton file (as produced by XIDX/tool using extract_skeletons). The third file requested will be the .cas animation file (as produced by XIDX/tool using extract_animations). For Rome Remastered use the RTW button.<br />
<br />
These processes will generate a .dae file in a /to_dae sub-folder where your IWTE.exe is located. You will also have two task files generated in the /iwte_tasks sub-folder. The dae_to_cas one provides a default task file for reversing the process and generating new .cas files. The cas_to_dae one allows you to repeat the process you just did by simply running the IWTE Task, you can also adapt that task file to load multiple animations. The following is an example task file for cas_to_dae with multiple anims, and using rtw skeleton and anims, note that if the file path/name has spaces the entire path needs to be inside " ", also note the skeleton name does not have a file extension, direction of \ or / doesn't matter:<br />
<task_id> cas_to_dae <br />
<cas_mesh_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\to_dae/from_dae/ALEX_companion_cavalry_lod_1.cas <br />
<directory_out> I:\M2TW\M2TWcopy\mods\IWTE/to_dae <br />
<dae_file_name_out> ALEX_companion_cavalry_taunt.dae <br />
<cas_animation_file_format> rtw <br />
<create_text_file> yes <br />
<create_task_file_from_input> yes <br />
<task_file_full_path_out> I:\M2TW\M2TWcopy\mods\IWTE/IWTE_tasks/dae_to_cas_alextaunt_task.txt <br />
<skeleton_unpacked_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\testthings\animations\rome_animations/fs_swordsman<br />
<cas_file_full_path_in_action_list> <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_04 taunt 2.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_06 taunt 1.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_07 taunt 3.cas" <br />
<br />
To get amended units/anims back into game you will need to 'export' 'collada' from Blender or 3dsMax. The .dae file created will have the same structure whether you're converting to Mesh/Cas model, and Full/XIDX packable anims, so you need to use a task file to specify the format to be returned. The automatically generated return task file will have assumed you want the same format that went in, so the task file above will have generated this return file:<br />
<task_id> dae_to_cas # to read dae file and generate *.cas files<br />
<dae_file_full_path_in> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/ALEX_companion_cavalry_taunt.dae # *.dae file to read in. i.e. change to collada name exported from Blender<br />
<directory_out> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/from_dae # directory to put new created files<br />
<cas_mesh_file_name_out> alex_companion_cavalry_lod_1.cas # *.cas file to be created<br />
<cas_animation_file_format> rr # format of cas to be created by dae (rtw or full) <br />
<cas_unpacked_skeleton_scale> 1.0000 # cas unpacked skeleton scaling<br />
<overlap_frames> no # overlap frames selection used to create the dae (not used on import)<br />
<cas_file_name_out_anim_split_list> # cas anim files start and end frames<br />
"lid_57_04 taunt 2.cas" 1 79 <br />
"lid_57_06 taunt 1.cas" 80 162 <br />
"lid_57_07 taunt 3.cas" 163 237 <br />
#<end_frame> 237 # Last animated frame (use to see full animation in blender)<br />
<br />
If you're trying to convert format, instead of rr you need to use:<br />
<cas_animation_file_format> '''m2''' #for M2TW anims re-packable by XIDX<br />
<br />
<cas_animation_file_format> '''full''' #for M2TW anims re-packable by '''the game'''<br />
<br />
If you want an M2TW mesh back instead of a .cas model use the <br />
<task_id> '''dae_to_mesh'''<br />
instead of dae_to_cas<br />
<br />
Using the 'Animated dae to cas_mesh' ('''4''') button will generate a separate cas model file and a full version anim called _action. See below for animation file type details.<br />
<br />
Using the 'RTW object animation dae to cas' ('''5''') will produce a cas which includes both the model and the animation together, these are used only for [[Spot fx animations and effects|spot_fx]] items in RTW/RR.<br />
<br />
===Bone Weighting===<br />
RTW battle map units and strat models and M2TW strat models will generally have vertexes weighted to only one bone per vertex.<br />
<br />
If you convert a dae with multiple bone weights per vertex to cas with IWTE it will generate one cas with vertexes weighted to up to two bones, and one cas with the suffix "_lod1". The _lod1 cas can be renamed and used for RTW/M2TW. Ideally however you should limit the bone weight totals yourself so you can check how the model will behave in game when posed. See [[Blender_hints_and_tips#Bone_Assignment|Blender hints and tips]].<br />
<br />
For details on optionally creating a simple multi-weighted Section see: [[Model_flexi_m in RTW]]<br />
<br />
===Cas animation types===<br />
IWTE supports the full (never packed) versions of [[Cas Files|.cas files]], as supplied by Caliban and also the ones that have been generated from Pack files by XIDX, IWTE or similar tools. PLEASE NOTE: The RTW and M2TW anims generated from the pack files use a different format - DO NOT pack RTW types into M2TW packs or vice-versa - check that you are generating the correct type for the game you are going to use them in! Also do not attempt to re-pack the full type (where you can see the bone names) with XIDX or IWTE, they will only work if you have a full set including .evt files and let M2TW repack them from descr_skeleton.txt.<br />
<br />
==Units - General Tips==<br />
*Seams - To avoid seams in the finished model you CAN 'weld' vertexes that have disconnected uvs, in Blender use Mesh> Clean Up> Merge by Distance (without uvs ticked), and Shading> Smooth Faces. That will get you a shared normal that allows the area to look smooth. For the game IWTE will generate two vertexes at that point to preserve the uvs and set that normal as a custom normal for each.<br />
<br />
*Anims/skeletons - In Blender you can make any alteration you like to the 'Pose Mode' this will only affect the animation frames. Do NOT, unless you know what you are doing... move or edit the bones in the 'Armature' edit mode, this will affect the bone positions in the model/anim.cas produced, and will need to be matched to a skeleton with the same bone positions. If using the "full" M2TW cas anims that the game re-packs you can adjust the bone positions for a folder of .cas anims by using the skeleton replacement method detailed below. If using XIDX unpacked/packed anims you will need to change the skeleton using other tools.<br />
<br />
==Animations - General Tips==<br />
*Blender must be set to 20fps BEFORE importing a .dae with animation created by IWTE. To do this use the custom setting and type in 20. When you import a .dae file you should then see the keyframes neatly aligned with the time markers. See below:<br />
<br />
[[File:20fps.jpg|200px]]<br />
<br />
==Mesh Names/Comments==<br />
The Blender .dae interface does not support comments, so all the information about the mesh sections (primary/secondary weapons etc.) needs to go in the mesh name:<br />
<br />
*Section Naming - For Blender the full details of the group names are stored in the name itself. There isn't a comment section like milkshape. Things that need to go back into the game as separate sections, e.g. to denote primary weapons, or alternate versions, need a double underscore __ to show where the name should be split or a space included. For M2TW mesh sections that you want to be optional, use __opt at the end of the group name.<br />
<br />
==Siege/Artillery Engines==<br />
Siege/Artillery for both RTW and M2TW use the "full" cas anim versions (not packed/unpacked at any stage). For M2TW use the dedicated Model Files > Mesh Models > Siege Engine mesh to date for export and IWTE Task import process. For RTW use the Model Files > Cas Models > Animated cas_mesh to date, the RTW process seems to be quite straightforward as there isn't the mis-alignment between bone names and start poses that is present in M2TW.<br />
===M2TW Siege Engine Skeleton Alteration Example Process===<br />
*In top menu bar go to Model Files > Siege Engine mesh to dae > select mesh, then default cas then anim cas.<br />
:Check that the default .cas is actually the one listed as anim-default in descr_engine_skeleton.txt<br />
:also check that you're using an anim that is in use in game - some of the anims in the folder don't work.<br />
<br />
*IWTE will have written a .dae file in "to_dae" sub-folder below your .mesh model location.<br />
<br />
*Load in Blender by using 'file' 'import' 'collada'<br />
<br />
*Add bones as required to the Armature - note there should only be one top level bone, e.g bone_body add all other bones as child of this, or of existing bones.<br />
<br />
*Use 'weight paint' to assign vertices to bones as required.<br />
:Note - the .mesh file will only accept vertexes weighted to a max of 2 bones<br />
:use 'limit total' in 'weights' menu and set to 2 to avoid any verts weighted to 3 or more bones - (this is applied to selected verts only)<br />
:use 'normalise all' to make sure verts are fully weighted, use 'auto normalise' option whilst working also<br />
<br />
*change animation by switching to 'animation' layout in top bar<br />
:trigger Pose mode by clicking pose running man symbol within the Armature<br />
:if you can't see bones, or the summary when you click them, in main sidebar click the pose (running man) button, select "viewport display" and select the "in front" option<br />
:when you move a bone in the pose mode use shortcut "i" in main window to open keyframe dialogue and select "LocRot"<br />
:you can delete copy or move keyframes around for selected bones in the Dope Sheet section<br />
<br />
*Export collada - in settings check Anim is on Matrix option and 'keep keyframes' and 'all keyed curves' are selected.<br />
'''DO NOT USE IWTE Model Files > Siege Engine dae to mesh to convert back''' the dae doesn't include enough info to retain the three textures named in the mesh .<br />
<br />
*USE the "dae_to_mesh_*****_task.txt" that IWTE has written into the "IWTE_Tasks" sub-folder where your IWTE.exe is<br />
:change the .dae name you're reading in to the one you've just saved - change any other output names IF you need to<br />
:check the number of frames listed ties up with the end frame you set in collada.<br />
<br />
*Run the task file from the IWTE Task button in top menu bar, the separate files will be saved where specified in the task file.<br />
<br />
*If you have changed the number of bones used or their positions you will need to align all the other .cas anims used by the mesh, to do this use the skeleton replacement process explained below.<br />
<br />
==Skeleton Replacement (M2TW)==<br />
''RTW and packed M2TW skeletons can not be changed via this method.'' <br><br />
To replace the skeleton in M2TW where you have the set of full .cas anims that the game re-packs in the IWTE top menu bar go to:<br />
:Model Files > Cas Models > Skeleton Replacement<br />
<br />
*On the first prompt select the .cas file containing the bones in the basepose positions you want (probably the default or basepose .cas)<br />
*On the second prompt select the FOLDER that contains all the .cas files you want to change.<br />
<br />
The revised files will be saved in a sub folder of that folder called "updateskeletons" they will have the same names as the original .cas files and can be used to directly replace them. Please back-up your original files before doing this, and remember that other .cas/.mesh models may be using the same files, so you may need to create a separate folder and separate entry in descr_skeleton.txt etc.<br />
<br />
Adding bones should be straightforward, if you delete bones that had child bones then the result may be unpredictable and the resulting animations may need editing. <br />
<br />
===Bone Renaming Task===<br />
To rename the bones throughout a folder of full .cas animations use a task file. If you want to swap the names of bones you need to add an additional stage to re-name one bone to a temporary name, the example below shows how to swap bone_H_Saddle and bone_Spine names with each other:<br />
<task_id> cas_bone_name_change <br />
<directory_in> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka <br />
<directory_out> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka\changedbones <br />
<bone_name_change_list> <br />
bone_H_Saddle bone_H_Saddlex<br />
bone_Spine bone_H_Saddle<br />
bone_H_Saddlex bone_Spine<br />
<br />
* The task cas_bone_name_change changes a bone name (the NEW name must not already exist in a skeleton this is being applied to)<br />
* Directory in is optional, alternatively the task file can be placed in the directory and launched from there<br />
* Directory out is optional, if not given a sub-folder /updateskeletons will be created<br />
<br />
===Fixing Floating Units===<br />
For how to create the new basepose see [[Blender_hints_and_tips#Fixing_Floating_Units|Blender Hints and Tips]]<br />
<br />
Once you have the new basepose.cas you need to use it as the source to replace the bone positions in ALL of the animations the unit uses. For strat_models if you haven't already edited the .cas files of all the effected models include them in the skeleton replacement process too.<br />
<br />
==Weapon Animations (M2TW)==<br />
M2TW includes the possibility of having 'add-on' animations for weapons/shields. These are commonly listed in the model db file but rarely actually used.<br />
<br />
The advantage of properly using the weapon bones and anims instead of adding additional 'normal' bones to the skeleton is that the main skeleton remains 'standard' and does not cause the victim death anim bug when in battle with units whose skeletons have different numbers of bones!<br />
<br />
==IWTE Task File Options==<br />
===Text File Output===<br />
using <create_text_file> you can optionally generate .txt files that show, '''for information purposes only''', the content of the incoming .mesh/.cas files, the default option is <br />
<create_text_file> no #stops any text file being created <br />
<create_text_file> yes #creates a summary text file with header/trailer info, numbers of verts, texture and mesh names etc.<br />
<create_text_file> full #creates a full text file showing the interpretation of all the ints/floats etc in the file, with comments<br />
<br />
<br />
==External Links==<br />
* [https://www.blender.org/ Blender]<br />
* [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 IWTE Download]<br />
* [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing Discussion thread].<br />
<br />
[[Category:M2TW Modding]]<br />
[[Category:Blender]]<br />
[[Category:RTW Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=File:Export-mesh-in-IWTE.jpg&diff=86507File:Export-mesh-in-IWTE.jpg2023-06-09T09:27:50Z<p>Makanyane: Makanyane uploaded a new version of File:Export-mesh-in-IWTE.jpg</p>
<hr />
<div>== Summary ==<br />
where to find the mesh to dae in IWTE<br />
[[Category:M2TW Modding Images]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=File:IWTE_collada_menu.jpg&diff=86506File:IWTE collada menu.jpg2023-06-09T09:19:51Z<p>Makanyane: Makanyane uploaded a new version of File:IWTE collada menu.jpg</p>
<hr />
<div>== Summary ==<br />
menu location for IWTE collada import/export<br />
<br />
[[Category:M2TW Modding Images]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=File:IWTE_painter_process.jpg&diff=86505File:IWTE painter process.jpg2023-06-09T09:16:16Z<p>Makanyane: Makanyane uploaded a new version of File:IWTE painter process.jpg</p>
<hr />
<div>== Summary ==<br />
Accessing the IWTE painter process<br />
[[Category:M2TW Modding Images]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=TWC_Wiki:User_Rights&diff=86503TWC Wiki:User Rights2023-06-08T15:51:12Z<p>Makanyane: /* Bots */ I am not a red link...</p>
<hr />
<div>==Overview==<br />
This page describes '''User Rights''', a feature of the software this wiki uses. These are separate from the management of the wiki, which is governed by TWC's Content [[Hex]] and supervised by the [[Wiki Team]] with assistance from independent editors. <br />
<br />
User rights are described at Mediawiki.org here: [https://www.mediawiki.org/wiki/Manual:User_rights Manual:User rights]<br />
<br />
This page explains what user rights exist on TWC Wiki and how they are used. Note that these rights are not hierarchical: what would be an Administrator on TWC (including the rights of all lower staff) is a combination of user rights below. A bureaucrat may be able to assign any rights, but they have to assign administrator and interface administrator to themselves in order to use the permissions in either group.<br />
<br />
Note that none of these rights grant the ability to edit core wiki files directly or update/change the software. That is exclusive to the [[Technical Staff]].<br />
<br />
===Bureaucrat===<br />
Bureaucrats can assign or remove all rights listed including bureaucrat itself, and rename users.<br />
<br />
It is held by Hex, the Wiki Director, and trusted former members of either group.<br />
<br />
===Administrators===<br />
Administrators are also referred to as as Sysops. Nearly every permission on the wiki is available to this group except the above, and they can assign some of the user rights below. Highlights include editing most of the interface except those limited to Interface Administrator, placing blocks and checking user accounts in cases of abuse, and <br />
<br />
It is held by Hex, the Wiki Director, Wiki Team members as needed, and trusted former members of either group.<br />
<br />
===Interface Administrators===<br />
Interface administrator contains the ability to edit critical interface pages including global CSS and JS for the wiki. These critical pages are isolated from the standard administrator access.<br />
<br />
It is held by Hex, the Wiki Director, Wiki Team members as needed, and trusted former members of either group.<br />
<br />
===Auto/confirmed Users===<br />
New accounts may not be able to edit certain pages because they are 'semi protected', ie, they cannot be edited until someone is more established. Autoconfirmed is automatically gained when a user has been around 4 days and has made 10 edits. Confirmed may be assigned upon request if a page needs to be edited before these requirements are met.<br />
<br />
==Less used rights==<br />
===Check User===<br />
Allows select users to 'check' the IP of an editor. This right is a part of the administrator kit, and is rarely needed on its own.<br />
<br />
===Patrollers===<br />
A Wiki term for users who monitor new changes for accuracy and content quality, using the 'patrol' feature of the wiki. Wiki team members may receive this, in addition to prolific editors. It is mainly assigned as an incentive and rarely sees use in modern editing, since the patrol feature is not typically required with TWC Wiki's editing traffic and more limited access.<br />
<br />
===Bots===<br />
Bots are sometimes used to perform actions autonomously. They are specially flagged on recent changes and are operated by one or more people, usually wiki team members. Example: MakBot, a bot used by former director [[User:Makanyane|Makanyane]] for mass text replacements. Please contact the Wiki Team or Content Hex if you wish to use a bot.<br />
<br />
[[Category: Wiki Administration]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=-mod:my_mod&diff=86326-mod:my mod2023-03-12T14:09:14Z<p>Makanyane: display title thing</p>
<hr />
<div>{{DISPLAYTITLE:-mod:my_mod}}<br />
''This article needs to be completed, for now see [http://forums.totalwar.org/vb/showthread.php?t=44332 here] for more details''<br />
<br />
-mod is a [[Command line functions| command line function]]<br />
<br />
Please note -mod:my_mod system works very differently for Rome Total War and Barbarian Invasion modifications.<br />
<br />
For a RTW modification the -mod system is very user friendly with generally only changed files required in the mod folder, that mod folder can also be run under the BI.exe simply by adding -mod:my_mod to the shortcut for the BI.exe instead of the RTW.exe. The system works by looking first in the mod folder and then referring to the RTW/data folder for any files not present in the [[mod folder]]. The only files that '''must''' be present in the mod folder are those that give the map information, eg. data/text/regions_and_settlements_.... .txt, the contents of the data/world/maps/base and data/world/maps/campaign folders.<br />
<br />
For a BI modification, however, almost the entire contents of the original BI/data folder have to be copied into the mod folder. This is because BI is already effectively a -mod of RTW and it is not possible under CA's set-up to have a multiple look-up that refers to the mod folder first, then BI/data, then RTW/data folder.<br />
<br />
Even for BI modifications, the -mod:my_mod system is highly recommended, although it does not save as much space as for RTW mods, it does mean the users' original game installation is not affected by the modification, so other compatible mods can also be installed and the vanilla game still be played without the need for multiple installs.<br />
<br />
[[Category:RTW Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Spot_fx_animations_and_effects&diff=86298Spot fx animations and effects2023-03-05T13:44:52Z<p>Makanyane: added bit about effects</p>
<hr />
<div>Effects such as smoke, or animated effects such as the gatehouse flags are added to RTW and Rome Remastered using the spot_fx system.<br />
<br />
Animated items added by spot_fx will appear in custom and campaign map battles, but are not rendered in the settlement view option launched from campaign without a battle.<br />
<br />
==Spot_fx==<br />
The spot_fx is a .cas model which gives the location and rotation of the effect - the name of the mesh/es inside the .cas match the name of the effect to be called. If you need two versions of the same effect you'd use 'smoke00' and 'smoke01' etc.<br />
<br />
The blacksmiths and armourers have examples of spot_fx using smoke. The .cas is added to the buildings dbb listing after the physical_info line:<br />
barbarian_armourer<br />
{<br />
stat_cat medium_wooden<br />
localised_name barbarian_armourer<br />
level<br />
{<br />
min_health 1<br />
battle_stats<br />
item barbarian_armourer<br />
physical_info info_barbarian_armourer.cas<br />
'''spot_fx ''' barbarian_armourer_spot_fx.CAS<br />
}<br />
<br />
The gatehouse buildings have examples of spot_fx files which call animated 'models_spot' which give the animated flag effects.<br />
<br />
The .cas files for spot_fx are placed in data/models_building/spot_fx.<br />
<br />
===Changing spot_fx cas files===<br />
Versions of [[IWTE]] from v21_11_c.exe onwards will correctly export and import the fx cas files to .dae for Blender/Max.<br />
<br />
The important thing to note is the mesh naming and the transforms. The transforms tell the game where the effect should be moved to.<br />
To add a new mesh create a flat plane at 0,0,0 if you need to include a rotation change the shape in EDIT mode so you can tell which way you've turned the plane. Then in OBJECT mode move and rotate the plane so it is centered where you want the effect. DO NOT apply the transforms, the end result in Blender still needs to show the transform values, see pic below:<br />
<br />
[[File:Spot fx.jpg|200px|How the spot_fx file should look in object mode in Blender]]<br />
<br />
Earlier tools for .cas conversion did not add the transform information in the correct format, this caused the misaligned and huge versions of spot_fx effects.<br />
<br />
===Effects===<br />
Smoke and fire effects are already included in the game (fire is used in BI buildings for the street lamps). A spot_fx cas with a mesh called '''''smoke'''_anything'' will get you the chimney smoke effect, which appears to be hard-coded. <br />
<br />
You can use a mesh called '''''night_fx'''_anything'' to activate a fire effect which will appear at night. The name should correspond to the name of an effect_set included in your descr_effects_torch_fire.txt, for example if you have added an effect called ''new_torch_fire'' you could use it in an effect set as shown below.<br />
<br />
effect_set < 0 1 2 3 4 > night_fx_anything<br />
{<br />
lod 10000<br />
{<br />
new_torch_fire<br />
}<br />
}<br />
<br />
<br />
==Models_spot==<br />
Data/models_building/models_spot/flag_horizontal_large.cas is an example of an animated spot effect. The flag uses an armature and keyframes that are contained in the same file as the model, and does not use an external skeleton.<br />
<br />
The models_spot need to be added to the game in the same way as building items. The existing ones are found in data/descr_items/di_spot_items.txt. The horizontal flag is coded as:<br />
type flag_horizontal_large<br />
lod<br />
max_distance 200<br />
'''model_anim''' models_spot/flag_horizontal_large.CAS<br />
lod<br />
max_distance 4000<br />
model_rigid models_spot/flag_horizontal_large_low.CAS<br />
Note that the model_anim setting is needed for the high lod to use its animation. The model_rigid version is provided to stop the game having to animate the object when out of viewing distance.<br />
<br />
In addition to being added as building items the models_spot need to be added to spot_items in descr_building_battle.txt, the vanilla entries just include:<br />
spot_items<br />
{<br />
flag_vertical_small<br />
{<br />
any flag_vertical_small<br />
}<br />
flag_vertical_large<br />
{<br />
any flag_vertical_small<br />
}<br />
''flag_horizontal_large''<br />
{<br />
any '''flag_horizontal_large'''<br />
}<br />
}<br />
The part in italics is the spot_fx name which needs to be used in the _fx.cas as a mesh name, the part in bold is the models_spot item name.<br />
<br />
You can add additional spot_items. Getting the models_spot.cas to convert to a .item file requires the same procedure as generating other building items (delete your descr_items.db to get a new item added, delete the .item file if you want to use an updated .cas model for an existing item)<br />
<br />
===Changing models_spot cas files===<br />
[[IWTE]] will export the existing flag_horizontal_large.cas to .dae - if you import that to Blender you will see it contains an armature and simple animation. If you want to amend that file you can add bones, more mesh, change the animations etc., there doesn't seem to be a bone limit or any presets required for Rome Remastered models_spot. <br />
<br />
For IWTE dae to cas please leave the first bone of the armature called '''bone_'''something, so it recognises its meant to keep the armature! To get the animation and model in the same cas you will need to use the new button ''''RTW object animation dae to cas''''.<br />
<br />
[[File:Rtw-anim-object.jpg|200px|Location of new combined animation button]]<br />
<br />
If you want to create complex animations that involve some bone movement or large rotations you will need to simplify the Armature structure, the models_spot system does not seem to render parented bone structures with complex movements properly. For example with a horse or human animation the armature should have all the bones de-parented in edit mode, and then have 'child-of' constraints added in pose mode to simulate a similar movement system. The picture below shows a set up for a horse:<br />
<br />
[[File:Horse-with-constraints.jpg|200px|Horse with constrained instead of parented armature]]<br />
<br />
Note: the .dae file will not save the child constraints, it will instead provide keyframes for each bone as if they were independent, this suits the game, but will be hard to edit if you try to work back from it, so SAVE your BLEND file!<br />
<br />
Rome Remastered will only accept meshes that have 1 bone per vertex weighting. If you add a mesh with flexi_m type variable weighting on a vertex the mesh will not be shown in game. Use 'limit_total' in Blender to reduce to single bone weighting.<br />
<br />
== 3ds Max specific ==<br />
Working with 3ds max (importing the .dae created by IWTE and openCOLLADA) will require the attention to the following aspects:<br />
<br />
- Exporting the animated .dae file will require you in max to rotate the object with '''180 degrees'''.<br />
<br />
- IWTE doesn't handle textures, so in order to export the right texture, you need to name the material with the same name as the used texture, like this:<br />
<br />
[[File:3ds Max material naming.png|200px]]<br />
<br />
[[Category:RTW Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=IWTE&diff=86296IWTE2023-02-23T13:22:56Z<p>Makanyane: /* Task File Processes */ added texture list from .cas file function</p>
<hr />
<div>{{RTW M2TW Modding Logo}}<br />
{{IWTE}}<br />
'''IWTE stands for ''Integrated World Terrain Editor'', the tool is developed and maintained by [https://www.twcenter.net/forums/member.php?2026-wilddog wilddog]. It has been the major tool used for modifying battlemap buildings and environments in [[M2TW]].''' <br />
<br />
The tool's early development for settlements was based partly on prior research and development by Argantonio and [[KnightErrant]]. <br />
<br />
IWTE has expanded over the years to handle more aspects of M2TW modding and RTW modding and now handles animations and unit models, the export/import process has also been expanded to cover Blender and 3dsMax as well as Milkshape.<br />
<br />
IWTE is supplied as an executable only file so does not require a python installation. <br />
<br />
<big>'''IWTE has been expanded to handle functions for Rome Remastered see: [[IWTE - Rome Remastered Functions]]'''<br />
<br />
'''Download the latest IWTE version [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 here.]'''</big><br />
<br />
==Features==<br />
===For M2TW===<br />
The following list is a quick round-up of its current capabilities for M2TW:<br />
* '''Battlemap Settlements'''<br />
:Editing of [[.world]], [[.worldcollision]], [[.animinstances]], [[.worldterrain]], [[.worldpathfinding]], [[.worldvegetation]] and [[.worldpkgdesc]] files. Using these files you can completely change the settlement layout, models, textures, effects and lighting. <br />
* '''Building Animations'''<br />
:Editing and creation of new wall, gate and tower animations.<br />
* '''Battlemap Environment'''<br />
:Editing of [[vegetation.db]], [[Descr_geography_new.db]] and [[.lighting]] files. Adding/amending of vegetation models and generation of vegetation sprites.<br />
* '''Strat Models'''<br />
:Editing of residences, trees, resources in Milkshape/Blender/Max. Editing of animated character .cas models (via Blender/Max only), includes the ability to chain animations together, edit and save back to separate anims.<br />
* '''Mesh Models'''<br />
:Editing of skydome mesh and banners. Editing of .mesh unit/siege models whilst merged to .cas skeleton and chained anims. Animation editing including use of animated bone_weapon groups. (via Blender/Max only)<br />
* '''Model Traversable Network'''<br />
:For siege engines, editing by conversion to .txt and back.<br />
* '''Texture Conversion'''<br />
:Single file and directory level conversion of texture>dds>texture and tga>texture<br />
* '''Campaign Map'''<br />
:Supports simple editing of the stratmap TGA and HGT files with files shown at correct relative sizes. This also shows a 3d view of the strat map being edited as well as selection of different colour schemes for the heights HGT map.<br />
* '''Image Editing'''<br />
:A simple painting process editor which supports basic editing of several file types (terrain masks can be edited shown at actual size in relation to settlement).<br />
===For RTW and Remastered===<br />
* '''Campaign Map'''<br />
:Supports simple editing of the stratmap TGA and HGT files with files shown at correct relative sizes. This also shows a 3d view of the strat map being edited as well as selection of different colour schemes for the heights HGT map.<br />
* '''Campaign Map Mesh'''<br />
<br />
==Battle-map Settlement Files==<br />
For information about editing settlement models and terrain in Blender please see [[IWTE - Settlements in Blender]]<br />
===Loading and Saving .world Files===<br />
Launch the IWTE.exe file - when the tool opens make sure the 'WorldFiles' tab is selected;<br />
<br />
[[File:IWTE-open-close.png|200px]]<br />
<br />
Select 'Read 3 Binary Files'. Choose the .world, .worldcollision & .animinstances files to open when prompted, and then select a save name for the new .world. Note; this IWTE function will not overwrite the original files, it will add _1 to the file names.<br />
<br />
[[File:Command window.png|200px]]<br />
<br />
As well as the main window IWTE will open a command window as above. Do not attempt to type commands into this window! Do keep an eye on the contents and watch out for any warning or error messages.<br />
<br />
When you've finished making the changes you want, select 'Save 3 Binary Files'. Find your new files and re-name them so they are used instead of the original files.<br />
<br />
Although some changes (techtrees and textures for example) only affect the .world file, it is good practice to always swap in all three new files, so they have the same time/date and are easily identified as belonging to the correct set.<br />
<br />
===Finding Object Numbers===<br />
Object numbers are displayed in small print on the 2d view when in "Assign Perimeters" mode, accessed from the "Gameobjects" tab.<br />
<br />
===Using the Painter Process Function===<br />
Access the painter process by selecting the button at the top left and then select from the drop-down menus as shown in the picture below:<br />
<br />
[[File:IWTE painter process.jpg|200px]]<br />
This function can be used to edit the following files whilst matched against a view of the structures of the .world files;<br />
*[[.worldterrain]]<br />
*[[.worldpathfinding]]<br />
*[[.worldvegetation]]<br />
*Terrain mask.texture files<br />
Those files can be opened in the painter process at the same time and the opacity values adjusted so you can see the terrain through the pathfinding etc.<br />
<br />
===Game Objects===<br />
====Plaza====<br />
The plaza, which is the area which has to be controlled to win a settlement or fort battle, can be repositioned and re-sized with IWTE. Use the "Gameobjects" tab, "View Plaza" button, then "Change Plaza". To see its relationship to other features use the main "Views" tab or painter process. From Jan2020 IWTE allows both x and y sizes of the plaza to be changed independently to allow rectangular shapes. The 2D view now shows the nominal size of the plaza (30x30m in the example shown) and also an outer line indicating approximately where the flags will appear, which is approximately 1/3rd of the nominal size outside the nominal plaza size.<br><br />
[[File:Two stage plaza.jpg|200px|caption=2d view of change plaza function]] [[File:Plaza flags.jpg|200px|caption=Actual flag positions for plaza position in last image]]<br />
<br />
==Units and Animations==<br />
For information about editing character/unit models and their animations in Blender please see [[IWTE - Units in Blender]]<br />
<br />
==Task File Processes==<br />
Some functions of IWTE v20_09+ are controlled via text files, the text files need to be named *_task.txt. The function is accessed from '''IWTE Task''' in the top menu bar, then select your pre-written task file from "Select Task File"<br />
<br />
In a _task.txt file:<br />
*items enclosed in < > are commands<br />
* # will comment out a line and is used before explanatory comments<br />
<br />
Current functions include the ability to change the names of bones within a set of .cas files, and the ability to merge unit and strat cas and mesh files with .cas animations, edit in Blender and split back into component animations.<br />
<br />
===Texture list from .cas files in mod folders===<br />
To obtain a .csv list of all the texture names encoded in the .cas files within a modfolder use a _task.txt file with the following contents, corrected for the paths on your computer:<br />
<br />
<task_id> cas_texture_csv # to read all .cas files in selected folders<br />
<directory_in> "C:\folder_name\folder_name\mods\Mod_Name\data" # highest level folder to check <br />
<directory_out> "C:\IWTE\cas-check" # directory to put new created files<br />
<directory_out_increment> no # use yes if you want to avoid overwriting last file<br />
<all_subdirectories> yes # yes is recommended<br />
<br />
==External Links==<br />
<br />
* [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 Download]<br />
<br />
* [https://www.twcenter.net/forums/showthread.php?323503-IWTE-World-editing-(General-Discussion) Main discussion thread]<br />
<br />
* [https://www.twcenter.net/forums/forumdisplay.php?2047-The-IWTE-Project IWTE Project sub-forum]<br />
<br />
[[Category:M2TW Modding]]<br />
[[Category:M2TW Battle Map Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Porting_a_Mod_to_Rome_Remastered&diff=86293Porting a Mod to Rome Remastered2023-02-13T10:37:20Z<p>Makanyane: added merchants bit</p>
<hr />
<div>{{Rome Remastered Modding}}<br />
'''For general modding advice see [[Total War: Rome Remastered - Modding]]<br />
<br />
The files used in the mod currently need to be compatible with the game version the mod will be played on. E.g. if the mod is to be played on the Barbarian Invasion game, then it needs to contain the same internal faction names, or include ALL the files that mention faction names.<br />
<br />
Before trying to get your actual mod into RR try setting up a new modfolder copying in the map files from BI and make a small change e.g. to the playable/non-playable list of factions so you can see if that change has worked and game will load.<br />
<br />
==Porting units from RTW==<br />
See Feral's guide [https://github.com/FeralInteractive/romeremastered/blob/main/documentation/techart_guides/Importing_RTW_units_to_Remastered.md Importing Rome Total War units to Total War: ROME REMASTERED].<br />
<br />
Do note that while you can import RTW models and textures... you might find they don't look very good with the new upgraded graphics as they will be significantly lower poly/lower resolution than the new Remastered units.<br />
<br />
==Mapping / Campaign Differences==<br />
Visually the important difference is you will now require a new 3d mesh if your map shape differs from the base games' map. See [[Creating New Campaign Map in Rome Remastered]].<br />
<br />
Minor differences required to get your world/maps files to work are detailed below. <br />
<br />
===descr_strat.txt===<br />
'''Version 2.0.2 requires the names of characters in descr_strat to be present for correct faction in descr_names.txt and text/names.txt<br />
incorrect names will cause a CTD.'''<br />
<br />
The descr_strat.txt file now has a quantity value specified for each resource, you will need to change your resource section from:<br />
resource marble, 56, 62<br />
to<br />
resource marble, 1, 56, 62<br />
and can optionally increase the number from 1 if you want to signify having multiple resources at that location.<br />
<br />
The format for writing the AI personalities has also changed, needing and underscore instead of a space so:<br />
comfortable caesar<br />
needs to be changed to<br />
comfortable'''_'''caesar<br />
apparently missing this step will cause the AI to fail to expand. The personalities combinations must also be detailed as a combination in feral_descr_ai_personality.txt, e.g.<br />
personality '''comfortable_caesar'''<br />
building_priority Comfortable<br />
military_priority caesar<br />
diplomatic_priority default<br />
the ai_personality file accepts a maximum of 32 entries.<br />
<br />
To get an existing descr_strat file to load you may also need to carry out some simplification, e.g. removing new buildings and units unless you have also set up your EDU and EDB to be compatible. The structure of the EDB file will probably be compatible, but if it has recruit lines for new units, they will need to be in EDU and their soldier models will need to be in DMB which is a completely different structure.<br />
<br />
Some traits and ancillaries have been changed, so you either need to cross-check that they still exist with the same name, or remove existing traits and ancillaries initially.<br />
<br />
===descr_win_conditions.txt===<br />
For hold_regions condition, the '''Settlement''' name must be used '''NOT the Region Name''' as in original BI. Using the region name will produce a "not found in stringtable" error message. So you'll need to convert any regions mentioned to the appropriate settlement name instead.<br />
<br />
==Merchants==<br />
Remastered adds the agent type 'merchant' these need to be added to descr_character.txt and descr_model_strat.txt even if you are playing with merchants off. Failure to add entries for them will result in a CTD approx 1/3rd the way along loading bar for campaign map.<br />
<br />
[[Category:Rome Remastered Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Unit_Models_in_Rome_Remastered&diff=86292Unit Models in Rome Remastered2023-02-12T15:38:31Z<p>Makanyane: bodge in torch explanation</p>
<hr />
<div>{{Rome Remastered Modding}}<br />
<br />
Units in Rome Remastered use the same skeleton, animations and .cas type format as the original game. Remastered allows more detailed units, better 'movement' with vertexes able to be weighted across two bones, and more sophisticated graphical effects using PBR textures.<br />
<br />
Feral's tech art guide to [https://github.com/FeralInteractive/romeremastered/blob/main/documentation/techart_guides/Characters.md Characters] provides detailed information on modding units.<br />
<br />
Details of how to unpack existing models from the game packs can be found [https://github.com/FeralInteractive/romeremastered/blob/main/tools/unpack_characters/unpack_characters.md here].<br />
<br />
Feral's [https://github.com/FeralInteractive/romeremastered/tree/main/tools/CasPacker Cas Converter] tool will convert the unit model .cas files to .fbx, [[IWTE]] will convert RTW and Remastered models via .dae (Collada) and export in a cas format suitable for Remastered by default. Both tools are primarly designed to work with [[Blender]] but the .fbx and .dae formats can be used in other programs such as 3dsMax.<br />
<br />
==UV Mapping for Variations==<br />
Remastered allows variations of faces, hair and skin textures based on ethnicity. The sections of mesh that use these textures do not need to be in separate groups assigned to the textures, instead the texture used is determined by the relative position of the uv coordinates. The picture below shows a Berserker unit from Remastered with the uv mapping explained.<br />
<br />
[[File:RR-unit-mapping.jpg|300px|UV mapping for a Rome Remastered Unit]]<br />
<br />
The textures for the face, skin and hair elements are in a long and thin format with multiple variations that the uv maps tile horizontally across to pick up the variants. The sections of texture selected for hair appear to be determined by the text file descr_unit_variation.txt. The skin and body sections presumably just scroll horizontally through their respective textures.<br />
<br />
==Ethnic Model Variations==<br />
The ethnicity system allows a different model to be loaded for a unit depending on ethnicity. Descr_model_battle.txt has model entries for each soldier type for African, Arabic, Caucasian, EastAsian, Egyptian, Indian & Mediterranean so 7 different models could potential be used per-faction, per-soldier type. If nothing else is specified in the EDU then the game should load the model for the ethnicity your faction uses in descr_sm_factions.<br />
<br />
Groups of ethnicities can be assigned to units in the EDU. At the end of the unit 'type' after ownership you can have an ethnicity line per faction, e.g.<br />
ethnicity celts, Wood_shields<br />
ethnicity huns, Heaters<br />
would mean the celts use ethnic group 'Wood_shields', and huns would use 'Heaters'<br />
<br />
To create a new ethnic group add in the last section of descr_unit_variations.txt<br />
code like:<br />
Wood_shields<br />
{<br />
variant<br />
{<br />
ethnicity african<br />
distribution 35<br />
}<br />
variant<br />
{<br />
ethnicity caucasiandark<br />
distribution 65<br />
}<br />
}<br />
This means the unit using 'Wood_shields' will turn up with approx 35% of the African model, and 65% of the Caucasian model (using caucasiandark skin).<br />
<br />
There are 12 possible ethnic types that can be used here, they will use the skin/hair/faces of the exact ethnicity specified, but will use the model from the associated major group. The full list of possibilities is as follows:<br />
*african<br />
*arabic<br />
*berber (Arabic model)<br />
*berserker (Caucasian model)<br />
*caucasiandark (Caucasian model)<br />
*caucasian<br />
*culann (Caucasian model)<br />
*eastasian<br />
*egyptian<br />
*mediterranean<br />
*north_african (African model)<br />
*indian<br />
Note that 4 of the skin types actually use the Caucasian model, if you use those for variations you will get different skin/hair/faces but the same models!<br />
<br />
All the models within the one soldier type entry in descr_model_battle.txt will use the same texture for that faction. If you have space on the texture you can include variants and map each model differently.<br />
<br />
Getting flexibility from this system relies on not needing the original ethnic variety. If you don't need units that look like the berserkers you could give them a copy of the mediterranean skin/faces and use the berserker/mediterranean combination to get two different models to load for all your mediterranean appearance units. If you really don't need certain sections of the skin texture you can move some of your generic cross-faction items there and change the units uv mapping to use it. Units such as fully armoured knights with helms that don't have anything mapped to the skin/face sections could theoretically use a group which selected all 7 possible model types, which would allow 7 different shaped and mapped models which would all be using the same texture.<br />
<br />
==EDU multiple soldier and upgrade options==<br />
From patch 2.0.4 it is possible to specify multiple DMB soldier types to the same export_descr_unit.txt entry. An example using this system can be found in '''[https://github.com/FeralInteractive/romeremastered/tree/main/example_mods Feral's example mods]'''.<br />
<br />
The format is instead of the soldier line you have '''soldiers'''. A simple mix would be:<br />
soldiers 60, 0, 1<br />
{<br />
default<br />
{<br />
my_spearmen<br />
my_axemen<br />
my_axemen<br />
}<br />
}<br />
where you would expect to get about two thirds of the unit using the my_axemen DMB entry model/s you can mix soldiers with different animations, but as the sounds and stats will be the same there is a limit to what you can practically mix, and you may also have formation difficulties if you mix movement speeds.<br />
<br />
Armour and weapon upgrades can also achieve visual effects using this system. An example for armour upgrades could be:<br />
soldiers 40, 0, 1.1<br />
{<br />
;;default, no armour look<br />
default<br />
{<br />
my_base_soldier<br />
}<br />
armour 1<br />
{<br />
my_base_soldier<br />
my_base_soldier<br />
my_upgrade_soldier<br />
}<br />
armour 2<br />
{<br />
my_base_soldier<br />
my_upgrade_soldier<br />
my_upgrade_soldier<br />
}<br />
armour 3<br />
{<br />
my_upgrade_soldier<br />
}<br />
}<br />
giving progressively more versions of the my_upgrade_soldier with upgrade level. You can do the same purely for weapons, or you can add settings for the 16 possible armour/weapon combinations by using:<br />
armour 3, weapon 1<br />
etc as the selector.<br />
<br />
==Bone Weighting==<br />
Unlike RTW Remastered allows full variable weighting for all 'body' components, so each vertex can be weighted proportionately across any two bones.<br />
<br />
Primary and secondary weapons however have to each be fully weighted to just one bone. You also CAN NOT have multiple weapon components, e.g. a 'primary' shield on the back of an archer that switches to 'secondary' shield in hand.<br />
<br />
==Lods==<br />
All units must have files named:<br />
:whatever_name_lod0.cas<br />
:whatever_name_lod1.cas<br />
:whatever_name_lod2.cas<br />
:whatever_name_lod3.cas<br />
as the DMB entry is solely to 'whatever_name' and the game then looks up the other lod names automatically. You can however use a lod1 (single weighted version) re-named appropriately if you don't yet have different versions of the model.<br />
<br />
==Torches==<br />
Torch positions can be adjusted by using different attachment files listed below the unit's model db entry:<br />
<br />
https://i.postimg.cc/szHY6Y4W/no-torch-hastati.png<br />
<br />
to disable torches for a unit omit the torch entry in the attachments file and just include the bone map reference.<br />
<br />
[[Category:Rome Remastered Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=IWTE_-_Units_in_Blender/Milkshape&diff=86269IWTE - Units in Blender/Milkshape2023-01-08T14:05:16Z<p>Makanyane: /* Export and Import RTW Units & RTW/M2TW Strat Characters */</p>
<hr />
<div>{{RTW M2TW Modding Logo}}<br />
{{IWTE}} <br />
__TOC__<br />
<br />
<big>Tips and instructions for working with RTW and M2TW battle map units and strat map characters via '''[[IWTE]]''' and '''[[Blender]]''' using the .dae format.</big> <br />
<br />
''The .dae files used for the Collada import/export can also be used with '''3ds Max''', however, max users absolutely have to use the [https://github.com/KhronosGroup/OpenCOLLADA/wiki/OpenCOLLADA-Tools '''OpenCollada plugin'''] and file format when importing/exporting files, max comes with the AutodeskCollada file format by default which neither imports nor exports files from the game correctly.''<br />
<br />
*IWTE download [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 here] - please use the latest version, early versions do not have this functionality.<br />
*For queries about these functions please ask [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing here].<br />
*For information on working on M2TW Settlements in Blender see [[IWTE - Settlements in Blender]]<br />
*For general tips on working with Blender see [[Blender hints and tips]]<br />
*For related info about .cas file structure see [[Cas Files|here]]<br />
<br />
<br />
==Export and Import M2TW .mesh Units==<br />
The most useful method of export involves matching the unit .mesh with its skeleton basepose and one or more animations. <br />
<br />
The drop-down menu in IWTE allows a unit .mesh to be merged with its basepose skeleton and one animation. A task file is needed to allow combining of animations and is the only way to also incorporate weapon animations.<br />
<br />
The drop-down menu options, and alternative IWTE Task button positions are shown below:<br />
<br />
[[File:Export-mesh-in-IWTE.jpg]]<br />
<br />
Select 'Unit mesh to date' if you have the "full" version of the .cas anims (the ones the game re-packs). Select the 'Unit mesh/skel/casanim to dae' option if you have the versions unpacked using XIDX.<br />
<br />
Select the double mesh option for unit meshes that have both a main and attachment texture. Select the single mesh option for most other cases (e.g. standard mounts). <br />
<br />
You will be prompted to select the model .mesh first, then the basepose.cas for the skeleton (full cas version) or the unpacked skeleton file (unpacked version), and then an animation.cas file that is compatible with that skeleton (this will need to be in the same format as the skeleton, full or unpacked). <br />
<br />
===Export/Import by Task Process===<br />
To generate a .dae file from .mesh and .anims via the task process you will need a text file ending in _task.txt which starts with the mesh to dae command, run the task file by selecting the 'IWTE Task' > 'Select Task File' buttons. See example below for mesh_to_dae (the extra line breaks have been included just to show the body/weapon pairing):<br />
<br />
<task_id> mesh_to_dae <br />
<mesh_file_full_path_in> C:\M2TW\mods\devkit\data\animations\EB_Slinger\numidian_slinger_lod0.mesh <br />
<mesh_double_texture> yes <br />
<cas_file_types_in_list> body weapon<br />
<br />
<cas_file_full_path_in_default_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_basepose.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas<br />
<br />
<cas_file_full_path_in_action_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_stand_A_idle.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas <br />
<br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_attack_missile_ready.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_attack_missile_ready.cas <br />
<br />
<directory_out> C:\M2TW\mods\devkit\data\animations\EB_Slinger <br />
<dae_file_name_out> EBslingerAnims.dae <br />
<create_text_file> yes <br />
<br />
Please see the IWTE example control processes.txt file that ships with IWTE for further details/instructions. <br />
<br />
Running the task will generate you a .dae file with the animations joined together with an additional 'basepose' frame added at frame 0, to aid editing. The task will also auto-generate for a reverse dae_to_mesh_****_task.txt file for you, this will list the start and end frame positions of all included animations and the names of all the files that will be re-created from the .dae. The names and frame positions can be edited to suit any changes you may require before running the return task.<br />
<br />
When creating the task files it is common to make minor errors in the file names/paths that mean IWTE cannot find all the elements! If you get an error message whilst running the task you'll get a chance to read the error message <br />
(which is easier in the command window) - you can then click "Ignore" to keep IWTE open, fix the name/path/file issue in the .txt file and try running the task again. The error message should indicate which file it couldn't find. If you forget to add the file extension and try and get it to open a folder you'll get an 'access violation' type message. <br />
<br />
For unit models that do not have any elements weighted to the 'weapon bones' you only need to run the process with <br />
<br />
<code> <cas_file_types_in_list> body </code> <br />
<br />
and supply the main skeleton basepose and animation.<br />
<br />
If the mesh has a weapon weighted to weapon bones use the ''body weapon'' example shown above.<br />
<br />
If the mesh has both a weapon weighted to weapon bones and a shield weighted to bone_shield etc use<br />
<br />
<code> <cas_file_types_in_list> body weapon shield</code> <br />
<br />
and supply the main skeleton, weapon animation and shield animation baseposes and animations in sets of three in order.<br />
<br />
Note: a lot of models that are apparently using ''fs_test_shield'' according to their [[battle_models.modeldb]] entry don't actually have anything weighted to bone_shield, making the shield 'anim' irrelevant.<br />
<br />
===UV Mapping for Double Texture Units===<br />
The mesh format for both double and singled textured units in M2TW is actually exactly the same with just one set of uv's that should range from 0 to 1.0 in both horizontal and vertical axis.<br />
<br />
If you assign two textures to a unit in the [[battle_models.modeldb]] then the game expands out the horizontal axis of the uv maps so that the area from 0 to 0.5 is used to cover 0 to 1 on the first texture, and the uv's from 0.5 to 1.0 on the horizontal axis are used to cover 0 to 1 on the second texture.<br />
<br />
Milkshape/.mesh converters use the texture (Main or Attachment) assigned to a mesh group to determine which section of the uv map the group's uv coordinates will be moved to, with Main texture co-ordinates compressed into the 0>0.5 area and Attachment texture co-ordinates compressed into the 0.75>1.0 section.<br />
<br />
The IWTE mesh to .dae for Blender process works differently. The texture assignment process is used purely so you can view the mesh groups with the correct relevant texture. The 0>1.0 horizontal uvs are expanded to 0>2.0 if you use the process for 'double textures' and then compressed back to 0>1.0 on the return to .mesh.<br />
<br />
In Blender the uv mapping to the two textures will look like the image below.<br />
<br />
[[File:Uvs for double textured units.jpg|400px]]<br />
<br />
To see the 2nd texture under its uv's open the sidebar (n) in the uv screen and select the 'repeat texture' button.<br />
In Blender it is possible to partially assign some triangles from a group to the 1st texture and some triangles to the 2nd texture, if you do that please remember to also move the uv's to the appropriate zone.<br />
<br />
===Scaling of Anims===<br />
The 'full' cas animations as supplied by Caliban should be regarded as scale 1.0. If you need to load from them to suit a skeleton that will be scaled by the game you need to give IWTE the skeleton scale in the mesh_to_extract task using the appropriate tag e.g.<br><br />
<skeleton_scale> <br><br />
<mount_skeleton_scale><br />
<br />
If you load from the unpacked skeleton and unpacked animation the scale will be read from the skeleton, so you do not need to add any further information.<br />
<br />
==Export and Import RTW Units & RTW/M2TW Strat Characters==<br />
<big>'''NOTE:''' IWTE now supports the full weighting allowed in Rome Remastered by default - to ensure you do not create RTW/M2TW cas files that exceed their games capabilities add '''<cas_mesh_format> rtw''' (or M2) to the task file.</big><br />
<br />
<br />
The process for this is similar to the .mesh Export/Import process described above, the button locations are shown in the below image: <br><br />
[[File:Export-cas-to-dae.jpg|Exporting animated cas to date with IWTE]]<br />
<br />
Use the 'Animated cas_mesh to dae' ('''3''') button if you have the full versions of the animation files, e.g the type supplied by Caliban that M2TW itself re-packs. The first file requested will be the .cas 'mesh', e.g. the one with the body model in it. The second file requested will be an animation file, if you do not have a suitable animation file just click 'Cancel' to close the selection screen. You can use the 'Animated cas/dae' button for all unit/character .cas files even if you aren't going to load an animation.<br />
<br />
If you are using RTW or are using M2TW but only have the skeleton/cas files unpacked using XIDX or other tools use the appropriate '* casmesh,skel,casanim to dae' button ('''1''' or '''2'''). The first file requested will again be the .cas 'mesh', e.g. model. The second file requested will be the skeleton file (as produced by XIDX/tool using extract_skeletons). The third file requested will be the .cas animation file (as produced by XIDX/tool using extract_animations). For Rome Remastered use the RTW button.<br />
<br />
These processes will generate a .dae file in a /to_dae sub-folder where your IWTE.exe is located. You will also have two task files generated in the /iwte_tasks sub-folder. The dae_to_cas one provides a default task file for reversing the process and generating new .cas files. The cas_to_dae one allows you to repeat the process you just did by simply running the IWTE Task, you can also adapt that task file to load multiple animations. The following is an example task file for cas_to_dae with multiple anims, and using rtw skeleton and anims, note that if the file path/name has spaces the entire path needs to be inside " ", also note the skeleton name does not have a file extension, direction of \ or / doesn't matter:<br />
<task_id> cas_to_dae <br />
<cas_mesh_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\to_dae/from_dae/ALEX_companion_cavalry_lod_1.cas <br />
<directory_out> I:\M2TW\M2TWcopy\mods\IWTE/to_dae <br />
<dae_file_name_out> ALEX_companion_cavalry_taunt.dae <br />
<cas_animation_file_format> rtw <br />
<create_text_file> yes <br />
<create_task_file_from_input> yes <br />
<task_file_full_path_out> I:\M2TW\M2TWcopy\mods\IWTE/IWTE_tasks/dae_to_cas_alextaunt_task.txt <br />
<skeleton_unpacked_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\testthings\animations\rome_animations/fs_swordsman<br />
<cas_file_full_path_in_action_list> <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_04 taunt 2.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_06 taunt 1.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_07 taunt 3.cas" <br />
<br />
To get amended units/anims back into game you will need to 'export' 'collada' from Blender or 3dsMax. The .dae file created will have the same structure whether you're converting to Mesh/Cas model, and Full/XIDX packable anims, so you need to use a task file to specify the format to be returned. The automatically generated return task file will have assumed you want the same format that went in, so the task file above will have generated this return file:<br />
<task_id> dae_to_cas # to read dae file and generate *.cas files<br />
<dae_file_full_path_in> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/ALEX_companion_cavalry_taunt.dae # *.dae file to read in. i.e. change to collada name exported from Blender<br />
<directory_out> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/from_dae # directory to put new created files<br />
<cas_mesh_file_name_out> alex_companion_cavalry_lod_1.cas # *.cas file to be created<br />
<cas_animation_file_format> rr # format of cas to be created by dae (rtw or full) <br />
<cas_unpacked_skeleton_scale> 1.0000 # cas unpacked skeleton scaling<br />
<overlap_frames> no # overlap frames selection used to create the dae (not used on import)<br />
<cas_file_name_out_anim_split_list> # cas anim files start and end frames<br />
"lid_57_04 taunt 2.cas" 1 79 <br />
"lid_57_06 taunt 1.cas" 80 162 <br />
"lid_57_07 taunt 3.cas" 163 237 <br />
#<end_frame> 237 # Last animated frame (use to see full animation in blender)<br />
<br />
If you're trying to convert format, instead of rr you need to use:<br />
<cas_animation_file_format> '''m2''' #for M2TW anims re-packable by XIDX<br />
<br />
<cas_animation_file_format> '''full''' #for M2TW anims re-packable by '''the game'''<br />
<br />
If you want an M2TW mesh back instead of a .cas model use the <br />
<task_id> '''dae_to_mesh'''<br />
instead of dae_to_cas<br />
<br />
Using the 'Animated dae to cas_mesh' ('''4''') button will generate a separate cas model file and a full version anim called _action. See below for animation file type details.<br />
<br />
Using the 'RTW object animation dae to cas' ('''5''') will produce a cas which includes both the model and the animation together, these are used only for [[Spot fx animations and effects|spot_fx]] items in RTW/RR.<br />
<br />
===Bone Weighting===<br />
RTW battle map units and strat models and M2TW strat models will generally have vertexes weighted to only one bone per vertex.<br />
<br />
If you convert a dae with multiple bone weights per vertex to cas with IWTE it will generate one cas with vertexes weighted to up to two bones, and one cas with the suffix "_lod1". The _lod1 cas can be renamed and used for RTW/M2TW. Ideally however you should limit the bone weight totals yourself so you can check how the model will behave in game when posed. See [[Blender_hints_and_tips#Bone_Assignment|Blender hints and tips]].<br />
<br />
For details on optionally creating a simple multi-weighted Section see: [[Model_flexi_m in RTW]]<br />
<br />
===Cas animation types===<br />
IWTE supports the full (never packed) versions of [[Cas Files|.cas files]], as supplied by Caliban and also the ones that have been generated from Pack files by XIDX, IWTE or similar tools. PLEASE NOTE: The RTW and M2TW anims generated from the pack files use a different format - DO NOT pack RTW types into M2TW packs or vice-versa - check that you are generating the correct type for the game you are going to use them in! Also do not attempt to re-pack the full type (where you can see the bone names) with XIDX or IWTE, they will only work if you have a full set including .evt files and let M2TW repack them from descr_skeleton.txt.<br />
<br />
==Units - General Tips==<br />
*Seams - To avoid seams in the finished model you CAN 'weld' vertexes that have disconnected uvs, in Blender use Mesh> Clean Up> Merge by Distance (without uvs ticked), and Shading> Smooth Faces. That will get you a shared normal that allows the area to look smooth. For the game IWTE will generate two vertexes at that point to preserve the uvs and set that normal as a custom normal for each.<br />
<br />
*Anims/skeletons - In Blender you can make any alteration you like to the 'Pose Mode' this will only affect the animation frames. Do NOT, unless you know what you are doing... move or edit the bones in the 'Armature' edit mode, this will affect the bone positions in the model/anim.cas produced, and will need to be matched to a skeleton with the same bone positions. If using the "full" M2TW cas anims that the game re-packs you can adjust the bone positions for a folder of .cas anims by using the skeleton replacement method detailed below. If using XIDX unpacked/packed anims you will need to change the skeleton using other tools.<br />
<br />
==Animations - General Tips==<br />
*Blender must be set to 20fps BEFORE importing a .dae with animation created by IWTE. To do this use the custom setting and type in 20. When you import a .dae file you should then see the keyframes neatly aligned with the time markers. See below:<br />
<br />
[[File:20fps.jpg|200px]]<br />
<br />
==Mesh Names/Comments==<br />
The Blender .dae interface does not support comments, so all the information about the mesh sections (primary/secondary weapons etc.) needs to go in the mesh name:<br />
<br />
*Section Naming - For Blender the full details of the group names are stored in the name itself. There isn't a comment section like milkshape. Things that need to go back into the game as separate sections, e.g. to denote primary weapons, or alternate versions, need a double underscore __ to show where the name should be split or a space included. For M2TW mesh sections that you want to be optional, use __opt at the end of the group name.<br />
<br />
==Siege/Artillery Engines==<br />
Siege/Artillery for both RTW and M2TW use the "full" cas anim versions (not packed/unpacked at any stage). For M2TW use the dedicated Model Files > Mesh Models > Siege Engine mesh to date for export and IWTE Task import process. For RTW use the Model Files > Cas Models > Animated cas_mesh to date, the RTW process seems to be quite straightforward as there isn't the mis-alignment between bone names and start poses that is present in M2TW.<br />
===M2TW Siege Engine Skeleton Alteration Example Process===<br />
*In top menu bar go to Model Files > Siege Engine mesh to dae > select mesh, then default cas then anim cas.<br />
:Check that the default .cas is actually the one listed as anim-default in descr_engine_skeleton.txt<br />
:also check that you're using an anim that is in use in game - some of the anims in the folder don't work.<br />
<br />
*IWTE will have written a .dae file in "to_dae" sub-folder below your .mesh model location.<br />
<br />
*Load in Blender by using 'file' 'import' 'collada'<br />
<br />
*Add bones as required to the Armature - note there should only be one top level bone, e.g bone_body add all other bones as child of this, or of existing bones.<br />
<br />
*Use 'weight paint' to assign vertices to bones as required.<br />
:Note - the .mesh file will only accept vertexes weighted to a max of 2 bones<br />
:use 'limit total' in 'weights' menu and set to 2 to avoid any verts weighted to 3 or more bones - (this is applied to selected verts only)<br />
:use 'normalise all' to make sure verts are fully weighted, use 'auto normalise' option whilst working also<br />
<br />
*change animation by switching to 'animation' layout in top bar<br />
:trigger Pose mode by clicking pose running man symbol within the Armature<br />
:if you can't see bones, or the summary when you click them, in main sidebar click the pose (running man) button, select "viewport display" and select the "in front" option<br />
:when you move a bone in the pose mode use shortcut "i" in main window to open keyframe dialogue and select "LocRot"<br />
:you can delete copy or move keyframes around for selected bones in the Dope Sheet section<br />
<br />
*Export collada - in settings check Anim is on Matrix option and 'keep keyframes' and 'all keyed curves' are selected.<br />
'''DO NOT USE IWTE Model Files > Siege Engine dae to mesh to convert back''' the dae doesn't include enough info to retain the three textures named in the mesh .<br />
<br />
*USE the "dae_to_mesh_*****_task.txt" that IWTE has written into the "IWTE_Tasks" sub-folder where your IWTE.exe is<br />
:change the .dae name you're reading in to the one you've just saved - change any other output names IF you need to<br />
:check the number of frames listed ties up with the end frame you set in collada.<br />
<br />
*Run the task file from the IWTE Task button in top menu bar, the separate files will be saved where specified in the task file.<br />
<br />
*If you have changed the number of bones used or their positions you will need to align all the other .cas anims used by the mesh, to do this use the skeleton replacement process explained below.<br />
<br />
==Skeleton Replacement (M2TW)==<br />
''RTW and packed M2TW skeletons can not be changed via this method.'' <br><br />
To replace the skeleton in M2TW where you have the set of full .cas anims that the game re-packs in the IWTE top menu bar go to:<br />
:Model Files > Cas Models > Skeleton Replacement<br />
<br />
*On the first prompt select the .cas file containing the bones in the basepose positions you want (probably the default or basepose .cas)<br />
*On the second prompt select the FOLDER that contains all the .cas files you want to change.<br />
<br />
The revised files will be saved in a sub folder of that folder called "updateskeletons" they will have the same names as the original .cas files and can be used to directly replace them. Please back-up your original files before doing this, and remember that other .cas/.mesh models may be using the same files, so you may need to create a separate folder and separate entry in descr_skeleton.txt etc.<br />
<br />
Adding bones should be straightforward, if you delete bones that had child bones then the result may be unpredictable and the resulting animations may need editing. <br />
<br />
===Bone Renaming Task===<br />
To rename the bones throughout a folder of full .cas animations use a task file. If you want to swap the names of bones you need to add an additional stage to re-name one bone to a temporary name, the example below shows how to swap bone_H_Saddle and bone_Spine names with each other:<br />
<task_id> cas_bone_name_change <br />
<directory_in> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka <br />
<directory_out> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka\changedbones <br />
<bone_name_change_list> <br />
bone_H_Saddle bone_H_Saddlex<br />
bone_Spine bone_H_Saddle<br />
bone_H_Saddlex bone_Spine<br />
<br />
* The task cas_bone_name_change changes a bone name (the NEW name must not already exist in a skeleton this is being applied to)<br />
* Directory in is optional, alternatively the task file can be placed in the directory and launched from there<br />
* Directory out is optional, if not given a sub-folder /updateskeletons will be created<br />
<br />
===Fixing Floating Units===<br />
For how to create the new basepose see [[Blender_hints_and_tips#Fixing_Floating_Units|Blender Hints and Tips]]<br />
<br />
Once you have the new basepose.cas you need to use it as the source to replace the bone positions in ALL of the animations the unit uses. For strat_models if you haven't already edited the .cas files of all the effected models include them in the skeleton replacement process too.<br />
<br />
==Weapon Animations (M2TW)==<br />
M2TW includes the possibility of having 'add-on' animations for weapons/shields. These are commonly listed in the model db file but rarely actually used.<br />
<br />
The advantage of properly using the weapon bones and anims instead of adding additional 'normal' bones to the skeleton is that the main skeleton remains 'standard' and does not cause the victim death anim bug when in battle with units whose skeletons have different numbers of bones!<br />
<br />
==IWTE Task File Options==<br />
===Text File Output===<br />
using <create_text_file> you can optionally generate .txt files that show, '''for information purposes only''', the content of the incoming .mesh/.cas files, the default option is <br />
<create_text_file> no #stops any text file being created <br />
<create_text_file> yes #creates a summary text file with header/trailer info, numbers of verts, texture and mesh names etc.<br />
<create_text_file> full #creates a full text file showing the interpretation of all the ints/floats etc in the file, with comments<br />
<br />
<br />
==External Links==<br />
* [https://www.blender.org/ Blender]<br />
* [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 IWTE Download]<br />
* [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing Discussion thread].<br />
<br />
[[Category:M2TW Modding]]<br />
[[Category:Blender]]<br />
[[Category:RTW Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=IWTE_-_Units_in_Blender/Milkshape&diff=86268IWTE - Units in Blender/Milkshape2023-01-07T15:08:40Z<p>Makanyane: /* Scaling of Anims */</p>
<hr />
<div>{{RTW M2TW Modding Logo}}<br />
{{IWTE}} <br />
__TOC__<br />
<br />
<big>Tips and instructions for working with RTW and M2TW battle map units and strat map characters via '''[[IWTE]]''' and '''[[Blender]]''' using the .dae format.</big> <br />
<br />
''The .dae files used for the Collada import/export can also be used with '''3ds Max''', however, max users absolutely have to use the [https://github.com/KhronosGroup/OpenCOLLADA/wiki/OpenCOLLADA-Tools '''OpenCollada plugin'''] and file format when importing/exporting files, max comes with the AutodeskCollada file format by default which neither imports nor exports files from the game correctly.''<br />
<br />
*IWTE download [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 here] - please use the latest version, early versions do not have this functionality.<br />
*For queries about these functions please ask [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing here].<br />
*For information on working on M2TW Settlements in Blender see [[IWTE - Settlements in Blender]]<br />
*For general tips on working with Blender see [[Blender hints and tips]]<br />
*For related info about .cas file structure see [[Cas Files|here]]<br />
<br />
<br />
==Export and Import M2TW .mesh Units==<br />
The most useful method of export involves matching the unit .mesh with its skeleton basepose and one or more animations. <br />
<br />
The drop-down menu in IWTE allows a unit .mesh to be merged with its basepose skeleton and one animation. A task file is needed to allow combining of animations and is the only way to also incorporate weapon animations.<br />
<br />
The drop-down menu options, and alternative IWTE Task button positions are shown below:<br />
<br />
[[File:Export-mesh-in-IWTE.jpg]]<br />
<br />
Select 'Unit mesh to date' if you have the "full" version of the .cas anims (the ones the game re-packs). Select the 'Unit mesh/skel/casanim to dae' option if you have the versions unpacked using XIDX.<br />
<br />
Select the double mesh option for unit meshes that have both a main and attachment texture. Select the single mesh option for most other cases (e.g. standard mounts). <br />
<br />
You will be prompted to select the model .mesh first, then the basepose.cas for the skeleton (full cas version) or the unpacked skeleton file (unpacked version), and then an animation.cas file that is compatible with that skeleton (this will need to be in the same format as the skeleton, full or unpacked). <br />
<br />
===Export/Import by Task Process===<br />
To generate a .dae file from .mesh and .anims via the task process you will need a text file ending in _task.txt which starts with the mesh to dae command, run the task file by selecting the 'IWTE Task' > 'Select Task File' buttons. See example below for mesh_to_dae (the extra line breaks have been included just to show the body/weapon pairing):<br />
<br />
<task_id> mesh_to_dae <br />
<mesh_file_full_path_in> C:\M2TW\mods\devkit\data\animations\EB_Slinger\numidian_slinger_lod0.mesh <br />
<mesh_double_texture> yes <br />
<cas_file_types_in_list> body weapon<br />
<br />
<cas_file_full_path_in_default_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_basepose.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas<br />
<br />
<cas_file_full_path_in_action_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_stand_A_idle.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas <br />
<br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_attack_missile_ready.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_attack_missile_ready.cas <br />
<br />
<directory_out> C:\M2TW\mods\devkit\data\animations\EB_Slinger <br />
<dae_file_name_out> EBslingerAnims.dae <br />
<create_text_file> yes <br />
<br />
Please see the IWTE example control processes.txt file that ships with IWTE for further details/instructions. <br />
<br />
Running the task will generate you a .dae file with the animations joined together with an additional 'basepose' frame added at frame 0, to aid editing. The task will also auto-generate for a reverse dae_to_mesh_****_task.txt file for you, this will list the start and end frame positions of all included animations and the names of all the files that will be re-created from the .dae. The names and frame positions can be edited to suit any changes you may require before running the return task.<br />
<br />
When creating the task files it is common to make minor errors in the file names/paths that mean IWTE cannot find all the elements! If you get an error message whilst running the task you'll get a chance to read the error message <br />
(which is easier in the command window) - you can then click "Ignore" to keep IWTE open, fix the name/path/file issue in the .txt file and try running the task again. The error message should indicate which file it couldn't find. If you forget to add the file extension and try and get it to open a folder you'll get an 'access violation' type message. <br />
<br />
For unit models that do not have any elements weighted to the 'weapon bones' you only need to run the process with <br />
<br />
<code> <cas_file_types_in_list> body </code> <br />
<br />
and supply the main skeleton basepose and animation.<br />
<br />
If the mesh has a weapon weighted to weapon bones use the ''body weapon'' example shown above.<br />
<br />
If the mesh has both a weapon weighted to weapon bones and a shield weighted to bone_shield etc use<br />
<br />
<code> <cas_file_types_in_list> body weapon shield</code> <br />
<br />
and supply the main skeleton, weapon animation and shield animation baseposes and animations in sets of three in order.<br />
<br />
Note: a lot of models that are apparently using ''fs_test_shield'' according to their [[battle_models.modeldb]] entry don't actually have anything weighted to bone_shield, making the shield 'anim' irrelevant.<br />
<br />
===UV Mapping for Double Texture Units===<br />
The mesh format for both double and singled textured units in M2TW is actually exactly the same with just one set of uv's that should range from 0 to 1.0 in both horizontal and vertical axis.<br />
<br />
If you assign two textures to a unit in the [[battle_models.modeldb]] then the game expands out the horizontal axis of the uv maps so that the area from 0 to 0.5 is used to cover 0 to 1 on the first texture, and the uv's from 0.5 to 1.0 on the horizontal axis are used to cover 0 to 1 on the second texture.<br />
<br />
Milkshape/.mesh converters use the texture (Main or Attachment) assigned to a mesh group to determine which section of the uv map the group's uv coordinates will be moved to, with Main texture co-ordinates compressed into the 0>0.5 area and Attachment texture co-ordinates compressed into the 0.75>1.0 section.<br />
<br />
The IWTE mesh to .dae for Blender process works differently. The texture assignment process is used purely so you can view the mesh groups with the correct relevant texture. The 0>1.0 horizontal uvs are expanded to 0>2.0 if you use the process for 'double textures' and then compressed back to 0>1.0 on the return to .mesh.<br />
<br />
In Blender the uv mapping to the two textures will look like the image below.<br />
<br />
[[File:Uvs for double textured units.jpg|400px]]<br />
<br />
To see the 2nd texture under its uv's open the sidebar (n) in the uv screen and select the 'repeat texture' button.<br />
In Blender it is possible to partially assign some triangles from a group to the 1st texture and some triangles to the 2nd texture, if you do that please remember to also move the uv's to the appropriate zone.<br />
<br />
===Scaling of Anims===<br />
The 'full' cas animations as supplied by Caliban should be regarded as scale 1.0. If you need to load from them to suit a skeleton that will be scaled by the game you need to give IWTE the skeleton scale in the mesh_to_extract task using the appropriate tag e.g.<br><br />
<skeleton_scale> <br><br />
<mount_skeleton_scale><br />
<br />
If you load from the unpacked skeleton and unpacked animation the scale will be read from the skeleton, so you do not need to add any further information.<br />
<br />
==Export and Import RTW Units & RTW/M2TW Strat Characters==<br />
<big>'''NOTE:''' IWTE now supports the full weighting allowed in Rome Remastered by default - to ensure you do not create RTW/M2TW cas files that exceed their games capabilities add '''<cas_mesh_format> rtw''' (or M2) to the task file.</big><br />
<br />
<br />
The process for this is similar to the .mesh Export/Import process described above, the button locations are shown in the below image: <br><br />
[[File:Export-cas-to-dae.jpg|Exporting animated cas to date with IWTE]]<br />
<br />
Use the 'Animated cas_mesh to dae' ('''3''') button if you have the full versions of the animation files, e.g the type supplied by Caliban that M2TW itself re-packs. The first file requested will be the .cas 'mesh', e.g. the one with the body model in it. The second file requested will be an animation file, if you do not have a suitable animation file just click 'Cancel' to close the selection screen. You can use the 'Animated cas/dae' button for all unit/character .cas files even if you aren't going to load an animation.<br />
<br />
If you are using RTW or are using M2TW but only have the skeleton/cas files unpacked using XIDX or other tools use the appropriate '* casmesh,skel,casanim to dae' button ('''1''' or '''2'''). The first file requested will again be the .cas 'mesh', e.g. model. The second file requested will be the skeleton file (as produced by XIDX/tool using extract_skeletons). The third file requested will be the .cas animation file (as produced by XIDX/tool using extract_animations). For Rome Remastered use the RTW button.<br />
<br />
These processes will generate a .dae file in a /to_dae sub-folder where your IWTE.exe is located. You will also have two task files generated in the /iwte_tasks sub-folder. The dae_to_cas one provides a default task file for reversing the process and generating new .cas files. The cas_to_dae one allows you to repeat the process you just did by simply running the IWTE Task, you can also adapt that task file to load multiple animations. The following is an example task file for cas_to_dae with multiple anims, and using rtw skeleton and anims, note that if the file path/name has spaces the entire path needs to be inside " ", also note the skeleton name does not have a file extension, direction of \ or / doesn't matter:<br />
<task_id> cas_to_dae <br />
<cas_mesh_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\to_dae/from_dae/ALEX_companion_cavalry_lod_1.cas <br />
<directory_out> I:\M2TW\M2TWcopy\mods\IWTE/to_dae <br />
<dae_file_name_out> ALEX_companion_cavalry_taunt.dae <br />
<cas_animation_file_format> rtw <br />
<create_text_file> yes <br />
<create_task_file_from_input> yes <br />
<task_file_full_path_out> I:\M2TW\M2TWcopy\mods\IWTE/IWTE_tasks/dae_to_cas_alextaunt_task.txt <br />
<skeleton_unpacked_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\testthings\animations\rome_animations/fs_swordsman<br />
<cas_file_full_path_in_action_list> <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_04 taunt 2.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_06 taunt 1.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_07 taunt 3.cas" <br />
<br />
To get amended units/anims back into game you will need to 'export' 'collada' from Blender or 3dsMax. The .dae file created will have the same structure whether you're converting to Mesh/Cas model, and Full/XIDX packable anims, so you need to use a task file to specify the format to be returned. The automatically generated return task file will have assumed you want the same format that went in, so the task file above will have generated this return file:<br />
<task_id> dae_to_cas # to read dae file and generate *.cas files<br />
<dae_file_full_path_in> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/ALEX_companion_cavalry_taunt.dae # *.dae file to read in. i.e. change to collada name exported from Blender<br />
<directory_out> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/from_dae # directory to put new created files<br />
<cas_mesh_file_name_out> alex_companion_cavalry_lod_1.cas # *.cas file to be created<br />
<cas_animation_file_format> rtw # format of cas to be created by dae (rtw or full) <br />
<cas_unpacked_skeleton_scale> 1.0000 # cas unpacked skeleton scaling<br />
<overlap_frames> no # overlap frames selection used to create the dae (not used on import)<br />
<cas_file_name_out_anim_split_list> # cas anim files start and end frames<br />
"lid_57_04 taunt 2.cas" 1 79 <br />
"lid_57_06 taunt 1.cas" 80 162 <br />
"lid_57_07 taunt 3.cas" 163 237 <br />
#<end_frame> 237 # Last animated frame (use to see full animation in blender)<br />
<br />
If you're trying to convert format, instead of rtw you need to use:<br />
<cas_animation_file_format> '''m2''' #for M2TW anims re-packable by XIDX<br />
<br />
<cas_animation_file_format> '''full''' #for M2TW anims re-packable by '''the game'''<br />
<br />
If you want an M2TW mesh back instead of a .cas model use the <br />
<task_id> '''dae_to_mesh'''<br />
instead of dae_to_cas<br />
<br />
Using the 'Animated dae to cas_mesh' ('''4''') button will generate a separate cas model file and a full version anim called _action. See below for animation file type details.<br />
<br />
Using the 'RTW object animation dae to cas' ('''5''') will produce a cas which includes both the model and the animation together, these are used only for [[Spot fx animations and effects|spot_fx]] items in RTW/RR.<br />
<br />
===Bone Weighting===<br />
RTW battle map units and strat models and M2TW strat models will generally have vertexes weighted to only one bone per vertex.<br />
<br />
If you convert a dae with multiple bone weights per vertex to cas with IWTE it will generate one cas with vertexes weighted to up to two bones, and one cas with the suffix "_lod1". The _lod1 cas can be renamed and used for RTW/M2TW. Ideally however you should limit the bone weight totals yourself so you can check how the model will behave in game when posed. See [[Blender_hints_and_tips#Bone_Assignment|Blender hints and tips]].<br />
<br />
For details on optionally creating a simple multi-weighted Section see: [[Model_flexi_m in RTW]]<br />
<br />
===Cas animation types===<br />
IWTE supports the full (never packed) versions of [[Cas Files|.cas files]], as supplied by Caliban and also the ones that have been generated from Pack files by XIDX, IWTE or similar tools. PLEASE NOTE: The RTW and M2TW anims generated from the pack files use a different format - DO NOT pack RTW types into M2TW packs or vice-versa - check that you are generating the correct type for the game you are going to use them in! Also do not attempt to re-pack the full type (where you can see the bone names) with XIDX or IWTE, they will only work if you have a full set including .evt files and let M2TW repack them from descr_skeleton.txt.<br />
<br />
==Units - General Tips==<br />
*Seams - To avoid seams in the finished model you CAN 'weld' vertexes that have disconnected uvs, in Blender use Mesh> Clean Up> Merge by Distance (without uvs ticked), and Shading> Smooth Faces. That will get you a shared normal that allows the area to look smooth. For the game IWTE will generate two vertexes at that point to preserve the uvs and set that normal as a custom normal for each.<br />
<br />
*Anims/skeletons - In Blender you can make any alteration you like to the 'Pose Mode' this will only affect the animation frames. Do NOT, unless you know what you are doing... move or edit the bones in the 'Armature' edit mode, this will affect the bone positions in the model/anim.cas produced, and will need to be matched to a skeleton with the same bone positions. If using the "full" M2TW cas anims that the game re-packs you can adjust the bone positions for a folder of .cas anims by using the skeleton replacement method detailed below. If using XIDX unpacked/packed anims you will need to change the skeleton using other tools.<br />
<br />
==Animations - General Tips==<br />
*Blender must be set to 20fps BEFORE importing a .dae with animation created by IWTE. To do this use the custom setting and type in 20. When you import a .dae file you should then see the keyframes neatly aligned with the time markers. See below:<br />
<br />
[[File:20fps.jpg|200px]]<br />
<br />
==Mesh Names/Comments==<br />
The Blender .dae interface does not support comments, so all the information about the mesh sections (primary/secondary weapons etc.) needs to go in the mesh name:<br />
<br />
*Section Naming - For Blender the full details of the group names are stored in the name itself. There isn't a comment section like milkshape. Things that need to go back into the game as separate sections, e.g. to denote primary weapons, or alternate versions, need a double underscore __ to show where the name should be split or a space included. For M2TW mesh sections that you want to be optional, use __opt at the end of the group name.<br />
<br />
==Siege/Artillery Engines==<br />
Siege/Artillery for both RTW and M2TW use the "full" cas anim versions (not packed/unpacked at any stage). For M2TW use the dedicated Model Files > Mesh Models > Siege Engine mesh to date for export and IWTE Task import process. For RTW use the Model Files > Cas Models > Animated cas_mesh to date, the RTW process seems to be quite straightforward as there isn't the mis-alignment between bone names and start poses that is present in M2TW.<br />
===M2TW Siege Engine Skeleton Alteration Example Process===<br />
*In top menu bar go to Model Files > Siege Engine mesh to dae > select mesh, then default cas then anim cas.<br />
:Check that the default .cas is actually the one listed as anim-default in descr_engine_skeleton.txt<br />
:also check that you're using an anim that is in use in game - some of the anims in the folder don't work.<br />
<br />
*IWTE will have written a .dae file in "to_dae" sub-folder below your .mesh model location.<br />
<br />
*Load in Blender by using 'file' 'import' 'collada'<br />
<br />
*Add bones as required to the Armature - note there should only be one top level bone, e.g bone_body add all other bones as child of this, or of existing bones.<br />
<br />
*Use 'weight paint' to assign vertices to bones as required.<br />
:Note - the .mesh file will only accept vertexes weighted to a max of 2 bones<br />
:use 'limit total' in 'weights' menu and set to 2 to avoid any verts weighted to 3 or more bones - (this is applied to selected verts only)<br />
:use 'normalise all' to make sure verts are fully weighted, use 'auto normalise' option whilst working also<br />
<br />
*change animation by switching to 'animation' layout in top bar<br />
:trigger Pose mode by clicking pose running man symbol within the Armature<br />
:if you can't see bones, or the summary when you click them, in main sidebar click the pose (running man) button, select "viewport display" and select the "in front" option<br />
:when you move a bone in the pose mode use shortcut "i" in main window to open keyframe dialogue and select "LocRot"<br />
:you can delete copy or move keyframes around for selected bones in the Dope Sheet section<br />
<br />
*Export collada - in settings check Anim is on Matrix option and 'keep keyframes' and 'all keyed curves' are selected.<br />
'''DO NOT USE IWTE Model Files > Siege Engine dae to mesh to convert back''' the dae doesn't include enough info to retain the three textures named in the mesh .<br />
<br />
*USE the "dae_to_mesh_*****_task.txt" that IWTE has written into the "IWTE_Tasks" sub-folder where your IWTE.exe is<br />
:change the .dae name you're reading in to the one you've just saved - change any other output names IF you need to<br />
:check the number of frames listed ties up with the end frame you set in collada.<br />
<br />
*Run the task file from the IWTE Task button in top menu bar, the separate files will be saved where specified in the task file.<br />
<br />
*If you have changed the number of bones used or their positions you will need to align all the other .cas anims used by the mesh, to do this use the skeleton replacement process explained below.<br />
<br />
==Skeleton Replacement (M2TW)==<br />
''RTW and packed M2TW skeletons can not be changed via this method.'' <br><br />
To replace the skeleton in M2TW where you have the set of full .cas anims that the game re-packs in the IWTE top menu bar go to:<br />
:Model Files > Cas Models > Skeleton Replacement<br />
<br />
*On the first prompt select the .cas file containing the bones in the basepose positions you want (probably the default or basepose .cas)<br />
*On the second prompt select the FOLDER that contains all the .cas files you want to change.<br />
<br />
The revised files will be saved in a sub folder of that folder called "updateskeletons" they will have the same names as the original .cas files and can be used to directly replace them. Please back-up your original files before doing this, and remember that other .cas/.mesh models may be using the same files, so you may need to create a separate folder and separate entry in descr_skeleton.txt etc.<br />
<br />
Adding bones should be straightforward, if you delete bones that had child bones then the result may be unpredictable and the resulting animations may need editing. <br />
<br />
===Bone Renaming Task===<br />
To rename the bones throughout a folder of full .cas animations use a task file. If you want to swap the names of bones you need to add an additional stage to re-name one bone to a temporary name, the example below shows how to swap bone_H_Saddle and bone_Spine names with each other:<br />
<task_id> cas_bone_name_change <br />
<directory_in> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka <br />
<directory_out> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka\changedbones <br />
<bone_name_change_list> <br />
bone_H_Saddle bone_H_Saddlex<br />
bone_Spine bone_H_Saddle<br />
bone_H_Saddlex bone_Spine<br />
<br />
* The task cas_bone_name_change changes a bone name (the NEW name must not already exist in a skeleton this is being applied to)<br />
* Directory in is optional, alternatively the task file can be placed in the directory and launched from there<br />
* Directory out is optional, if not given a sub-folder /updateskeletons will be created<br />
<br />
===Fixing Floating Units===<br />
For how to create the new basepose see [[Blender_hints_and_tips#Fixing_Floating_Units|Blender Hints and Tips]]<br />
<br />
Once you have the new basepose.cas you need to use it as the source to replace the bone positions in ALL of the animations the unit uses. For strat_models if you haven't already edited the .cas files of all the effected models include them in the skeleton replacement process too.<br />
<br />
==Weapon Animations (M2TW)==<br />
M2TW includes the possibility of having 'add-on' animations for weapons/shields. These are commonly listed in the model db file but rarely actually used.<br />
<br />
The advantage of properly using the weapon bones and anims instead of adding additional 'normal' bones to the skeleton is that the main skeleton remains 'standard' and does not cause the victim death anim bug when in battle with units whose skeletons have different numbers of bones!<br />
<br />
==IWTE Task File Options==<br />
===Text File Output===<br />
using <create_text_file> you can optionally generate .txt files that show, '''for information purposes only''', the content of the incoming .mesh/.cas files, the default option is <br />
<create_text_file> no #stops any text file being created <br />
<create_text_file> yes #creates a summary text file with header/trailer info, numbers of verts, texture and mesh names etc.<br />
<create_text_file> full #creates a full text file showing the interpretation of all the ints/floats etc in the file, with comments<br />
<br />
<br />
==External Links==<br />
* [https://www.blender.org/ Blender]<br />
* [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 IWTE Download]<br />
* [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing Discussion thread].<br />
<br />
[[Category:M2TW Modding]]<br />
[[Category:Blender]]<br />
[[Category:RTW Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=IWTE_-_Units_in_Blender/Milkshape&diff=86267IWTE - Units in Blender/Milkshape2023-01-07T15:07:44Z<p>Makanyane: /* Export and Import M2TW .mesh Units */ scaling</p>
<hr />
<div>{{RTW M2TW Modding Logo}}<br />
{{IWTE}} <br />
__TOC__<br />
<br />
<big>Tips and instructions for working with RTW and M2TW battle map units and strat map characters via '''[[IWTE]]''' and '''[[Blender]]''' using the .dae format.</big> <br />
<br />
''The .dae files used for the Collada import/export can also be used with '''3ds Max''', however, max users absolutely have to use the [https://github.com/KhronosGroup/OpenCOLLADA/wiki/OpenCOLLADA-Tools '''OpenCollada plugin'''] and file format when importing/exporting files, max comes with the AutodeskCollada file format by default which neither imports nor exports files from the game correctly.''<br />
<br />
*IWTE download [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 here] - please use the latest version, early versions do not have this functionality.<br />
*For queries about these functions please ask [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing here].<br />
*For information on working on M2TW Settlements in Blender see [[IWTE - Settlements in Blender]]<br />
*For general tips on working with Blender see [[Blender hints and tips]]<br />
*For related info about .cas file structure see [[Cas Files|here]]<br />
<br />
<br />
==Export and Import M2TW .mesh Units==<br />
The most useful method of export involves matching the unit .mesh with its skeleton basepose and one or more animations. <br />
<br />
The drop-down menu in IWTE allows a unit .mesh to be merged with its basepose skeleton and one animation. A task file is needed to allow combining of animations and is the only way to also incorporate weapon animations.<br />
<br />
The drop-down menu options, and alternative IWTE Task button positions are shown below:<br />
<br />
[[File:Export-mesh-in-IWTE.jpg]]<br />
<br />
Select 'Unit mesh to date' if you have the "full" version of the .cas anims (the ones the game re-packs). Select the 'Unit mesh/skel/casanim to dae' option if you have the versions unpacked using XIDX.<br />
<br />
Select the double mesh option for unit meshes that have both a main and attachment texture. Select the single mesh option for most other cases (e.g. standard mounts). <br />
<br />
You will be prompted to select the model .mesh first, then the basepose.cas for the skeleton (full cas version) or the unpacked skeleton file (unpacked version), and then an animation.cas file that is compatible with that skeleton (this will need to be in the same format as the skeleton, full or unpacked). <br />
<br />
===Export/Import by Task Process===<br />
To generate a .dae file from .mesh and .anims via the task process you will need a text file ending in _task.txt which starts with the mesh to dae command, run the task file by selecting the 'IWTE Task' > 'Select Task File' buttons. See example below for mesh_to_dae (the extra line breaks have been included just to show the body/weapon pairing):<br />
<br />
<task_id> mesh_to_dae <br />
<mesh_file_full_path_in> C:\M2TW\mods\devkit\data\animations\EB_Slinger\numidian_slinger_lod0.mesh <br />
<mesh_double_texture> yes <br />
<cas_file_types_in_list> body weapon<br />
<br />
<cas_file_full_path_in_default_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_basepose.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas<br />
<br />
<cas_file_full_path_in_action_list> <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_stand_A_idle.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_default.cas <br />
<br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\EB_Slinger_attack_missile_ready.cas <br />
C:\M2TW\mods\devkit\data\animations\EB_Slinger\Weapon\w_EB_Slinger_attack_missile_ready.cas <br />
<br />
<directory_out> C:\M2TW\mods\devkit\data\animations\EB_Slinger <br />
<dae_file_name_out> EBslingerAnims.dae <br />
<create_text_file> yes <br />
<br />
Please see the IWTE example control processes.txt file that ships with IWTE for further details/instructions. <br />
<br />
Running the task will generate you a .dae file with the animations joined together with an additional 'basepose' frame added at frame 0, to aid editing. The task will also auto-generate for a reverse dae_to_mesh_****_task.txt file for you, this will list the start and end frame positions of all included animations and the names of all the files that will be re-created from the .dae. The names and frame positions can be edited to suit any changes you may require before running the return task.<br />
<br />
When creating the task files it is common to make minor errors in the file names/paths that mean IWTE cannot find all the elements! If you get an error message whilst running the task you'll get a chance to read the error message <br />
(which is easier in the command window) - you can then click "Ignore" to keep IWTE open, fix the name/path/file issue in the .txt file and try running the task again. The error message should indicate which file it couldn't find. If you forget to add the file extension and try and get it to open a folder you'll get an 'access violation' type message. <br />
<br />
For unit models that do not have any elements weighted to the 'weapon bones' you only need to run the process with <br />
<br />
<code> <cas_file_types_in_list> body </code> <br />
<br />
and supply the main skeleton basepose and animation.<br />
<br />
If the mesh has a weapon weighted to weapon bones use the ''body weapon'' example shown above.<br />
<br />
If the mesh has both a weapon weighted to weapon bones and a shield weighted to bone_shield etc use<br />
<br />
<code> <cas_file_types_in_list> body weapon shield</code> <br />
<br />
and supply the main skeleton, weapon animation and shield animation baseposes and animations in sets of three in order.<br />
<br />
Note: a lot of models that are apparently using ''fs_test_shield'' according to their [[battle_models.modeldb]] entry don't actually have anything weighted to bone_shield, making the shield 'anim' irrelevant.<br />
<br />
===UV Mapping for Double Texture Units===<br />
The mesh format for both double and singled textured units in M2TW is actually exactly the same with just one set of uv's that should range from 0 to 1.0 in both horizontal and vertical axis.<br />
<br />
If you assign two textures to a unit in the [[battle_models.modeldb]] then the game expands out the horizontal axis of the uv maps so that the area from 0 to 0.5 is used to cover 0 to 1 on the first texture, and the uv's from 0.5 to 1.0 on the horizontal axis are used to cover 0 to 1 on the second texture.<br />
<br />
Milkshape/.mesh converters use the texture (Main or Attachment) assigned to a mesh group to determine which section of the uv map the group's uv coordinates will be moved to, with Main texture co-ordinates compressed into the 0>0.5 area and Attachment texture co-ordinates compressed into the 0.75>1.0 section.<br />
<br />
The IWTE mesh to .dae for Blender process works differently. The texture assignment process is used purely so you can view the mesh groups with the correct relevant texture. The 0>1.0 horizontal uvs are expanded to 0>2.0 if you use the process for 'double textures' and then compressed back to 0>1.0 on the return to .mesh.<br />
<br />
In Blender the uv mapping to the two textures will look like the image below.<br />
<br />
[[File:Uvs for double textured units.jpg|400px]]<br />
<br />
To see the 2nd texture under its uv's open the sidebar (n) in the uv screen and select the 'repeat texture' button.<br />
In Blender it is possible to partially assign some triangles from a group to the 1st texture and some triangles to the 2nd texture, if you do that please remember to also move the uv's to the appropriate zone.<br />
<br />
===Scaling of Anims===<br />
The 'full' cas animations as supplied by Caliban should be regarded as scale 1.0. If you need to load from them to suit a skeleton that will be scaled by the game you need to give IWTE the skeleton scale in the mesh_to_extract task using the appropriate tag e.g.<br><br />
<skeleton_scale> <br><br />
<mount_skeleton_scale><br />
<br />
==Export and Import RTW Units & RTW/M2TW Strat Characters==<br />
<big>'''NOTE:''' IWTE now supports the full weighting allowed in Rome Remastered by default - to ensure you do not create RTW/M2TW cas files that exceed their games capabilities add '''<cas_mesh_format> rtw''' (or M2) to the task file.</big><br />
<br />
<br />
The process for this is similar to the .mesh Export/Import process described above, the button locations are shown in the below image: <br><br />
[[File:Export-cas-to-dae.jpg|Exporting animated cas to date with IWTE]]<br />
<br />
Use the 'Animated cas_mesh to dae' ('''3''') button if you have the full versions of the animation files, e.g the type supplied by Caliban that M2TW itself re-packs. The first file requested will be the .cas 'mesh', e.g. the one with the body model in it. The second file requested will be an animation file, if you do not have a suitable animation file just click 'Cancel' to close the selection screen. You can use the 'Animated cas/dae' button for all unit/character .cas files even if you aren't going to load an animation.<br />
<br />
If you are using RTW or are using M2TW but only have the skeleton/cas files unpacked using XIDX or other tools use the appropriate '* casmesh,skel,casanim to dae' button ('''1''' or '''2'''). The first file requested will again be the .cas 'mesh', e.g. model. The second file requested will be the skeleton file (as produced by XIDX/tool using extract_skeletons). The third file requested will be the .cas animation file (as produced by XIDX/tool using extract_animations). For Rome Remastered use the RTW button.<br />
<br />
These processes will generate a .dae file in a /to_dae sub-folder where your IWTE.exe is located. You will also have two task files generated in the /iwte_tasks sub-folder. The dae_to_cas one provides a default task file for reversing the process and generating new .cas files. The cas_to_dae one allows you to repeat the process you just did by simply running the IWTE Task, you can also adapt that task file to load multiple animations. The following is an example task file for cas_to_dae with multiple anims, and using rtw skeleton and anims, note that if the file path/name has spaces the entire path needs to be inside " ", also note the skeleton name does not have a file extension, direction of \ or / doesn't matter:<br />
<task_id> cas_to_dae <br />
<cas_mesh_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\to_dae/from_dae/ALEX_companion_cavalry_lod_1.cas <br />
<directory_out> I:\M2TW\M2TWcopy\mods\IWTE/to_dae <br />
<dae_file_name_out> ALEX_companion_cavalry_taunt.dae <br />
<cas_animation_file_format> rtw <br />
<create_text_file> yes <br />
<create_task_file_from_input> yes <br />
<task_file_full_path_out> I:\M2TW\M2TWcopy\mods\IWTE/IWTE_tasks/dae_to_cas_alextaunt_task.txt <br />
<skeleton_unpacked_file_full_path_in> I:\M2TW\M2TWcopy\mods\IWTE\testthings\animations\rome_animations/fs_swordsman<br />
<cas_file_full_path_in_action_list> <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_04 taunt 2.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_06 taunt 1.cas" <br />
"i:/m2tw/m2twcopy/mods/iwte/to_dae/from_dae/lid_57_07 taunt 3.cas" <br />
<br />
To get amended units/anims back into game you will need to 'export' 'collada' from Blender or 3dsMax. The .dae file created will have the same structure whether you're converting to Mesh/Cas model, and Full/XIDX packable anims, so you need to use a task file to specify the format to be returned. The automatically generated return task file will have assumed you want the same format that went in, so the task file above will have generated this return file:<br />
<task_id> dae_to_cas # to read dae file and generate *.cas files<br />
<dae_file_full_path_in> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/ALEX_companion_cavalry_taunt.dae # *.dae file to read in. i.e. change to collada name exported from Blender<br />
<directory_out> i:/m2tw/m2twcopy/mods/iwte_v20_12_c/to_dae/from_dae # directory to put new created files<br />
<cas_mesh_file_name_out> alex_companion_cavalry_lod_1.cas # *.cas file to be created<br />
<cas_animation_file_format> rtw # format of cas to be created by dae (rtw or full) <br />
<cas_unpacked_skeleton_scale> 1.0000 # cas unpacked skeleton scaling<br />
<overlap_frames> no # overlap frames selection used to create the dae (not used on import)<br />
<cas_file_name_out_anim_split_list> # cas anim files start and end frames<br />
"lid_57_04 taunt 2.cas" 1 79 <br />
"lid_57_06 taunt 1.cas" 80 162 <br />
"lid_57_07 taunt 3.cas" 163 237 <br />
#<end_frame> 237 # Last animated frame (use to see full animation in blender)<br />
<br />
If you're trying to convert format, instead of rtw you need to use:<br />
<cas_animation_file_format> '''m2''' #for M2TW anims re-packable by XIDX<br />
<br />
<cas_animation_file_format> '''full''' #for M2TW anims re-packable by '''the game'''<br />
<br />
If you want an M2TW mesh back instead of a .cas model use the <br />
<task_id> '''dae_to_mesh'''<br />
instead of dae_to_cas<br />
<br />
Using the 'Animated dae to cas_mesh' ('''4''') button will generate a separate cas model file and a full version anim called _action. See below for animation file type details.<br />
<br />
Using the 'RTW object animation dae to cas' ('''5''') will produce a cas which includes both the model and the animation together, these are used only for [[Spot fx animations and effects|spot_fx]] items in RTW/RR.<br />
<br />
===Bone Weighting===<br />
RTW battle map units and strat models and M2TW strat models will generally have vertexes weighted to only one bone per vertex.<br />
<br />
If you convert a dae with multiple bone weights per vertex to cas with IWTE it will generate one cas with vertexes weighted to up to two bones, and one cas with the suffix "_lod1". The _lod1 cas can be renamed and used for RTW/M2TW. Ideally however you should limit the bone weight totals yourself so you can check how the model will behave in game when posed. See [[Blender_hints_and_tips#Bone_Assignment|Blender hints and tips]].<br />
<br />
For details on optionally creating a simple multi-weighted Section see: [[Model_flexi_m in RTW]]<br />
<br />
===Cas animation types===<br />
IWTE supports the full (never packed) versions of [[Cas Files|.cas files]], as supplied by Caliban and also the ones that have been generated from Pack files by XIDX, IWTE or similar tools. PLEASE NOTE: The RTW and M2TW anims generated from the pack files use a different format - DO NOT pack RTW types into M2TW packs or vice-versa - check that you are generating the correct type for the game you are going to use them in! Also do not attempt to re-pack the full type (where you can see the bone names) with XIDX or IWTE, they will only work if you have a full set including .evt files and let M2TW repack them from descr_skeleton.txt.<br />
<br />
==Units - General Tips==<br />
*Seams - To avoid seams in the finished model you CAN 'weld' vertexes that have disconnected uvs, in Blender use Mesh> Clean Up> Merge by Distance (without uvs ticked), and Shading> Smooth Faces. That will get you a shared normal that allows the area to look smooth. For the game IWTE will generate two vertexes at that point to preserve the uvs and set that normal as a custom normal for each.<br />
<br />
*Anims/skeletons - In Blender you can make any alteration you like to the 'Pose Mode' this will only affect the animation frames. Do NOT, unless you know what you are doing... move or edit the bones in the 'Armature' edit mode, this will affect the bone positions in the model/anim.cas produced, and will need to be matched to a skeleton with the same bone positions. If using the "full" M2TW cas anims that the game re-packs you can adjust the bone positions for a folder of .cas anims by using the skeleton replacement method detailed below. If using XIDX unpacked/packed anims you will need to change the skeleton using other tools.<br />
<br />
==Animations - General Tips==<br />
*Blender must be set to 20fps BEFORE importing a .dae with animation created by IWTE. To do this use the custom setting and type in 20. When you import a .dae file you should then see the keyframes neatly aligned with the time markers. See below:<br />
<br />
[[File:20fps.jpg|200px]]<br />
<br />
==Mesh Names/Comments==<br />
The Blender .dae interface does not support comments, so all the information about the mesh sections (primary/secondary weapons etc.) needs to go in the mesh name:<br />
<br />
*Section Naming - For Blender the full details of the group names are stored in the name itself. There isn't a comment section like milkshape. Things that need to go back into the game as separate sections, e.g. to denote primary weapons, or alternate versions, need a double underscore __ to show where the name should be split or a space included. For M2TW mesh sections that you want to be optional, use __opt at the end of the group name.<br />
<br />
==Siege/Artillery Engines==<br />
Siege/Artillery for both RTW and M2TW use the "full" cas anim versions (not packed/unpacked at any stage). For M2TW use the dedicated Model Files > Mesh Models > Siege Engine mesh to date for export and IWTE Task import process. For RTW use the Model Files > Cas Models > Animated cas_mesh to date, the RTW process seems to be quite straightforward as there isn't the mis-alignment between bone names and start poses that is present in M2TW.<br />
===M2TW Siege Engine Skeleton Alteration Example Process===<br />
*In top menu bar go to Model Files > Siege Engine mesh to dae > select mesh, then default cas then anim cas.<br />
:Check that the default .cas is actually the one listed as anim-default in descr_engine_skeleton.txt<br />
:also check that you're using an anim that is in use in game - some of the anims in the folder don't work.<br />
<br />
*IWTE will have written a .dae file in "to_dae" sub-folder below your .mesh model location.<br />
<br />
*Load in Blender by using 'file' 'import' 'collada'<br />
<br />
*Add bones as required to the Armature - note there should only be one top level bone, e.g bone_body add all other bones as child of this, or of existing bones.<br />
<br />
*Use 'weight paint' to assign vertices to bones as required.<br />
:Note - the .mesh file will only accept vertexes weighted to a max of 2 bones<br />
:use 'limit total' in 'weights' menu and set to 2 to avoid any verts weighted to 3 or more bones - (this is applied to selected verts only)<br />
:use 'normalise all' to make sure verts are fully weighted, use 'auto normalise' option whilst working also<br />
<br />
*change animation by switching to 'animation' layout in top bar<br />
:trigger Pose mode by clicking pose running man symbol within the Armature<br />
:if you can't see bones, or the summary when you click them, in main sidebar click the pose (running man) button, select "viewport display" and select the "in front" option<br />
:when you move a bone in the pose mode use shortcut "i" in main window to open keyframe dialogue and select "LocRot"<br />
:you can delete copy or move keyframes around for selected bones in the Dope Sheet section<br />
<br />
*Export collada - in settings check Anim is on Matrix option and 'keep keyframes' and 'all keyed curves' are selected.<br />
'''DO NOT USE IWTE Model Files > Siege Engine dae to mesh to convert back''' the dae doesn't include enough info to retain the three textures named in the mesh .<br />
<br />
*USE the "dae_to_mesh_*****_task.txt" that IWTE has written into the "IWTE_Tasks" sub-folder where your IWTE.exe is<br />
:change the .dae name you're reading in to the one you've just saved - change any other output names IF you need to<br />
:check the number of frames listed ties up with the end frame you set in collada.<br />
<br />
*Run the task file from the IWTE Task button in top menu bar, the separate files will be saved where specified in the task file.<br />
<br />
*If you have changed the number of bones used or their positions you will need to align all the other .cas anims used by the mesh, to do this use the skeleton replacement process explained below.<br />
<br />
==Skeleton Replacement (M2TW)==<br />
''RTW and packed M2TW skeletons can not be changed via this method.'' <br><br />
To replace the skeleton in M2TW where you have the set of full .cas anims that the game re-packs in the IWTE top menu bar go to:<br />
:Model Files > Cas Models > Skeleton Replacement<br />
<br />
*On the first prompt select the .cas file containing the bones in the basepose positions you want (probably the default or basepose .cas)<br />
*On the second prompt select the FOLDER that contains all the .cas files you want to change.<br />
<br />
The revised files will be saved in a sub folder of that folder called "updateskeletons" they will have the same names as the original .cas files and can be used to directly replace them. Please back-up your original files before doing this, and remember that other .cas/.mesh models may be using the same files, so you may need to create a separate folder and separate entry in descr_skeleton.txt etc.<br />
<br />
Adding bones should be straightforward, if you delete bones that had child bones then the result may be unpredictable and the resulting animations may need editing. <br />
<br />
===Bone Renaming Task===<br />
To rename the bones throughout a folder of full .cas animations use a task file. If you want to swap the names of bones you need to add an additional stage to re-name one bone to a temporary name, the example below shows how to swap bone_H_Saddle and bone_Spine names with each other:<br />
<task_id> cas_bone_name_change <br />
<directory_in> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka <br />
<directory_out> I:\M2TW\mods\WD_PKH\data\animations\pkh_horse_marka\changedbones <br />
<bone_name_change_list> <br />
bone_H_Saddle bone_H_Saddlex<br />
bone_Spine bone_H_Saddle<br />
bone_H_Saddlex bone_Spine<br />
<br />
* The task cas_bone_name_change changes a bone name (the NEW name must not already exist in a skeleton this is being applied to)<br />
* Directory in is optional, alternatively the task file can be placed in the directory and launched from there<br />
* Directory out is optional, if not given a sub-folder /updateskeletons will be created<br />
<br />
===Fixing Floating Units===<br />
For how to create the new basepose see [[Blender_hints_and_tips#Fixing_Floating_Units|Blender Hints and Tips]]<br />
<br />
Once you have the new basepose.cas you need to use it as the source to replace the bone positions in ALL of the animations the unit uses. For strat_models if you haven't already edited the .cas files of all the effected models include them in the skeleton replacement process too.<br />
<br />
==Weapon Animations (M2TW)==<br />
M2TW includes the possibility of having 'add-on' animations for weapons/shields. These are commonly listed in the model db file but rarely actually used.<br />
<br />
The advantage of properly using the weapon bones and anims instead of adding additional 'normal' bones to the skeleton is that the main skeleton remains 'standard' and does not cause the victim death anim bug when in battle with units whose skeletons have different numbers of bones!<br />
<br />
==IWTE Task File Options==<br />
===Text File Output===<br />
using <create_text_file> you can optionally generate .txt files that show, '''for information purposes only''', the content of the incoming .mesh/.cas files, the default option is <br />
<create_text_file> no #stops any text file being created <br />
<create_text_file> yes #creates a summary text file with header/trailer info, numbers of verts, texture and mesh names etc.<br />
<create_text_file> full #creates a full text file showing the interpretation of all the ints/floats etc in the file, with comments<br />
<br />
<br />
==External Links==<br />
* [https://www.blender.org/ Blender]<br />
* [https://www.twcenter.net/forums/downloads.php?do=file&id=2741 IWTE Download]<br />
* [https://www.twcenter.net/forums/showthread.php?808315-IWTE-Character-Unit-Skeleton-and-Animation-editing Discussion thread].<br />
<br />
[[Category:M2TW Modding]]<br />
[[Category:Blender]]<br />
[[Category:RTW Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Unit_Animations_-_M2TW&diff=86266Unit Animations - M2TW2023-01-07T15:00:41Z<p>Makanyane: added Category:M2TW Modding using HotCat</p>
<hr />
<div>Unit animations in M2TW are based on a skeleton system using a maximum of 24 bones.<br />
<br />
There are two different ways of importing skeletons and animations to a mod.<br />
<br />
==Original Game==<br />
Although M2TW ships with a copy of descr_skeleton.txt it is not read by the game unless the pack and skeletons .idx and .dat files in data/animations are deleted.<br />
The game cannot rebuild the pack/skeletons files with the information originally shipped with the game.<br />
<br />
Caliban from CA supplied a full set of original .cas and .evt files which can be added to the data/animations folder and will allow the game to rebuild the packs based on the contents of descr_skeleton.txt<br />
<br />
The .cas files for the siege engines are in the same format as those supplied by Caliban, they are never packed.<br />
<br />
==Scaling==<br />
The Caliban/full cas animations should be regarded as being as scale 1:1. If descr_skeleton.txt specifies a scale other than 1 then all the animations packed by the game for that skeleton will be adjusted to that scale. If the same animation is used by multiple skeletons which have different scales then multiple versions of that animation will be created at each of the scales. Therefore the pack can contain multiple files that say they are, for example:<br><br />
data\animations\MTW2_Spear\MTW2_Fast_Spear_run.cas<br><br />
this doesn't cause a problem when using the packs, but can cause issues with tools attempting to unpack the segments, as files with the same name and folder path would overwrite each other.<br />
<br />
==Porting Modded Skeletons==<br />
The easiest way to get a newly created skeleton into the pack files is by letting the game rebuild from the full .cas and .evt files and descr_skeleton.txt.<br />
<br />
Once the packs have been made the .cas and .evt files can be deleted from the modfolder.<br />
<br />
===Porting by Merging Packs===<br />
If you need skeletons and anims that exist in two or more separate packs you can merge them into one pack by using tools such as XIDX. These 'unpack' the skeletons (which contain the .evt information) and the anims, they provide you with a list of skeleton names and animation names and you can then manipulate the lists to re-pack the skeletons and animations you want. The unpackers do not change or decompress any contents from the packs they simply split the packs into chunks of the relevant length and write them as separate files, the chunks are then combined back together when they are 'packed'.<br />
<br />
===Porting by Converting back to Original Format===<br />
Using a combination of the original .cas and .evt files supplied by Caliban, original modded .cas files if available, or converted .cas files using JoJo's tool, or a full set of converted .cas files using IWTE, you can get the game to rebuild from a descr_skeleton.txt file. IWTE will write a descr_skeleton.txt file for each pack set it unpacks, you can then text edit the required skeletons into one file.<br />
<br />
Gigantus's DEVKIT provides a mod-folder set-up with Caliban's animations and a mechanism for automatically getting the packs to regenerate.<br />
<br />
<big>'''NOTE'''</big> - The Unpackers e.g. XIDX will provide you with a large folder of '.cas' files - THESE ARE NOT THE SAME AS ORIGINAL/CONVERTED CAS FILES!<br />
You need a full set of the correct type of 'cas' (unpacked OR original/converted), you can't mix and match some of each...<br />
<br />
[[Category:M2TW Modding]]</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Unit_Animations_-_M2TW&diff=86265Unit Animations - M2TW2023-01-07T14:52:44Z<p>Makanyane: /* Scaling */</p>
<hr />
<div>Unit animations in M2TW are based on a skeleton system using a maximum of 24 bones.<br />
<br />
There are two different ways of importing skeletons and animations to a mod.<br />
<br />
==Original Game==<br />
Although M2TW ships with a copy of descr_skeleton.txt it is not read by the game unless the pack and skeletons .idx and .dat files in data/animations are deleted.<br />
The game cannot rebuild the pack/skeletons files with the information originally shipped with the game.<br />
<br />
Caliban from CA supplied a full set of original .cas and .evt files which can be added to the data/animations folder and will allow the game to rebuild the packs based on the contents of descr_skeleton.txt<br />
<br />
The .cas files for the siege engines are in the same format as those supplied by Caliban, they are never packed.<br />
<br />
==Scaling==<br />
The Caliban/full cas animations should be regarded as being as scale 1:1. If descr_skeleton.txt specifies a scale other than 1 then all the animations packed by the game for that skeleton will be adjusted to that scale. If the same animation is used by multiple skeletons which have different scales then multiple versions of that animation will be created at each of the scales. Therefore the pack can contain multiple files that say they are, for example:<br><br />
data\animations\MTW2_Spear\MTW2_Fast_Spear_run.cas<br><br />
this doesn't cause a problem when using the packs, but can cause issues with tools attempting to unpack the segments, as files with the same name and folder path would overwrite each other.<br />
<br />
==Porting Modded Skeletons==<br />
The easiest way to get a newly created skeleton into the pack files is by letting the game rebuild from the full .cas and .evt files and descr_skeleton.txt.<br />
<br />
Once the packs have been made the .cas and .evt files can be deleted from the modfolder.<br />
<br />
===Porting by Merging Packs===<br />
If you need skeletons and anims that exist in two or more separate packs you can merge them into one pack by using tools such as XIDX. These 'unpack' the skeletons (which contain the .evt information) and the anims, they provide you with a list of skeleton names and animation names and you can then manipulate the lists to re-pack the skeletons and animations you want. The unpackers do not change or decompress any contents from the packs they simply split the packs into chunks of the relevant length and write them as separate files, the chunks are then combined back together when they are 'packed'.<br />
<br />
===Porting by Converting back to Original Format===<br />
Using a combination of the original .cas and .evt files supplied by Caliban, original modded .cas files if available, or converted .cas files using JoJo's tool, or a full set of converted .cas files using IWTE, you can get the game to rebuild from a descr_skeleton.txt file. IWTE will write a descr_skeleton.txt file for each pack set it unpacks, you can then text edit the required skeletons into one file.<br />
<br />
Gigantus's DEVKIT provides a mod-folder set-up with Caliban's animations and a mechanism for automatically getting the packs to regenerate.<br />
<br />
<big>'''NOTE'''</big> - The Unpackers e.g. XIDX will provide you with a large folder of '.cas' files - THESE ARE NOT THE SAME AS ORIGINAL/CONVERTED CAS FILES!<br />
You need a full set of the correct type of 'cas' (unpacked OR original/converted), you can't mix and match some of each...</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Unit_Animations_-_M2TW&diff=86264Unit Animations - M2TW2023-01-07T14:52:13Z<p>Makanyane: /* Scaling */</p>
<hr />
<div>Unit animations in M2TW are based on a skeleton system using a maximum of 24 bones.<br />
<br />
There are two different ways of importing skeletons and animations to a mod.<br />
<br />
==Original Game==<br />
Although M2TW ships with a copy of descr_skeleton.txt it is not read by the game unless the pack and skeletons .idx and .dat files in data/animations are deleted.<br />
The game cannot rebuild the pack/skeletons files with the information originally shipped with the game.<br />
<br />
Caliban from CA supplied a full set of original .cas and .evt files which can be added to the data/animations folder and will allow the game to rebuild the packs based on the contents of descr_skeleton.txt<br />
<br />
The .cas files for the siege engines are in the same format as those supplied by Caliban, they are never packed.<br />
<br />
==Scaling==<br />
The Caliban/full cas animations should be regarded as being as scale 1:1. If descr_skeleton.txt specifies a scale other than 1 then all the animations packed by the game for that skeleton will be adjusted to that scale. If the same animation is used by multiple skeletons which have different scales then multiple versions of that animation will be created at each of the scales. Therefore the pack can contain multiple files that say they are, for example:<br><br />
data\animations\MTW2_Spear\MTW2_Fast_Spear_run.cas<br><br />
this doesn't cause a problem when using the packs, but can cause issues with tools attempting to unpack the segments.<br />
<br />
==Porting Modded Skeletons==<br />
The easiest way to get a newly created skeleton into the pack files is by letting the game rebuild from the full .cas and .evt files and descr_skeleton.txt.<br />
<br />
Once the packs have been made the .cas and .evt files can be deleted from the modfolder.<br />
<br />
===Porting by Merging Packs===<br />
If you need skeletons and anims that exist in two or more separate packs you can merge them into one pack by using tools such as XIDX. These 'unpack' the skeletons (which contain the .evt information) and the anims, they provide you with a list of skeleton names and animation names and you can then manipulate the lists to re-pack the skeletons and animations you want. The unpackers do not change or decompress any contents from the packs they simply split the packs into chunks of the relevant length and write them as separate files, the chunks are then combined back together when they are 'packed'.<br />
<br />
===Porting by Converting back to Original Format===<br />
Using a combination of the original .cas and .evt files supplied by Caliban, original modded .cas files if available, or converted .cas files using JoJo's tool, or a full set of converted .cas files using IWTE, you can get the game to rebuild from a descr_skeleton.txt file. IWTE will write a descr_skeleton.txt file for each pack set it unpacks, you can then text edit the required skeletons into one file.<br />
<br />
Gigantus's DEVKIT provides a mod-folder set-up with Caliban's animations and a mechanism for automatically getting the packs to regenerate.<br />
<br />
<big>'''NOTE'''</big> - The Unpackers e.g. XIDX will provide you with a large folder of '.cas' files - THESE ARE NOT THE SAME AS ORIGINAL/CONVERTED CAS FILES!<br />
You need a full set of the correct type of 'cas' (unpacked OR original/converted), you can't mix and match some of each...</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Unit_Animations_-_M2TW&diff=86263Unit Animations - M2TW2023-01-07T14:51:31Z<p>Makanyane: </p>
<hr />
<div>Unit animations in M2TW are based on a skeleton system using a maximum of 24 bones.<br />
<br />
There are two different ways of importing skeletons and animations to a mod.<br />
<br />
==Original Game==<br />
Although M2TW ships with a copy of descr_skeleton.txt it is not read by the game unless the pack and skeletons .idx and .dat files in data/animations are deleted.<br />
The game cannot rebuild the pack/skeletons files with the information originally shipped with the game.<br />
<br />
Caliban from CA supplied a full set of original .cas and .evt files which can be added to the data/animations folder and will allow the game to rebuild the packs based on the contents of descr_skeleton.txt<br />
<br />
The .cas files for the siege engines are in the same format as those supplied by Caliban, they are never packed.<br />
<br />
==Scaling==<br />
The Caliban/full cas animations should be regarded as being as scale 1:1. If descr_skeleton.txt specifies a scale other than 1 then all the animations packed by the game for that skeleton will be adjusted to that scale. If the same animation is used by multiple skeletons which have different scales then multiple versions of that animation will be created at each of the scales. Therefore the pack can contain multiple files that say they are, for example:<br />
data\animations\MTW2_Spear\MTW2_Fast_Spear_run.cas<br />
this doesn't cause a problem when using the packs, but can cause issues with tools attempting to unpack the segments.<br />
<br />
==Porting Modded Skeletons==<br />
The easiest way to get a newly created skeleton into the pack files is by letting the game rebuild from the full .cas and .evt files and descr_skeleton.txt.<br />
<br />
Once the packs have been made the .cas and .evt files can be deleted from the modfolder.<br />
<br />
===Porting by Merging Packs===<br />
If you need skeletons and anims that exist in two or more separate packs you can merge them into one pack by using tools such as XIDX. These 'unpack' the skeletons (which contain the .evt information) and the anims, they provide you with a list of skeleton names and animation names and you can then manipulate the lists to re-pack the skeletons and animations you want. The unpackers do not change or decompress any contents from the packs they simply split the packs into chunks of the relevant length and write them as separate files, the chunks are then combined back together when they are 'packed'.<br />
<br />
===Porting by Converting back to Original Format===<br />
Using a combination of the original .cas and .evt files supplied by Caliban, original modded .cas files if available, or converted .cas files using JoJo's tool, or a full set of converted .cas files using IWTE, you can get the game to rebuild from a descr_skeleton.txt file. IWTE will write a descr_skeleton.txt file for each pack set it unpacks, you can then text edit the required skeletons into one file.<br />
<br />
Gigantus's DEVKIT provides a mod-folder set-up with Caliban's animations and a mechanism for automatically getting the packs to regenerate.<br />
<br />
<big>'''NOTE'''</big> - The Unpackers e.g. XIDX will provide you with a large folder of '.cas' files - THESE ARE NOT THE SAME AS ORIGINAL/CONVERTED CAS FILES!<br />
You need a full set of the correct type of 'cas' (unpacked OR original/converted), you can't mix and match some of each...</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Unit_Animations_-_M2TW&diff=86262Unit Animations - M2TW2022-12-27T14:53:46Z<p>Makanyane: /* Porting by Merging Packs */</p>
<hr />
<div>Unit animations in M2TW are based on a skeleton system using a maximum of 24 bones.<br />
<br />
There are two different ways of importing skeletons and animations to a mod.<br />
<br />
==Original Game==<br />
Although M2TW ships with a copy of descr_skeleton.txt it is not read by the game unless the pack and skeletons .idx and .dat files in data/animations are deleted.<br />
The game cannot rebuild the pack/skeletons files with the information originally shipped with the game.<br />
<br />
Caliban from CA supplied a full set of original .cas and .evt files which can be added to the data/animations folder and will allow the game to rebuild the packs based on the contents of descr_skeleton.txt<br />
<br />
The .cas files for the siege engines are in the same format as those supplied by Caliban, they are never packed.<br />
<br />
==Porting Modded Skeletons==<br />
The easiest way to get a newly created skeleton into the pack files is by letting the game rebuild from the full .cas and .evt files and descr_skeleton.txt.<br />
<br />
Once the packs have been made the .cas and .evt files can be deleted from the modfolder.<br />
<br />
===Porting by Merging Packs===<br />
If you need skeletons and anims that exist in two or more separate packs you can merge them into one pack by using tools such as XIDX. These 'unpack' the skeletons (which contain the .evt information) and the anims, they provide you with a list of skeleton names and animation names and you can then manipulate the lists to re-pack the skeletons and animations you want. The unpackers do not change or decompress any contents from the packs they simply split the packs into chunks of the relevant length and write them as separate files, the chunks are then combined back together when they are 'packed'.<br />
<br />
===Porting by Converting back to Original Format===<br />
Using a combination of the original .cas and .evt files supplied by Caliban, original modded .cas files if available, or converted .cas files using JoJo's tool, or a full set of converted .cas files using IWTE, you can get the game to rebuild from a descr_skeleton.txt file. IWTE will write a descr_skeleton.txt file for each pack set it unpacks, you can then text edit the required skeletons into one file.<br />
<br />
Gigantus's DEVKIT provides a mod-folder set-up with Caliban's animations and a mechanism for automatically getting the packs to regenerate.<br />
<br />
<big>'''NOTE'''</big> - The Unpackers e.g. XIDX will provide you with a large folder of '.cas' files - THESE ARE NOT THE SAME AS ORIGINAL/CONVERTED CAS FILES!<br />
You need a full set of the correct type of 'cas' (unpacked OR original/converted), you can't mix and match some of each...</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Unit_Animations_-_M2TW&diff=86261Unit Animations - M2TW2022-12-27T14:52:45Z<p>Makanyane: /* Porting Modded Skeletons */</p>
<hr />
<div>Unit animations in M2TW are based on a skeleton system using a maximum of 24 bones.<br />
<br />
There are two different ways of importing skeletons and animations to a mod.<br />
<br />
==Original Game==<br />
Although M2TW ships with a copy of descr_skeleton.txt it is not read by the game unless the pack and skeletons .idx and .dat files in data/animations are deleted.<br />
The game cannot rebuild the pack/skeletons files with the information originally shipped with the game.<br />
<br />
Caliban from CA supplied a full set of original .cas and .evt files which can be added to the data/animations folder and will allow the game to rebuild the packs based on the contents of descr_skeleton.txt<br />
<br />
The .cas files for the siege engines are in the same format as those supplied by Caliban, they are never packed.<br />
<br />
==Porting Modded Skeletons==<br />
The easiest way to get a newly created skeleton into the pack files is by letting the game rebuild from the full .cas and .evt files and descr_skeleton.txt.<br />
<br />
Once the packs have been made the .cas and .evt files can be deleted from the modfolder.<br />
<br />
===Porting by Merging Packs===<br />
If you need skeletons and anims that exist in two or more separate packs you can merge them into one pack by using tools such as XIDX. These 'unpack' the skeletons (which contain the .evt information) and the anims, they provide you with a list of skeleton names and animation names and you can then manipulate the lists to re-pack the skeletons and animations you want. The unpackers do not change or decompress any contents from the packs they simply split the packs into chunks of the relevant length and write them as separate files.<br />
<br />
===Porting by Converting back to Original Format===<br />
Using a combination of the original .cas and .evt files supplied by Caliban, original modded .cas files if available, or converted .cas files using JoJo's tool, or a full set of converted .cas files using IWTE, you can get the game to rebuild from a descr_skeleton.txt file. IWTE will write a descr_skeleton.txt file for each pack set it unpacks, you can then text edit the required skeletons into one file.<br />
<br />
Gigantus's DEVKIT provides a mod-folder set-up with Caliban's animations and a mechanism for automatically getting the packs to regenerate.<br />
<br />
<big>'''NOTE'''</big> - The Unpackers e.g. XIDX will provide you with a large folder of '.cas' files - THESE ARE NOT THE SAME AS ORIGINAL/CONVERTED CAS FILES!<br />
You need a full set of the correct type of 'cas' (unpacked OR original/converted), you can't mix and match some of each...</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Unit_Animations_-_M2TW&diff=86260Unit Animations - M2TW2022-12-27T14:52:10Z<p>Makanyane: </p>
<hr />
<div>Unit animations in M2TW are based on a skeleton system using a maximum of 24 bones.<br />
<br />
There are two different ways of importing skeletons and animations to a mod.<br />
<br />
==Original Game==<br />
Although M2TW ships with a copy of descr_skeleton.txt it is not read by the game unless the pack and skeletons .idx and .dat files in data/animations are deleted.<br />
The game cannot rebuild the pack/skeletons files with the information originally shipped with the game.<br />
<br />
Caliban from CA supplied a full set of original .cas and .evt files which can be added to the data/animations folder and will allow the game to rebuild the packs based on the contents of descr_skeleton.txt<br />
<br />
The .cas files for the siege engines are in the same format as those supplied by Caliban, they are never packed.<br />
<br />
==Porting Modded Skeletons==<br />
The easiest way to initially get a modded skeleton into the pack files is by letting the game rebuild from the full .cas and .evt files and descr_skeleton.txt.<br />
<br />
Once the packs have been made the .cas and .evt files can be deleted from the modfolder.<br />
<br />
===Porting by Merging Packs===<br />
If you need skeletons and anims that exist in two or more separate packs you can merge them into one pack by using tools such as XIDX. These 'unpack' the skeletons (which contain the .evt information) and the anims, they provide you with a list of skeleton names and animation names and you can then manipulate the lists to re-pack the skeletons and animations you want. The unpackers do not change or decompress any contents from the packs they simply split the packs into chunks of the relevant length and write them as separate files.<br />
<br />
===Porting by Converting back to Original Format===<br />
Using a combination of the original .cas and .evt files supplied by Caliban, original modded .cas files if available, or converted .cas files using JoJo's tool, or a full set of converted .cas files using IWTE, you can get the game to rebuild from a descr_skeleton.txt file. IWTE will write a descr_skeleton.txt file for each pack set it unpacks, you can then text edit the required skeletons into one file.<br />
<br />
Gigantus's DEVKIT provides a mod-folder set-up with Caliban's animations and a mechanism for automatically getting the packs to regenerate.<br />
<br />
<big>'''NOTE'''</big> - The Unpackers e.g. XIDX will provide you with a large folder of '.cas' files - THESE ARE NOT THE SAME AS ORIGINAL/CONVERTED CAS FILES!<br />
You need a full set of the correct type of 'cas' (unpacked OR original/converted), you can't mix and match some of each...</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Unit_Animations_-_M2TW&diff=86259Unit Animations - M2TW2022-12-27T14:51:11Z<p>Makanyane: </p>
<hr />
<div>Unit animations in M2TW are based on a skeleton system using a maximum of 24 bones.<br />
<br />
There are two different ways of importing skeletons and animations to a mod.<br />
<br />
==Original Game==<br />
Although M2TW ships with a copy of descr_skeleton.txt it is not read by the game unless the pack and skeletons .idx and .dat files in data/animations are deleted.<br />
The game cannot rebuild the pack/skeletons files with the information originally shipped with the game.<br />
<br />
Caliban from CA supplied a full set of original .cas and .evt files which can be added to the data/animations folder and will allow the game to rebuild the packs based on the contents of descr_skeleton.txt<br />
<br />
The .cas files for the siege engines are in the same format as those supplied by Caliban, they are never packed.<br />
<br />
==Porting Modded Skeletons==<br />
The only way to initially get a modded skeleton into the pack files is by letting the game rebuild from the full .cas and .evt files and descr_skeleton.txt.<br />
<br />
Once the packs have been made the .cas and .evt files can be deleted from the modfolder.<br />
<br />
===Porting by Merging Packs===<br />
If you need skeletons and anims that exist in two or more separate packs you can merge them into one pack by using tools such as XIDX. These 'unpack' the skeletons (which contain the .evt information) and the anims, they provide you with a list of skeleton names and animation names and you can then manipulate the lists to re-pack the skeletons and animations you want. The unpackers do not change or decompress any contents from the packs they simply split the packs into chunks of the relevant length and write them as separate files.<br />
<br />
===Porting by Converting back to Original Format===<br />
Using a combination of the original .cas and .evt files supplied by Caliban, original modded .cas files if available, or converted .cas files using JoJo's tool, or a full set of converted .cas files using IWTE, you can get the game to rebuild from a descr_skeleton.txt file. IWTE will write a descr_skeleton.txt file for each pack set it unpacks, you can then text edit the required skeletons into one file.<br />
<br />
Gigantus's DEVKIT provides a mod-folder set-up with Caliban's animations and a mechanism for automatically getting the packs to regenerate.<br />
<br />
<big>'''NOTE'''</big> - The Unpackers e.g. XIDX will provide you with a large folder of '.cas' files - THESE ARE NOT THE SAME AS ORIGINAL/CONVERTED CAS FILES!<br />
You need a full set of the correct type of 'cas' (unpacked OR original/converted), you can't mix and match some of each...</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Unit_Animations_-_M2TW&diff=86258Unit Animations - M2TW2022-12-27T14:44:46Z<p>Makanyane: </p>
<hr />
<div>Unit animations in M2TW are based on a skeleton system using a maximum of 24 bones.<br />
<br />
There are two different ways of importing skeletons and animations to a mod.<br />
<br />
==Original Game==<br />
Although M2TW ships with a copy of descr_skeleton.txt it is not read by the game unless the pack and skeletons .idx and .dat files in data/animations are deleted.<br />
The game cannot rebuild the pack/skeletons files with the information originally shipped with the game.<br />
<br />
Caliban from CA supplied a full set of original .cas and .evt files which can be added to the data/animations folder and will allow the game to rebuild the packs based on the contents of descr_skeleton.txt<br />
<br />
The .cas files for the siege engines are in the same format as those supplied by Caliban, they are never packed.<br />
<br />
==Porting Modded Skeletons==<br />
The only way to initially get a modded skeleton into the pack files is by letting the game rebuild from the full .cas and .evt files and descr_skeleton.txt.<br />
<br />
Once the packs have been made the .cas and .evt files can be deleted from the modfolder.<br />
<br />
===Porting by Merging Packs===<br />
If you need skeletons and anims that exist in two or more separate packs you can merge them into one pack by using tools such as XIDX. These 'unpack' the skeletons (which contain the .evt information) and the anims, they provide you with a list of skeleton names and animation names and you can then manipulate the lists to re-pack the skeletons and animations you want. The unpackers do not change or decompress any contents from the packs they simply split the packs into chunks of the relevant length and write them as separate files.<br />
<br />
===Porting by Converting back to Original Format===<br />
Using a combination of the original .cas and .evt files supplied by Caliban, original modded .cas files if available, or converted .cas files using JoJo's tool, or a full set of converted .cas files using IWTE, you can get the game to rebuild from a descr_skeleton.txt file. IWTE will write a descr_skeleton.txt file for each pack set it unpacks, you can then text edit the required skeletons into one file.<br />
<br />
Gigantus's DEVKIT provides a mod-folder set-up with Caliban's animations and a mechanism for automatically getting the packs to regenerate.<br />
<br />
<big>'''NOTE'''</big> - The Unpackers e.g. XIDX will provide you with a large folder of '.cas' files - THESE ARE NOT THE SAME AS ORIGINAL OR CONVERTED CAS FILES!<br />
You need a full set of the correct type of 'cas' (unpacked OR original/converted), you can't mix and match some of each...</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Unit_Animations_-_M2TW&diff=86257Unit Animations - M2TW2022-12-27T14:43:33Z<p>Makanyane: </p>
<hr />
<div>Unit animations in M2TW are based on a skeleton system using a maximum of 24 bones.<br />
<br />
There are two different ways of importing skeletons and animations to a mod.<br />
<br />
==Original Game==<br />
Although M2TW ships with a copy of descr_skeleton.txt it is not read by the game unless the pack and skeletons .idx and .dat files in data/animations are deleted.<br />
The game cannot rebuild the pack/skeletons files with the information originally shipped with the game.<br />
<br />
Caliban from CA supplied a full set of original .cas and .evt files which can be added to the data/animations folder and will allow the game to rebuild the packs based on the contents of descr_skeleton.txt<br />
<br />
The .cas files for the siege engines are in the same format as those supplied by Caliban, they are never packed.<br />
<br />
==Porting Modded Skeletons==<br />
The only way to initially get a modded skeleton into the pack files is by letting the game rebuild from the full .cas and .evt files and descr_skeleton.txt.<br />
<br />
Once the packs have been made the .cas and .evt files can be deleted from the modfolder.<br />
<br />
===Porting by Merging Packs===<br />
If you need skeletons and anims that exist in two or more separate packs you can merge them into one pack by using tools such as XIDX. These 'unpack' the skeletons (which contain the .evt information) and the anims, they provide you with a list of skeleton names and animation names and you can then manipulate the lists to re-pack the skeletons and animations you want. The unpackers do not change or decompress any contents from the packs they simply split the packs into chunks of the relevant length and write them as separate files.<br />
<br />
===Porting by Converting back to Original Format===<br />
Using a combination of the original .cas and .evt files supplied by Caliban, original modded .cas files if available, or converted .cas files using JoJo's tool, or a full set of converted .cas files using IWTE, you can get the game to rebuild from a descr_skeleton.txt file. IWTE will write a descr_skeleton.txt file for each pack set it unpacks, you can then text edit the required skeletons into one file.<br />
<br />
<big>'''NOTE'''</big> - The Unpackers e.g. XIDX will provide you with a large folder of '.cas' files - THESE ARE NOT THE SAME AS ORIGINAL OR CONVERTED CAS FILES!<br />
You need a full set of the correct type of 'cas' (unpacked OR original/converted), you can't mix and match some of each...</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Unit_Animations_-_M2TW&diff=86256Unit Animations - M2TW2022-12-27T14:42:14Z<p>Makanyane: /* Original Game */</p>
<hr />
<div>Unit animations in M2TW are based on a skeleton system using a maximum of 24 bones.<br />
<br />
There are two different ways of importing skeletons and animations to a mod.<br />
<br />
==Original Game==<br />
Although M2TW ships with a copy of descr_skeleton.txt it is not read by the game unless the pack and skeletons .idx and .dat files in data/animations are deleted.<br />
The game cannot rebuild the pack/skeletons files with the information originally shipped with the game.<br />
<br />
Caliban from CA supplied a full set of original .cas and .evt files which can be added to the data/animations folder and will allow the game to rebuild the packs based on the contents of descr_skeleton.txt<br />
<br />
The .cas files for the siege engines are in the same format as those supplied by Caliban, they are never packed.<br />
<br />
==Porting Modded Skeletons==<br />
The only way to initially get a modded skeleton into the pack files is by letting the game rebuild from the full .cas and .evt files and descr_skeleton.txt.<br />
<br />
Once the packs have been made the .cas and .evt files can be deleted from the modfolder.<br />
<br />
===Porting by Merging Packs===<br />
If you need skeletons and anims that exist in two or more separate packs you can merge them into one pack by using tools such as XIDX. These 'unpack' the skeletons (which contain the .evt information) and the anims, they provide you with a list of skeleton names and animation names and you can then manipulate the lists to re-pack the skeletons and animations you want.<br />
<br />
===Porting by Converting back to Original Format===<br />
Using a combination of the original .cas and .evt files supplied by Caliban, original modded .cas files if available, or converted .cas files using JoJo's tool, or a full set of converted .cas files using IWTE, you can get the game to rebuild from a descr_skeleton.txt file. IWTE will write a descr_skeleton.txt file for each pack set it unpacks, you can then text edit the required skeletons into one file.<br />
<br />
<big>'''NOTE'''</big> - The Unpackers e.g. XIDX will provide you with a large folder of '.cas' files - THESE ARE NOT THE SAME AS ORIGINAL OR CONVERTED CAS FILES!<br />
You need a full set of the correct type of 'cas' (unpacked OR original/converted), you can't mix and match some of each...</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Unit_Animations_-_M2TW&diff=86255Unit Animations - M2TW2022-12-27T14:41:22Z<p>Makanyane: Created page with "Unit animations in M2TW are based on a skeleton system using a maximum of 24 bones. There are two different ways of importing skeletons and animations to a mod. ==Original G..."</p>
<hr />
<div>Unit animations in M2TW are based on a skeleton system using a maximum of 24 bones.<br />
<br />
There are two different ways of importing skeletons and animations to a mod.<br />
<br />
==Original Game==<br />
Although M2TW ships with a copy of descr_skeleton.txt it is not read by the game unless the pack and skeletons .idx and .dat files in data/animations are deleted.<br />
The game cannot rebuild the pack/skeletons files with the information originally shipped with the game.<br />
<br />
Caliban from CA supplied a full set of original .cas and .evt files which can be added to the data/animations folder and will allow the game to rebuild the packs based on the contents of descr_skeleton.txt<br />
<br />
==Porting Modded Skeletons==<br />
The only way to initially get a modded skeleton into the pack files is by letting the game rebuild from the full .cas and .evt files and descr_skeleton.txt.<br />
<br />
Once the packs have been made the .cas and .evt files can be deleted from the modfolder.<br />
<br />
===Porting by Merging Packs===<br />
If you need skeletons and anims that exist in two or more separate packs you can merge them into one pack by using tools such as XIDX. These 'unpack' the skeletons (which contain the .evt information) and the anims, they provide you with a list of skeleton names and animation names and you can then manipulate the lists to re-pack the skeletons and animations you want.<br />
<br />
===Porting by Converting back to Original Format===<br />
Using a combination of the original .cas and .evt files supplied by Caliban, original modded .cas files if available, or converted .cas files using JoJo's tool, or a full set of converted .cas files using IWTE, you can get the game to rebuild from a descr_skeleton.txt file. IWTE will write a descr_skeleton.txt file for each pack set it unpacks, you can then text edit the required skeletons into one file.<br />
<br />
<big>'''NOTE'''</big> - The Unpackers e.g. XIDX will provide you with a large folder of '.cas' files - THESE ARE NOT THE SAME AS ORIGINAL OR CONVERTED CAS FILES!<br />
You need a full set of the correct type of 'cas' (unpacked OR original/converted), you can't mix and match some of each...</div>Makanyanehttps://wiki.twcenter.net/index.php?title=Landmass_Crash&diff=86248Landmass Crash2022-11-18T18:50:11Z<p>Makanyane: note on remastered</p>
<hr />
<div>{{RTW Modding Logo}}<br />
<br />
'''Note''''': this article is not applicable to M2TW - the problem appears to have been resolved in that game.''<br />
<br />
In Rome - Total War and Barbarian Invasion there can be problems if you have too large a map with too little land (or too much sea depending on how you look at it). This was initially thought to be an issue of a required hard-coded ratio between the amount of land and sea. Subsequent experimentation has shown that this is not the case.<br />
<br />
Rome Remastered allows somewhat more sea (and larger maps) than RTW did, but can still crash if very large areas of sea are used.<br />
<br />
For some discussion on this issue see [http://forums.totalwar.org/vb/showthread.php?t=66332 here].<br />
<br />
==The Symptoms==<br />
Attempting to load a newly designed or re-sized campaign map gives a CTD without -[[show_err]] message as soon as you select the arrow to launch the campaign from the faction selection screen. A new map.rwm is NOT generated. Also, in the root folder, a new cliffs_debug.tga is created. corrected_regions.tga is NOT created.<br />
<br />
==The Explanation==<br />
''Umm, well it seems to be to do with path-finding!''<br />
<br />
There is no ratio involved in this problem at all. Too large an area that land units are excluded from produces crash. This becomes more of a problem for larger maps as it is easier to have too large an area. <br />
<br />
It has not been possible to exactly define 'too large an area'. There is no figure in terms of actual area, height or width! What is not possible can only be found by experimentation for each size of map and coastline layout.<br />
<br />
Even within the same sized maps, no ratio can be discerned. A map with a lot of small seas can have far greater ratio of sea to land than one that tries to have only one larger sea. The shape of the sea also has an effect, with simple plain shapes apparently being the hardest to accommodate.<br />
<br />
==Relationship to Impassable Terrain==<br />
If you substitute any of the impassable land terrain types for areas of sea which do not work on the map, then you will still have same problem. Impassable land terrain types include the forest and mountain types. Including a VERY large area of forest or mountain gives exactly the same crash as having too large a sea.<br />
<br />
If you add an island to break up sea area and make it's terrain entirely impassable you will gain no advantage. If using a land-bridge or definite link between land masses to divide sea solves initial problem, then attempting to make that bridge impassable by use of forest or mountain terrain will bring back the [[CTD]].<br />
<br />
==Possible Solutions==<br />
*Make map smaller, a sea shape that won't work on a large map can be perfectly fine on a smaller map.<br />
*Add islands that aren't actually required for campaign, in the form of 'graphics', they can be isolated by placing 'ocean' ground type around them if necessary.<br />
*Try tweaking the sea shapes, reduce widest areas and make narrow points even more narrow, sometimes almost but not quite divided seas can work. Seas that are divided but remain accessible to ships by use of land-bridges can also solve a lot of problems.<br />
<br />
<br />
[[Category:RTW Campaign Map Modding]]</div>Makanyane