Ticket #2264: terrainModifier.diff
File terrainModifier.diff, 37.9 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_medium_p.xml
Cannot display: file marked as a binary type. svn:mime-type = application/xml
-
binaries/data/mods/public/art/actors/structures/celts/wall_short.xml
Property changes on: binaries/data/mods/public/art/actors/structures/celts/wall_medium_p.xml ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/xml \ No newline at end of property
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_short_p.xml
Cannot display: file marked as a binary type. svn:mime-type = application/xml
-
binaries/data/mods/public/art/actors/structures/celts/wall_tower.xml
Property changes on: binaries/data/mods/public/art/actors/structures/celts/wall_short_p.xml ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/xml \ No newline at end of property
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/art/actors/structures/celts/wall_tower_p.xml
Cannot display: file marked as a binary type. svn:mime-type = application/xml
-
binaries/data/mods/public/simulation/templates/structures/brit_wall_long.xml
Property changes on: binaries/data/mods/public/art/actors/structures/celts/wall_tower_p.xml ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/xml \ No newline at end of property
1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <Entity parent="template_structure_defense_wall_long"> 3 3 <Footprint> 4 <Square width="38.5" depth=" 8.5"/>4 <Square width="38.5" depth="12.5"/> 5 5 <Height>9.0</Height> 6 6 </Footprint> 7 7 <Identity> … … 11 11 <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 12 </Identity> 13 13 <Obstruction> 14 <Static width="37.0" depth=" 7.0"/>14 <Static width="37.0" depth="10.0"/> 15 15 </Obstruction> 16 <TerrainModifier> 17 <Type> 18 slopeWall 19 </Type> 20 </TerrainModifier> 16 21 <VisualActor> 17 22 <Actor>structures/celts/wall_long.xml</Actor> 18 23 </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 3 <Footprint> 4 <Square width="26.5" depth=" 8.5"/>4 <Square width="26.5" depth="12.5"/> 5 5 <Height>9.0</Height> 6 6 </Footprint> 7 7 <Health> … … 14 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> 15 15 </Identity> 16 16 <Obstruction> 17 <Static width="25.0" depth=" 7.0"/>17 <Static width="25.0" depth="10.0"/> 18 18 </Obstruction> 19 <TerrainModifier> 20 <Type> 21 slopeWall 22 </Type> 23 </TerrainModifier> 19 24 <VisualActor> 20 25 <Actor>structures/celts/wall_medium.xml</Actor> 21 26 </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 3 <Footprint> 4 <Square width="14.5" depth=" 8.5"/>4 <Square width="14.5" depth="12.5"/> 5 5 <Height>9.0</Height> 6 6 </Footprint> 7 7 <Health> … … 14 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> 15 15 </Identity> 16 16 <Obstruction> 17 <Static width="13.0" depth=" 7.0"/>17 <Static width="13.0" depth="10.0"/> 18 18 </Obstruction> 19 <TerrainModifier> 20 <Type> 21 slopeWall 22 </Type> 23 </TerrainModifier> 19 24 <VisualActor> 20 25 <Actor>structures/celts/wall_short.xml</Actor> 21 26 </VisualActor> -
binaries/data/mods/public/simulation/templates/structures/brit_wall_tower.xml
2 2 <Entity parent="template_structure_defense_wall_tower"> 3 3 <Attack disable=""/> 4 4 <Footprint> 5 <Square width="10.0" depth="1 0.0"/>6 <Height> 20.0</Height>5 <Square width="10.0" depth="13.0"/> 6 <Height>9.0</Height> 7 7 </Footprint> 8 8 <GarrisonHolder disable=""/> 9 9 <Identity> … … 13 13 <Tooltip>Does not shoot or garrison.</Tooltip> 14 14 </Identity> 15 15 <Obstruction> 16 <Static width="9.0" depth=" 9.0"/>16 <Static width="9.0" depth="12.0"/> 17 17 </Obstruction> 18 <TerrainModifier> 19 <Type> 20 slopeWall 21 </Type> 22 </TerrainModifier> 18 23 <RallyPoint disable=""/> 19 24 <VisualActor> 20 25 <Actor>structures/celts/wall_tower.xml</Actor> -
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 3 <Footprint> 4 <Square width="38.5" depth=" 8.5"/>4 <Square width="38.5" depth="12.5"/> 5 5 <Height>9.0</Height> 6 6 </Footprint> 7 7 <Identity> … … 11 11 <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 12 </Identity> 13 13 <Obstruction> 14 <Static width="37.0" depth=" 7.0"/>14 <Static width="37.0" depth="10.0"/> 15 15 </Obstruction> 16 <TerrainModifier> 17 <Type> 18 slopeWall 19 </Type> 20 </TerrainModifier> 16 21 <VisualActor> 17 22 <Actor>structures/celts/wall_long.xml</Actor> 18 23 </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 3 <Footprint> 4 <Square width="26.5" depth=" 8.5"/>4 <Square width="26.5" depth="12.5"/> 5 5 <Height>9.0</Height> 6 6 </Footprint> 7 7 <Health> … … 14 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> 15 15 </Identity> 16 16 <Obstruction> 17 <Static width="25.0" depth=" 7.0"/>17 <Static width="25.0" depth="10.0"/> 18 18 </Obstruction> 19 <TerrainModifier> 20 <Type> 21 slopeWall 22 </Type> 23 </TerrainModifier> 19 24 <VisualActor> 20 25 <Actor>structures/celts/wall_medium.xml</Actor> 21 26 </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 3 <Footprint> 4 <Square width="14.5" depth=" 8.5"/>4 <Square width="14.5" depth="12.5"/> 5 5 <Height>9.0</Height> 6 6 </Footprint> 7 7 <Health> … … 14 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> 15 15 </Identity> 16 16 <Obstruction> 17 <Static width="13.0" depth=" 7.0"/>17 <Static width="13.0" depth="10.0"/> 18 18 </Obstruction> 19 <TerrainModifier> 20 <Type> 21 slopeWall 22 </Type> 23 </TerrainModifier> 19 24 <VisualActor> 20 25 <Actor>structures/celts/wall_short.xml</Actor> 21 26 </VisualActor> -
binaries/data/mods/public/simulation/templates/structures/celt_wall_tower.xml
2 2 <Entity parent="template_structure_defense_wall_tower"> 3 3 <Attack disable=""/> 4 4 <Footprint> 5 <Square width="10.0" depth="1 0.0"/>6 <Height> 20.0</Height>5 <Square width="10.0" depth="13.0"/> 6 <Height>9.0</Height> 7 7 </Footprint> 8 8 <GarrisonHolder disable=""/> 9 9 <Identity> … … 13 13 <Tooltip>Does not shoot or garrison.</Tooltip> 14 14 </Identity> 15 15 <Obstruction> 16 <Static width="9.0" depth=" 9.0"/>16 <Static width="9.0" depth="12.0"/> 17 17 </Obstruction> 18 18 <RallyPoint disable=""/> 19 <TerrainModifier> 20 <Type> 21 slopeWall 22 </Type> 23 </TerrainModifier> 19 24 <VisualActor> 20 25 <Actor>structures/celts/wall_tower.xml</Actor> 21 26 </VisualActor> -
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 3 <Footprint> 4 <Square width="38.5" depth=" 8.5"/>4 <Square width="38.5" depth="12.5"/> 5 5 <Height>9.0</Height> 6 6 </Footprint> 7 7 <Identity> … … 11 11 <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 12 </Identity> 13 13 <Obstruction> 14 <Static width="37.0" depth=" 7.0"/>14 <Static width="37.0" depth="10.0"/> 15 15 </Obstruction> 16 <TerrainModifier> 17 <Type> 18 slopeWall 19 </Type> 20 </TerrainModifier> 16 21 <VisualActor> 17 22 <Actor>structures/celts/wall_long.xml</Actor> 18 23 </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 3 <Footprint> 4 <Square width="26.5" depth=" 8.5"/>4 <Square width="26.5" depth="12.5"/> 5 5 <Height>9.0</Height> 6 6 </Footprint> 7 7 <Health> … … 14 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> 15 15 </Identity> 16 16 <Obstruction> 17 <Static width="25.0" depth=" 7.0"/>17 <Static width="25.0" depth="10.0"/> 18 18 </Obstruction> 19 <TerrainModifier> 20 <Type> 21 slopeWall 22 </Type> 23 </TerrainModifier> 19 24 <VisualActor> 20 25 <Actor>structures/celts/wall_medium.xml</Actor> 21 26 </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 3 <Footprint> 4 <Square width="14.5" depth=" 8.5"/>4 <Square width="14.5" depth="12.5"/> 5 5 <Height>9.0</Height> 6 6 </Footprint> 7 7 <Health> … … 14 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> 15 15 </Identity> 16 16 <Obstruction> 17 <Static width="13.0" depth=" 7.0"/>17 <Static width="13.0" depth="10.0"/> 18 18 </Obstruction> 19 <TerrainModifier> 20 <Type> 21 slopeWall 22 </Type> 23 </TerrainModifier> 19 24 <VisualActor> 20 25 <Actor>structures/celts/wall_short.xml</Actor> 21 26 </VisualActor> -
binaries/data/mods/public/simulation/templates/structures/gaul_wall_tower.xml
2 2 <Entity parent="template_structure_defense_wall_tower"> 3 3 <Attack disable=""/> 4 4 <Footprint> 5 <Square width="10.0" depth="1 0.0"/>5 <Square width="10.0" depth="13.0"/> 6 6 <Height>20.0</Height> 7 7 </Footprint> 8 8 <GarrisonHolder disable=""/> … … 13 13 <Tooltip>Does not shoot or garrison.</Tooltip> 14 14 </Identity> 15 15 <Obstruction> 16 <Static width="9.0" depth=" 9.0"/>16 <Static width="9.0" depth="12.0"/> 17 17 </Obstruction> 18 <TerrainModifier> 19 <Type> 20 slopeWall 21 </Type> 22 </TerrainModifier> 18 23 <RallyPoint disable=""/> 19 24 <VisualActor> 20 25 <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; 51 61 } 52 62 53 63 virtual void Deinit() … … 68 78 return m_Terrain->GetVerticesPerSide() != 0; 69 79 } 70 80 81 82 virtual u16* GetSimHeightMap() 83 { 84 return &m_SimHeightmap[0]; 85 } 86 87 virtual void MakeVisualTerrainDirty() 88 { 89 if (m_Terrain->GetPatchesPerSide() != m_MapSizePatches) 90 m_Terrain->Resize(m_MapSizePatches); 91 92 if (m_MapSizePatches) 93 RecalculateVisualHeightmap(); 94 } 95 71 96 virtual CFixedVector3D CalcNormal(entity_pos_t x, entity_pos_t z) 72 97 { 73 98 CFixedVector3D normal; … … 83 108 virtual entity_pos_t GetGroundLevel(entity_pos_t x, entity_pos_t z) 84 109 { 85 110 // TODO: this can crash if the terrain heightmap isn't initialised yet 86 87 111 return m_Terrain->GetExactGroundLevelFixed(x, z); 88 112 } 89 113 … … 94 118 95 119 virtual u16 GetTilesPerSide() 96 120 { 97 ssize_t tiles = m_ Terrain->GetTilesPerSide();121 ssize_t tiles = m_MapSizePatches * PATCH_SIZE; 98 122 ENSURE(1 <= tiles && tiles <= 65535); 99 123 return (u16)tiles; 100 124 } … … 101 125 102 126 virtual u16 GetVerticesPerSide() 103 127 { 104 ssize_t vertices = m_ Terrain->GetVerticesPerSide();105 ENSURE(1 < =vertices && vertices <= 65535);128 ssize_t vertices = m_MapSizePatches * PATCH_SIZE + 1; 129 ENSURE(1 < vertices && vertices <= 65535); 106 130 return (u16)vertices; 107 131 } 108 132 … … 111 135 return m_Terrain; 112 136 } 113 137 138 struct IterateHeightmapAverage 139 { 140 u16* heightmap; 141 int pitch; 142 143 // weighted sum of the wanted heights 144 fixed* avgHeightmap; 145 // sum of the weights 146 fixed* sumWeightmap; 147 148 void operator()(int i, int j, fixed weight, fixed newHeight) 149 { 150 if (weight > fixed::Zero()) 151 { 152 fixed sumWeight = sumWeightmap[i+j*pitch] + weight; 153 // avoid overflows by dividing before multiplying 154 avgHeightmap[i+j*pitch] = (avgHeightmap[i+j*pitch]/sumWeight).Multiply(sumWeightmap[i+j*pitch]) + (newHeight/sumWeight).Multiply(weight); 155 156 sumWeightmap[i+j*pitch] = sumWeight; 157 int h = HEIGHT_UNITS_PER_METRE*avgHeightmap[i+j*pitch].ToInt_RoundToNearest(); 158 heightmap[i + j*pitch] = Clamp(h, 0, 65535); 159 } 160 } 161 }; 162 163 template<typename T> 164 void IterateHeightmap(T& callback, CFixedVector2D pos, fixed angle, entity_id_t ent) 165 { 166 CmpPtr<ICmpTerrainModifier> CCmpTerrainModifier(GetSimContext(), ent); 167 // get the bbox, multiply by sqrt(2)/2 (rounded up) to get half the size and take 168 // account of possible rotations 169 fixed BBoxSize = CCmpTerrainModifier->GetBBox()/2; 170 fixed maxBBoxSize = BBoxSize*142/100; 171 int numVerts = m_MapSizePatches*PATCH_SIZE + 1; 172 173 int i0 = ((pos.X - maxBBoxSize) / TERRAIN_TILE_SIZE).ToInt_RoundToNegInfinity(); 174 int i1 = ((pos.X + maxBBoxSize) / TERRAIN_TILE_SIZE).ToInt_RoundToInfinity(); 175 int j0 = ((pos.Y - maxBBoxSize) / TERRAIN_TILE_SIZE).ToInt_RoundToNegInfinity(); 176 int j1 = ((pos.Y + maxBBoxSize) / TERRAIN_TILE_SIZE).ToInt_RoundToInfinity(); 177 i0 = Clamp(i0, 0, numVerts); 178 i1 = Clamp(i1, 0, numVerts); 179 j0 = Clamp(j0, 0, numVerts); 180 j1 = Clamp(j1, 0, numVerts); 181 182 fixed entHeight = m_Terrain->GetExactGroundLevelFixed(pos.X, pos.Y); 183 for (int j = j0; j <= j1; ++j) 184 { 185 for (int i = i0; i <= i1; ++i) 186 { 187 CFixedVector2D pt = CFixedVector2D(fixed::FromInt(i*TERRAIN_TILE_SIZE), fixed::FromInt(j*TERRAIN_TILE_SIZE)) - CFixedVector2D(pos.X, pos.Y); 188 pt = pt.Rotate(-angle); 189 if (pt.X.Absolute() > BBoxSize || pt.Y.Absolute() > BBoxSize) 190 continue; 191 fixed oldHeight = m_Terrain->GetVertexGroundLevelFixed(i, j); 192 fixed newHeight, weight; 193 CCmpTerrainModifier->GetNewHeight(pt, oldHeight, entHeight, newHeight, weight); 194 callback(i, j, weight, newHeight); 195 } 196 } 197 MakeDirty(i0, j0, i1, j1); 198 } 199 200 void RecalculateVisualHeightmap() 201 { 202 u16* heightmap = m_Terrain->GetHeightMap(); 203 int pitch = m_MapSizePatches * PATCH_SIZE + 1; 204 std::vector<u16> tempHeightmap(pitch*pitch); 205 memcpy(&tempHeightmap[0], &m_SimHeightmap[0], pitch * pitch * sizeof(u16)); 206 memcpy(heightmap, &m_SimHeightmap[0], pitch * pitch * sizeof(u16)); 207 208 IterateHeightmapAverage callback; 209 callback.heightmap = &tempHeightmap[0]; 210 callback.pitch = pitch; 211 std::vector<fixed> avgHeightmap(pitch * pitch, fixed::Zero()); 212 callback.avgHeightmap = &avgHeightmap[0]; 213 std::vector<fixed> sumWeightmap(pitch * pitch, fixed::Zero()); 214 callback.sumWeightmap = &sumWeightmap[0]; 215 216 CComponentManager::InterfaceList ents = GetSimContext().GetComponentManager().GetEntitiesWithInterface(IID_TerrainModifier); 217 for (CComponentManager::InterfaceList::const_iterator it = ents.begin(); it != ents.end(); ++it) 218 { 219 CmpPtr<ICmpPosition> cmpPosition(GetSimContext(), it->first); 220 if (cmpPosition) 221 { 222 CFixedVector2D pos = cmpPosition->GetPosition2D(); 223 fixed angle = cmpPosition->GetRotation().Y; 224 225 IterateHeightmap(callback, pos, angle, it->first); 226 } 227 } 228 229 memcpy(heightmap, &tempHeightmap[0], pitch * pitch * sizeof(u16)); 230 m_Terrain->MakeDirty(RENDERDATA_UPDATE_VERTICES); 231 } 232 114 233 virtual void ReloadTerrain() 115 234 { 116 235 // TODO: should refactor this code to be nicer 236 m_MapSizePatches = m_Terrain->GetPatchesPerSide(); 237 size_t size = (m_MapSizePatches * PATCH_SIZE + 1)*(m_MapSizePatches * PATCH_SIZE + 1); 238 m_SimHeightmap.resize(size); 239 if (m_Terrain->GetHeightMap()) 240 memcpy(&m_SimHeightmap[0], m_Terrain->GetHeightMap(), size*sizeof(u16)); 241 else 242 memset(&m_SimHeightmap[0], 0, size*sizeof(u16)); 117 243 118 244 u16 tiles = GetTilesPerSide(); 119 245 u16 vertices = GetVerticesPerSide(); … … 138 264 if (CRenderer::IsInitialised()) 139 265 g_Renderer.GetWaterManager()->SetMapSize(vertices); 140 266 141 MakeDirty(0, 0, tiles+1, tiles+1); 267 MakeVisualTerrainDirty(); 268 MakeDirty(0, 0, tiles + 1, tiles + 1); 142 269 } 143 270 144 271 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