-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Big problem with ID sprites #4018
Comments
It sounds like you might be confusing the global tile IDs (GIDs) in the maps with the local tile IDs in tilesets. Since a map may contain multiple tilesets, it can't store the tile IDs directly, it has to distinguish between tiles from different tilesets that may have the same IDs. GIDs are a way to re-number tiles from different tilesets and thus remain unambiguous. More info in the docs: https://doc.mapeditor.org/en/stable/reference/global-tile-ids/ |
Then in property dock window we need both ID and GID coz hard to operate with of ID should be for collisions etc cases with algo game. |
Strange.. I did not know that can be different ID.. in .tmx file is not separated.. but is dissonance when working with map and have some sprites to touch and identify for code.. I see repeatable ID on .tmx files but ID on file is different from GUI dock. |
GIDs are a format-specific detail, they do not exist until you write the map out as a file, and different file formats may use different ways to disambiguate tilesets, not all of them use GIDs. You should NOT be using GIDs as part of your game logic! They may be inconsistent between maps (if maps e.g. use different tilesets, or use the same tilesets in a different order), and they are a file format implementation detail. You should use data assigned to the actual tiles instead. At best, you can use the tile IDs, but ideally you should be using custom properties on the tiles. You should not need to even look at tile IDs generally, Tiled provides much better tools for things like matching in-game data to specific tiles (or layers, or objects, or maps...). |
Don't care.. need in app see the ID as .tmx file have.. coz nothing to do.. but bad case is to searching ID for sprite in .tmx file to recognize and control by code. |
Looks problem is more advanced or bug.. |
Finally comment.. there is no option to see GID in GUI app, only when preview .tmx file in some other editor like notepad.. this is bad case. |
As I wrote before, GIDs are a file format implementation detail, not all map formats use them. So, they simply "don't exist" to be displayed in the GUI, they're only generated as needed if/when you write to a file format that uses them. Just like image editors don't let you view/edit the PNG data blocks directly, Tiled doesn't let you view/edit the GIDs - because they're not actually the map data, just a way to represent it in a text format. That you're making active use of them in your game beyond merely using them to reconstitute the map data is an unintended use case that is not likely to become supported. |
Don't know what You trying explain.. and thats mind GIDs ID should be as "unknow" in GUI and not used in development? Each sprite added to map on second layer as coins for examples are far from ID.. and to discover colision must operate this ID from .tmx map.. Then.. try to load to python .tmx file with pytmx libarary to operate collisions.. or something.
What a stupid explanation.. here.. GIDs are in tmx file as image I added 484.. it is a tile on layer. Are you developing games with this app and gui? How you recognizing tile for collision like coins? |
Yes, I am developing games with Tiled. I identify tiles by the method described on the GID documentation page I linked earlier - the GID tells me which tileset the tile is from, and which tile in that tileset it is. The GIDs are only relevant when reading the map in my game, at which point I create the data as used by my game directly (collision representation, lists of collectible items, drawables, etc). In my game I don't need to keep tile identifiers around after that, but if I did, I would use tile pointers, not GIDs, since a tile pointer is unique to the tile, while a single tile may have as many different GIDs as there are maps. I don't understand what you're doing in your game. Either you're overcomplicating things, or you didn't read the documentation page I linked and are misunderstanding the function of the GIDs. |
What is But how you counting or mapping this IDs per sprite without checking .tmx file? The case is that I don't want to verify nothing in .tmx files coz why? But now must due GUI. Then if you developing games, how you doing identification for .png files if in developing process eg. adding more tiles, operating names as workflow? You trying manage names to be sure it is next after current tabs?
Also is possible in GUI replace tile positions accidentally or as dev want when edit:
The ID is this same for tiles but position in GUI is other. Next case, adding next sprites and tiles but not 64x64 but 32x32.. so by this counting it's not so clear as + next similar size array for this..
|
From my side and experience exist bug. 2nd tilesets are characters. Due changes around GID as not rational case here, then if many maps as .tmx files is impossible to easy mange tiles as good workflow without hard job. GID not respecting "FIFO" here, by this whole array is always broken in case basic map image tiles are still this same. Note case.. that without Tiled Editor for gaming was excel/csv used ;] |
Describe the bug
The dock property for sprite_2 sprite_3 showing tile ID = 2, 3 4 in case in file is 484, 486
To Reproduce
Expected behavior
This same ID in dock widget like file .tmx
Media
not have time for this
Specifications:
The text was updated successfully, but these errors were encountered: