3 | | PMP file format (version 4), described in something a bit like C: |
| 3 | A scenario consists of an XML data file and, optionally, a PMP data file. The XML format is text and may be viewed in any text editor, while the PMP is a proprietary binary format. Most scenarios are created with [wiki:Atlas_Manual Atlas scenario editor], which generates one of each file per map. |
| 4 | |
| 5 | The PMP files store a map's elevation and terrain texture references for each tile. The XML files store map objects (entities and actors) as well as information for environment (e.g. lighting and water parameters), camera orientation, and various other settings. |
| 6 | |
| 7 | == PMP format == |
| 8 | |
| 9 | The following described version 4 of the PMP file format with C-like syntax. |
48 | | <?xml version="1.0" encoding="utf-8" standalone="no"?> |
49 | | <Scenario> |
50 | | <Environment> |
51 | | <SunColour r="1" g="1" b="1" /> <!-- range 0..1, though out-of-range values are allowed --> |
52 | | <SunElevation angle="0.785398" /> <!-- elevation above horizontal, in radians --> |
53 | | <SunRotation angle="4.71239" /> <!-- angle clockwise from positive-z axis (north), in radians --> |
54 | | <TerrainAmbientColour r="0" g="0" b="0" /> |
55 | | <UnitsAmbientColour r="0.4" g="0.4" b="0.4" /> |
56 | | </Environment> |
| 59 | #!xml |
| 60 | <?xml version="1.0" encoding="UTF-8"?> |
| 61 | <Scenario version="5"> |
| 62 | <Environment> |
| 63 | <LightingModel>standard</LightingModel> |
| 64 | <SkySet>cloudless</SkySet> |
| 65 | <SunColour r="0.847059" g="0.792157" b="0.592157"/> |
| 66 | <SunElevation angle="0.773126"/> |
| 67 | <SunRotation angle="-0.374291"/> |
| 68 | <TerrainAmbientColour r="0.447059" g="0.509804" b="0.54902"/> |
| 69 | <UnitsAmbientColour r="0.501961" g="0.501961" b="0.501961"/> |
| 70 | <Water> |
| 71 | <WaterBody> |
| 72 | <Type>default</Type> |
| 73 | <Colour r="0.294118" g="0.34902" b="0.694118"/> |
| 74 | <Height>21.823</Height> |
| 75 | <Shininess>250</Shininess> |
| 76 | <Waviness>8</Waviness> |
| 77 | <Murkiness>1</Murkiness> |
| 78 | <Tint r="0.639216" g="0.54902" b="0.34902"/> |
| 79 | <ReflectionTint r="0.603922" g="0.529412" b="0.384314"/> |
| 80 | <ReflectionTintStrength>0.525391</ReflectionTintStrength> |
| 81 | </WaterBody> |
| 82 | </Water> |
| 83 | </Environment> |
| 84 | <Camera> |
| 85 | <Position x="246.599" y="91.5253" z="497.928"/> |
| 86 | <Rotation angle="0"/> |
| 87 | <Declination angle="0.610865"/> |
| 88 | </Camera> |
| 89 | <ScriptSettings><![CDATA[ |
| 90 | { |
| 91 | "CircularMap": true, |
| 92 | "Description": "Northwest India. Nearby rivers swell with monsoon rains, allowing for only a few treacherous crossings...", |
| 93 | "GameType": "conquest", |
| 94 | "Keywords": [], |
| 95 | "LockTeams": false, |
| 96 | "Name": "Punjab 1", |
| 97 | "PlayerData": [ |
| 98 | { |
| 99 | "AI": "", |
| 100 | "Civ": "spart", |
| 101 | "Colour": { |
| 102 | "b": 200, |
| 103 | "g": 46, |
| 104 | "r": 46 |
| 105 | }, |
| 106 | "Name": "Player 1", |
| 107 | "Team": -1 |
| 108 | }, |
| 109 | ... |
| 110 | ], |
| 111 | "RevealMap": false |
| 112 | }]]> |
| 113 | </ScriptSettings> |
| 114 | <Entities> |
| 115 | <Entity uid="12"> |
| 116 | <Template>structures/pers_civil_centre</Template> |
| 117 | <Player>2</Player> |
| 118 | <Position x="815.72754" z="384.37818"/> |
| 119 | <Orientation y="2.35621"/> |
| 120 | </Entity> |
| 121 | <Entity uid="13"> |
| 122 | <Template>actor|props/flora/grass_tropic_field_tall.xml</Template> |
| 123 | <Position x="154.78473" z="589.32166"/> |
| 124 | <Orientation y="2.35621"/> |
| 125 | </Entity> |
| 126 | ... |
79 | | (This structure is not rigidly enforced (e.g. by a DTD) - many elements are optional, to preserve backward compatibility with older map formats. However, it should be generated in this latest version of the format whenever possible.) |
| 133 | === Environment === |
| 134 | |
| 135 | These elements correspond to settings on the [wiki:Atlas_Manual_Environment_Tab environment tab] in Atlas. They affect renderer behavior. |
| 136 | |
| 137 | === Camera === |
| 138 | |
| 139 | Currently unused? |
| 140 | |
| 141 | === !ScriptSettings === |
| 142 | |
| 143 | A special element containing a [wiki:JSON JSON] object. This object gets parsed during game setup to display information about the map such as its name, description, number of players and their civilizations. It's a flexible format which gets updated as we add new map settings. |
| 144 | |
| 145 | This data mostly corresponds to the [wiki:Atlas_Manual_Map_Tab map] and [wiki:Atlas_Manual_Player_Tab player] settings tabs in Atlas. |
| 146 | |
| 147 | '''Note:''' there is intentional symmetry between this data and that used by the [wiki:Random_Map_Generator_Internals random map generator]. |
| 148 | |
| 149 | === Entities === |
| 150 | |
| 151 | This is a list of Entity elements that define all the objects and actors on the map. Each Entity consists of: |
| 152 | * unique entity ID of type u32. Players are also considered entities, so these don't necessarily start with 1. 0 is reserved for `INVALID_ENTITY`. |
| 153 | * entity template filename. For actors, these are a reference to the actor template instead, prefixed with '''actor|''' |
| 154 | * player ID which owns the entity, positive integer of type i32. Gaia is reserved as player 0, typically 1-8 are used for other players, -1 is reserved for `INVALID_PLAYER`. |
| 155 | * world position. Only X and Z translation are currently supported. |
| 156 | * world orientation. Only rotation in radians about the Y-axis is currently supported. |