Building Modding

Buildings, in modding terminology, comprise the various cities, camps, bridges and resource buildings on the map.

It is possible to mod the base stats of these various buildings to tweak consumption and production rates. It is also possible to define additional types of buildings, which can then be added to custom maps through the map editor and used in custom scenarios. The general rules of entity modding apply when modding buildings.

If you are instead looking for how to mod building upgrades, which are constructed in-game within these cities, camps, bridges and resource buildings at the cost of wood and gold, please refer to the upgrade modding tutorial instead.

Modding Cities
Cities are by far the most complex type of building, having the most different types of attributes and many attributes having several separate values for each of the population levels. The files also contains information for which portraits and miniature graphics are used for each possible native faction group, though a default variant will still be used for faction groups that aren't explicitly defined here.

Example
citycommon city 1000 	 5  	 6  	 30  	 0  	 20 35 70 125 250 450 700 1100 1600 2300 3500 3500  	 200 300 500 700 1000 1300 1700 2100 2500 3000 3500 4000  	 75 150 250 400 600 850 1200 1700 2400 3200 4500 0  	 1 1 2 2 3 3 4 4 5 5 6 6  	 2.5 3.0 3.4 3.8 4.3 4.7 5.1 5.5 6.0 6.5 7.0 8.0  	 80 90 100 110 120 130 140 150 160 170 180 190  	 10 16 21 29 37 48 58 68 82 96 112 128  	 300 400 500 600 700 800 900 1000 1100 1200 1300 1400  	 20.0 22.0 24.0 26.0 28.0 30.0 32.0 34.0 36.0 38.0 40.0 42.0  	 500 600 700 800 900 1100 1300 1500 1700 2000 2300 2600  	 100 150 200 275 350 425 525 625 725 850 975 1100  	 50 65 75 95 110 125 145 160 180 205 230 255  	 7.0 8.0 9.0 10.0 10.5 11.0 11.5 12.0 12.0 12.0 12.0 12.0  	 30 40 50 65 80 100 120 140 165 190 215 240  	 200 350 500 750 1000 1250 1500 2000 2500 3000 4000 5000  	                <miniatureent state="1" factiongroup="sabellic" class="objectmesh" type="mesh_mini_city_latin"/> <miniatureent state="2" factiongroup="sabellic" class="objectmesh" type="mesh_mini_city_latin"/> <miniatureent state="0" factiongroup="illyric" class="objectmesh" type="mesh_mini_city_gaul"/> <miniatureent state="1" factiongroup="illyric" class="objectmesh" type="mesh_mini_city_gaul"/> <miniatureent state="2" factiongroup="illyric" class="objectmesh" type="mesh_mini_city_gaul"/> <portrait factiongroup="etruscan" atlas="objportraits" sprite="cityetruscan"/> <portrait factiongroup="latin" atlas="objportraits" sprite="citylatin"/> <portrait factiongroup="sabellic" atlas="objportraits" sprite="citylatin"/> <portrait factiongroup="greek" atlas="objportraits" sprite="citygreek"/> <portrait factiongroup="gaul" atlas="objportraits" sprite="citygallic"/> <portrait factiongroup="illyric" atlas="objportraits" sprite="citygallic"/>

Default Type
citycommon

Modding Bridges
Bridges are constructable buildings on the map that only support wall upgrades, and connect 2 points on the map (usually on opposite sides of rivers), one of which needs to first be captured and connected via supply lines in order to begin constructing the bridge with wood.

Example
woodbridge bridge 1000 	 200  	 8  	 6  	 40  	 200  	 200  	 12  	 3  	 15  	<bridgesegment class="constructedprop" type="bridgewood_segment"/> <tower class="fortificationprop" type="bridgewood_towers"/> <gate class="fortificationprop" type="bridgewood_gate"/> <miniatureent state="0" class="objectmesh" type="mesh_mini_bridge"/> <miniatureent state="1" class="objectmesh" type="mesh_mini_bridge"/> <miniaturehead class="objectmesh" type="mesh_mini_bridge_unbuilt"/> <miniatureford class="objectmesh" type="mesh_mini_bridge_ford"/> <portrait state="0" atlas="objportraits" sprite="bridge"/> <portrait state="1" atlas="objportraits" sprite="bridge"/>

Default Type
woodbridge

Modding Camps/Forts
Camps (known internally as forts) are constructable buildings on the map that can support walls as well as certain other types of upgrades. Modding forts is largely the same as modding bridges, with some differences in defining graphical assets.

Example
fortcommon fort 1000 	 300  	 8  	 6  	 100  	 200  	 200  	 16  	 5  	 15  	<wallsegment class="fortificationprop" type="commonwallfort"/> <tower class="fortificationprop" type="commonwalltowerfort"/> <gate class="fortificationprop" type="commonwallgate"/> <miniatureent state="0" class="objectmesh" type="mesh_mini_fort"/> <miniatureent state="1" class="objectmesh" type="mesh_mini_fort"/> <miniatureent state="2" class="objectmesh" type="mesh_mini_fort"/> <terraindecalmesh class="objectmesh" type="TerrainDirtDecal"/> <portrait state="0" atlas="objportraits" sprite="fort"/> <portrait state="1" atlas="objportraits" sprite="fort"/> <portrait state="2" atlas="objportraits" sprite="fort"/>

Default Type
fortcommon

Modding Resource Buildings
Resource buildings produce wood, gold and/or food when garrisoned with workers or slaves. Unlike other building types they cannot be garrisoned with military units and can't defend themselves with missile fire. They also do not block movement of the pathing regions in which they exist, and instead are usually placed on the edge of the walkable area.

Resource buildings have 3 possible classes, namely: farm, cattlefarm and mine. The exact technical differences between these classes isn't clear and they may be partially interchangeable. In vanilla, lumber camps and mines use the 'mine' class; farms, vineyards and fisheries use the 'farm' class; and livestock farms use the 'cattlefarm' class. As a general rule, when defining new types of resource buildings it may be safer to use 'farm' if the building produces food (possibly along with gold and/or wood) and 'mine' if it doesn't.

Examples
cattlefarm cattlefarm BuildingTypes::CattleFarm <portrait atlas="objportraits" sprite="cattle"/> <miniaturemesh class="objectmesh" type="mesh_mini_livestock"/> <tradetilesprite atlas="overlay" sprite="sheeptile"/> 1 	 3  	 20  	 1  	 0.2  	 0.7  	 1.4  	 1.0  	 360  	 50  	 livestockoutput

fishery farm BuildingTypes::Fishery <portrait atlas="objportraits" sprite="fishery"/> <miniaturemesh class="objectmesh" type="mesh_mini_fishery"/> <tradetilesprite atlas="overlay" sprite="fishtile"/> true 1 	 3  	 20  	 0.0  	 1.1  	 1.1  	 1.1  	 30  	 50  	 fisheryoutput

woodmill mine BuildingTypes::WoodMill <portrait atlas="objportraits" sprite="woodmill"/> <miniaturemesh class="objectmesh" type="mesh_mini_loggingCamp"/> <tradetilesprite atlas="overlay" sprite="woodtile"/> 1 	 3  	 20  	 0.75  	 50  	 120  	 lumberoutput

Default Types

 * cattlefarm
 * farm
 * fishery
 * vineyard
 * woodmill
 * mine