BIG-BUG!!!!!!!! firstgid corruption when editing multiple maps sharing tilesets
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 12.9k
- Forks
- 2k
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 8
Description
Describe the bug
Our designer encountered firstgid corruption when working with two maps that share some common tilesets.
Actual Behavior:
After saving Season_1_miniMap, the firstgid values for shared tilesets are overwritten and become inconsistent with their original values.
File Evidence:
Normal Season_1_miniMap (before corruption):
<tileset firstgid="264" source="../tilesets/s1/easy_water/s1_easy_water.tsx"/>
<tileset firstgid="288" source="../meta_tilesets/collision_check/collision_check.tsx"/>
<tileset firstgid="290" source="../tilesets/s1/one_tree/s1_2x2sk.tsx"/>
<tileset firstgid="294" source="../tilesets/s1/xzddb/s1_xzddb.tsx"/>
<tileset firstgid="298" source="../tilesets/s1/xzddb/s1_xzddb_c.tsx"/>
<tileset firstgid="314" source="../tilesets/s1/map_anim_objs/map_anim_objs_tileset.tsx"/>
Normal Season_1:
<tileset firstgid="270" source="../tilesets/s1/easy_water/s1_easy_water.tsx"/>
<tileset firstgid="408" source="../tilesets/s1/xzddb/s1_xzddb.tsx"/>
<tileset firstgid="412" source="../tilesets/s1/xzddb/s1_xzddb_c.tsx"/>
<tileset firstgid="428" source="../tilesets/s1/one_tree/s1_2x2sk.tsx"/>
<tileset firstgid="432" source="../tilesets/s1/db_2/s1_db.tsx"/>
Corrupted Season_1_miniMap (after saving):
<tileset firstgid="264" source="../tilesets/s1/easy_water/s1_easy_water.tsx"/>
<tileset firstgid="402" source="../meta_tilesets/collision_check/collision_check.tsx"/>
<tileset firstgid="404" source="../tilesets/s1/one_tree/s1_2x2sk.tsx"/>
<tileset firstgid="408" source="../tilesets/s1/xzddb/s1_xzddb.tsx"/>
<tileset firstgid="412" source="../tilesets/s1/xzddb/s1_xzddb_c.tsx"/>
<tileset firstgid="428" source="../tilesets/s1/map_anim_objs/map_anim_objs_tileset.tsx"/>
Suspected Cause:
We suspect that Tiled might be treating tileset objects as globally shared instances, and the firstgid assignment logic might be using a global context instead of being map-specific.
Steps to reproduce
- Open and edit
Season_1.tmx - Then open and edit
Season_1_miniMap.tmx - Save
Season_1_miniMap.tmx - The firstgid values for shared tilesets become corrupted
Expected behavior
Each map should maintain its own firstgid assignments for tilesets, even when they reference the same source tileset files.
OS version
Windows 10
Tiled version
1.11.2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue by opening and editing Season_1.tmx followed by Season_1_miniMap.tmx, then saving the mini-map. Trace the map-specific tileset and firstgid assignment logic, checking how shared source tilesets are handled. Done means each map retains its own firstgid values after saving, without changing the other map.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100