Changes between Version 1 and Version 2 of XML:_Terrain
- Timestamp:
- Jul 10, 2009, 10:27:13 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
XML:_Terrain
v1 v2 1 XML: Terrain 1 Terrain can be defined as the ground plane. It is the basic tile based foundation that establishes the game world. This document defines those attributes.[[BR]][[BR]]The placement of what texture goes where is defined by random map script or a map editor. They will be able to control troop movement, structure placement, ambush points, strategic harbours, and impassable mountain ranges with these tools.[[BR]][[BR]]There are going to be lots of different terrains, and many of them will share similar attributes. To reduce the hassle of creating XML for each terrain tile, terrain XML should have the following support: 2 1. Multiple terrain objects can be stored in the same XML file (separated by their <terrain> tags). 3 1. Multiple terrain XML files can be read from the same folder. 4 1. Terrains can inherit attributes from other terrains by specifying a "parent" (see the section on inheritance in the '''XML Header Overview'''). 2 5 3 Terrain can be defined as the ground plane. It is the basic tile based foundation that establishes the game world. This document defines those attributes. 6 ||'''Skin'''|| 4 7 5 The placement of what texture goes where is defined by random map script or a map editor. They will be able to control troop movement, structure placement, ambush points, strategic harbours, and impassable mountain ranges with these tools. 8 [[BR]]'''''BRIEF DESCRIPTION ::'''''Specifies the name and path of the terrain's texture. Note that the icon for the terrain is automatically generated as a thumbnail of this image.[[BR]][[BR]]Animated textures can be specified here. This feature could be used for all sorts of effects: waterfalls, water effects, UI effects, fire, conveyor belts, skyboxes.[[BR]][[BR]]'''Dirt'''[[BR]]- dirt1 - bare[[BR]]- dirt2 - cracked[[BR]]- dirt3 – mud[[BR]][[BR]]'''Grass'''[[BR]]- grass1 - plain[[BR]]- grass2 - lush[[BR]]- grass3 - long[[BR]]- grass4 - weeds[[BR]]- grass5 – short/long mix[[BR]]- grass6 – bunched dry[[BR]]- grass7 – yellow[[BR]]- grass8 – dark tufts[[BR]]- grass9 – mixed greens, weeds[[BR]][[BR]]'''Sand'''[[BR]]- sand1 - plain[[BR]]- sand2 - rippled[[BR]]- sand3 – rough, rocky[[BR]][[BR]]'''Forrest'''[[BR]]- forest1 – leafy[[BR]]- forest2 – needles[[BR]]- forest3 – fronds[[BR]]- forest4 – scrub[[BR]]- forest5 – logged[[BR]][[BR]]'''Road'''[[BR]]- road1 – Persian[[BR]]- road2 – Roman[[BR]]- road3 – Hellenic[[BR]]- road4 – Celtic[[BR]]- road5 – Carthaginian[[BR]]- road6 – Iberian[[BR]]- road7 – gravel - gray[[BR]]- road8 – gravel - brown[[BR]][[BR]]'''Water Sub-Terrain '''[[BR]]- coral1 - brown[[BR]]- coral2 - turquoise[[BR]]- coral3 - red[[BR]]- rock1 - light[[BR]]- rock2 - medium[[BR]]- rock3 - dark[[BR]]- pebble1 - small[[BR]]- pebble2 - large[[BR]][[BR]]'''Beach'''[[BR]]- sand1[[BR]]- sand2[[BR]]- sand3[[BR]][[BR]]'''Cliff'''[[BR]]- cliff1 - brown[[BR]]- cliff2 – brown, vegetation[[BR]]- cliff3 – brown, cracks[[BR]]- cliff4 - gray[[BR]]- cliff5 – gray, vegetation[[BR]]- cliff6 – gray, cracks[[BR]][[BR]]'''Special'''[[BR]]- furrows1 – dirt[[BR]]- furrows2 – dirt, small plants[[BR]]- furrows3 – dirt, large plants[[BR]]- black[[BR]]- lava[[BR]]- structure – under structures[[BR]][[BR]] 9 ||'''MMap'''|| 6 10 7 There are going to be lots of different terrains, and many of them will share similar attributes. To reduce the hassle of creating XML for each terrain tile, terrain XML should have the following support: 8 Multiple terrain objects can be stored in the same XML file (separated by their <terrain> tags). 9 Multiple terrain XML files can be read from the same folder. 10 Terrains can inherit attributes from other terrains by specifying a "parent" (see the section on inheritance in the XML Header Overview). 11 Skin 11 [[BR]]'''''BRIEF DESCRIPTION ::'''''The RGB colour used to represent this terrain on the Mini Map.[[BR]][[BR]]Note: If no value is specified, then the terrain colour is determined by finding the primary colour used in the skin, as in the current highly cool !ScEd.[[BR]][[BR]] 12 ||'''Group'''|| 12 13 13 BRIEF DESCRIPTION ::Specifies the name and path of the terrain's texture. Note that the icon for the terrain is automatically generated as a thumbnail of this image. 14 [[BR]]'''''BRIEF DESCRIPTION ::'''''The types/classes/groups to which this terrain belongs.[[BR]][[BR]]Used when painting by random group, and to specify under what categories it appears in the Editor. For example, if the user is painting group "Arid Grass", it'll randomly pick terrains with this type to paint. Actors like trees should use the same principle (eg an Oak Tree group for all oak trees). [[BR]][[BR]] 15 ||Properties''''''|| 14 16 15 Animated textures can be specified here. This feature could be used for all sorts of effects: waterfalls, water effects, UI effects, fire, conveyor belts, skyboxes. 17 [[BR]]'''''BRIEF DESCRIPTION ::'''''List of special properties for the terrain.[[BR]][[BR]]For example, "buildable" means that structures can be built on the terrain, assuming that it is flat enough.[[BR]][[BR]] 18 ||Passable''''''|| 16 19 17 Dirt 18 - dirt1 - bare 19 - dirt2 - cracked 20 - dirt3 – mud 20 [[BR]]'''''BRIEF DESCRIPTION ::'''''Defines that a certain type of unit can move over this terrain, and the effects the terrain applies when the unit is moving over it.[[BR]][[BR]]A terrain can have multiple Passable attributes to define different behaviours for different unit types walking over it.[[BR]][[BR]][[BR]][[BR]](Note that special actors that combine multiple terrain objects (such as water and cliffs) simply use the passable attributes for those terrains. For example, the only thing stopping units from walking up the wall of a cliff is that the wall terrain is impassable to units. Equally, the appropriate surface and shore terrains determine what units and ships can walk on the different areas of a water object.)[[BR]][[BR]]A Passable attribute consists of: 21 * '''Type:''' The category of unit(s) that can pass over this terrain (determined by the entity's '''Id.Type'''). 22 * '''Speed:''' A percentage modifier to the unit's movement rate when moving over this terrain. 100% uses the unit's default movement rate. Higher numbers increase the unit's speed. Lower numbers decrease the unit's speed. 23 * '''Effect:''': A list of special effects that occur when the unit is walking over this terrain. Effects include: 24 * '''Dust:''' eg sand, dry dirt. Clouds of dust particles appear around the entity as it moves over the terrain. 25 * '''Tracks:''' eg mud, wet dirt. Entities leave tracks on the terrain as they move. This is dependent upon the entity type. For example, foot units leave footprints, cavalry leave hoofprints, while wheeled units cut grooves into the ground. 26 * '''Splash:''' eg shallows, mud. 27 * '''Wakes:''' eg deep water. Ripples and wave deformations of the water mesh. 21 28 22 Grass 23 - grass1 - plain 24 - grass2 - lush 25 - grass3 - long 26 - grass4 - weeds 27 - grass5 – short/long mix 28 - grass6 – bunched dry 29 - grass7 – yellow 30 - grass8 – dark tufts 31 - grass9 – mixed greens, weeds 29 QUOTEThese are the general rules for terrain movement:[[BR]] 30 [[BR]][[BR]][[BR]][[BR]] * '''Normal (undefined)'''[[BR]]''Units'' – movement of any entity except ships.[[BR]]''Structures'' – construction of any structure except Docks.[[BR]][[BR]][[BR]][[BR]] 31 * '''Shallows'''[[BR]]''Units'' – movement of any entity with feet ('''!UnitNonMechanical''').[[BR]]''Structures'' - only the construction of water structures that may be[[BR]]built in the shallows ('''StructWallW, StructTowerW''', '''Dock''').[[BR]][[BR]]A special note about the shallow type. The first image shows some nuances of the shallow water. See that though the water is visually ‘shallow’ in a certain region of that picture… it isn’t ‘shallow type’ because it doesn’t have the correct shallow texture type (designated by the difference in the skin appearance). In other words, 2 things must be in order before a[[BR]]terrain is considered shallow. It must not be too deep (elevation difference of the Z axis), and it must be the shallow terrain type.[[BR]][[BR]][[BR]][[BR]] 32 * '''Water'''[[BR]]''Units'' – movement only by ships ('''!UnitShips''').[[BR]]''Structures'' – no structures may be built.[[BR]][[BR]][[BR]][[BR]] 33 * '''Forest'''[[BR]]''Units'' – only units with the Boolean attribute of walking in forests may walk in Forest type.[[BR]]''Structures'' – no structures may be built.[[BR]][[BR]]A special note about the forest type. When a tree is placed on the terrain, the tile that the tree is placed on has the terrain’s secondary texture skin changed to a forest type. When a cluster of trees are placed in adjacent tiles it changes the terrain enough to make a ‘closed’ forest terrain which means that all eight tiles around it also have a tree on them. When that is the case, the terrain is now of the forest type and there are special permissions applied to it.[[BR]][[BR]][[BR]][[BR]][[BR]][[BR]] 34 * '''Cliff'''[[BR]]''Units'' – no unit may traverse.[[BR]]''Structures'' – no structure may be built.[[BR]][[BR]][[BR]] 32 35 33 Sand 34 - sand1 - plain 35 - sand2 - rippled 36 - sand3 – rough, rocky 36 [[BR]][[BR]] 37 ||'''Doodad'''|| 37 38 38 Forrest 39 - forest1 – leafy 40 - forest2 – needles 41 - forest3 – fronds 42 - forest4 – scrub 43 - forest5 – logged 39 [[BR]]'''''BRIEF DESCRIPTION ::'''''Doodads/goobers/decals that get randomly sprinkled over this terrain. Similar to props, except they aren't bonded to specific sockets.[[BR]][[BR]]Useful for beautifying terrain and breaking up patterns in the texture (cacti, plants, lilies, reeds).[[BR]][[BR]]Like the Passable attributes, a terrain can have multiple doodads.[[BR]][[BR]]A Doodad attribute consists of: 40 * '''Name:''' The name of the prop or decal actor that can be placed. 41 * '''Max:''' Determines the maximum quantity of this doodad that could placed on the terrain (a random number of doodads is chosen when terrain is placed; this is the cap on that number, 0-max). Higher numbers have a higher likelihood of getting more doodads. 44 42 45 Road 46 - road1 – Persian 47 - road2 – Roman 48 - road3 – Hellenic 49 - road4 – Celtic 50 - road5 – Carthaginian 51 - road6 – Iberian 52 - road7 – gravel - gray 53 - road8 – gravel - brown 54 55 Water Sub-Terrain 56 - coral1 - brown 57 - coral2 - turquoise 58 - coral3 - red 59 - rock1 - light 60 - rock2 - medium 61 - rock3 - dark 62 - pebble1 - small 63 - pebble2 - large 64 65 Beach 66 - sand1 67 - sand2 68 - sand3 69 70 Cliff 71 - cliff1 - brown 72 - cliff2 – brown, vegetation 73 - cliff3 – brown, cracks 74 - cliff4 - gray 75 - cliff5 – gray, vegetation 76 - cliff6 – gray, cracks 77 78 Special 79 - furrows1 – dirt 80 - furrows2 – dirt, small plants 81 - furrows3 – dirt, large plants 82 - black 83 - lava 84 - structure – under structures 85 86 MMap 87 88 BRIEF DESCRIPTION ::The RGB colour used to represent this terrain on the Mini Map. 89 90 Note: If no value is specified, then the terrain colour is determined by finding the primary colour used in the skin, as in the current highly cool ScEd. 91 92 Group 93 94 BRIEF DESCRIPTION ::The types/classes/groups to which this terrain belongs. 95 96 Used when painting by random group, and to specify under what categories it appears in the Editor. For example, if the user is painting group "Arid Grass", it'll randomly pick terrains with this type to paint. Actors like trees should use the same principle (eg an Oak Tree group for all oak trees). 97 98 Properties 99 100 BRIEF DESCRIPTION ::List of special properties for the terrain. 101 102 For example, "buildable" means that structures can be built on the terrain, assuming that it is flat enough. 103 104 Passable 105 106 BRIEF DESCRIPTION ::Defines that a certain type of unit can move over this terrain, and the effects the terrain applies when the unit is moving over it. 107 108 A terrain can have multiple Passable attributes to define different behaviours for different unit types walking over it. 109 110 111 112 (Note that special actors that combine multiple terrain objects (such as water and cliffs) simply use the passable attributes for those terrains. For example, the only thing stopping units from walking up the wall of a cliff is that the wall terrain is impassable to units. Equally, the appropriate surface and shore terrains determine what units and ships can walk on the different areas of a water object.) 113 114 A Passable attribute consists of: 115 Type: The category of unit(s) that can pass over this terrain (determined by the entity's Id.Type). 116 Speed: A percentage modifier to the unit's movement rate when moving over this terrain. 100% uses the unit's default movement rate. Higher numbers increase the unit's speed. Lower numbers decrease the unit's speed. 117 Effect:: A list of special effects that occur when the unit is walking over this terrain. Effects include: 118 Dust: eg sand, dry dirt. Clouds of dust particles appear around the entity as it moves over the terrain. 119 Tracks: eg mud, wet dirt. Entities leave tracks on the terrain as they move. This is dependent upon the entity type. For example, foot units leave footprints, cavalry leave hoofprints, while wheeled units cut grooves into the ground. 120 Splash: eg shallows, mud. 121 Wakes: eg deep water. Ripples and wave deformations of the water mesh. 122 QUOTE 123 These are the general rules for terrain movement: 124 125 126 127 128 Normal (undefined) 129 Units – movement of any entity except ships. 130 Structures – construction of any structure except Docks. 131 132 133 134 135 Shallows 136 Units – movement of any entity with feet (UnitNonMechanical). 137 Structures - only the construction of water structures that may be 138 built in the shallows (StructWallW, StructTowerW, Dock). 139 140 A special note about the shallow type. The first image shows some nuances of the shallow water. See that though the water is visually ‘shallow’ in a certain region of that picture… it isn’t ‘shallow type’ because it doesn’t have the correct shallow texture type (designated by the difference in the skin appearance). In other words, 2 things must be in order before a 141 terrain is considered shallow. It must not be too deep (elevation difference of the Z axis), and it must be the shallow terrain type. 142 143 144 145 146 Water 147 Units – movement only by ships (UnitShips). 148 Structures – no structures may be built. 149 150 151 152 153 Forest 154 Units – only units with the Boolean attribute of walking in forests may walk in Forest type. 155 Structures – no structures may be built. 156 157 A special note about the forest type. When a tree is placed on the terrain, the tile that the tree is placed on has the terrain’s secondary texture skin changed to a forest type. When a cluster of trees are placed in adjacent tiles it changes the terrain enough to make a ‘closed’ forest terrain which means that all eight tiles around it also have a tree on them. When that is the case, the terrain is now of the forest type and there are special permissions applied to it. 158 159 160 161 162 163 164 Cliff 165 Units – no unit may traverse. 166 Structures – no structure may be built. 167 168 169 170 171 172 173 Doodad 174 175 BRIEF DESCRIPTION ::Doodads/goobers/decals that get randomly sprinkled over this terrain. Similar to props, except they aren't bonded to specific sockets. 176 177 Useful for beautifying terrain and breaking up patterns in the texture (cacti, plants, lilies, reeds). 178 179 Like the Passable attributes, a terrain can have multiple doodads. 180 181 A Doodad attribute consists of: 182 Name: The name of the prop or decal actor that can be placed. 183 Max: Determines the maximum quantity of this doodad that could placed on the terrain (a random number of doodads is chosen when terrain is placed; this is the cap on that number, 0-max). Higher numbers have a higher likelihood of getting more doodads. 184 Example: 185 186 CODE 187 188 <terrain tag="GrassRoughB" parent="GrassRoughA" 189 skin="textures/terrain/water/GrassRoughB.dds" 190 mmap="100, 200, 250" 191 type="grass, roughgrass" 192 properties="buildable" 193 <passable type="siege" speed="80" effect="grooves, dust"/> 194 <passable type="wheeled" speed="75" effect="grooves, dust"/> 195 <passable type="mounted" speed="90" effect="tracks, dust"/> 196 <passable type="foot" speed="102" effect="footprints, dust"/> 197 <doodad name="Shrub1" max="2"> 198 <doodad name="Stone2" max="3"> 199 <doodad name="Stone3" max="3"> 200 <doodad name="Flower1" max="2"> 201 <event on="WalkOver" ![CDATA[ // When something walks on the terrain, 202 walker.SetAnimation("onfire",3); 203 Destroy(walker, "FireDeath"); // Set the unit walking on it on fire, just for the hell of it. 204 ]]></event> 205 ></terrain> 43 Example:[[BR]][[BR]]CODE[[BR]]<terrain tag="GrassRoughB" parent="GrassRoughA"[[BR]] skin="textures/terrain/water/GrassRoughB.dds"[[BR]] mmap="100, 200, 250" [[BR]] type="grass, roughgrass"[[BR]] properties="buildable"[[BR]] <passable type="siege" speed="80" effect="grooves, dust"/>[[BR]] <passable type="wheeled" speed="75" effect="grooves, dust"/>[[BR]] <passable type="mounted" speed="90" effect="tracks, dust"/> [[BR]] <passable type="foot" speed="102" effect="footprints, dust"/> [[BR]] <doodad name="Shrub1" max="2">[[BR]] <doodad name="Stone2" max="3">[[BR]] <doodad name="Stone3" max="3"> [[BR]] <doodad name="Flower1" max="2"> [[BR]] <event on="!WalkOver" ![CDATA[ // When something walks on the terrain, [[BR]] walker.!SetAnimation("onfire",3);[[BR]] Destroy(walker, "!FireDeath"); // Set the unit walking on it on fire, just for the hell of it. [[BR]] ]]></event> [[BR]]></terrain>