Index: binaries/data/mods/public/simulation/components/BuildRestrictions.js
===================================================================
--- binaries/data/mods/public/simulation/components/BuildRestrictions.js	(revision 18174)
+++ binaries/data/mods/public/simulation/components/BuildRestrictions.js	(working copy)
@@ -133,17 +133,8 @@
 	if (!cmpObstruction)
 		return result; // Fail
 
+	var ret = cmpObstruction.CheckFoundation(passClassName);
 
-	if (this.template.Category == "Wall")
-	{
-		// for walls, only test the center point
-		var ret = cmpObstruction.CheckFoundation(passClassName, true);
-	}
-	else
-	{
-		var ret = cmpObstruction.CheckFoundation(passClassName, false);
-	}
-
 	if (ret != "success")
 	{
 		switch (ret)
Index: binaries/data/mods/public/simulation/templates/other/palisades_rocks_tower.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/other/palisades_rocks_tower.xml	(revision 18174)
+++ binaries/data/mods/public/simulation/templates/other/palisades_rocks_tower.xml	(working copy)
@@ -30,7 +30,7 @@
 	<RequiredTechnology>phase_village</RequiredTechnology>
   </Identity>
   <Obstruction>
-    <Static width="4.0" depth="4.0"/>
+    <Static width="4.0" depth="4.0" clearance="-1"/>
     <ControlPersist/>
   </Obstruction>
   <StatusBars>
Index: binaries/data/mods/public/simulation/templates/template_gaia_flora.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_gaia_flora.xml	(revision 18174)
+++ binaries/data/mods/public/simulation/templates/template_gaia_flora.xml	(working copy)
@@ -8,6 +8,6 @@
     <GenericName>Generic Flora</GenericName>
   </Identity>
   <Obstruction>
-    <Static width="3.0" depth="3.0"/>
+    <Static width="3.0" depth="3.0" clearance="0"/>
   </Obstruction>
 </Entity>
Index: binaries/data/mods/public/simulation/templates/template_gaia_geo.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_gaia_geo.xml	(revision 18174)
+++ binaries/data/mods/public/simulation/templates/template_gaia_geo.xml	(working copy)
@@ -8,7 +8,7 @@
     <GenericName>Generic Geology</GenericName>
   </Identity>
   <Obstruction>
-    <Static width="7.0" depth="7.0"/>
+    <Static width="7.0" depth="7.0" clearance="0"/>
   </Obstruction>
   <Position>
     <Anchor>pitch-roll</Anchor>
Index: binaries/data/mods/public/simulation/templates/template_gaia_treasure.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_gaia_treasure.xml	(revision 18174)
+++ binaries/data/mods/public/simulation/templates/template_gaia_treasure.xml	(working copy)
@@ -15,7 +15,7 @@
     <Color r="250" g="250" b="250"/>
   </Minimap>
   <Obstruction>
-    <Static width="1.5" depth="1.5"/>
+    <Static width="1.5" depth="1.5" clearance="0"/>
   </Obstruction>
   <ResourceSupply>
     <KillBeforeGather>false</KillBeforeGather>
Index: binaries/data/mods/public/simulation/templates/template_structure.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_structure.xml	(revision 18174)
+++ binaries/data/mods/public/simulation/templates/template_structure.xml	(working copy)
@@ -62,6 +62,7 @@
     <Type>structure</Type>
   </Minimap>
   <Obstruction>
+    <Static width="2" depth="2" clearance="4"/>
     <Active>true</Active>
     <BlockMovement>true</BlockMovement>
     <BlockPathfinding>true</BlockPathfinding>
Index: binaries/data/mods/public/simulation/templates/template_structure_defense_wall.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_structure_defense_wall.xml	(revision 18174)
+++ binaries/data/mods/public/simulation/templates/template_structure_defense_wall.xml	(working copy)
@@ -37,7 +37,7 @@
     <metal>0</metal>
   </Loot>
   <Obstruction>
-    <Static width="6.0" depth="6.0"/>
+    <Static width="6.0" depth="6.0" clearance="0"/>
   </Obstruction>
   <RallyPoint disable=""/>
   <Sound>
Index: binaries/data/mods/public/simulation/templates/template_structure_defense_wall_gate.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_structure_defense_wall_gate.xml	(revision 18174)
+++ binaries/data/mods/public/simulation/templates/template_structure_defense_wall_gate.xml	(working copy)
@@ -39,6 +39,7 @@
     <metal>0</metal>
   </Loot>
   <Obstruction>
+    <Static disable=""/>
     <Obstructions>
       <Right width="5" depth="5" x="10" z="0"/>
       <Left width="5" depth="5" x="-10" z="0"/>
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 18174)
+++ binaries/data/mods/public/simulation/templates/template_structure_defense_wall_tower.xml	(working copy)
@@ -64,7 +64,7 @@
     <metal>0</metal>
   </Loot>
   <Obstruction>
-    <Static width="6.0" depth="6.0"/>
+    <Static width="6.0" depth="6.0" clearance="-1"/>
     <ControlPersist/>
   </Obstruction>
   <ProductionQueue>
Index: source/simulation2/components/CCmpObstruction.cpp
===================================================================
--- source/simulation2/components/CCmpObstruction.cpp	(revision 18174)
+++ source/simulation2/components/CCmpObstruction.cpp	(working copy)
@@ -122,6 +122,9 @@
 							"<param name='minInclusive'>1.5</param>"
 						"</data>"
 					"</attribute>"
+					"<attribute name='clearance' a:help='Extra clearance to be applied when placing the entity, ensures there is passable space around it (can be negative to allow for overlap, if the overlap is small enough to not cause problems).'>"
+						"<data type='decimal'/>"
+					"</attribute>"
 				"</element>"
 				"<element name='Unit'>"
 					"<empty/>"
@@ -216,6 +219,7 @@
 			m_Type = STATIC;
 			m_Size0 = paramNode.GetChild("Static").GetChild("@width").ToFixed();
 			m_Size1 = paramNode.GetChild("Static").GetChild("@depth").ToFixed();
+			m_Clearance = paramNode.GetChild("Static").GetChild("@clearance").ToFixed();
 			ENSURE(m_Size0 > minObstruction);
 			ENSURE(m_Size1 > minObstruction);
 		}
@@ -244,6 +248,8 @@
 			}
 			m_Size0 = fixed::FromInt(2).Multiply(MAX(max.X, -min.X));
 			m_Size1 = fixed::FromInt(2).Multiply(MAX(max.Y, -min.Y));
+			// TODO perhaps support clearance per obstruction
+			m_Clearance = entity_pos_t::Zero();
 		}
 
 		m_Active = paramNode.GetChild("Active").ToBool();
@@ -525,11 +531,6 @@
 	
 	virtual EFoundationCheck CheckFoundation(std::string className)
 	{
-		return  CheckFoundation(className, false);
-	}
-
-	virtual EFoundationCheck CheckFoundation(std::string className, bool onlyCenterPoint)
-	{
 		CmpPtr<ICmpPosition> cmpPosition(GetEntityHandle());
 		if (!cmpPosition)
 			return FOUNDATION_CHECK_FAIL_ERROR; // error
@@ -560,9 +561,9 @@
 			ICmpObstructionManager::FLAG_BLOCK_FOUNDATION);
 
 		if (m_Type == UNIT)
-			return cmpPathfinder->CheckUnitPlacement(filter, pos.X, pos.Y, m_Clearance, passClass, onlyCenterPoint);
+			return cmpPathfinder->CheckUnitPlacement(filter, pos.X, pos.Y, m_Clearance, passClass);
 		else
-			return cmpPathfinder->CheckBuildingPlacement(filter, pos.X, pos.Y, cmpPosition->GetRotation().Y, m_Size0, m_Size1, GetEntityId(), passClass, onlyCenterPoint);
+			return cmpPathfinder->CheckBuildingPlacement(filter, pos.X, pos.Y, cmpPosition->GetRotation().Y, m_Size0, m_Size1, GetEntityId(), passClass, m_Clearance * 2);
 	}
 
 	virtual bool CheckDuplicateFoundation()
Index: source/simulation2/components/CCmpPathfinder.cpp
===================================================================
--- source/simulation2/components/CCmpPathfinder.cpp	(revision 18174)
+++ source/simulation2/components/CCmpPathfinder.cpp	(working copy)
@@ -801,7 +801,7 @@
 }
 
 ICmpObstruction::EFoundationCheck CCmpPathfinder::CheckUnitPlacement(const IObstructionTestFilter& filter,
-	entity_pos_t x, entity_pos_t z, entity_pos_t r,	pass_class_t passClass, bool UNUSED(onlyCenterPoint))
+	entity_pos_t x, entity_pos_t z, entity_pos_t r,	pass_class_t passClass)
 {
 	// Check unit obstruction
 	CmpPtr<ICmpObstructionManager> cmpObstructionManager(GetSystemEntity());
@@ -829,13 +829,13 @@
 	entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w,
 	entity_pos_t h, entity_id_t id, pass_class_t passClass)
 {
-	return CCmpPathfinder::CheckBuildingPlacement(filter, x, z, a, w, h, id, passClass, false);
+	return CCmpPathfinder::CheckBuildingPlacement(filter, x, z, a, w, h, id, passClass, entity_pos_t::Zero());
 }
 
 
 ICmpObstruction::EFoundationCheck CCmpPathfinder::CheckBuildingPlacement(const IObstructionTestFilter& filter,
 	entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w,
-	entity_pos_t h, entity_id_t id, pass_class_t passClass, bool UNUSED(onlyCenterPoint))
+	entity_pos_t h, entity_id_t id, pass_class_t passClass, entity_pos_t clearance)
 {
 	// Check unit obstruction
 	CmpPtr<ICmpObstructionManager> cmpObstructionManager(GetSystemEntity());
@@ -842,7 +842,7 @@
 	if (!cmpObstructionManager)
 		return ICmpObstruction::FOUNDATION_CHECK_FAIL_ERROR;
 
-	if (cmpObstructionManager->TestStaticShape(filter, x, z, a, w, h, NULL))
+	if (cmpObstructionManager->TestStaticShape(filter, x, z, a, w + clearance, h + clearance, NULL))
 		return ICmpObstruction::FOUNDATION_CHECK_FAIL_OBSTRUCTS_FOUNDATION;
 
 	// Test against terrain:
Index: source/simulation2/components/CCmpPathfinder_Common.h
===================================================================
--- source/simulation2/components/CCmpPathfinder_Common.h	(revision 18174)
+++ source/simulation2/components/CCmpPathfinder_Common.h	(working copy)
@@ -212,11 +212,11 @@
 
 	virtual bool CheckMovement(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r, pass_class_t passClass);
 
-	virtual ICmpObstruction::EFoundationCheck CheckUnitPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t r, pass_class_t passClass, bool onlyCenterPoint);
+	virtual ICmpObstruction::EFoundationCheck CheckUnitPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t r, pass_class_t passClass);
 
 	virtual ICmpObstruction::EFoundationCheck CheckBuildingPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, entity_id_t id, pass_class_t passClass);
 
-	virtual ICmpObstruction::EFoundationCheck CheckBuildingPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, entity_id_t id, pass_class_t passClass, bool onlyCenterPoint);
+	virtual ICmpObstruction::EFoundationCheck CheckBuildingPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, entity_id_t id, pass_class_t passClass, entity_pos_t clearance);
 
 	virtual void FinishAsyncRequests();
 
Index: source/simulation2/components/ICmpObstruction.cpp
===================================================================
--- source/simulation2/components/ICmpObstruction.cpp	(revision 18174)
+++ source/simulation2/components/ICmpObstruction.cpp	(working copy)
@@ -23,9 +23,9 @@
 
 #include "simulation2/system/SimContext.h"
 
-std::string ICmpObstruction::CheckFoundation_wrapper(const std::string& className, bool onlyCenterPoint)
+std::string ICmpObstruction::CheckFoundation_wrapper(const std::string& className)
 {
-	EFoundationCheck check = CheckFoundation(className, onlyCenterPoint);
+	EFoundationCheck check = CheckFoundation(className);
 
 	switch (check)
 	{
@@ -47,7 +47,7 @@
 
 BEGIN_INTERFACE_WRAPPER(Obstruction)
 DEFINE_INTERFACE_METHOD_0("GetUnitRadius", entity_pos_t, ICmpObstruction, GetUnitRadius)
-DEFINE_INTERFACE_METHOD_2("CheckFoundation", std::string, ICmpObstruction, CheckFoundation_wrapper, std::string, bool)
+DEFINE_INTERFACE_METHOD_1("CheckFoundation", std::string, ICmpObstruction, CheckFoundation_wrapper, std::string)
 DEFINE_INTERFACE_METHOD_0("CheckDuplicateFoundation", bool, ICmpObstruction, CheckDuplicateFoundation)
 DEFINE_INTERFACE_METHOD_0("GetUnitCollisions", std::vector<entity_id_t>, ICmpObstruction, GetUnitCollisions)
 DEFINE_INTERFACE_METHOD_1("SetActive", void, ICmpObstruction, SetActive, bool)
Index: source/simulation2/components/ICmpObstruction.h
===================================================================
--- source/simulation2/components/ICmpObstruction.h	(revision 18174)
+++ source/simulation2/components/ICmpObstruction.h	(working copy)
@@ -68,13 +68,12 @@
 	 *	value describing the type of failure.
 	 */
 	virtual EFoundationCheck CheckFoundation(std::string className) = 0;
-	virtual EFoundationCheck CheckFoundation(std::string className, bool onlyCenterPoint) = 0;
 
 	/**
 	 * CheckFoundation wrapper for script calls, to return friendly strings instead of an EFoundationCheck.
 	 * @return "success" if check passes, else a string describing the type of failure.
 	 */
-	virtual std::string CheckFoundation_wrapper(const std::string& className, bool onlyCenterPoint);
+	virtual std::string CheckFoundation_wrapper(const std::string& className);
 
 	/**
 	 * Test whether this entity is colliding with any obstructions that share its
Index: source/simulation2/components/ICmpPathfinder.h
===================================================================
--- source/simulation2/components/ICmpPathfinder.h	(revision 18174)
+++ source/simulation2/components/ICmpPathfinder.h	(working copy)
@@ -134,11 +134,10 @@
 	/**
 	 * Check whether a unit placed here is valid and doesn't hit any obstructions
 	 * or impassable terrain.
-	 * When onlyCenterPoint = true, only check the center tile of the unit
 	 * @return ICmpObstruction::FOUNDATION_CHECK_SUCCESS if the placement is okay, else
 	 *	a value describing the type of failure.
 	 */
-	virtual ICmpObstruction::EFoundationCheck CheckUnitPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t r, pass_class_t passClass, bool onlyCenterPoint = false) = 0;
+	virtual ICmpObstruction::EFoundationCheck CheckUnitPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t r, pass_class_t passClass) = 0;
 
 	/**
 	 * Check whether a building placed here is valid and doesn't hit any obstructions
@@ -151,11 +150,10 @@
 	/**
 	 * Check whether a building placed here is valid and doesn't hit any obstructions
 	 * or impassable terrain.
-	 * when onlyCenterPoint = true, only check the center tile of the building
 	 * @return ICmpObstruction::FOUNDATION_CHECK_SUCCESS if the placement is okay, else
 	 *	a value describing the type of failure.
 	 */
-	virtual ICmpObstruction::EFoundationCheck CheckBuildingPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, entity_id_t id, pass_class_t passClass, bool onlyCenterPoint) = 0;
+	virtual ICmpObstruction::EFoundationCheck CheckBuildingPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, entity_id_t id, pass_class_t passClass, entity_pos_t clearance) = 0;
 
 
 	/**
