Related Tutorials:
Complete guide to BPI - model info files or Complete guide to BPI - model info files by RedFox
Explaination: Building Collision Files by Thor the Bassist
Research: Info files for engines and buildings by Duke John
Files involved:
data\descr_walls.txt
data\descr_building_battle.txt
data\descr_building_battle\dbb_walls_*culture*.txt
software needed: text editor, 3dsmax
PREMISE Here we go. The INFO files in RTW are kinda tricky ones to manage, for some reasons. The first one is, the game uses them as BPI files, and we cannot open, edit or modify BPI files as they are – or at least I never found any software permitting so. So, we will have to work on .cas files which the game engine will later convert into BPI, but again we will never be able to check what exactly happened during such conversion. This missing step of control always leaves a gap because sometimes during the conversion something may go wrong, having ingame results working differently from the idea we made them for as .cas.
Given that premise, here’s the simple procedure to edit or create new INFO files.
A) INFO FILES SYNTAX IN TXT
INFO files defines the parameters of an object- Being it a building, a mountain or whatever, the INFO files permits you to set its total health, some of its parameters like being more or less resistant to impact and flammability.
Most objects in RTW does have an INFO file associated with them. Those INFO files are associated in the descr_building_battle.txt (DBB) file or in some dbb_* files that are actually included into the DBB file itself by such line:
include dbb_[filename].txt
Either way, the INFO files are associated with the game objects with this syntax:
Code:
[ObjectName]
{
full_health [n]
stat_cat [stat_cat set or blank if none required]
localised_name [name]
level
{
min_health [n]
battle_stats [battlestats set or specific parameter or blank if none required]
basespec [unused as far as I know]
item [ItemName ]
physical_info [ItemName_INFO].CAS
}
}
So, you can have as far as four different Info.CAS files and ItemName for each object in the game, representing four different levels of health of the object. Of course you can use the same INFO or Item name for different levels, managing the differences as you prefer and letting them showed or not by a different aspect in the game.
Here are some details on single code lines parameters:
ObjectName
is the name you set for this object. It may be the same of the Item or not, as you like. Those names are then used by some other files like descr_settlement_plan.txt or descr_walls to add them in the game.
full_health [numbers]
is total count of health for the object. You may set this to indestructable
for special objects like the city INFO files, or mountains
stat_cat
In DBB are defined some grouped stat_cats mostly used to faster define buildings. Each of them sets a full health standard level, flammability and impact damage levels at once.
Vanilla defined stat_cats are:
tiny_wooden
small_wooden
medium_wooden
large_wooden
tiny_stone
small_stone
medium_stone
large_stone
medium_stone_nonflammable
large_stone_nonflammable
indestructable
You can read and eventually change (probably even add if you feel the need to) the single parameters of each stat. Generally speaking they give an increasing resistance to damage, low flammability for stone and high for wooden.
localised_name [name]
this entry sets the name the game will visualize when the cursor roll over the item in game. Those names must also be defined in Data\text\building_battle.txt file. There are some localized name of general use which are none and ambient. The first will just produce nothing, the latter will make ingame appearing the sentence: “[culture] building”. They can be customized by adding them both to dbb entry and building_battle.txt file. The syntax for building_battle.txt file is:
Code:
{MyBuildingNameUsedInDBBFileEntry} The sentence I want to see when I roll mouse over that building
level
Heach level sets a stage of health for the object and can manage its INFO parameters at that stage. One or more levels required, up to 4
min_health [number]
Sets the minimum level of health for the current level. Must decrease with each level, last level must be 0. If there’s just one level, it’s 0
battle_stats
specify the parameters of the object for such level of health. NOTE: in some files the battle_stats are not specified, leaving the general stat_cat chosen to work for all stages of damage. Known stats parameters are:
flammability_high
flammability_low
flammability_none
impact_damage_high
impact_damage_medium
impact_damage_none
Basespec
I have no idea about this parameter and its means. Seems to be nearly always blank or missing.
Item ItemName
This calls the name used in the di_* file for the object. This way a 3d model is called to represent the object at such stage of health (the level). It may vary at a different stage of the health, so that ingame the object looks different when its damaged or destroyed
physical_info Object_info.CAS
This calls the .CAS file with the INFO related to the current level of health for this object. Again, you may have different INFO.cas files for different stages of health of the same object and use them in different levels. So, for instance, a tower or a wall may have accessibility by troops until its too damaged.
B) INFO FILES ELEMENTS IN .CAS
Example INFO file | |
Lets see what an INFO files may contain as a .CAS file now.
There are some known kind of meshes there with some peculiar properties.
a) collision_3d
there can be just one collision_3d mesh in a INFO .cas file. The collision_3d mesh is a single tridimensional object and gives the game the encumbrance of the object. This obstruction will work ingame only for camera movements and missile hit purposes (the camera will move up when reaches the obstacle and missiles will impact it and stop there). The collision 3d is NOT VISIBLE in the game and WILL NOT interact with unit movements. So, you can have a little statue with a 3d collision 3 times higher or wider or smaller, as you like. Only missiles and camera movements will be affected by its dimensions and shape. About missiles, this file is important for some reasons. First thing, it defines when catapults or other siege attacking units will hit the object. So, if for instance yu want an object to be easily hit, you can make the collision_3d file bigger. On another hand, the collision_3d stops the missiles shot by units too. So, you can use the collision_3d of some objects to decide where units will be exposed or protected from arrows or other missile weapons – and again if and how units will be able to fire on enemies from a specific spot (e.g. from the top of a wall, a building or a tower). If you make a collision_3d with a very high wall on a side, on such side units will not be exposed to missiles and will not be able to directly fire their missile weapons. Or course, they will fire them at a high arch, with lower precision and effectiveness at a distance. Be aware that when you make a collision_3d the cursor during the game will recognize it so if you make it larger or of a different shape then the actual object appearing in the game you’ll have the cursor signaling its presence also outside the visible building. For instance, you cannot move units by clicking on a collision_3d covered area unless there are platforms there.
b) collision
Those meshes are single, flat (2D) objects and defines the areas where troops can’t walk. They shall be set at 0 altitude even if its not mandatory. You can have more then one collision meshes. Each collision must be named as “collision_01”, “collision_02” and on. Each collision mesh must be a single element, so if you use more then one polygon for a single “collision_[n]” be sure the weld the vertex where they match or the collision file will not work properly. Those meshes are pretty useful to let a building have some free areas or paths where troops may walk in/through. Note that when you use platforms or tunnels, troops on them will not consider collision_[n] limitations.
c) tunnel
Tunnels are simple meshes with 4 or 6 external edges (4 or 6 total vertex). They will be used by troops to walk across collision areas and reach platforms from/to ground or even to connect two or more platforms. Tunnels can be more then one and must be named as “tunnel_01”, “tunnel_02” and on. On a tunnel mesh the entrance will be set automatically as the shorter external edge of the mesh, then each external edge will be assigned to be non-entrance, then entrance, then non-entrance and on. If the tunnel is simple (4 sides) it will have two entrances and two sides, if its complex (6 edges) will have three entrances and three sides. To work, the tunnel entrance(s) external to the platform MUST be reachable by troops. So always check to have both vertex of external entrance(s) of a tunnel OUT of collision_[n] areas and not underground or other way covered or unaccesible, or troops will just not be able to reach the tunnel and use it. If you color the vertex of an entrance as black, units will enter/exit it backfacing it. Its useful for ladders. If you set just one tunnel accessing a platform, units will use it top enter and exit it indifferently. I noticed that most times, when you put two tunnels accessing a single platform, units will use one of them ONLY to enter the platform and the other ONLY to exit it. As I wrote, it works this way MOST TIMES but not ALL times, given many times I had two tunnels accessing one single platform and units using both or one of them as two way passage. Sill haven’t understand why, but well, its how it happens. Units accessing a tunnel will enter at the middle point of the entrance edge, walk in a direct single unit line and exit at the middle point of the exit edge. Units using a tunnel will not be selectable and cannot be redirected half way, and if you order to a group who’s already partially using a tunnel to move somewhere else units will act in a disordered way, and depending by circumstances some of them may be lost or try to regroup somehow.
d) platform
Platforms are areas where units can walk, run and fight regardless of collision_[n] limitations. A platform is made a 4 edges square and have an orientation, defined by the vertex color. Two vertex must be colored in black and they set the edge of orientation. You can have more then one one platform on a single INFO.cas file and each of them must be named as platform_0_[LETTERS], platform_1_[LETTERS], and on. I managed to have a max of 6 working platforms on a single INFO .cas file, dunno if there is a max number of them. The letters following the platform number in the name are at least 4 and can be: H,S,C or G. They set the properties of the edges of the platform. The first letter defines the edge of orientation and then the following in a clockwise circle. H (hard) means that edge is impassable by troops. S (soft) means that edge is not passable but troops can fall out of this side if pushed or jumped over (e.g. during battle or by a rush). Units falling over a platform will instantly and loudly die. C (communicating?) means that edge can be passed by troops. Beware that if there is another platform perfectly matching that edge units will pass on it, but if there’s nothing or the other platform is not matching, units will fall and die. G (ground) edges are special edges used to connect a platform to the ground. They are used by siege towers to let units enter their base and can be tricky for some reasons. Actually, in siege towers they must be inclined and that makes them tricky, due to the slot_platform mesh we’ll discuss next. Actually, G edges works pretty like tunnels but units can access them on all length and not in single lines. Unfortunately, for some unclear reasons, G edges often don’t work very well and units get stuck on them.
A note on C edge parameter. On walls specifically most segments uses C edges on their sides, so to let the next piece of wall match them and permit troops to move from a piece of wall to another. This looks great as long as the two wall piece platforms edge match perfectly. If they don’t, units may not be able to pass at all, or try to pass and fall/die, or pass in just one direction and got stuck on the opposite, depending by the kind of mismatching (a more or less wide space between the edges, edges overlapping, edges at different degrees).
I read about some more parameters addable to a platform name on a post by Duke John. I never worked on them so I just report here DJ’s observations:
Geometries for slot rows are named 'slot_platform_N_M<_options>'. The N refers to the platform it is for,
eg platform_0 has slot rows called slot_platform_0... The M refers to the rank of the slot row, with 0 being the
front rank. Direction of the triangle doesn't matter. The row number M CAN be multiple digits.
The optional part can contain a number of men, and/or an open/covered specifier. The number of men can be any
number of digits, but the value must be at least 2. The open/covered specifier consists of H, C, and O for
half-covered, covered and open. These values are repeated, so HO will flag alternate slots positions as
half-covered and open.
Eg, platform_0 could have slot_platform_0_0_10_HHO as its front rank of 10 soldiers, flagged as HHOHHOHHOH.
Tests for validity include rank order - bigger rank should mean farther from the front edge.
e) slot_platform
To let troops use platforms they need slot_platforms. They are triangle-shaped parallel one to another meshes added at the same height or a little higher then the platform. They can and usually are more then one and represent each a row of troops. They must be named “slot_platform_1_00”, “slot_platform_1_01” and on, with the _1_ being the platform number and the 01,02 and on being the ID number of the single slot. The 00 must be positioned first and closer to the orientation edge of the platform, the others must follow subsequently. Troops deployed on a platform will turn facing the orientation edge. The direction of the triangle is not important. Given sometimes platforms may obtrude out of the actual item dimensions to be used on other items (it’s the rule in some wall segments) you may be careful that slots come enough closer to the side item’s platform slots so that units when deployed between the two platforms does group correctly – but also not too close to cover the other item platforms slot or troops will occupy twice the same position and on deployment they may fall and die. Each slot platform represent a row of troops. The more slot platforms you add to a platform the more row of troops are deploying there. Again, if triangles are too narrow or too close to each other troops will be deployed one on another and often fall and die.
f) dock points
Docks are cubes (not necessarily with all sides of the same lenght). They set the point where siege engines will attach the item. There are some kind of docks:
dock_lad (or dock_ladder, they work with both names) and are used to define the point where ladders and siege towers will attach the item. There can be one or more on a item. They will work if named dock_lad, dock lad_01, dock_lad02 and on but also if they are all named dock_lad. The more dock_lad you add the more ladders will be used to climb that building. Actually, they work also if they are placed at a different height x and y from every other mesh of the INFO file. You may check ingame to decide where to place them to have the best fitting visual result. Only important note I can add there is that the ladders and the siege towers uses tunnels to move troops on the target platform, so if you use a tunnel in the sieged building too its ground level entrance must be pretty far from the building in the inner side of it – otherwise attackers will dock the ladder/siege tower then run against the wall at ground level trying to reach the inner tunnel and not using the siege tunnel. It’s a bug that kept me stuck for a week or so while modding some new walls.
dock_sap are used by attackers with the sapping ability to make the building crumble. I never used it, but as far as I saw it just have to be placed somewhere at or near ground level near the building.
dock_ram are used to define where the ram will stop and start hitting the gates. The dock_ram should be placed a bit far from the gate because the ram will slightly go onward during the ramming, so if you place the dock_ram right at the gate limit during the assault the head of the ram will protrude more and more inside the gate. Its your call, if you mod the gate too, to decide about this effect for a better result.
Example INFO file 2 | |
g) not yet studied elements:
- Spawn positions
(meshes to permit spawning and respawing of troops during a battle)
Further experimentation needed to say more.
- Entry way
(meshes permitting to enter a muster field)
Further experimentation needed to say more.
- Muster field
(meshes permitting troops to hid inside an item)
Further experimentation needed to say more.
- Banner positions
(meshes setting the position of troop banners while they are hidden in a muster field)
Further experimentation needed to say more.
- Arrow slots
(meshes used to define building ability to shot)
Further experimentation needed to say more.
C) SPOT FX files
Spot fx are not element of INFO files. They are another kind of .cas files used to define the presence and position of some dynamic objects on an item. They set the position of vertical or horizontal flags, boiling oil spurting points, torches and the like.
Further experimentation needed to say more.
D) ADDING A NEW GENERAL INFO FILE TO THE GAME – WALLS HAVE A SPECIFIC CHAPTER NEXT
To add an info file to the game:
a) open descr_building_battle.txt with a text editor
a1) decide to add the new info file there or to use an included dbb_* file for it. The latter is usually the best solution, so to use a specific include where you can group all the INFO files of a specific row of new objects.
b) add an entry like this one for the new INFO file use:
Code:
MyNewBuilding
{
full_health 100
stat_cat
localised_name MyItemNameIngame ;(or none or ambient)
level
{
min_health 0
battle_stats flammability_none impact_damage_high
basespec
item MyItemName
physical_info MyItemName_INFO.CAS
}
}
This will add the game an entry named MyNewBuilding, using ingame the model saved as MyItemName, not flammable, very vulnerable to attacks by catapults or other siege weapons, using all the features saved in the MyItemName_INFO.CAS file. Remember that the localized name MyItemNameIngame, to work, needs to be added to the building_battle.txt file too as explained. If you don’t want a localized custom name for that entry you should use “none” (cursor ingame will show nothing) or “ambient” (cursor will show “[culture] building” ingame).
c) open a settlement plan file in data\settlement_plans folder. The plan you open and mod is the plan where you’ll see the new building ingame, so check to mod the right settlement plan. In the buildings section of the settlement plan you can add a line like this one:
Code:
MyNewBuilding, 10.55, 75, 90, 40.7
This line will tell the game to place MyNewBuilding in the current settlement plan, at x position 10.55, y position 75, 90° degrees rotated, at the height of 40.7. Most buildings in vanilla game are placed at height of 0. Rotation is useful but also tricky, always test ingame results to decide if you want to modify parameters. Double check use of commas and/or points or the system will mess up things easily.
E) WALLS INFO MODDING SPECIFICS
Now, this procedure is standard for most objects’ INFO but Walls do have some more peculiar aspects to consider.
First thing, walls dbb_files are for some reasons encoded – or at least I was not able to create and use custom dbb_walls files. So, you are forced to use the existing dbb_walls files which are:
- dbb_walls_barbarian.txt
- dbb_walls_eastern.txt
- dbb_walls_egyptian.txt
- dbb_walls_greek.txt
- dbb_walls_roman.txt
- dbb_walls_wooden.txt
Each of them enlist the dbb entries for each piece of wall, which are:
[culture]_town_gateway
[culture]_town_wall_joiner_straight
[culture]_town_wall_joiner_diagonal
[culture]_town_wall_external_corner
[culture]_town_wall_joiner_external_right
[culture]_town_wall_joiner_external_left
[culture]_town_wall_joiner_internal_right
[culture]_town_wall_joiner_internal_left
[culture]_town_wall_internal_corner
[culture]_town_wall_straight
[culture]_town_wall_watchtower
[culture]_town_external_corner_watchtower
[culture]_town_internal_corner_watchtower
[culture]_city_gateway
[culture]_city_wall_joiner_straight
[culture]_city_wall_joiner_diagonal
[culture]_city_wall_external_corner
[culture]_city_wall_joiner_external_right
[culture]_city_wall_joiner_external_left
[culture]_city_wall_joiner_internal_right
[culture]_city_wall_joiner_internal_left
[culture]_city_wall_internal_corner
[culture]_city_wall_straight
[culture]_city_wall_watchtower
[culture]_city_external_corner_watchtower
[culture]_city_internal_corner_watchtower
Of course [culture] stands for the current culture, e.g. roman, barbarian etc.
Each of those entries have a single entry with some or lots parameters. Lets see an example:
[code]
Code:
roman_town_gateway
{
full_health 500
battle_stats flammability_none impact_damage_low
localised_name gateway
level
{
min_health 1
item roman_town_gateway
physical_info info_walls/info_roman_town_gateway.cas
spot_fx spot_fx_roman_town_gate.CAS
}
transition ; undamaged to collapsed
{
duration 120
physical_switch 0
item roman_town_gateway_collapse
{
0 enable
0 dust_anim 90 4 2 2 0 3
120 disable
}
item roman_town_gateway_collapse_anim
{
0 enable
0 anim 0 0 6
120 disable
}
}
level
{
min_health 0
item roman_town_gateway_collapse roman_town_gateway_collapse_remains
physical_info info_walls/info_roman_town_gateway.cas
}
}
roman_town_gateway is the entry name.
full_health 500 sets the full health of roman gateway to 500 when full.
battle_stats flammability_none impact_damage_low says roman town gateway are not going to flame up and will receive a low amount of damage when hit. Nite that usually dbb entries does have stat_cat there and battle_stats only inside levels. Being it a relic of developers or not, walls does have battle_stats in both positions.
localised_name gateway says that when the cursor ingame roll over that object it will show: “Roman Gateway”
level starts the first level of damage for this object
min_health 1 says this level will work from full health (500) to level 1 of health.
Item roman_town_gateway says the game to use the di_* entry named “roman_town_gateway”
physical_info info_walls/info_roman_town_gateway.cas says the game will use the INFO files of “info_roman_town_gateway.cas” located in games_buildings/ info_walls/
spot_fx spot_fx_roman_town_gate.CAS says the game will use “spot_fx_roman_town_gate.CAS”
transition ; undamaged to collapsed is used to start a transition session. Transitions are used to define what will happen when a level is let and the next one starts, in such case when the roman gateway health will drop under level 1.
The following parameters:
duration 120
physical_switch 0
item roman_town_gateway_collapse
0 enable
0 dust_anim 90 4 2 2 0 3
120 disable
item roman_town_gateway_collapse_anim
0 enable
0 anim 0 0 6
120 disable
Are all defining the specific animations, effects and items to be shown in the transition duration. Yes, they all are customizable and no, I’m not gonna explain how because well, I do have a life sometimes Maybe in the future.
Level starts the next level , and immediately says
min_health 0 defining this level is the last one, ending with level 0 of health for the building.
item roman_town_gateway_collapse roman_town_gateway_collapse_remains means the game will keep visible those two items from that point on
physical_info info_walls/info_roman_town_gateway.cas means the game will use this info file for the building from that point on. Please note that, in such case, the INFO file is the same of full health building. That means the roman gateway will go on working precisely with the same features when its brand new or when its utterly destroyed. In some cases, buildings may work differently, for instance walls, once broken, do not host anymore troops on them, so they use a different INFO file.
Given all that, if you want to add the game a custom wall, you’ll have to call the Custom Item instead of the
“roman_town_gateway” item, along with its damaged and animated version. Then again, if you want/need to mod also the INFO files for specific features related to your modded walls, you’ll need to create and add the modded INFO files at the place of the vanilla ones.
A few more notations for wall modders:
a) walls .cas models are grouped in Data\models_building \models_walls folder. Its not mandatory, you can define the position of a wall .cas file in the di_* file where its set, but I recommend to keep this folder for all new walls models for simplicity.
b) walls .info files are grouped in Data\models_building\INFO\info_walls folder. Same recommendation here.
c) walls platforms will work during deployment ONLY if they are placed within the deployment area, which is set some meters from the wall piece scene root positioning. As walls do have some fixed grid to be positioned and work properly, you may check not to protrude platforms too much far from the root scene of the wall piece or the game will partially use, not use at all or even got errors and CTDs on troops deployment phase.
d) the same grid limitation along with the quadrilateral forced shape of platforms severely limits the modding of walls shape, so that you can create and have ingame round shaped walls but you’ll have the hell to have them accepting troops deployment, moving and using properly their INFO features. Its possible, I actually did it, but its ALL but easy.
e) vanilla walls INFOS are done with some peculiarities. For example, the platforms in some cases extrude from some wall pieces and in some other wall pieces are consequently shorter then the collision_3d. This will make no problem as long as
1) you make the modded platforms exactly the same size and shape of the vanilla ones or
2) you create a whole matching set (I mean the whole wall pieces, straight, links, gateway, towers etc) of info files to replace the vanilla ones
Otherwise, if you replace just some INFO files and keep some vanilla ones, you’ll need to check your modded platforms fit perfectly with the ones you didn’t mod, or troops will get stuck, fall and die depending by the mismatch type. |