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

Difference between revisions of "Battle Map Buildings - M2TW"

From TWC Wiki
Jump to navigationJump to search
(texture variant paths explained)
(Overview)
Line 2: Line 2:
 
Battle map settlements and ambient buildings in M2TW are controlled by the files in the data/settlements folder.  Each settlement or ambient building is known as a 'world', more than one 'world' can appear on the same battle map.
 
Battle map settlements and ambient buildings in M2TW are controlled by the files in the data/settlements folder.  Each settlement or ambient building is known as a 'world', more than one 'world' can appear on the same battle map.
  
As yet only limited alterations to the settlement and buildings can be made.  A variety of [[World File Editing Tools - M2TW|editors]] have been released by [[KnightErrant]] which make elements of the files viewable and modifiable, but to date there is a limitation in that the numbers of elements in each file can not easily be varied.
+
As yet only limited alterations to the settlement and buildings can be made.  A variety of early [[World File Editing Tools - M2TW|editors]] were released by [[KnightErrant]] which made elements of the files viewable and modifiable. These have now been superseded by '''[http://www.twcenter.net/forums/forumdisplay.php?2047-The-IWTE-Project IWTE]'''
  
Discussion and research on this issue has largely taken place in the [http://www.twcenter.net/forums/showthread.php?t=166329 World Modified thread].  Most of the research findings so far have been discoveries made by [http://www.twcenter.net/forums/member.php?u=35169 Argantonio].
+
Early discussion and research on this issue took place in the [http://www.twcenter.net/forums/showthread.php?t=166329 World Modified thread].  with most of the original research findings made by [http://www.twcenter.net/forums/member.php?u=35169 Argantonio].
  
 
==How Settlements are Selected==  
 
==How Settlements are Selected==  

Revision as of 00:45, 11 February 2017

Overview

Battle map settlements and ambient buildings in M2TW are controlled by the files in the data/settlements folder. Each settlement or ambient building is known as a 'world', more than one 'world' can appear on the same battle map.

As yet only limited alterations to the settlement and buildings can be made. 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 on this issue took place in the World Modified thread. with most of the original research findings made by Argantonio.

How Settlements are Selected

Which settlement 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 .worldpkgdesc files can be located anywhere inside;

data/settlements or
mods/my_mod/data/settlements

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

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.

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.)

Each .world file contains the names and paths to the; .worldpathfinding, .worldterrain, .animinstances files and the textures, masks and effects used in that world. These paths can be altered with a hexeditor or using the write and load textfile functions of KnightErrant's or Wilddog's IWTE world editor programmes. (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.


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