1
\$\begingroup\$

I want to make an early version of a map for my game but then I want to be able to change some of the tiles for new and improved ones without destroying my entire map...is this possible?

\$\endgroup\$
1
  • \$\begingroup\$ You can use the Automap feature in Tiled. It's very confusing in the documentation, but this video clears it up: youtube.com/… \$\endgroup\$
    – alexjr
    Commented Jul 3, 2017 at 19:57

1 Answer 1

5
\$\begingroup\$

The .tmx data format stores each tile in the map as a reference to a specific tile on the provided tileset, whose information in the .tmx file is found at

<tileset ...>
    <image source="path/to/image/tileset.png" width="194" height="129"/>
</tileset>

The tile data itself can be found in the .tmx file if you set the layer format to XML and view the .tmx file.

<data>
   <tile gid="1"/>
   <tile gid="1"/>
   <tile gid="2"/>
   <tile gid="2"/>
  . . .
   <tile gid="1"/>
</data>

The gid property represents the tile in the tileset that is referred to. The mapping of id to tileset tile begins at 1 at the topleft corner of the tileset and increases moving to the right. The breakdown of the tileset image into tiles (i.e. the width and height of each tile) will depend on your tileset settings.

Tileset Numbering

Because of the .tmx use of references to refer to data, as opposed to storing the entire image itself, you can edit the tileset image file and any changes you save to it will immediately be seen on the map.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .