0
\$\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\$
  • \$\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 Jul 3 '17 at 19:57
4
\$\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\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.