{
  "schema": "imperivm-format-article/v1",
  "language": "en",
  "scope": "Imperivm HD",
  "status": "partial",
  "slug": "map-objects",
  "title": "map.obj.xml · map objects",
  "summary": "XML for the map's object layer: loose objects, settlements and references to groups and units.",
  "sections": [
    {
      "id": "purpose",
      "title": "Role in the map",
      "paragraphs": [
        "map.obj.xml describes the object layer of a saved map. It differs from map.xml metadata and terrain grid files.",
        "The document root is mapobject. The documented writing structure includes scriptobj objects, settlement blocks containing their objects, and group and partyunit sections."
      ]
    },
    {
      "id": "objects",
      "title": "Object fields",
      "table": {
        "columns": [
          "Field",
          "Documented description"
        ],
        "rows": [
          [
            "class",
            "Object class name"
          ],
          [
            "num",
            "Global writing counter, starting at zero, in document order"
          ],
          [
            "player",
            "Owner index plus one; do not treat it as a zero-based index"
          ],
          [
            "healthperc, stamina",
            "Object state fields; their complete ranges and units are not generalized here"
          ],
          [
            "inventorysize, slotN",
            "Inventory size and slot data"
          ],
          [
            "x, y",
            "Object position"
          ],
          [
            "flags",
            "Object flags; not every bit's meaning is described here"
          ],
          [
            "dir.x, dir.y",
            "Object direction components"
          ]
        ]
      }
    },
    {
      "id": "settlements",
      "title": "Settlements and references",
      "paragraphs": [
        "Settlement blocks can include id, player, classoffirstbuilding, maxpopulation, extrasentries, maxgold, maxfood, population, gold, food, icon and name, together with their scriptobj objects.",
        "Group sections contain obj references through num, and partyunit also uses num. Keep those references consistent when changing numbering or objects."
      ]
    },
    {
      "id": "limits",
      "title": "Known limits",
      "paragraphs": [
        "This is a partial description of map writing, not complete saved-game serialization. Do not automatically transfer settlement attributes between those contexts.",
        "The complete reader is not documented here. Group and partyunit sections are not covered by the same file examples as objects and settlements, and some objects can omit player. Preserve that omission when its meaning is unknown."
      ]
    }
  ]
}