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

Battle Map Buildings - M2TW

From TWC Wiki
Jump to navigationJump to search
M2TW Modding Index


Vanilla aztec city.png

Overview

Battle map settlements, techtrees and ambient buildings in vanilla M2TW are controlled by the files in the data/settlements folder. Each settlement, techtree or ambient building is known as a 'world', more than one 'world' can appear on the same battle map. IWTE allows comprehensive alterations to be made to the buildings, terrain, vegetation distribution and settlement pathfinding, it requires any 3d models used to be in ms3d (Milkshape) format.


A variety of early editors were released by KnightErrant which made elements of the files viewable and modifiable. These have now been superseded by IWTE.

Early discussion and research into battlemap buildings took place in the World Modified thread. with most of the original research findings made by Argantonio.

How Settlements & Buildings are Selected

Which settlement, techtree or ambient turns up in the game for each specific use is controlled by a .worldpkgdesc file. Each .worldpkgdesc file calls one specific .world file.

The .world file's name and folder location that is specified inside the .worldpkgdesc file and other parameters can be amended with a hex editor or the IWTE tool.

The packagedb.txt file determines where the game will search for .worldpkgdesc files. Its normal contents are;

; List of directories to search for packages
.\settlements

which means the game will search inside

data/settlements

if you add a copy of the packagedb.txt to your mod-folder it will also search

mods/my_mod/data/settlements

They will all be read when M2TW loads (prior to reaching the menu).

The .worldpkgdesc files in the /packs folders will also be read meaning you cannot effectively delete any original .worldpkgdesc's.

NOTE: the game reads ALL the .worldpkgdesc's inside the data/settlements folders, so beware of leaving copies of old ones lying around in there that you don't intend to be read!

The .worldpkgdesc options that can be used in M2TW (upgraded to the latest patches) now include, culture type, environment and faction, so each different faction could technically use different settlements instead of setting settlements purely at culture level. It is not clear if the 'environment' function actually works or not...

Culture Folders

The vanilla settlements 'appear' to be in folders organised by culture name. NOTE: these are not the actual culture names, e.g. they use north_european instead of northern_european. They are simply organised that way for convenience.

The thing that assigns a settlement to a culture is purely the INTERNAL CONTENTS of the .worldpkgdesc file, e.g. if it has 'northern_european' in the 'culture' section. It will then direct to whichever .world is specified in its 'path', which might not be in the same folder, or have a 'north_european' type name.

World Components

When a battle map which is to have a settlement or ambient building is loaded in game, the game engine first selects the most relevant .worldpkgdesc file from all of those that it loaded at start-up. The name_here.world file specified is then loaded, and the file paths inside that name_here.world file are followed to load other components and textures. The log file on full trace will show which of these files are being called (and the alternative places the game can look for variants).

The conventional layout of the files is that each 'world' has it's own folder in data/settlements, the vanilla game organises the world folders inside folders named roughly after the various cultures. NOTE: putting a world folder inside say 'North_European' does not automatically make it appear for that culture, it's solely the content of the .worldpkgdesc that determines which file is used (which explains why it doesn't matter that the culture names are misspelt in the vanilla folder names)

Typically each 'world' folder contains the following:

and a /maps sub-folder.

The only two files that actually have to exist in the same folder and have the same name prefix are .world and .worldcollision, because the path between them is not separately specified anywhere. (It's probably easiest to keep to the convention for the other files as well. It's also best to keep the .worldterrain and /maps in the same folder, as some functionality e.g. the automatic assignment of 'cliff' texture to steep slopes, is lost if you split them up)

Each .world file contains the names and paths to the; .worldpathfinding, .worldterrain, .worldvegetation, .animinstances files and the textures, anims and effects used in that world. If you copy an existing .world file to a new location without editing it, it will still be looking up all the files except .worldcollision in the old locations.

The .worldterrain file contains the paths to the masks and tgas that effect the representation of the ground plane, eg. for farms, paths and mud. The paths and texture names can be changed with the IWTE tool.

Altering referenced file paths with IWTE

(coming soon...)

Textures

When a building texture is loaded the game will search for any applicable variants in the mod-folder and then the main-folder. These can include faction variants, winter variants, or 'culture' variants. Note that the 'culture' variants are actually called according to which climate the settlement is in, and are nothing to do with the culture of the settlement/builder/occupier. You can view the paths it is searching by looking at a log file on *trace setting.

For all climates except the four listed below the paths searched for a winter battle will be;

mods/mod_name/data/BlockSet/Textures/faction_variations/faction_name/texture_name.texture
mods/mod_name/data/BlockSet/Textures/faction_variations/faction_name/winter/texture_name.texture
mods/mod_name/data/BlockSet/Textures/winter/texture_name.texture
data/BlockSet/Textures/faction_variations/faction_name/texture_name.texture
data/BlockSet/Textures/faction_variations/faction_name/winter/texture_name.texture
data/BlockSet/Textures/winter/texture_name.texture
mods/mod_name/data/BlockSet/Textures/texture_name.texture

For the Mediterranean climate the paths for a winter battle (if the climate has winter setting) will be;

mods/mod_name/data/BlockSet/Textures/faction_variations/faction_name/texture_name.texture
mods/mod_name/data/BlockSet/Textures/faction_variations/faction_name/variations/south_european/winter/texture_name.texture
mods/mod_name/data/BlockSet/Textures/faction_variations/faction_name/variations/south_european/texture_name.texture
mods/mod_name/data/BlockSet/Textures/faction_variations/faction_name/winter/texture_name.texture
mods/mod_name/data/BlockSet/Textures/variations/south_european/winter/texture_name.texture
mods/mod_name/data/BlockSet/Textures/variations/south_european/texture_name.texture
mods/mod_name/data/BlockSet/Textures/winter/texture_name.texture
data/BlockSet/Textures/faction_variations/faction_name/texture_name.texture
data/BlockSet/Textures/faction_variations/faction_name/variations/south_european/winter/texture_name.texture
data/BlockSet/Textures/faction_variations/faction_name/variations/south_european/texture_name.texture
data/BlockSet/Textures/faction_variations/faction_name/winter/texture_name.texture
data/BlockSet/Textures/variations/south_european/winter/texture_name.texture
data/BlockSet/Textures/variations/south_european/texture_name.texture
data/BlockSet/Textures/winter/texture_name.texture
mods/mod_name/data/BlockSet/Textures/texture_name.texture

For the semi-arid, sandy_desert & rocky_desert climates the paths for a winter battle (if the climate has winter setting) will be the same as above but using middle_eastern instead of SE;

mods/mod_name/data/BlockSet/Textures/faction_variations/faction_name/texture_name.texture
mods/mod_name/data/BlockSet/Textures/faction_variations/faction_name/variations/middle_eastern/winter/texture_name.texture
mods/mod_name/data/BlockSet/Textures/faction_variations/faction_name/variations/middle_eastern/texture_name.texture
mods/mod_name/data/BlockSet/Textures/faction_variations/faction_name/winter/texture_name.texture
mods/mod_name/data/BlockSet/Textures/variations/middle_eastern/winter/texture_name.texture
mods/mod_name/data/BlockSet/Textures/variations/middle_eastern/texture_name.texture
mods/mod_name/data/BlockSet/Textures/winter/texture_name.texture
data/BlockSet/Textures/faction_variations/faction_name/texture_name.texture
data/BlockSet/Textures/faction_variations/faction_name/variations/middle_eastern/winter/texture_name.texture
data/BlockSet/Textures/faction_variations/faction_name/variations/middle_eastern/texture_name.texture
data/BlockSet/Textures/faction_variations/faction_name/winter/texture_name.texture
data/BlockSet/Textures/variations/middle_eastern/winter/texture_name.texture
data/BlockSet/Textures/variations/middle_eastern/texture_name.texture
data/BlockSet/Textures/winter/texture_name.texture
mods/mod_name/data/BlockSet/Textures/texture_name.texture

Summer battles are similar - but without the lines referencing /winter/ folders

Building Animations

Gates, arrow towers and walls typically have animations that apply on gate opening/closing, damage and destruction.

See Building Animations - M2TW for further details.
YOU can help us improve this Wiki! ~ Look for ways to help and editing advice. ~ If you need further advice, please post here.