Announcement

Collapse
No announcement yet.

description of the MAP FORMAT

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • description of the MAP FORMAT

    just got this from Mr Ogre

    <center><table width=80%><tr><td><font color=000080 face="Verdana" size=2><font size="1">quote:
    <img src="/images/blue1.gif" width=100% height=1>
    </font>
    The file is divided into blocks. Each block starts with a four character ID (as defined below) followed by 4 bytes for the size of the rest of the block (not counting the 4 byte header or the 4 bytes for size). All data is stored in Intel byte order. A TERR block, describing the map terrain, is required, but the rest are, at least theoretically, optional. A few of these blocks will still be read if present, but are not generated by the internal save code any more.

    <PRE><font size=arial size=2>
    #define k_TERRAIN_HEADER 'TERR'
    // sint16 width, height
    // uint8[width * height]

    #define k_TERRAIN_ENV_HEADER 'TENV'
    // sint16 width, height
    // uint32[width * height]

    #define k_CITIES_HEADER 'CITY'
    // sint32 numCities
    // { numCities instances of:
    // sint16 x, y
    // sint32 size \
    // uint64 improvements >-- MapFileCityData
    // uint64 wonders /
    // uint8 owner
    // }

    // Same, but has names too
    #define k_NEW_CITIES_HEADER 'NCTY'
    // sint32 numCities
    // { numCities instances of:
    // sint16 x, y
    // sint32 size \
    // uint64 improvements >-- MapFileCityData
    // uint64 wonders /
    // uint8 owner
    // string name
    // }

    #define k_UNIT_TYPES_HEADER 'UTYP'
    // sint32 numTypes
    // { numTypes instances of:
    // String db_ID_Name
    // }

    #define k_UNITS_HEADER 'UNIT'
    // sint32 numCellsWithUnits
    // { numCellsWithUnits instances of:
    // sint16 x, y
    // sint32 numUnits
    // { numUnits instances of:
    // uint8 owner
    // sint32 type
    // }
    // }

    #define k_IMPROVEMENT_TYPES_HEADER 'ITYP'
    // sint32 numTypes
    // { numTypes instances:
    // String db_ID_Name
    // }

    #define k_IMPROVEMENTS_HEADER 'IMPS'
    // sint32 numCells
    // { numCells instances:
    // sint16 x, y
    // uint8 numImprovements
    // { numImprovements instances:
    // sint32 impType
    // }
    // }

    #define k_VISION_HEADER 'VISN'
    // uint8 player
    // sint16 width, height
    // uint16 [width * height]

    #define k_ADVANCE_TYPES_HEADER 'ATYP'
    // sint32 numTypes
    // { numTypes instances:
    // String db_ID_Name
    // }

    #define k_PLAYER_ADVANCES_HEADER 'PADV'
    // uint8 player
    // sint16 numAdvances
    // uint8[numAdvances]


    // MDS - 08/2000
    #define k_HUTS_HEADER 'HUTS'
    // uint32 value
    // uint32 typeValue

    // MDS - 08/2000
    #define k_CIVS_HEADER 'CIVS'
    // uint32 civ</font></pre>
    <img src="/images/blue1.gif" width=100% height=1></font></td></tr></table></center>
    <font size=1 face=Arial color=444444>[This message has been edited by MarkG (edited December 06, 2000).]</font>

  • #2
    I realize this isn't a very thorough description, but it should be accurate. If anyone's planning to work on an exporter to this format, I'll try and answer questions here. Poking around with a hex editor in some maps saved from the game with this document at hand might be helpful as well.
    Joe Rumsey - CTP Programmer

    Comment


    • #3
      I would like to clarify that this is the BINARY map format used by the 'Save Map' editor option.

      While, the BMP2CtP2 program (mentioned in another thread) uses the TEXT map format used by the Chat Window's '/Importmap' option.

      Thanks, Mr. Ogre

      Don,
      CtPMaps (Hosted by Apolyton)

      Comment

      Working...
      X