Index: binaries/data/mods/public/art/actors/structures/celts/wall_long.xml
===================================================================
--- binaries/data/mods/public/art/actors/structures/celts/wall_long.xml	(revision 14215)
+++ binaries/data/mods/public/art/actors/structures/celts/wall_long.xml	(working copy)
@@ -2,25 +2,17 @@
 <actor version="1">
   <castshadow/>
   <group>
-    <variant frequency="100" name="celt wall long">
-      <mesh>structural/celt_wall_long.dae</mesh>
-      <textures>
-	    <texture file="structural/celt_murus.png" name="baseTex"/>
-	    <texture file="structural/celt_murus_norm.png" name="normTex"/>
-	    <texture file="structural/celt_murus_spec.png" name="specTex"/>
-		<texture file="structural/ao/celt_wall_long.png" name="aoTex"/>
-	  </textures>
-    </variant>
-  </group>
-  <group>
-    <variant frequency="100" name="Idle"/>
-    <variant name="death">
+    <variant frequency="1" name="wall">
+      <mesh>structural/slope_wall_propped.dae</mesh>
       <props>
-        <prop actor="particle/destruction_smoke_med.xml" attachpoint="root"/>
-        <prop actor="particle/destruction_dust_med.xml" attachpoint="root"/>
-        <prop actor="particle/destruction_dust_med_gray.xml" attachpoint="root"/>
+        <prop actor="structures/celts/wall_long_p.xml" attachpoint="wall" maxheight="20" minheight="-20"/>
       </props>
+      <textures>
+        <texture file="gaia/decal_farmland.png" name="baseTex"/>
+        <texture file="gaia/decal_farmland_norm.png" name="normTex"/>
+        <texture file="gaia/decal_farmland_spec.png" name="specTex"/>
+      </textures>
     </variant>
   </group>
-  <material>player_trans_ao_parallax_spec.xml</material>
+  <material>basic_trans.xml</material>
 </actor>
Index: binaries/data/mods/public/art/actors/structures/celts/wall_medium.xml
===================================================================
--- binaries/data/mods/public/art/actors/structures/celts/wall_medium.xml	(revision 14215)
+++ binaries/data/mods/public/art/actors/structures/celts/wall_medium.xml	(working copy)
@@ -2,25 +2,17 @@
 <actor version="1">
   <castshadow/>
   <group>
-    <variant frequency="100" name="celt wall medium">
-      <mesh>structural/celt_wall_medium.dae</mesh>
-      <textures>
-	    <texture file="structural/celt_murus.png" name="baseTex"/>
-	    <texture file="structural/celt_murus_norm.png" name="normTex"/>
-	    <texture file="structural/celt_murus_spec.png" name="specTex"/>
-		<texture file="structural/ao/celt_wall_medium.png" name="aoTex"/>
-	  </textures>
-    </variant>
-  </group>
-  <group>
-    <variant frequency="100" name="Idle"/>
-    <variant name="death">
+    <variant frequency="1" name="wall">
+      <mesh>structural/slope_wall_propped.dae</mesh>
       <props>
-        <prop actor="particle/destruction_smoke_med.xml" attachpoint="root"/>
-        <prop actor="particle/destruction_dust_med.xml" attachpoint="root"/>
-        <prop actor="particle/destruction_dust_med_gray.xml" attachpoint="root"/>
+        <prop actor="structures/celts/wall_medium_p.xml" attachpoint="wall" maxheight="20" minheight="-20"/>
       </props>
+      <textures>
+        <texture file="gaia/decal_farmland.png" name="baseTex"/>
+        <texture file="gaia/decal_farmland_norm.png" name="normTex"/>
+        <texture file="gaia/decal_farmland_spec.png" name="specTex"/>
+      </textures>
     </variant>
   </group>
-   <material>player_trans_ao_parallax_spec.xml</material>
+  <material>basic_trans.xml</material>
 </actor>
Index: binaries/data/mods/public/art/actors/structures/celts/wall_short.xml
===================================================================
--- binaries/data/mods/public/art/actors/structures/celts/wall_short.xml	(revision 14215)
+++ binaries/data/mods/public/art/actors/structures/celts/wall_short.xml	(working copy)
@@ -2,25 +2,17 @@
 <actor version="1">
   <castshadow/>
   <group>
-    <variant frequency="100" name="celt wall short">
-      <mesh>structural/celt_wall_short.dae</mesh>
-      <textures>
-	    <texture file="structural/celt_murus.png" name="baseTex"/>
-	    <texture file="structural/celt_murus_norm.png" name="normTex"/>
-	    <texture file="structural/celt_murus_spec.png" name="specTex"/>
-		<texture file="structural/ao/celt_wall_short.png" name="aoTex"/>
-	  </textures>
-    </variant>
-  </group>
-  <group>
-    <variant frequency="100" name="Idle"/>
-    <variant name="death">
+    <variant frequency="1" name="wall">
+      <mesh>structural/slope_wall_propped.dae</mesh>
       <props>
-        <prop actor="particle/destruction_smoke_med.xml" attachpoint="root"/>
-        <prop actor="particle/destruction_dust_med.xml" attachpoint="root"/>
-        <prop actor="particle/destruction_dust_med_gray.xml" attachpoint="root"/>
+        <prop actor="structures/celts/wall_short_p.xml" attachpoint="wall" maxheight="20" minheight="-20"/>
       </props>
+      <textures>
+        <texture file="gaia/decal_farmland.png" name="baseTex"/>
+        <texture file="gaia/decal_farmland_norm.png" name="normTex"/>
+        <texture file="gaia/decal_farmland_spec.png" name="specTex"/>
+      </textures>
     </variant>
   </group>
-  <material>player_trans_ao_parallax_spec.xml</material>
+  <material>basic_trans.xml</material>
 </actor>
Index: binaries/data/mods/public/art/actors/structures/celts/wall_tower.xml
===================================================================
--- binaries/data/mods/public/art/actors/structures/celts/wall_tower.xml	(revision 14215)
+++ binaries/data/mods/public/art/actors/structures/celts/wall_tower.xml	(working copy)
@@ -1,36 +1,18 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<?xml version="1.0" encoding="utf-8"?>
 <actor version="1">
   <castshadow/>
   <group>
-    <variant>
-      <mesh>structural/celt_wall_tower.dae</mesh>
+    <variant frequency="1" name="wall">
+      <mesh>structural/slope_wall_propped.dae</mesh>
       <props>
-        <prop actor="props/structures/persians/wall_tower.xml" attachpoint="root"/>
-        <prop actor="props/units/weapons/arrow_front.xml" attachpoint="loaded-projectile"/>
-        <prop actor="props/units/weapons/arrow_front.xml" attachpoint="projectile"/>
+        <prop actor="structures/celts/wall_tower_p.xml" attachpoint="wall" maxheight="20" minheight="-20"/>
       </props>
       <textures>
-	    <texture file="structural/celt_murus.png" name="baseTex"/>
-	    <texture file="structural/celt_murus_norm.png" name="normTex"/>
-	    <texture file="structural/celt_murus_spec.png" name="specTex"/>
-		<texture file="structural/ao/celt_wall_tower.png" name="aoTex"/>
-	  </textures>
+        <texture file="gaia/decal_farmland.png" name="baseTex"/>
+        <texture file="gaia/decal_farmland_norm.png" name="normTex"/>
+        <texture file="gaia/decal_farmland_spec.png" name="specTex"/>
+      </textures>
     </variant>
   </group>
-  <group>
-    <variant frequency="100" name="Idle"/>
-    <variant name="garrisoned">
-      <props>
-        <prop actor="props/special/common/garrison_flag_celt.xml" attachpoint="garrisoned"/>
-      </props>
-    </variant>
-    <variant name="death">
-      <props>
-        <prop actor="particle/destruction_smoke_small.xml" attachpoint="root"/>
-        <prop actor="particle/destruction_dust_small.xml" attachpoint="root"/>
-        <prop actor="particle/destruction_dust_small_gray.xml" attachpoint="root"/>
-      </props>
-    </variant>
-  </group>
-  <material>player_trans_ao_parallax_spec.xml</material>
+  <material>basic_trans.xml</material>
 </actor>
Index: binaries/data/mods/public/simulation/templates/structures/brit_wall_gate.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/brit_wall_gate.xml	(revision 14215)
+++ binaries/data/mods/public/simulation/templates/structures/brit_wall_gate.xml	(working copy)
@@ -11,6 +11,9 @@
     <Square width="38.5" depth="9.0"/>
     <Height>9.0</Height>
   </Footprint>
+  <Health>
+    <Max>1500</Max>
+  </Health>
   <Identity>
     <Civ>brit</Civ>
     <SpecificName>Dor</SpecificName>
Index: binaries/data/mods/public/simulation/templates/structures/brit_wall_long.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/brit_wall_long.xml	(revision 14215)
+++ binaries/data/mods/public/simulation/templates/structures/brit_wall_long.xml	(working copy)
@@ -1,7 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Entity parent="template_structure_defense_wall_long">
+  <Armour>
+    <Crush>20</Crush>
+  </Armour>
   <Footprint>
-    <Square width="38.5" depth="8.5"/>
+    <Square width="38.5" depth="12.5"/>
     <Height>9.0</Height>
   </Footprint>
   <Identity>
@@ -11,8 +14,13 @@
     <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>
   </Identity>
   <Obstruction>
-    <Static width="37.0" depth="7.0"/>
+    <Static width="37.0" depth="10.0"/>
   </Obstruction>
+  <TerrainModifier>
+    <Type>
+      slopeWall
+    </Type>
+  </TerrainModifier>
   <VisualActor>
     <Actor>structures/celts/wall_long.xml</Actor>
   </VisualActor>
Index: binaries/data/mods/public/simulation/templates/structures/brit_wall_medium.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/brit_wall_medium.xml	(revision 14215)
+++ binaries/data/mods/public/simulation/templates/structures/brit_wall_medium.xml	(working copy)
@@ -1,7 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Entity parent="template_structure_defense_wall_medium">
+  <Armour>
+    <Crush>20</Crush>
+  </Armour>
   <Footprint>
-    <Square width="26.5" depth="8.5"/>
+    <Square width="26.5" depth="12.5"/>
     <Height>9.0</Height>
   </Footprint>
   <Health>
@@ -14,8 +17,13 @@
     <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>
   </Identity>
   <Obstruction>
-    <Static width="25.0" depth="7.0"/>
+    <Static width="25.0" depth="10.0"/>
   </Obstruction>
+  <TerrainModifier>
+    <Type>
+      slopeWall
+    </Type>
+  </TerrainModifier>
   <VisualActor>
     <Actor>structures/celts/wall_medium.xml</Actor>
   </VisualActor>
Index: binaries/data/mods/public/simulation/templates/structures/brit_wall_short.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/brit_wall_short.xml	(revision 14215)
+++ binaries/data/mods/public/simulation/templates/structures/brit_wall_short.xml	(working copy)
@@ -1,7 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Entity parent="template_structure_defense_wall_short">
+  <Armour>
+    <Crush>20</Crush>
+  </Armour>
   <Footprint>
-    <Square width="14.5" depth="8.5"/>
+    <Square width="14.5" depth="12.5"/>
     <Height>9.0</Height>
   </Footprint>
   <Health>
@@ -14,8 +17,13 @@
     <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>
   </Identity>
   <Obstruction>
-    <Static width="13.0" depth="7.0"/>
+    <Static width="13.0" depth="10.0"/>
   </Obstruction>
+  <TerrainModifier>
+    <Type>
+      slopeWall
+    </Type>
+  </TerrainModifier>
   <VisualActor>
     <Actor>structures/celts/wall_short.xml</Actor>
   </VisualActor>
Index: binaries/data/mods/public/simulation/templates/structures/brit_wall_tower.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/brit_wall_tower.xml	(revision 14215)
+++ binaries/data/mods/public/simulation/templates/structures/brit_wall_tower.xml	(working copy)
@@ -1,9 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Entity parent="template_structure_defense_wall_tower">
   <Attack disable=""/>
+  <Armour>
+    <Crush>20</Crush>
+  </Armour>
   <Footprint>
-    <Square width="10.0" depth="10.0"/>
-    <Height>20.0</Height>
+    <Square width="10.0" depth="13.0"/>
+    <Height>9.0</Height>
   </Footprint>
   <GarrisonHolder disable=""/>
   <Identity>
@@ -13,8 +16,13 @@
     <Tooltip>Does not shoot or garrison.</Tooltip>
   </Identity>
   <Obstruction>
-    <Static width="9.0" depth="9.0"/>
+    <Static width="9.0" depth="12.0"/>
   </Obstruction>
+  <TerrainModifier>
+    <Type>
+      slopeWall
+    </Type>
+  </TerrainModifier>
   <RallyPoint disable=""/>
   <VisualActor>
     <Actor>structures/celts/wall_tower.xml</Actor>
Index: binaries/data/mods/public/simulation/templates/structures/celt_wall_gate.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/celt_wall_gate.xml	(revision 14215)
+++ binaries/data/mods/public/simulation/templates/structures/celt_wall_gate.xml	(working copy)
@@ -11,6 +11,9 @@
     <Square width="38.5" depth="9.0"/>
     <Height>9.0</Height>
   </Footprint>
+  <Health>
+    <Max>1500</Max>
+  </Health>
   <Identity>
     <Civ>celt</Civ>
     <SpecificName>Gate</SpecificName>
Index: binaries/data/mods/public/simulation/templates/structures/celt_wall_long.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/celt_wall_long.xml	(revision 14215)
+++ binaries/data/mods/public/simulation/templates/structures/celt_wall_long.xml	(working copy)
@@ -1,7 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Entity parent="template_structure_defense_wall_long">
+  <Armour>
+    <Crush>20</Crush>
+  </Armour>
   <Footprint>
-    <Square width="38.5" depth="8.5"/>
+    <Square width="38.5" depth="12.5"/>
     <Height>9.0</Height>
   </Footprint>
   <Identity>
@@ -11,8 +14,13 @@
     <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>
   </Identity>
   <Obstruction>
-    <Static width="37.0" depth="7.0"/>
+    <Static width="37.0" depth="10.0"/>
   </Obstruction>
+  <TerrainModifier>
+    <Type>
+      slopeWall
+    </Type>
+  </TerrainModifier>
   <VisualActor>
     <Actor>structures/celts/wall_long.xml</Actor>
   </VisualActor>
Index: binaries/data/mods/public/simulation/templates/structures/celt_wall_medium.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/celt_wall_medium.xml	(revision 14215)
+++ binaries/data/mods/public/simulation/templates/structures/celt_wall_medium.xml	(working copy)
@@ -1,7 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Entity parent="template_structure_defense_wall_medium">
+  <Armour>
+    <Crush>20</Crush>
+  </Armour>
   <Footprint>
-    <Square width="26.5" depth="8.5"/>
+    <Square width="26.5" depth="12.5"/>
     <Height>9.0</Height>
   </Footprint>
   <Health>
@@ -14,8 +17,13 @@
     <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>
   </Identity>
   <Obstruction>
-    <Static width="25.0" depth="7.0"/>
+    <Static width="25.0" depth="10.0"/>
   </Obstruction>
+  <TerrainModifier>
+    <Type>
+      slopeWall
+    </Type>
+  </TerrainModifier>
   <VisualActor>
     <Actor>structures/celts/wall_medium.xml</Actor>
   </VisualActor>
Index: binaries/data/mods/public/simulation/templates/structures/celt_wall_short.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/celt_wall_short.xml	(revision 14215)
+++ binaries/data/mods/public/simulation/templates/structures/celt_wall_short.xml	(working copy)
@@ -1,7 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Entity parent="template_structure_defense_wall_short">
+  <Armour>
+    <Crush>20</Crush>
+  </Armour>
   <Footprint>
-    <Square width="14.5" depth="8.5"/>
+    <Square width="14.5" depth="12.5"/>
     <Height>9.0</Height>
   </Footprint>
   <Health>
@@ -14,8 +17,13 @@
     <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>
   </Identity>
   <Obstruction>
-    <Static width="13.0" depth="7.0"/>
+    <Static width="13.0" depth="10.0"/>
   </Obstruction>
+  <TerrainModifier>
+    <Type>
+      slopeWall
+    </Type>
+  </TerrainModifier>
   <VisualActor>
     <Actor>structures/celts/wall_short.xml</Actor>
   </VisualActor>
Index: binaries/data/mods/public/simulation/templates/structures/celt_wall_tower.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/celt_wall_tower.xml	(revision 14215)
+++ binaries/data/mods/public/simulation/templates/structures/celt_wall_tower.xml	(working copy)
@@ -1,9 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Entity parent="template_structure_defense_wall_tower">
   <Attack disable=""/>
+  <Armour>
+    <Crush>20</Crush>
+  </Armour>
   <Footprint>
-    <Square width="10.0" depth="10.0"/>
-    <Height>20.0</Height>
+    <Square width="10.0" depth="13.0"/>
+    <Height>9.0</Height>
   </Footprint>
   <GarrisonHolder disable=""/>
   <Identity>
@@ -13,9 +16,14 @@
     <Tooltip>Does not shoot or garrison.</Tooltip>
   </Identity>
   <Obstruction>
-    <Static width="9.0" depth="9.0"/>
+    <Static width="9.0" depth="12.0"/>
   </Obstruction>
   <RallyPoint disable=""/>
+  <TerrainModifier>
+    <Type>
+      slopeWall
+    </Type>
+  </TerrainModifier>
   <VisualActor>
     <Actor>structures/celts/wall_tower.xml</Actor>
   </VisualActor>
Index: binaries/data/mods/public/simulation/templates/structures/gaul_wall_gate.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/gaul_wall_gate.xml	(revision 14215)
+++ binaries/data/mods/public/simulation/templates/structures/gaul_wall_gate.xml	(working copy)
@@ -11,6 +11,9 @@
     <Square width="38.5" depth="9.0"/>
     <Height>9.0</Height>
   </Footprint>
+  <Health>
+    <Max>1500</Max>
+  </Health>
   <Identity>
     <Civ>gaul</Civ>
     <SpecificName>Duro</SpecificName>
Index: binaries/data/mods/public/simulation/templates/structures/gaul_wall_long.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/gaul_wall_long.xml	(revision 14215)
+++ binaries/data/mods/public/simulation/templates/structures/gaul_wall_long.xml	(working copy)
@@ -1,7 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Entity parent="template_structure_defense_wall_long">
+  <Armour>
+    <Crush>20</Crush>
+  </Armour>
   <Footprint>
-    <Square width="38.5" depth="8.5"/>
+    <Square width="38.5" depth="12.5"/>
     <Height>9.0</Height>
   </Footprint>
   <Identity>
@@ -11,8 +14,13 @@
     <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>
   </Identity>
   <Obstruction>
-    <Static width="37.0" depth="7.0"/>
+    <Static width="37.0" depth="10.0"/>
   </Obstruction>
+  <TerrainModifier>
+    <Type>
+      slopeWall
+    </Type>
+  </TerrainModifier>
   <VisualActor>
     <Actor>structures/celts/wall_long.xml</Actor>
   </VisualActor>
Index: binaries/data/mods/public/simulation/templates/structures/gaul_wall_medium.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/gaul_wall_medium.xml	(revision 14215)
+++ binaries/data/mods/public/simulation/templates/structures/gaul_wall_medium.xml	(working copy)
@@ -1,7 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Entity parent="template_structure_defense_wall_medium">
+  <Armour>
+    <Crush>20</Crush>
+  </Armour>
   <Footprint>
-    <Square width="26.5" depth="8.5"/>
+    <Square width="26.5" depth="12.5"/>
     <Height>9.0</Height>
   </Footprint>
   <Health>
@@ -14,8 +17,13 @@
     <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>
   </Identity>
   <Obstruction>
-    <Static width="25.0" depth="7.0"/>
+    <Static width="25.0" depth="10.0"/>
   </Obstruction>
+  <TerrainModifier>
+    <Type>
+      slopeWall
+    </Type>
+  </TerrainModifier>
   <VisualActor>
     <Actor>structures/celts/wall_medium.xml</Actor>
   </VisualActor>
Index: binaries/data/mods/public/simulation/templates/structures/gaul_wall_short.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/gaul_wall_short.xml	(revision 14215)
+++ binaries/data/mods/public/simulation/templates/structures/gaul_wall_short.xml	(working copy)
@@ -1,7 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Entity parent="template_structure_defense_wall_short">
+  <Armour>
+    <Crush>20</Crush>
+  </Armour>
   <Footprint>
-    <Square width="14.5" depth="8.5"/>
+    <Square width="14.5" depth="12.5"/>
     <Height>9.0</Height>
   </Footprint>
   <Health>
@@ -14,8 +17,13 @@
     <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>
   </Identity>
   <Obstruction>
-    <Static width="13.0" depth="7.0"/>
+    <Static width="13.0" depth="10.0"/>
   </Obstruction>
+  <TerrainModifier>
+    <Type>
+      slopeWall
+    </Type>
+  </TerrainModifier>
   <VisualActor>
     <Actor>structures/celts/wall_short.xml</Actor>
   </VisualActor>
Index: binaries/data/mods/public/simulation/templates/structures/gaul_wall_tower.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/gaul_wall_tower.xml	(revision 14215)
+++ binaries/data/mods/public/simulation/templates/structures/gaul_wall_tower.xml	(working copy)
@@ -1,9 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Entity parent="template_structure_defense_wall_tower">
   <Attack disable=""/>
+  <Armour>
+    <Crush>20</Crush>
+  </Armour>
   <Footprint>
-    <Square width="10.0" depth="10.0"/>
-    <Height>20.0</Height>
+    <Square width="10.0" depth="13.0"/>
+    <Height>9.0</Height>
   </Footprint>
   <GarrisonHolder disable=""/>
   <Identity>
@@ -13,8 +16,13 @@
     <Tooltip>Does not shoot or garrison.</Tooltip>
   </Identity>
   <Obstruction>
-    <Static width="9.0" depth="9.0"/>
+    <Static width="9.0" depth="12.0"/>
   </Obstruction>
+  <TerrainModifier>
+    <Type>
+      slopeWall
+    </Type>
+  </TerrainModifier>
   <RallyPoint disable=""/>
   <VisualActor>
     <Actor>structures/celts/wall_tower.xml</Actor>
Index: binaries/data/mods/public/simulation/templates/structures/iber_house.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/iber_house.xml	(revision 14215)
+++ binaries/data/mods/public/simulation/templates/structures/iber_house.xml	(working copy)
@@ -19,6 +19,11 @@
     <Radius>16</Radius>
     <Weight>65536</Weight>
   </TerritoryInfluence>
+  <TerrainModifier>
+    <Type>
+      flatten
+    </Type>
+  </TerrainModifier>
   <VisualActor>
     <Actor>structures/iberians/house.xml</Actor>
     <FoundationActor>structures/fndn_2x2.xml</FoundationActor>
Index: binaries/data/mods/public/simulation/templates/template_structure_defense_wall.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_structure_defense_wall.xml	(revision 14215)
+++ binaries/data/mods/public/simulation/templates/template_structure_defense_wall.xml	(working copy)
@@ -48,6 +48,7 @@
     <Radius>20</Radius>
     <Weight>65536</Weight>
   </TerritoryInfluence>
+  <TerrainModifier disable=""/>
   <Vision>
     <Range>20</Range>
   </Vision>
Index: binaries/data/mods/public/simulation/templates/template_structure_defense_wall_long.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_structure_defense_wall_long.xml	(revision 14215)
+++ binaries/data/mods/public/simulation/templates/template_structure_defense_wall_long.xml	(working copy)
@@ -10,7 +10,7 @@
 	<SpawnEntityOnDeath>rubble/rubble_stone_wall_long</SpawnEntityOnDeath>
   </Health>
   <Identity>
-    <Classes datatype="tokens">LongWall</Classes>
-    <Tooltip>Long wall segments can be converted to gates.</Tooltip>
-  </Identity>
-</Entity>
+    <Classes datatype="tokens">LongWall</Classes>
+    <Tooltip>Long wall segments can be converted to gates.</Tooltip>
+  </Identity>
+</Entity>
Index: binaries/data/mods/public/simulation/templates/template_structure_defense_wall_tower.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_structure_defense_wall_tower.xml	(revision 14215)
+++ binaries/data/mods/public/simulation/templates/template_structure_defense_wall_tower.xml	(working copy)
@@ -85,6 +85,7 @@
   <StatusBars>
     <HeightOffset>20.0</HeightOffset>
   </StatusBars>
+  <TerrainModifier disable=""/>
   <TerritoryInfluence>
     <Root>false</Root>
     <Radius>20</Radius>
Index: binaries/data/mods/public/simulation/templates/template_structure_military_dock.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_structure_military_dock.xml	(revision 14215)
+++ binaries/data/mods/public/simulation/templates/template_structure_military_dock.xml	(working copy)
@@ -53,6 +53,7 @@
     </SoundGroups>
   </Sound>
   <TerritoryDecay disable=""/>
+  <TerrainModifier disable=""/>
   <ProductionQueue>
     <BatchTimeModifier>0.8</BatchTimeModifier>
     <Entities datatype="tokens">
Index: source/simulation2/TypeList.h
===================================================================
--- source/simulation2/TypeList.h	(revision 14215)
+++ source/simulation2/TypeList.h	(working copy)
@@ -148,6 +148,9 @@
 INTERFACE(Terrain)
 COMPONENT(Terrain)
 
+INTERFACE(TerrainModifier)
+COMPONENT(TerrainModifierScripted)
+
 INTERFACE(TerritoryInfluence)
 COMPONENT(TerritoryInfluence)
 
Index: source/simulation2/components/CCmpTerrain.cpp
===================================================================
--- source/simulation2/components/CCmpTerrain.cpp	(revision 14215)
+++ source/simulation2/components/CCmpTerrain.cpp	(working copy)
@@ -20,13 +20,18 @@
 #include "simulation2/system/Component.h"
 #include "ICmpTerrain.h"
 
+#include "ICmpTerrainModifier.h"
 #include "ICmpObstructionManager.h"
 #include "ICmpRangeManager.h"
+#include "ICmpPosition.h"
 #include "simulation2/MessageTypes.h"
+#include "simulation2/helpers/Geometry.h"
 
 #include "graphics/Terrain.h"
 #include "renderer/Renderer.h"
 #include "renderer/WaterManager.h"
+#include "graphics/Patch.h"
+#include "maths/MathUtil.h"
 #include "maths/Vector3D.h"
 
 class CCmpTerrain : public ICmpTerrain
@@ -40,6 +45,10 @@
 
 	CTerrain* m_Terrain; // not null
 
+	std::vector<u16> m_SimHeightmap;
+	ssize_t m_MapSizePatches;
+
+
 	static std::string GetSchema()
 	{
 		return "<a:component type='system'/><empty/>";
@@ -48,6 +57,8 @@
 	virtual void Init(const CParamNode& UNUSED(paramNode))
 	{
 		m_Terrain = &GetSimContext().GetTerrain();
+		m_MapSizePatches = 0;
+		ReloadTerrain();
 	}
 
 	virtual void Deinit()
@@ -68,6 +79,21 @@
 		return m_Terrain->GetVerticesPerSide() != 0;
 	}
 
+
+	virtual u16* GetSimHeightMap()
+	{
+		return &m_SimHeightmap[0];
+	}
+
+	virtual void MakeVisualTerrainDirty()
+	{
+		if (m_Terrain->GetPatchesPerSide() != m_MapSizePatches)
+			m_Terrain->Resize(m_MapSizePatches);
+
+		if (m_MapSizePatches)
+			RecalculateVisualHeightmap();
+	}
+
 	virtual CFixedVector3D CalcNormal(entity_pos_t x, entity_pos_t z)
 	{
 		CFixedVector3D normal;
@@ -83,7 +109,6 @@
 	virtual entity_pos_t GetGroundLevel(entity_pos_t x, entity_pos_t z)
 	{
 		// TODO: this can crash if the terrain heightmap isn't initialised yet
-
 		return m_Terrain->GetExactGroundLevelFixed(x, z);
 	}
 
@@ -94,7 +119,7 @@
 
 	virtual u16 GetTilesPerSide()
 	{
-		ssize_t tiles = m_Terrain->GetTilesPerSide();
+		ssize_t tiles = m_MapSizePatches * PATCH_SIZE;
 		ENSURE(1 <= tiles && tiles <= 65535);
 		return (u16)tiles;
 	}
@@ -101,8 +126,8 @@
 
 	virtual u16 GetVerticesPerSide()
 	{
-		ssize_t vertices = m_Terrain->GetVerticesPerSide();
-		ENSURE(1 <= vertices && vertices <= 65535);
+		ssize_t vertices = m_MapSizePatches * PATCH_SIZE + 1;
+		ENSURE(1 < vertices && vertices <= 65535);
 		return (u16)vertices;
 	}
 
@@ -111,10 +136,115 @@
 		return m_Terrain;
 	}
 
+	struct IterateHeightmapAverage
+	{
+		u16* heightmap;
+		int pitch;
+
+		// weighted sum of the wanted heights
+		fixed* avgHeightmap;
+		// sum of the weights
+		fixed* sumWeightmap;
+
+		void operator()(int i, int j, fixed weight, fixed newHeight)
+		{
+			if (weight > fixed::Zero())
+			{
+				fixed sumWeight = sumWeightmap[i+j*pitch] + weight;
+				// avoid overflows by dividing before multiplying
+				avgHeightmap[i+j*pitch] = (avgHeightmap[i+j*pitch]/sumWeight).Multiply(sumWeightmap[i+j*pitch]) + (newHeight/sumWeight).Multiply(weight);
+				
+				sumWeightmap[i+j*pitch] = sumWeight;
+				int h = HEIGHT_UNITS_PER_METRE*avgHeightmap[i+j*pitch].ToInt_RoundToNearest();
+				heightmap[i + j*pitch] = Clamp(h, 0, 65535);
+			}
+		}
+	};
+
+	template<typename T>
+	void IterateHeightmap(T& callback, CFixedVector2D pos, fixed angle, entity_id_t ent)
+	{
+		CmpPtr<ICmpTerrainModifier> CCmpTerrainModifier(GetSimContext(), ent);
+		// get the bbox, multiply by sqrt(2)/2 (rounded up) to get half the size and take
+		// account of possible rotations
+		fixed BBoxSize = CCmpTerrainModifier->GetBBox()/2;
+		fixed maxBBoxSize = BBoxSize*142/100;
+		int numVerts = m_MapSizePatches*PATCH_SIZE + 1;
+
+		int i0 = ((pos.X - maxBBoxSize) / TERRAIN_TILE_SIZE).ToInt_RoundToNegInfinity();
+		int i1 = ((pos.X + maxBBoxSize) / TERRAIN_TILE_SIZE).ToInt_RoundToInfinity();
+		int j0 = ((pos.Y - maxBBoxSize) / TERRAIN_TILE_SIZE).ToInt_RoundToNegInfinity();
+		int j1 = ((pos.Y + maxBBoxSize) / TERRAIN_TILE_SIZE).ToInt_RoundToInfinity();
+		i0 = Clamp(i0, 0, numVerts);
+		i1 = Clamp(i1, 0, numVerts);
+		j0 = Clamp(j0, 0, numVerts);
+		j1 = Clamp(j1, 0, numVerts);
+
+		fixed entHeight = m_Terrain->GetExactGroundLevelFixed(pos.X, pos.Y);
+		for (int j = j0; j <= j1; ++j)
+		{
+			for (int i = i0; i <= i1; ++i)
+			{
+				CFixedVector2D pt = CFixedVector2D(fixed::FromInt(i*TERRAIN_TILE_SIZE), fixed::FromInt(j*TERRAIN_TILE_SIZE)) - CFixedVector2D(pos.X, pos.Y);
+				pt = pt.Rotate(-angle);
+				if (pt.X.Absolute() > BBoxSize || pt.Y.Absolute() > BBoxSize)
+					continue;
+				fixed oldHeight = m_Terrain->GetVertexGroundLevelFixed(i, j);
+				fixed newHeight, weight;
+				CCmpTerrainModifier->GetNewHeight(pt, oldHeight, entHeight, newHeight, weight);
+				callback(i, j, weight, newHeight);
+			}
+		}
+		MakeDirty(i0, j0, i1, j1);
+	}
+
+	void RecalculateVisualHeightmap()
+	{
+		u16* heightmap = m_Terrain->GetHeightMap();
+		int pitch = m_MapSizePatches * PATCH_SIZE + 1;
+		std::vector<u16> tempHeightmap(pitch*pitch);
+		memcpy(&tempHeightmap[0], &m_SimHeightmap[0], pitch * pitch * sizeof(u16));
+		memcpy(heightmap, &m_SimHeightmap[0], pitch * pitch * sizeof(u16));
+
+		IterateHeightmapAverage callback;
+		callback.heightmap = &tempHeightmap[0];
+		callback.pitch = pitch;
+		std::vector<fixed> avgHeightmap(pitch * pitch, fixed::Zero());
+		callback.avgHeightmap = &avgHeightmap[0];
+		std::vector<fixed> sumWeightmap(pitch * pitch, fixed::Zero());
+		callback.sumWeightmap = &sumWeightmap[0];
+
+		CComponentManager::InterfaceList ents = GetSimContext().GetComponentManager().GetEntitiesWithInterface(IID_TerrainModifier);
+		for (CComponentManager::InterfaceList::const_iterator it = ents.begin(); it != ents.end(); ++it)
+		{
+			CmpPtr<ICmpPosition> cmpPosition(GetSimContext(), it->first);
+			if (cmpPosition)
+			{
+				CFixedVector2D pos = cmpPosition->GetPosition2D();
+				fixed angle = cmpPosition->GetRotation().Y;
+
+				IterateHeightmap(callback, pos, angle, it->first);
+			}
+		}
+
+		memcpy(heightmap, &tempHeightmap[0], pitch * pitch * sizeof(u16));
+		m_Terrain->MakeDirty(RENDERDATA_UPDATE_VERTICES);
+	}
+
 	virtual void ReloadTerrain()
 	{
 		// TODO: should refactor this code to be nicer
+		m_MapSizePatches = m_Terrain->GetPatchesPerSide();
+		if (!m_MapSizePatches) 
+			return;// terrain wasn't loaded yet, this method must be called manually 
 
+		size_t size = (m_MapSizePatches * PATCH_SIZE + 1)*(m_MapSizePatches * PATCH_SIZE + 1);
+		m_SimHeightmap.resize(size);
+		if (m_Terrain->GetHeightMap())
+			memcpy(&m_SimHeightmap[0], m_Terrain->GetHeightMap(), size*sizeof(u16));
+		else
+			memset(&m_SimHeightmap[0], 0, size*sizeof(u16));
+
 		u16 tiles = GetTilesPerSide();
 		u16 vertices = GetVerticesPerSide();
 
@@ -138,7 +268,8 @@
 		if (CRenderer::IsInitialised())
 			g_Renderer.GetWaterManager()->SetMapSize(vertices);
 
-		MakeDirty(0, 0, tiles+1, tiles+1);
+		MakeVisualTerrainDirty();
+		MakeDirty(0, 0, tiles + 1, tiles + 1);
 	}
 
 	virtual void MakeDirty(i32 i0, i32 j0, i32 i1, i32 j1)
Index: source/simulation2/components/ICmpTerrain.cpp
===================================================================
--- source/simulation2/components/ICmpTerrain.cpp	(revision 14215)
+++ source/simulation2/components/ICmpTerrain.cpp	(working copy)
@@ -24,4 +24,5 @@
 BEGIN_INTERFACE_WRAPPER(Terrain)
 DEFINE_INTERFACE_METHOD_2("GetGroundLevel", entity_pos_t, ICmpTerrain, GetGroundLevel, entity_pos_t, entity_pos_t)
 DEFINE_INTERFACE_METHOD_2("CalcNormal", CFixedVector3D, ICmpTerrain, CalcNormal, entity_pos_t, entity_pos_t)
+DEFINE_INTERFACE_METHOD_0("MakeVisualTerrainDirty", void, ICmpTerrain, MakeVisualTerrainDirty)
 END_INTERFACE_WRAPPER(Terrain)
Index: source/simulation2/components/ICmpTerrain.h
===================================================================
--- source/simulation2/components/ICmpTerrain.h	(revision 14215)
+++ source/simulation2/components/ICmpTerrain.h	(working copy)
@@ -32,6 +32,10 @@
 public:
 	virtual bool IsLoaded() = 0;
 
+	virtual u16* GetSimHeightMap() = 0;
+
+	virtual void MakeVisualTerrainDirty() = 0;
+
 	virtual CFixedVector3D CalcNormal(entity_pos_t x, entity_pos_t z) = 0;
 
 	virtual CVector3D CalcExactNormal(float x, float z) = 0;
Index: source/simulation2/system/ComponentTest.h
===================================================================
--- source/simulation2/system/ComponentTest.h	(revision 14215)
+++ source/simulation2/system/ComponentTest.h	(working copy)
@@ -229,4 +229,13 @@
 	virtual void ReloadTerrain()
 	{
 	}
+
+	virtual void MakeVisualTerrainDirty()
+	{
+	}
+
+	virtual u16* GetSimHeightMap()
+	{
+		return NULL;
+	}
 };
Index: source/tools/atlas/GameInterface/Handlers/ElevationHandlers.cpp
===================================================================
--- source/tools/atlas/GameInterface/Handlers/ElevationHandlers.cpp	(revision 14215)
+++ source/tools/atlas/GameInterface/Handlers/ElevationHandlers.cpp	(working copy)
@@ -41,6 +41,9 @@
 	void Init()
 	{
 		m_Heightmap = g_Game->GetWorld()->GetTerrain()->GetHeightMap();
+		CmpPtr<ICmpTerrain> cmpTerrain(*g_Game->GetSimulation2(), SYSTEM_ENTITY);
+		if (cmpTerrain)
+			m_SimHeightmap = cmpTerrain->GetSimHeightMap();
 		m_VertsPerSide = g_Game->GetWorld()->GetTerrain()->GetVerticesPerSide();
 	}
 
@@ -90,9 +93,12 @@
 	void setNew(ssize_t x, ssize_t y, const u16& val)
 	{
 		m_Heightmap[y*m_VertsPerSide + x] = val;
+		if (m_SimHeightmap)
+			m_SimHeightmap[y*m_VertsPerSide + x] = val;
 	}
 
 	u16* m_Heightmap;
+	u16* m_SimHeightmap;
 	ssize_t m_VertsPerSide;
 };
 
