Ticket #2264: terrainModifier.2.diff

File terrainModifier.2.diff, 38.1 KB (added by sanderd17, 10 years ago)
  • binaries/data/mods/public/art/actors/structures/celts/wall_long.xml

     
    22<actor version="1">
    33  <castshadow/>
    44  <group>
    5     <variant frequency="100" name="celt wall long">
    6       <mesh>structural/celt_wall_long.dae</mesh>
    7       <textures>
    8         <texture file="structural/celt_murus.png" name="baseTex"/>
    9         <texture file="structural/celt_murus_norm.png" name="normTex"/>
    10         <texture file="structural/celt_murus_spec.png" name="specTex"/>
    11         <texture file="structural/ao/celt_wall_long.png" name="aoTex"/>
    12       </textures>
    13     </variant>
    14   </group>
    15   <group>
    16     <variant frequency="100" name="Idle"/>
    17     <variant name="death">
     5    <variant frequency="1" name="wall">
     6      <mesh>structural/slope_wall_propped.dae</mesh>
    187      <props>
    19         <prop actor="particle/destruction_smoke_med.xml" attachpoint="root"/>
    20         <prop actor="particle/destruction_dust_med.xml" attachpoint="root"/>
    21         <prop actor="particle/destruction_dust_med_gray.xml" attachpoint="root"/>
     8        <prop actor="structures/celts/wall_long_p.xml" attachpoint="wall" maxheight="20" minheight="-20"/>
    229      </props>
     10      <textures>
     11        <texture file="gaia/decal_farmland.png" name="baseTex"/>
     12        <texture file="gaia/decal_farmland_norm.png" name="normTex"/>
     13        <texture file="gaia/decal_farmland_spec.png" name="specTex"/>
     14      </textures>
    2315    </variant>
    2416  </group>
    25   <material>player_trans_ao_parallax_spec.xml</material>
     17  <material>basic_trans.xml</material>
    2618</actor>
  • binaries/data/mods/public/art/actors/structures/celts/wall_medium.xml

     
    22<actor version="1">
    33  <castshadow/>
    44  <group>
    5     <variant frequency="100" name="celt wall medium">
    6       <mesh>structural/celt_wall_medium.dae</mesh>
    7       <textures>
    8         <texture file="structural/celt_murus.png" name="baseTex"/>
    9         <texture file="structural/celt_murus_norm.png" name="normTex"/>
    10         <texture file="structural/celt_murus_spec.png" name="specTex"/>
    11         <texture file="structural/ao/celt_wall_medium.png" name="aoTex"/>
    12       </textures>
    13     </variant>
    14   </group>
    15   <group>
    16     <variant frequency="100" name="Idle"/>
    17     <variant name="death">
     5    <variant frequency="1" name="wall">
     6      <mesh>structural/slope_wall_propped.dae</mesh>
    187      <props>
    19         <prop actor="particle/destruction_smoke_med.xml" attachpoint="root"/>
    20         <prop actor="particle/destruction_dust_med.xml" attachpoint="root"/>
    21         <prop actor="particle/destruction_dust_med_gray.xml" attachpoint="root"/>
     8        <prop actor="structures/celts/wall_medium_p.xml" attachpoint="wall" maxheight="20" minheight="-20"/>
    229      </props>
     10      <textures>
     11        <texture file="gaia/decal_farmland.png" name="baseTex"/>
     12        <texture file="gaia/decal_farmland_norm.png" name="normTex"/>
     13        <texture file="gaia/decal_farmland_spec.png" name="specTex"/>
     14      </textures>
    2315    </variant>
    2416  </group>
    25    <material>player_trans_ao_parallax_spec.xml</material>
     17  <material>basic_trans.xml</material>
    2618</actor>
  • binaries/data/mods/public/art/actors/structures/celts/wall_short.xml

     
    22<actor version="1">
    33  <castshadow/>
    44  <group>
    5     <variant frequency="100" name="celt wall short">
    6       <mesh>structural/celt_wall_short.dae</mesh>
    7       <textures>
    8         <texture file="structural/celt_murus.png" name="baseTex"/>
    9         <texture file="structural/celt_murus_norm.png" name="normTex"/>
    10         <texture file="structural/celt_murus_spec.png" name="specTex"/>
    11         <texture file="structural/ao/celt_wall_short.png" name="aoTex"/>
    12       </textures>
    13     </variant>
    14   </group>
    15   <group>
    16     <variant frequency="100" name="Idle"/>
    17     <variant name="death">
     5    <variant frequency="1" name="wall">
     6      <mesh>structural/slope_wall_propped.dae</mesh>
    187      <props>
    19         <prop actor="particle/destruction_smoke_med.xml" attachpoint="root"/>
    20         <prop actor="particle/destruction_dust_med.xml" attachpoint="root"/>
    21         <prop actor="particle/destruction_dust_med_gray.xml" attachpoint="root"/>
     8        <prop actor="structures/celts/wall_short_p.xml" attachpoint="wall" maxheight="20" minheight="-20"/>
    229      </props>
     10      <textures>
     11        <texture file="gaia/decal_farmland.png" name="baseTex"/>
     12        <texture file="gaia/decal_farmland_norm.png" name="normTex"/>
     13        <texture file="gaia/decal_farmland_spec.png" name="specTex"/>
     14      </textures>
    2315    </variant>
    2416  </group>
    25   <material>player_trans_ao_parallax_spec.xml</material>
     17  <material>basic_trans.xml</material>
    2618</actor>
  • binaries/data/mods/public/art/actors/structures/celts/wall_tower.xml

     
    1 <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
     1<?xml version="1.0" encoding="utf-8"?>
    22<actor version="1">
    33  <castshadow/>
    44  <group>
    5     <variant>
    6       <mesh>structural/celt_wall_tower.dae</mesh>
     5    <variant frequency="1" name="wall">
     6      <mesh>structural/slope_wall_propped.dae</mesh>
    77      <props>
    8         <prop actor="props/structures/persians/wall_tower.xml" attachpoint="root"/>
    9         <prop actor="props/units/weapons/arrow_front.xml" attachpoint="loaded-projectile"/>
    10         <prop actor="props/units/weapons/arrow_front.xml" attachpoint="projectile"/>
     8        <prop actor="structures/celts/wall_tower_p.xml" attachpoint="wall" maxheight="20" minheight="-20"/>
    119      </props>
    1210      <textures>
    13         <texture file="structural/celt_murus.png" name="baseTex"/>
    14         <texture file="structural/celt_murus_norm.png" name="normTex"/>
    15         <texture file="structural/celt_murus_spec.png" name="specTex"/>
    16         <texture file="structural/ao/celt_wall_tower.png" name="aoTex"/>
    17       </textures>
     11        <texture file="gaia/decal_farmland.png" name="baseTex"/>
     12        <texture file="gaia/decal_farmland_norm.png" name="normTex"/>
     13        <texture file="gaia/decal_farmland_spec.png" name="specTex"/>
     14      </textures>
    1815    </variant>
    1916  </group>
    20   <group>
    21     <variant frequency="100" name="Idle"/>
    22     <variant name="garrisoned">
    23       <props>
    24         <prop actor="props/special/common/garrison_flag_celt.xml" attachpoint="garrisoned"/>
    25       </props>
    26     </variant>
    27     <variant name="death">
    28       <props>
    29         <prop actor="particle/destruction_smoke_small.xml" attachpoint="root"/>
    30         <prop actor="particle/destruction_dust_small.xml" attachpoint="root"/>
    31         <prop actor="particle/destruction_dust_small_gray.xml" attachpoint="root"/>
    32       </props>
    33     </variant>
    34   </group>
    35   <material>player_trans_ao_parallax_spec.xml</material>
     17  <material>basic_trans.xml</material>
    3618</actor>
  • binaries/data/mods/public/simulation/templates/structures/brit_wall_gate.xml

     
    1111    <Square width="38.5" depth="9.0"/>
    1212    <Height>9.0</Height>
    1313  </Footprint>
     14  <Health>
     15    <Max>1500</Max>
     16  </Health>
    1417  <Identity>
    1518    <Civ>brit</Civ>
    1619    <SpecificName>Dor</SpecificName>
  • binaries/data/mods/public/simulation/templates/structures/brit_wall_long.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22<Entity parent="template_structure_defense_wall_long">
     3  <Armour>
     4    <Crush>20</Crush>
     5  </Armour>
    36  <Footprint>
    4     <Square width="38.5" depth="8.5"/>
     7    <Square width="38.5" depth="12.5"/>
    58    <Height>9.0</Height>
    69  </Footprint>
    710  <Identity>
     
    1114    <History>The Romans called this wall 'Murus Gallicus'. Translated, it means 'Gaulish wall'. It was extremely resistant to assault by battering ram. Julius Caesar described a type of wood and stone wall, known as a Murus Gallicus, in his account of the Gallic Wars. These walls were made of a stone wall filled with rubble, with wooden logs inside for stability. Caesar noted how the flexibility of the wood added to the strength of the fort in case of battering ram attack.</History>
    1215  </Identity>
    1316  <Obstruction>
    14     <Static width="37.0" depth="7.0"/>
     17    <Static width="37.0" depth="10.0"/>
    1518  </Obstruction>
     19  <TerrainModifier>
     20    <Type>
     21      slopeWall
     22    </Type>
     23  </TerrainModifier>
    1624  <VisualActor>
    1725    <Actor>structures/celts/wall_long.xml</Actor>
    1826  </VisualActor>
  • binaries/data/mods/public/simulation/templates/structures/brit_wall_medium.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22<Entity parent="template_structure_defense_wall_medium">
     3  <Armour>
     4    <Crush>20</Crush>
     5  </Armour>
    36  <Footprint>
    4     <Square width="26.5" depth="8.5"/>
     7    <Square width="26.5" depth="12.5"/>
    58    <Height>9.0</Height>
    69  </Footprint>
    710  <Health>
     
    1417    <History>The Romans called this wall 'Murus Gallicus'. Translated, it means 'Gaulish wall'. It was extremely resistant to assault by battering ram. Julius Caesar described a type of wood and stone wall, known as a Murus Gallicus, in his account of the Gallic Wars. These walls were made of a stone wall filled with rubble, with wooden logs inside for stability. Caesar noted how the flexibility of the wood added to the strength of the fort in case of battering ram attack.</History>
    1518  </Identity>
    1619  <Obstruction>
    17     <Static width="25.0" depth="7.0"/>
     20    <Static width="25.0" depth="10.0"/>
    1821  </Obstruction>
     22  <TerrainModifier>
     23    <Type>
     24      slopeWall
     25    </Type>
     26  </TerrainModifier>
    1927  <VisualActor>
    2028    <Actor>structures/celts/wall_medium.xml</Actor>
    2129  </VisualActor>
  • binaries/data/mods/public/simulation/templates/structures/brit_wall_short.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22<Entity parent="template_structure_defense_wall_short">
     3  <Armour>
     4    <Crush>20</Crush>
     5  </Armour>
    36  <Footprint>
    4     <Square width="14.5" depth="8.5"/>
     7    <Square width="14.5" depth="12.5"/>
    58    <Height>9.0</Height>
    69  </Footprint>
    710  <Health>
     
    1417    <History>The Romans called this wall 'Murus Gallicus'. Translated, it means 'Gaulish wall'. It was extremely resistant to assault by battering ram. Julius Caesar described a type of wood and stone wall, known as a Murus Gallicus, in his account of the Gallic Wars. These walls were made of a stone wall filled with rubble, with wooden logs inside for stability. Caesar noted how the flexibility of the wood added to the strength of the fort in case of battering ram attack.</History>
    1518  </Identity>
    1619  <Obstruction>
    17     <Static width="13.0" depth="7.0"/>
     20    <Static width="13.0" depth="10.0"/>
    1821  </Obstruction>
     22  <TerrainModifier>
     23    <Type>
     24      slopeWall
     25    </Type>
     26  </TerrainModifier>
    1927  <VisualActor>
    2028    <Actor>structures/celts/wall_short.xml</Actor>
    2129  </VisualActor>
  • binaries/data/mods/public/simulation/templates/structures/brit_wall_tower.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22<Entity parent="template_structure_defense_wall_tower">
    33  <Attack disable=""/>
     4  <Armour>
     5    <Crush>20</Crush>
     6  </Armour>
    47  <Footprint>
    5     <Square width="10.0" depth="10.0"/>
    6     <Height>20.0</Height>
     8    <Square width="10.0" depth="13.0"/>
     9    <Height>9.0</Height>
    710  </Footprint>
    811  <GarrisonHolder disable=""/>
    912  <Identity>
     
    1316    <Tooltip>Does not shoot or garrison.</Tooltip>
    1417  </Identity>
    1518  <Obstruction>
    16     <Static width="9.0" depth="9.0"/>
     19    <Static width="9.0" depth="12.0"/>
    1720  </Obstruction>
     21  <TerrainModifier>
     22    <Type>
     23      slopeWall
     24    </Type>
     25  </TerrainModifier>
    1826  <RallyPoint disable=""/>
    1927  <VisualActor>
    2028    <Actor>structures/celts/wall_tower.xml</Actor>
  • binaries/data/mods/public/simulation/templates/structures/celt_wall_gate.xml

     
    1111    <Square width="38.5" depth="9.0"/>
    1212    <Height>9.0</Height>
    1313  </Footprint>
     14  <Health>
     15    <Max>1500</Max>
     16  </Health>
    1417  <Identity>
    1518    <Civ>celt</Civ>
    1619    <SpecificName>Gate</SpecificName>
  • binaries/data/mods/public/simulation/templates/structures/celt_wall_long.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22<Entity parent="template_structure_defense_wall_long">
     3  <Armour>
     4    <Crush>20</Crush>
     5  </Armour>
    36  <Footprint>
    4     <Square width="38.5" depth="8.5"/>
     7    <Square width="38.5" depth="12.5"/>
    58    <Height>9.0</Height>
    69  </Footprint>
    710  <Identity>
     
    1114    <History>The Romans called this wall 'Murus Gallicus'. Translated, it means 'Gaulish wall'. It was extremely resistant to assault by battering ram. Julius Caesar described a type of wood and stone wall, known as a Murus Gallicus, in his account of the Gallic Wars. These walls were made of a stone wall filled with rubble, with wooden logs inside for stability. Caesar noted how the flexibility of the wood added to the strength of the fort in case of battering ram attack.</History>
    1215  </Identity>
    1316  <Obstruction>
    14     <Static width="37.0" depth="7.0"/>
     17    <Static width="37.0" depth="10.0"/>
    1518  </Obstruction>
     19  <TerrainModifier>
     20    <Type>
     21      slopeWall
     22    </Type>
     23  </TerrainModifier>
    1624  <VisualActor>
    1725    <Actor>structures/celts/wall_long.xml</Actor>
    1826  </VisualActor>
  • binaries/data/mods/public/simulation/templates/structures/celt_wall_medium.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22<Entity parent="template_structure_defense_wall_medium">
     3  <Armour>
     4    <Crush>20</Crush>
     5  </Armour>
    36  <Footprint>
    4     <Square width="26.5" depth="8.5"/>
     7    <Square width="26.5" depth="12.5"/>
    58    <Height>9.0</Height>
    69  </Footprint>
    710  <Health>
     
    1417    <History>The Romans called this wall 'Murus Gallicus'. Translated, it means 'Gaulish wall'. It was extremely resistant to assault by battering ram. Julius Caesar described a type of wood and stone wall, known as a Murus Gallicus, in his account of the Gallic Wars. These walls were made of a stone wall filled with rubble, with wooden logs inside for stability. Caesar noted how the flexibility of the wood added to the strength of the fort in case of battering ram attack.</History>
    1518  </Identity>
    1619  <Obstruction>
    17     <Static width="25.0" depth="7.0"/>
     20    <Static width="25.0" depth="10.0"/>
    1821  </Obstruction>
     22  <TerrainModifier>
     23    <Type>
     24      slopeWall
     25    </Type>
     26  </TerrainModifier>
    1927  <VisualActor>
    2028    <Actor>structures/celts/wall_medium.xml</Actor>
    2129  </VisualActor>
  • binaries/data/mods/public/simulation/templates/structures/celt_wall_short.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22<Entity parent="template_structure_defense_wall_short">
     3  <Armour>
     4    <Crush>20</Crush>
     5  </Armour>
    36  <Footprint>
    4     <Square width="14.5" depth="8.5"/>
     7    <Square width="14.5" depth="12.5"/>
    58    <Height>9.0</Height>
    69  </Footprint>
    710  <Health>
     
    1417    <History>The Romans called this wall 'Murus Gallicus'. Translated, it means 'Gaulish wall'. It was extremely resistant to assault by battering ram. Julius Caesar described a type of wood and stone wall, known as a Murus Gallicus, in his account of the Gallic Wars. These walls were made of a stone wall filled with rubble, with wooden logs inside for stability. Caesar noted how the flexibility of the wood added to the strength of the fort in case of battering ram attack.</History>
    1518  </Identity>
    1619  <Obstruction>
    17     <Static width="13.0" depth="7.0"/>
     20    <Static width="13.0" depth="10.0"/>
    1821  </Obstruction>
     22  <TerrainModifier>
     23    <Type>
     24      slopeWall
     25    </Type>
     26  </TerrainModifier>
    1927  <VisualActor>
    2028    <Actor>structures/celts/wall_short.xml</Actor>
    2129  </VisualActor>
  • binaries/data/mods/public/simulation/templates/structures/celt_wall_tower.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22<Entity parent="template_structure_defense_wall_tower">
    33  <Attack disable=""/>
     4  <Armour>
     5    <Crush>20</Crush>
     6  </Armour>
    47  <Footprint>
    5     <Square width="10.0" depth="10.0"/>
    6     <Height>20.0</Height>
     8    <Square width="10.0" depth="13.0"/>
     9    <Height>9.0</Height>
    710  </Footprint>
    811  <GarrisonHolder disable=""/>
    912  <Identity>
     
    1316    <Tooltip>Does not shoot or garrison.</Tooltip>
    1417  </Identity>
    1518  <Obstruction>
    16     <Static width="9.0" depth="9.0"/>
     19    <Static width="9.0" depth="12.0"/>
    1720  </Obstruction>
    1821  <RallyPoint disable=""/>
     22  <TerrainModifier>
     23    <Type>
     24      slopeWall
     25    </Type>
     26  </TerrainModifier>
    1927  <VisualActor>
    2028    <Actor>structures/celts/wall_tower.xml</Actor>
    2129  </VisualActor>
  • binaries/data/mods/public/simulation/templates/structures/gaul_wall_gate.xml

     
    1111    <Square width="38.5" depth="9.0"/>
    1212    <Height>9.0</Height>
    1313  </Footprint>
     14  <Health>
     15    <Max>1500</Max>
     16  </Health>
    1417  <Identity>
    1518    <Civ>gaul</Civ>
    1619    <SpecificName>Duro</SpecificName>
  • binaries/data/mods/public/simulation/templates/structures/gaul_wall_long.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22<Entity parent="template_structure_defense_wall_long">
     3  <Armour>
     4    <Crush>20</Crush>
     5  </Armour>
    36  <Footprint>
    4     <Square width="38.5" depth="8.5"/>
     7    <Square width="38.5" depth="12.5"/>
    58    <Height>9.0</Height>
    69  </Footprint>
    710  <Identity>
     
    1114    <History>The Romans called this wall 'Murus Gallicus'. Translated, it means 'Gaulish wall'. It was extremely resistant to assault by battering ram. Julius Caesar described a type of wood and stone wall, known as a Murus Gallicus, in his account of the Gallic Wars. These walls were made of a stone wall filled with rubble, with wooden logs inside for stability. Caesar noted how the flexibility of the wood added to the strength of the fort in case of battering ram attack.</History>
    1215  </Identity>
    1316  <Obstruction>
    14     <Static width="37.0" depth="7.0"/>
     17    <Static width="37.0" depth="10.0"/>
    1518  </Obstruction>
     19  <TerrainModifier>
     20    <Type>
     21      slopeWall
     22    </Type>
     23  </TerrainModifier>
    1624  <VisualActor>
    1725    <Actor>structures/celts/wall_long.xml</Actor>
    1826  </VisualActor>
  • binaries/data/mods/public/simulation/templates/structures/gaul_wall_medium.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22<Entity parent="template_structure_defense_wall_medium">
     3  <Armour>
     4    <Crush>20</Crush>
     5  </Armour>
    36  <Footprint>
    4     <Square width="26.5" depth="8.5"/>
     7    <Square width="26.5" depth="12.5"/>
    58    <Height>9.0</Height>
    69  </Footprint>
    710  <Health>
     
    1417    <History>The Romans called this wall 'Murus Gallicus'. Translated, it means 'Gaulish wall'. It was extremely resistant to assault by battering ram. Julius Caesar described a type of wood and stone wall, known as a Murus Gallicus, in his account of the Gallic Wars. These walls were made of a stone wall filled with rubble, with wooden logs inside for stability. Caesar noted how the flexibility of the wood added to the strength of the fort in case of battering ram attack.</History>
    1518  </Identity>
    1619  <Obstruction>
    17     <Static width="25.0" depth="7.0"/>
     20    <Static width="25.0" depth="10.0"/>
    1821  </Obstruction>
     22  <TerrainModifier>
     23    <Type>
     24      slopeWall
     25    </Type>
     26  </TerrainModifier>
    1927  <VisualActor>
    2028    <Actor>structures/celts/wall_medium.xml</Actor>
    2129  </VisualActor>
  • binaries/data/mods/public/simulation/templates/structures/gaul_wall_short.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22<Entity parent="template_structure_defense_wall_short">
     3  <Armour>
     4    <Crush>20</Crush>
     5  </Armour>
    36  <Footprint>
    4     <Square width="14.5" depth="8.5"/>
     7    <Square width="14.5" depth="12.5"/>
    58    <Height>9.0</Height>
    69  </Footprint>
    710  <Health>
     
    1417    <History>The Romans called this wall 'Murus Gallicus'. Translated, it means 'Gaulish wall'. It was extremely resistant to assault by battering ram. Julius Caesar described a type of wood and stone wall, known as a Murus Gallicus, in his account of the Gallic Wars. These walls were made of a stone wall filled with rubble, with wooden logs inside for stability. Caesar noted how the flexibility of the wood added to the strength of the fort in case of battering ram attack.</History>
    1518  </Identity>
    1619  <Obstruction>
    17     <Static width="13.0" depth="7.0"/>
     20    <Static width="13.0" depth="10.0"/>
    1821  </Obstruction>
     22  <TerrainModifier>
     23    <Type>
     24      slopeWall
     25    </Type>
     26  </TerrainModifier>
    1927  <VisualActor>
    2028    <Actor>structures/celts/wall_short.xml</Actor>
    2129  </VisualActor>
  • binaries/data/mods/public/simulation/templates/structures/gaul_wall_tower.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22<Entity parent="template_structure_defense_wall_tower">
    33  <Attack disable=""/>
     4  <Armour>
     5    <Crush>20</Crush>
     6  </Armour>
    47  <Footprint>
    5     <Square width="10.0" depth="10.0"/>
    6     <Height>20.0</Height>
     8    <Square width="10.0" depth="13.0"/>
     9    <Height>9.0</Height>
    710  </Footprint>
    811  <GarrisonHolder disable=""/>
    912  <Identity>
     
    1316    <Tooltip>Does not shoot or garrison.</Tooltip>
    1417  </Identity>
    1518  <Obstruction>
    16     <Static width="9.0" depth="9.0"/>
     19    <Static width="9.0" depth="12.0"/>
    1720  </Obstruction>
     21  <TerrainModifier>
     22    <Type>
     23      slopeWall
     24    </Type>
     25  </TerrainModifier>
    1826  <RallyPoint disable=""/>
    1927  <VisualActor>
    2028    <Actor>structures/celts/wall_tower.xml</Actor>
  • binaries/data/mods/public/simulation/templates/structures/iber_house.xml

     
    1919    <Radius>16</Radius>
    2020    <Weight>65536</Weight>
    2121  </TerritoryInfluence>
     22  <TerrainModifier>
     23    <Type>
     24      flatten
     25    </Type>
     26  </TerrainModifier>
    2227  <VisualActor>
    2328    <Actor>structures/iberians/house.xml</Actor>
    2429    <FoundationActor>structures/fndn_2x2.xml</FoundationActor>
  • binaries/data/mods/public/simulation/templates/template_structure_defense_wall.xml

     
    4848    <Radius>20</Radius>
    4949    <Weight>65536</Weight>
    5050  </TerritoryInfluence>
     51  <TerrainModifier disable=""/>
    5152  <Vision>
    5253    <Range>20</Range>
    5354  </Vision>
  • binaries/data/mods/public/simulation/templates/template_structure_defense_wall_long.xml

     
    1010    <SpawnEntityOnDeath>rubble/rubble_stone_wall_long</SpawnEntityOnDeath>
    1111  </Health>
    1212  <Identity>
    13     <Classes datatype="tokens">LongWall</Classes>
    14     <Tooltip>Long wall segments can be converted to gates.</Tooltip>
    15   </Identity>
    16 </Entity>
     13    <Classes datatype="tokens">LongWall</Classes>
     14    <Tooltip>Long wall segments can be converted to gates.</Tooltip>
     15  </Identity>
     16</Entity>
  • binaries/data/mods/public/simulation/templates/template_structure_defense_wall_tower.xml

     
    8585  <StatusBars>
    8686    <HeightOffset>20.0</HeightOffset>
    8787  </StatusBars>
     88  <TerrainModifier disable=""/>
    8889  <TerritoryInfluence>
    8990    <Root>false</Root>
    9091    <Radius>20</Radius>
  • binaries/data/mods/public/simulation/templates/template_structure_military_dock.xml

     
    5353    </SoundGroups>
    5454  </Sound>
    5555  <TerritoryDecay disable=""/>
     56  <TerrainModifier disable=""/>
    5657  <ProductionQueue>
    5758    <BatchTimeModifier>0.8</BatchTimeModifier>
    5859    <Entities datatype="tokens">
  • source/simulation2/TypeList.h

     
    148148INTERFACE(Terrain)
    149149COMPONENT(Terrain)
    150150
     151INTERFACE(TerrainModifier)
     152COMPONENT(TerrainModifierScripted)
     153
    151154INTERFACE(TerritoryInfluence)
    152155COMPONENT(TerritoryInfluence)
    153156
  • source/simulation2/components/CCmpTerrain.cpp

     
    2020#include "simulation2/system/Component.h"
    2121#include "ICmpTerrain.h"
    2222
     23#include "ICmpTerrainModifier.h"
    2324#include "ICmpObstructionManager.h"
    2425#include "ICmpRangeManager.h"
     26#include "ICmpPosition.h"
    2527#include "simulation2/MessageTypes.h"
     28#include "simulation2/helpers/Geometry.h"
    2629
    2730#include "graphics/Terrain.h"
    2831#include "renderer/Renderer.h"
    2932#include "renderer/WaterManager.h"
     33#include "graphics/Patch.h"
     34#include "maths/MathUtil.h"
    3035#include "maths/Vector3D.h"
    3136
    3237class CCmpTerrain : public ICmpTerrain
     
    4045
    4146    CTerrain* m_Terrain; // not null
    4247
     48    std::vector<u16> m_SimHeightmap;
     49    ssize_t m_MapSizePatches;
     50
     51
    4352    static std::string GetSchema()
    4453    {
    4554        return "<a:component type='system'/><empty/>";
     
    4857    virtual void Init(const CParamNode& UNUSED(paramNode))
    4958    {
    5059        m_Terrain = &GetSimContext().GetTerrain();
     60        m_MapSizePatches = 0;
     61        ReloadTerrain();
    5162    }
    5263
    5364    virtual void Deinit()
     
    6879        return m_Terrain->GetVerticesPerSide() != 0;
    6980    }
    7081
     82
     83    virtual u16* GetSimHeightMap()
     84    {
     85        return &m_SimHeightmap[0];
     86    }
     87
     88    virtual void MakeVisualTerrainDirty()
     89    {
     90        if (m_Terrain->GetPatchesPerSide() != m_MapSizePatches)
     91            m_Terrain->Resize(m_MapSizePatches);
     92
     93        if (m_MapSizePatches)
     94            RecalculateVisualHeightmap();
     95    }
     96
    7197    virtual CFixedVector3D CalcNormal(entity_pos_t x, entity_pos_t z)
    7298    {
    7399        CFixedVector3D normal;
     
    83109    virtual entity_pos_t GetGroundLevel(entity_pos_t x, entity_pos_t z)
    84110    {
    85111        // TODO: this can crash if the terrain heightmap isn't initialised yet
    86 
    87112        return m_Terrain->GetExactGroundLevelFixed(x, z);
    88113    }
    89114
     
    94119
    95120    virtual u16 GetTilesPerSide()
    96121    {
    97         ssize_t tiles = m_Terrain->GetTilesPerSide();
     122        ssize_t tiles = m_MapSizePatches * PATCH_SIZE;
    98123        ENSURE(1 <= tiles && tiles <= 65535);
    99124        return (u16)tiles;
    100125    }
     
    101126
    102127    virtual u16 GetVerticesPerSide()
    103128    {
    104         ssize_t vertices = m_Terrain->GetVerticesPerSide();
    105         ENSURE(1 <= vertices && vertices <= 65535);
     129        ssize_t vertices = m_MapSizePatches * PATCH_SIZE + 1;
     130        ENSURE(1 < vertices && vertices <= 65535);
    106131        return (u16)vertices;
    107132    }
    108133
     
    111136        return m_Terrain;
    112137    }
    113138
     139    struct IterateHeightmapAverage
     140    {
     141        u16* heightmap;
     142        int pitch;
     143
     144        // weighted sum of the wanted heights
     145        fixed* avgHeightmap;
     146        // sum of the weights
     147        fixed* sumWeightmap;
     148
     149        void operator()(int i, int j, fixed weight, fixed newHeight)
     150        {
     151            if (weight > fixed::Zero())
     152            {
     153                fixed sumWeight = sumWeightmap[i+j*pitch] + weight;
     154                // avoid overflows by dividing before multiplying
     155                avgHeightmap[i+j*pitch] = (avgHeightmap[i+j*pitch]/sumWeight).Multiply(sumWeightmap[i+j*pitch]) + (newHeight/sumWeight).Multiply(weight);
     156               
     157                sumWeightmap[i+j*pitch] = sumWeight;
     158                int h = HEIGHT_UNITS_PER_METRE*avgHeightmap[i+j*pitch].ToInt_RoundToNearest();
     159                heightmap[i + j*pitch] = Clamp(h, 0, 65535);
     160            }
     161        }
     162    };
     163
     164    template<typename T>
     165    void IterateHeightmap(T& callback, CFixedVector2D pos, fixed angle, entity_id_t ent)
     166    {
     167        CmpPtr<ICmpTerrainModifier> CCmpTerrainModifier(GetSimContext(), ent);
     168        // get the bbox, multiply by sqrt(2)/2 (rounded up) to get half the size and take
     169        // account of possible rotations
     170        fixed BBoxSize = CCmpTerrainModifier->GetBBox()/2;
     171        fixed maxBBoxSize = BBoxSize*142/100;
     172        int numVerts = m_MapSizePatches*PATCH_SIZE + 1;
     173
     174        int i0 = ((pos.X - maxBBoxSize) / TERRAIN_TILE_SIZE).ToInt_RoundToNegInfinity();
     175        int i1 = ((pos.X + maxBBoxSize) / TERRAIN_TILE_SIZE).ToInt_RoundToInfinity();
     176        int j0 = ((pos.Y - maxBBoxSize) / TERRAIN_TILE_SIZE).ToInt_RoundToNegInfinity();
     177        int j1 = ((pos.Y + maxBBoxSize) / TERRAIN_TILE_SIZE).ToInt_RoundToInfinity();
     178        i0 = Clamp(i0, 0, numVerts);
     179        i1 = Clamp(i1, 0, numVerts);
     180        j0 = Clamp(j0, 0, numVerts);
     181        j1 = Clamp(j1, 0, numVerts);
     182
     183        fixed entHeight = m_Terrain->GetExactGroundLevelFixed(pos.X, pos.Y);
     184        for (int j = j0; j <= j1; ++j)
     185        {
     186            for (int i = i0; i <= i1; ++i)
     187            {
     188                CFixedVector2D pt = CFixedVector2D(fixed::FromInt(i*TERRAIN_TILE_SIZE), fixed::FromInt(j*TERRAIN_TILE_SIZE)) - CFixedVector2D(pos.X, pos.Y);
     189                pt = pt.Rotate(-angle);
     190                if (pt.X.Absolute() > BBoxSize || pt.Y.Absolute() > BBoxSize)
     191                    continue;
     192                fixed oldHeight = m_Terrain->GetVertexGroundLevelFixed(i, j);
     193                fixed newHeight, weight;
     194                CCmpTerrainModifier->GetNewHeight(pt, oldHeight, entHeight, newHeight, weight);
     195                callback(i, j, weight, newHeight);
     196            }
     197        }
     198        MakeDirty(i0, j0, i1, j1);
     199    }
     200
     201    void RecalculateVisualHeightmap()
     202    {
     203        u16* heightmap = m_Terrain->GetHeightMap();
     204        int pitch = m_MapSizePatches * PATCH_SIZE + 1;
     205        std::vector<u16> tempHeightmap(pitch*pitch);
     206        memcpy(&tempHeightmap[0], &m_SimHeightmap[0], pitch * pitch * sizeof(u16));
     207        memcpy(heightmap, &m_SimHeightmap[0], pitch * pitch * sizeof(u16));
     208
     209        IterateHeightmapAverage callback;
     210        callback.heightmap = &tempHeightmap[0];
     211        callback.pitch = pitch;
     212        std::vector<fixed> avgHeightmap(pitch * pitch, fixed::Zero());
     213        callback.avgHeightmap = &avgHeightmap[0];
     214        std::vector<fixed> sumWeightmap(pitch * pitch, fixed::Zero());
     215        callback.sumWeightmap = &sumWeightmap[0];
     216
     217        CComponentManager::InterfaceList ents = GetSimContext().GetComponentManager().GetEntitiesWithInterface(IID_TerrainModifier);
     218        for (CComponentManager::InterfaceList::const_iterator it = ents.begin(); it != ents.end(); ++it)
     219        {
     220            CmpPtr<ICmpPosition> cmpPosition(GetSimContext(), it->first);
     221            if (cmpPosition)
     222            {
     223                CFixedVector2D pos = cmpPosition->GetPosition2D();
     224                fixed angle = cmpPosition->GetRotation().Y;
     225
     226                IterateHeightmap(callback, pos, angle, it->first);
     227            }
     228        }
     229
     230        memcpy(heightmap, &tempHeightmap[0], pitch * pitch * sizeof(u16));
     231        m_Terrain->MakeDirty(RENDERDATA_UPDATE_VERTICES);
     232    }
     233
    114234    virtual void ReloadTerrain()
    115235    {
    116236        // TODO: should refactor this code to be nicer
     237        m_MapSizePatches = m_Terrain->GetPatchesPerSide();
     238        if (!m_MapSizePatches)
     239            return;// terrain wasn't loaded yet, this method must be called manually
    117240
     241        size_t size = (m_MapSizePatches * PATCH_SIZE + 1)*(m_MapSizePatches * PATCH_SIZE + 1);
     242        m_SimHeightmap.resize(size);
     243        if (m_Terrain->GetHeightMap())
     244            memcpy(&m_SimHeightmap[0], m_Terrain->GetHeightMap(), size*sizeof(u16));
     245        else
     246            memset(&m_SimHeightmap[0], 0, size*sizeof(u16));
     247
    118248        u16 tiles = GetTilesPerSide();
    119249        u16 vertices = GetVerticesPerSide();
    120250
     
    138268        if (CRenderer::IsInitialised())
    139269            g_Renderer.GetWaterManager()->SetMapSize(vertices);
    140270
    141         MakeDirty(0, 0, tiles+1, tiles+1);
     271        MakeVisualTerrainDirty();
     272        MakeDirty(0, 0, tiles + 1, tiles + 1);
    142273    }
    143274
    144275    virtual void MakeDirty(i32 i0, i32 j0, i32 i1, i32 j1)
  • source/simulation2/components/ICmpTerrain.cpp

     
    2424BEGIN_INTERFACE_WRAPPER(Terrain)
    2525DEFINE_INTERFACE_METHOD_2("GetGroundLevel", entity_pos_t, ICmpTerrain, GetGroundLevel, entity_pos_t, entity_pos_t)
    2626DEFINE_INTERFACE_METHOD_2("CalcNormal", CFixedVector3D, ICmpTerrain, CalcNormal, entity_pos_t, entity_pos_t)
     27DEFINE_INTERFACE_METHOD_0("MakeVisualTerrainDirty", void, ICmpTerrain, MakeVisualTerrainDirty)
    2728END_INTERFACE_WRAPPER(Terrain)
  • source/simulation2/components/ICmpTerrain.h

     
    3232public:
    3333    virtual bool IsLoaded() = 0;
    3434
     35    virtual u16* GetSimHeightMap() = 0;
     36
     37    virtual void MakeVisualTerrainDirty() = 0;
     38
    3539    virtual CFixedVector3D CalcNormal(entity_pos_t x, entity_pos_t z) = 0;
    3640
    3741    virtual CVector3D CalcExactNormal(float x, float z) = 0;
  • source/simulation2/system/ComponentTest.h

     
    229229    virtual void ReloadTerrain()
    230230    {
    231231    }
     232
     233    virtual void MakeVisualTerrainDirty()
     234    {
     235    }
     236
     237    virtual u16* GetSimHeightMap()
     238    {
     239        return NULL;
     240    }
    232241};
  • source/tools/atlas/GameInterface/Handlers/ElevationHandlers.cpp

     
    4141    void Init()
    4242    {
    4343        m_Heightmap = g_Game->GetWorld()->GetTerrain()->GetHeightMap();
     44        CmpPtr<ICmpTerrain> cmpTerrain(*g_Game->GetSimulation2(), SYSTEM_ENTITY);
     45        if (cmpTerrain)
     46            m_SimHeightmap = cmpTerrain->GetSimHeightMap();
    4447        m_VertsPerSide = g_Game->GetWorld()->GetTerrain()->GetVerticesPerSide();
    4548    }
    4649
     
    9093    void setNew(ssize_t x, ssize_t y, const u16& val)
    9194    {
    9295        m_Heightmap[y*m_VertsPerSide + x] = val;
     96        if (m_SimHeightmap)
     97            m_SimHeightmap[y*m_VertsPerSide + x] = val;
    9398    }
    9499
    95100    u16* m_Heightmap;
     101    u16* m_SimHeightmap;
    96102    ssize_t m_VertsPerSide;
    97103};
    98104