Ticket #2264: terrainModifier.2.diff
File terrainModifier.2.diff, 38.1 KB (added by , 10 years ago) |
---|
-
binaries/data/mods/public/art/actors/structures/celts/wall_long.xml
2 2 <actor version="1"> 3 3 <castshadow/> 4 4 <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> 18 7 <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"/> 22 9 </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> 23 15 </variant> 24 16 </group> 25 <material> player_trans_ao_parallax_spec.xml</material>17 <material>basic_trans.xml</material> 26 18 </actor> -
binaries/data/mods/public/art/actors/structures/celts/wall_medium.xml
2 2 <actor version="1"> 3 3 <castshadow/> 4 4 <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> 18 7 <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"/> 22 9 </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> 23 15 </variant> 24 16 </group> 25 <material>player_trans_ao_parallax_spec.xml</material>17 <material>basic_trans.xml</material> 26 18 </actor> -
binaries/data/mods/public/art/actors/structures/celts/wall_short.xml
2 2 <actor version="1"> 3 3 <castshadow/> 4 4 <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> 18 7 <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"/> 22 9 </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> 23 15 </variant> 24 16 </group> 25 <material> player_trans_ao_parallax_spec.xml</material>17 <material>basic_trans.xml</material> 26 18 </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"?> 2 2 <actor version="1"> 3 3 <castshadow/> 4 4 <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> 7 7 <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"/> 11 9 </props> 12 10 <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> 18 15 </variant> 19 16 </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> 36 18 </actor> -
binaries/data/mods/public/simulation/templates/structures/brit_wall_gate.xml
11 11 <Square width="38.5" depth="9.0"/> 12 12 <Height>9.0</Height> 13 13 </Footprint> 14 <Health> 15 <Max>1500</Max> 16 </Health> 14 17 <Identity> 15 18 <Civ>brit</Civ> 16 19 <SpecificName>Dor</SpecificName> -
binaries/data/mods/public/simulation/templates/structures/brit_wall_long.xml
1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <Entity parent="template_structure_defense_wall_long"> 3 <Armour> 4 <Crush>20</Crush> 5 </Armour> 3 6 <Footprint> 4 <Square width="38.5" depth=" 8.5"/>7 <Square width="38.5" depth="12.5"/> 5 8 <Height>9.0</Height> 6 9 </Footprint> 7 10 <Identity> … … 11 14 <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> 12 15 </Identity> 13 16 <Obstruction> 14 <Static width="37.0" depth=" 7.0"/>17 <Static width="37.0" depth="10.0"/> 15 18 </Obstruction> 19 <TerrainModifier> 20 <Type> 21 slopeWall 22 </Type> 23 </TerrainModifier> 16 24 <VisualActor> 17 25 <Actor>structures/celts/wall_long.xml</Actor> 18 26 </VisualActor> -
binaries/data/mods/public/simulation/templates/structures/brit_wall_medium.xml
1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <Entity parent="template_structure_defense_wall_medium"> 3 <Armour> 4 <Crush>20</Crush> 5 </Armour> 3 6 <Footprint> 4 <Square width="26.5" depth=" 8.5"/>7 <Square width="26.5" depth="12.5"/> 5 8 <Height>9.0</Height> 6 9 </Footprint> 7 10 <Health> … … 14 17 <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> 15 18 </Identity> 16 19 <Obstruction> 17 <Static width="25.0" depth=" 7.0"/>20 <Static width="25.0" depth="10.0"/> 18 21 </Obstruction> 22 <TerrainModifier> 23 <Type> 24 slopeWall 25 </Type> 26 </TerrainModifier> 19 27 <VisualActor> 20 28 <Actor>structures/celts/wall_medium.xml</Actor> 21 29 </VisualActor> -
binaries/data/mods/public/simulation/templates/structures/brit_wall_short.xml
1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <Entity parent="template_structure_defense_wall_short"> 3 <Armour> 4 <Crush>20</Crush> 5 </Armour> 3 6 <Footprint> 4 <Square width="14.5" depth=" 8.5"/>7 <Square width="14.5" depth="12.5"/> 5 8 <Height>9.0</Height> 6 9 </Footprint> 7 10 <Health> … … 14 17 <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> 15 18 </Identity> 16 19 <Obstruction> 17 <Static width="13.0" depth=" 7.0"/>20 <Static width="13.0" depth="10.0"/> 18 21 </Obstruction> 22 <TerrainModifier> 23 <Type> 24 slopeWall 25 </Type> 26 </TerrainModifier> 19 27 <VisualActor> 20 28 <Actor>structures/celts/wall_short.xml</Actor> 21 29 </VisualActor> -
binaries/data/mods/public/simulation/templates/structures/brit_wall_tower.xml
1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <Entity parent="template_structure_defense_wall_tower"> 3 3 <Attack disable=""/> 4 <Armour> 5 <Crush>20</Crush> 6 </Armour> 4 7 <Footprint> 5 <Square width="10.0" depth="1 0.0"/>6 <Height> 20.0</Height>8 <Square width="10.0" depth="13.0"/> 9 <Height>9.0</Height> 7 10 </Footprint> 8 11 <GarrisonHolder disable=""/> 9 12 <Identity> … … 13 16 <Tooltip>Does not shoot or garrison.</Tooltip> 14 17 </Identity> 15 18 <Obstruction> 16 <Static width="9.0" depth=" 9.0"/>19 <Static width="9.0" depth="12.0"/> 17 20 </Obstruction> 21 <TerrainModifier> 22 <Type> 23 slopeWall 24 </Type> 25 </TerrainModifier> 18 26 <RallyPoint disable=""/> 19 27 <VisualActor> 20 28 <Actor>structures/celts/wall_tower.xml</Actor> -
binaries/data/mods/public/simulation/templates/structures/celt_wall_gate.xml
11 11 <Square width="38.5" depth="9.0"/> 12 12 <Height>9.0</Height> 13 13 </Footprint> 14 <Health> 15 <Max>1500</Max> 16 </Health> 14 17 <Identity> 15 18 <Civ>celt</Civ> 16 19 <SpecificName>Gate</SpecificName> -
binaries/data/mods/public/simulation/templates/structures/celt_wall_long.xml
1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <Entity parent="template_structure_defense_wall_long"> 3 <Armour> 4 <Crush>20</Crush> 5 </Armour> 3 6 <Footprint> 4 <Square width="38.5" depth=" 8.5"/>7 <Square width="38.5" depth="12.5"/> 5 8 <Height>9.0</Height> 6 9 </Footprint> 7 10 <Identity> … … 11 14 <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> 12 15 </Identity> 13 16 <Obstruction> 14 <Static width="37.0" depth=" 7.0"/>17 <Static width="37.0" depth="10.0"/> 15 18 </Obstruction> 19 <TerrainModifier> 20 <Type> 21 slopeWall 22 </Type> 23 </TerrainModifier> 16 24 <VisualActor> 17 25 <Actor>structures/celts/wall_long.xml</Actor> 18 26 </VisualActor> -
binaries/data/mods/public/simulation/templates/structures/celt_wall_medium.xml
1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <Entity parent="template_structure_defense_wall_medium"> 3 <Armour> 4 <Crush>20</Crush> 5 </Armour> 3 6 <Footprint> 4 <Square width="26.5" depth=" 8.5"/>7 <Square width="26.5" depth="12.5"/> 5 8 <Height>9.0</Height> 6 9 </Footprint> 7 10 <Health> … … 14 17 <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> 15 18 </Identity> 16 19 <Obstruction> 17 <Static width="25.0" depth=" 7.0"/>20 <Static width="25.0" depth="10.0"/> 18 21 </Obstruction> 22 <TerrainModifier> 23 <Type> 24 slopeWall 25 </Type> 26 </TerrainModifier> 19 27 <VisualActor> 20 28 <Actor>structures/celts/wall_medium.xml</Actor> 21 29 </VisualActor> -
binaries/data/mods/public/simulation/templates/structures/celt_wall_short.xml
1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <Entity parent="template_structure_defense_wall_short"> 3 <Armour> 4 <Crush>20</Crush> 5 </Armour> 3 6 <Footprint> 4 <Square width="14.5" depth=" 8.5"/>7 <Square width="14.5" depth="12.5"/> 5 8 <Height>9.0</Height> 6 9 </Footprint> 7 10 <Health> … … 14 17 <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> 15 18 </Identity> 16 19 <Obstruction> 17 <Static width="13.0" depth=" 7.0"/>20 <Static width="13.0" depth="10.0"/> 18 21 </Obstruction> 22 <TerrainModifier> 23 <Type> 24 slopeWall 25 </Type> 26 </TerrainModifier> 19 27 <VisualActor> 20 28 <Actor>structures/celts/wall_short.xml</Actor> 21 29 </VisualActor> -
binaries/data/mods/public/simulation/templates/structures/celt_wall_tower.xml
1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <Entity parent="template_structure_defense_wall_tower"> 3 3 <Attack disable=""/> 4 <Armour> 5 <Crush>20</Crush> 6 </Armour> 4 7 <Footprint> 5 <Square width="10.0" depth="1 0.0"/>6 <Height> 20.0</Height>8 <Square width="10.0" depth="13.0"/> 9 <Height>9.0</Height> 7 10 </Footprint> 8 11 <GarrisonHolder disable=""/> 9 12 <Identity> … … 13 16 <Tooltip>Does not shoot or garrison.</Tooltip> 14 17 </Identity> 15 18 <Obstruction> 16 <Static width="9.0" depth=" 9.0"/>19 <Static width="9.0" depth="12.0"/> 17 20 </Obstruction> 18 21 <RallyPoint disable=""/> 22 <TerrainModifier> 23 <Type> 24 slopeWall 25 </Type> 26 </TerrainModifier> 19 27 <VisualActor> 20 28 <Actor>structures/celts/wall_tower.xml</Actor> 21 29 </VisualActor> -
binaries/data/mods/public/simulation/templates/structures/gaul_wall_gate.xml
11 11 <Square width="38.5" depth="9.0"/> 12 12 <Height>9.0</Height> 13 13 </Footprint> 14 <Health> 15 <Max>1500</Max> 16 </Health> 14 17 <Identity> 15 18 <Civ>gaul</Civ> 16 19 <SpecificName>Duro</SpecificName> -
binaries/data/mods/public/simulation/templates/structures/gaul_wall_long.xml
1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <Entity parent="template_structure_defense_wall_long"> 3 <Armour> 4 <Crush>20</Crush> 5 </Armour> 3 6 <Footprint> 4 <Square width="38.5" depth=" 8.5"/>7 <Square width="38.5" depth="12.5"/> 5 8 <Height>9.0</Height> 6 9 </Footprint> 7 10 <Identity> … … 11 14 <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> 12 15 </Identity> 13 16 <Obstruction> 14 <Static width="37.0" depth=" 7.0"/>17 <Static width="37.0" depth="10.0"/> 15 18 </Obstruction> 19 <TerrainModifier> 20 <Type> 21 slopeWall 22 </Type> 23 </TerrainModifier> 16 24 <VisualActor> 17 25 <Actor>structures/celts/wall_long.xml</Actor> 18 26 </VisualActor> -
binaries/data/mods/public/simulation/templates/structures/gaul_wall_medium.xml
1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <Entity parent="template_structure_defense_wall_medium"> 3 <Armour> 4 <Crush>20</Crush> 5 </Armour> 3 6 <Footprint> 4 <Square width="26.5" depth=" 8.5"/>7 <Square width="26.5" depth="12.5"/> 5 8 <Height>9.0</Height> 6 9 </Footprint> 7 10 <Health> … … 14 17 <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> 15 18 </Identity> 16 19 <Obstruction> 17 <Static width="25.0" depth=" 7.0"/>20 <Static width="25.0" depth="10.0"/> 18 21 </Obstruction> 22 <TerrainModifier> 23 <Type> 24 slopeWall 25 </Type> 26 </TerrainModifier> 19 27 <VisualActor> 20 28 <Actor>structures/celts/wall_medium.xml</Actor> 21 29 </VisualActor> -
binaries/data/mods/public/simulation/templates/structures/gaul_wall_short.xml
1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <Entity parent="template_structure_defense_wall_short"> 3 <Armour> 4 <Crush>20</Crush> 5 </Armour> 3 6 <Footprint> 4 <Square width="14.5" depth=" 8.5"/>7 <Square width="14.5" depth="12.5"/> 5 8 <Height>9.0</Height> 6 9 </Footprint> 7 10 <Health> … … 14 17 <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> 15 18 </Identity> 16 19 <Obstruction> 17 <Static width="13.0" depth=" 7.0"/>20 <Static width="13.0" depth="10.0"/> 18 21 </Obstruction> 22 <TerrainModifier> 23 <Type> 24 slopeWall 25 </Type> 26 </TerrainModifier> 19 27 <VisualActor> 20 28 <Actor>structures/celts/wall_short.xml</Actor> 21 29 </VisualActor> -
binaries/data/mods/public/simulation/templates/structures/gaul_wall_tower.xml
1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <Entity parent="template_structure_defense_wall_tower"> 3 3 <Attack disable=""/> 4 <Armour> 5 <Crush>20</Crush> 6 </Armour> 4 7 <Footprint> 5 <Square width="10.0" depth="1 0.0"/>6 <Height> 20.0</Height>8 <Square width="10.0" depth="13.0"/> 9 <Height>9.0</Height> 7 10 </Footprint> 8 11 <GarrisonHolder disable=""/> 9 12 <Identity> … … 13 16 <Tooltip>Does not shoot or garrison.</Tooltip> 14 17 </Identity> 15 18 <Obstruction> 16 <Static width="9.0" depth=" 9.0"/>19 <Static width="9.0" depth="12.0"/> 17 20 </Obstruction> 21 <TerrainModifier> 22 <Type> 23 slopeWall 24 </Type> 25 </TerrainModifier> 18 26 <RallyPoint disable=""/> 19 27 <VisualActor> 20 28 <Actor>structures/celts/wall_tower.xml</Actor> -
binaries/data/mods/public/simulation/templates/structures/iber_house.xml
19 19 <Radius>16</Radius> 20 20 <Weight>65536</Weight> 21 21 </TerritoryInfluence> 22 <TerrainModifier> 23 <Type> 24 flatten 25 </Type> 26 </TerrainModifier> 22 27 <VisualActor> 23 28 <Actor>structures/iberians/house.xml</Actor> 24 29 <FoundationActor>structures/fndn_2x2.xml</FoundationActor> -
binaries/data/mods/public/simulation/templates/template_structure_defense_wall.xml
48 48 <Radius>20</Radius> 49 49 <Weight>65536</Weight> 50 50 </TerritoryInfluence> 51 <TerrainModifier disable=""/> 51 52 <Vision> 52 53 <Range>20</Range> 53 54 </Vision> -
binaries/data/mods/public/simulation/templates/template_structure_defense_wall_long.xml
10 10 <SpawnEntityOnDeath>rubble/rubble_stone_wall_long</SpawnEntityOnDeath> 11 11 </Health> 12 12 <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
85 85 <StatusBars> 86 86 <HeightOffset>20.0</HeightOffset> 87 87 </StatusBars> 88 <TerrainModifier disable=""/> 88 89 <TerritoryInfluence> 89 90 <Root>false</Root> 90 91 <Radius>20</Radius> -
binaries/data/mods/public/simulation/templates/template_structure_military_dock.xml
53 53 </SoundGroups> 54 54 </Sound> 55 55 <TerritoryDecay disable=""/> 56 <TerrainModifier disable=""/> 56 57 <ProductionQueue> 57 58 <BatchTimeModifier>0.8</BatchTimeModifier> 58 59 <Entities datatype="tokens"> -
source/simulation2/TypeList.h
148 148 INTERFACE(Terrain) 149 149 COMPONENT(Terrain) 150 150 151 INTERFACE(TerrainModifier) 152 COMPONENT(TerrainModifierScripted) 153 151 154 INTERFACE(TerritoryInfluence) 152 155 COMPONENT(TerritoryInfluence) 153 156 -
source/simulation2/components/CCmpTerrain.cpp
20 20 #include "simulation2/system/Component.h" 21 21 #include "ICmpTerrain.h" 22 22 23 #include "ICmpTerrainModifier.h" 23 24 #include "ICmpObstructionManager.h" 24 25 #include "ICmpRangeManager.h" 26 #include "ICmpPosition.h" 25 27 #include "simulation2/MessageTypes.h" 28 #include "simulation2/helpers/Geometry.h" 26 29 27 30 #include "graphics/Terrain.h" 28 31 #include "renderer/Renderer.h" 29 32 #include "renderer/WaterManager.h" 33 #include "graphics/Patch.h" 34 #include "maths/MathUtil.h" 30 35 #include "maths/Vector3D.h" 31 36 32 37 class CCmpTerrain : public ICmpTerrain … … 40 45 41 46 CTerrain* m_Terrain; // not null 42 47 48 std::vector<u16> m_SimHeightmap; 49 ssize_t m_MapSizePatches; 50 51 43 52 static std::string GetSchema() 44 53 { 45 54 return "<a:component type='system'/><empty/>"; … … 48 57 virtual void Init(const CParamNode& UNUSED(paramNode)) 49 58 { 50 59 m_Terrain = &GetSimContext().GetTerrain(); 60 m_MapSizePatches = 0; 61 ReloadTerrain(); 51 62 } 52 63 53 64 virtual void Deinit() … … 68 79 return m_Terrain->GetVerticesPerSide() != 0; 69 80 } 70 81 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 71 97 virtual CFixedVector3D CalcNormal(entity_pos_t x, entity_pos_t z) 72 98 { 73 99 CFixedVector3D normal; … … 83 109 virtual entity_pos_t GetGroundLevel(entity_pos_t x, entity_pos_t z) 84 110 { 85 111 // TODO: this can crash if the terrain heightmap isn't initialised yet 86 87 112 return m_Terrain->GetExactGroundLevelFixed(x, z); 88 113 } 89 114 … … 94 119 95 120 virtual u16 GetTilesPerSide() 96 121 { 97 ssize_t tiles = m_ Terrain->GetTilesPerSide();122 ssize_t tiles = m_MapSizePatches * PATCH_SIZE; 98 123 ENSURE(1 <= tiles && tiles <= 65535); 99 124 return (u16)tiles; 100 125 } … … 101 126 102 127 virtual u16 GetVerticesPerSide() 103 128 { 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); 106 131 return (u16)vertices; 107 132 } 108 133 … … 111 136 return m_Terrain; 112 137 } 113 138 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 114 234 virtual void ReloadTerrain() 115 235 { 116 236 // 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 117 240 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 118 248 u16 tiles = GetTilesPerSide(); 119 249 u16 vertices = GetVerticesPerSide(); 120 250 … … 138 268 if (CRenderer::IsInitialised()) 139 269 g_Renderer.GetWaterManager()->SetMapSize(vertices); 140 270 141 MakeDirty(0, 0, tiles+1, tiles+1); 271 MakeVisualTerrainDirty(); 272 MakeDirty(0, 0, tiles + 1, tiles + 1); 142 273 } 143 274 144 275 virtual void MakeDirty(i32 i0, i32 j0, i32 i1, i32 j1) -
source/simulation2/components/ICmpTerrain.cpp
24 24 BEGIN_INTERFACE_WRAPPER(Terrain) 25 25 DEFINE_INTERFACE_METHOD_2("GetGroundLevel", entity_pos_t, ICmpTerrain, GetGroundLevel, entity_pos_t, entity_pos_t) 26 26 DEFINE_INTERFACE_METHOD_2("CalcNormal", CFixedVector3D, ICmpTerrain, CalcNormal, entity_pos_t, entity_pos_t) 27 DEFINE_INTERFACE_METHOD_0("MakeVisualTerrainDirty", void, ICmpTerrain, MakeVisualTerrainDirty) 27 28 END_INTERFACE_WRAPPER(Terrain) -
source/simulation2/components/ICmpTerrain.h
32 32 public: 33 33 virtual bool IsLoaded() = 0; 34 34 35 virtual u16* GetSimHeightMap() = 0; 36 37 virtual void MakeVisualTerrainDirty() = 0; 38 35 39 virtual CFixedVector3D CalcNormal(entity_pos_t x, entity_pos_t z) = 0; 36 40 37 41 virtual CVector3D CalcExactNormal(float x, float z) = 0; -
source/simulation2/system/ComponentTest.h
229 229 virtual void ReloadTerrain() 230 230 { 231 231 } 232 233 virtual void MakeVisualTerrainDirty() 234 { 235 } 236 237 virtual u16* GetSimHeightMap() 238 { 239 return NULL; 240 } 232 241 }; -
source/tools/atlas/GameInterface/Handlers/ElevationHandlers.cpp
41 41 void Init() 42 42 { 43 43 m_Heightmap = g_Game->GetWorld()->GetTerrain()->GetHeightMap(); 44 CmpPtr<ICmpTerrain> cmpTerrain(*g_Game->GetSimulation2(), SYSTEM_ENTITY); 45 if (cmpTerrain) 46 m_SimHeightmap = cmpTerrain->GetSimHeightMap(); 44 47 m_VertsPerSide = g_Game->GetWorld()->GetTerrain()->GetVerticesPerSide(); 45 48 } 46 49 … … 90 93 void setNew(ssize_t x, ssize_t y, const u16& val) 91 94 { 92 95 m_Heightmap[y*m_VertsPerSide + x] = val; 96 if (m_SimHeightmap) 97 m_SimHeightmap[y*m_VertsPerSide + x] = val; 93 98 } 94 99 95 100 u16* m_Heightmap; 101 u16* m_SimHeightmap; 96 102 ssize_t m_VertsPerSide; 97 103 }; 98 104