We found Tiled hard to wok with same map by several people

We are using tiled to make map for our game. And we faced to the issue of collabarative developing.

It is almost impossible to merge tmx map file with changes from different people. The reason is global idenitfication of obejects in map and tilesets. If someone add tiles in tileset, then objects in tmx will change their global id of the tile in local version of the map (because tile in tileset has local id and global id is calculated based on global offset and local id, so in this one tileset begin to contain more tiles and offset is changed)

To merge this changes we have to recalculate gid for tile objects…

I believe it could be more simple if tiles and objects had some uniqe global indetificator like GUID and it would be independet of content of tilests.

GUIDs generated by different machines can conflict too, so they would not really solve this problem. The tile IDs would still be required on tiles and Tile Objects anyway, as maps need some way to know which tiles from which tilesets they’re using, and maps by different users using the same tileset would still need to refer to the same tiles.

This sort of problem that affects many software, and the only reliable solution is to coordinate the modifications, e.g. using an asset checkout/checkin system. There are software for this, but it can also be done informally.

You can also use Tiled or external scripting to automate some of the merging. For example, you can add coordinated IDs as custom properties to tiles or objects, and use those to merge the objects into a committed Tiled file. The custom IDs can be removed any time everyone syncs up by using this file, since those objects will no longer need syncing.

I remember making the suggestion before that Tiled could facilitate merging maps by letting people set a multiplier and an offset so that IDs generated by each member of a team never conflict with those generated by other members, but this would only work for things that have IDs generated on the fly, such as objects, layers, and Image Collection tiles, it would not work for regular tilesets where the tile ID corresponds to the tile position (but a project with multiple tile authors could use an image collection with image subrects instead of such tilesets, and in the future, the planned Atlas tileset type will make that even easier).

Thanks for response! Tiled is a great software, we love it a lot. We have to work with it in way you described - monopolistic lock.

We also created a code which can merge different pieces of map, and because of conflicts of ids we have to identify tiles in tilests by sprite full name. It works, but still is not suitable

I understand it is impossible to solve all issues of collabarative work.

But most important issue is tilesets. Tileset is an entity which can be used in different maps. And changes in this tileset make affection to maps where it is used.

If tiles would had their own non changeble global id, each member of the team can set up own nextobjectid offset in the map and do not have conflicts by objects and tiles ids at least

Thanks again

Tiles do have their own, non-changing tile IDs*. You seem to be conflating Object IDs with Tile IDs - they are completely independent, and you can set your nextobject ID after prior to opening the map in Tiled to avoid conflicts, or update the object IDs after the fact, as part of the merge process.

*Unless you mean that the tile ID should be somehow tied to the image used for that tile, so that different users adding different images to the tileset end up with different IDs. This is not possible as multiple tiles can use the exact same image, and even the same subrect of that image.

It sounds like the tileset is the main source of conflicts for you. Have you considered using multiple tilesets instead, so that each author is only allowed to add tiles to one tileset, but anyone can use tiles from any tileset (i.e. anyone can read, but only one person per tileset can write)? This could avoid many conflicts, and you can periodically merge the tilesets into a single, more organised tileset if you prefer (there are scripts available to aid with this).

If each member will add images to their own tilesets the issue will be still there. All tilesets should be imported to the main map. If person adds new images in his tileset, the firstgid property of the all next tilessets will be changed. And all objects will be linked to images by new gid (tiled will be recalculate it) <tileset firstgid="846" source="tileSets/tilest1.tsx"/> <tileset firstgid="851" source="tileSets/tileset2.tsx"/> <object id="51672" gid="855" x="45311" y="19258"
will be

<tileset firstgid="846" source="tileSets/tilest1.tsx"/> <tileset firstgid="852" source="tileSets/tileset2.tsx"/> <object id="51672" gid="856" x="45311" y="19258"
And this is my issue because in the local version of other member this object will use old gid

I mean tile has calculated id for map, and each map can has different tile gid for same sprite.

Hmm, yes, the only safe way to collaborate is to make sure you’re editing each file exclusively. However, since this is not always possible and accidents also happen, it would be useful to offer some mechanism to avoid the most common conflicts.

For tilesets, I think this could be achieved by forcing a minimum ID range per tileset, potentially configured per-project (though that would break if a map is edited without the project being loaded… but that can also break custom types). If one would set this to say, 10000, then any expansion of an existing tileset would not cause a shift in the IDs of other tilesets unless it was expanded beyond 10000 tiles.