Tile index issue

I noticed that the tile index starts at 0. My problem is that my current game engine does not support the tiled format extension. The engine I’m using uses a map array. I have to export the file as a csv file. Open the file with note pad, and copy and paste the numerical values into my engines map file. The problem is that my engines map uses 0 as an empty tile space. Tiled uses -1. So as a result my map is offset by one tile. Is there any way to get the tile index to start at 1 rather than 0?

At first I did not understand the question, because Tiled also uses 0 to mean an empty space, and not -1.

But then I realized you’re talking about the CSV export format. Indeed in this format, -1 is the empty tile and 0 the first tile in the tileset. There is currently no way around this. Couldn’t you add 1 to the tile index when loading the file in your game?

I’m still learning. I’m a relatively new programmer. Is there any other format where I can extract the numerical values in notepad and have them start at 0 instead of negative one. Also is it possible to send you my source code? I would love to use the standard tiled format. I just don’t know how to import it into code::blocks.

You could just save as the default TMX format, making sure the tile layer data format is set to “CSV” in the map properties. Then, you can copy the layer data out of this XML file. It will have 0 as “no tile” and 1 as the first tile in your tileset.

I’m afraid that I have no time to integrate a TMX loader for you. If you try any particular library and run into problems, you should try contacting its author.