Skip to content

Restored Tiled 1.8 file format compatibility by default #3560

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

Merged
merged 3 commits into from
Feb 9, 2023

Conversation

bjorn
Copy link
Member

@bjorn bjorn commented Feb 2, 2023

Since Tiled 1.9, the "type" attribute was written out as "class", for consistency with the new "class" attribute added to other elements. This change affected the TMX, JSON and Lua formats. For compatibility, a "Compatibility Version" option was introduced for projects, which could be used to restore compatibility with Tiled 1.8.

This change has unfortunately caused considerable confusion, and many existing libraries and frameworks supporting Tiled files still do not support "class" even half a year after this change. Renaming this attribute just for consistency was clearly a mistake.

This change restores the compatibility with Tiled 1.8 by default, using "class" only in new places but reverting back to the older "type" attribute for map objects and tiles. This is not consistent, but compatibility is more important than consistency.

For projects that came to rely on the Tiled 1.9 approach of using "class" consistently, a new "Tiled 1.9" compatibility mode has been introduced.

Finally, new projects no longer default to the latest version, but rather to the current version. This means that should there ever be a reason to break compatibility in the future, such breakage will not affect existing projects (when they are using a .tiled-project file at least).

Since Tiled 1.9, the "type" attribute was written out as "class", for
consistency with the new "class" attribute added to other elements. This
change affected the TMX, JSON and Lua formats. For compatibility, a
"Compatibility Version" option was introduced for projects, which could
be used to restore compatibility with Tiled 1.8.

This change has unfortunately caused considerable confusion, and many
existing libraries and frameworks supporting Tiled files still do not
support "class" even half a year after this change. Renaming this
attribute just for consistency was clearly a mistake.

This change restores the compatibility with Tiled 1.8 by default, using
"class" only in new places but reverting back to the older "type"
attribute for map objects and tiles. This is not consistent, but
compatibility is more important than consistency.

For projects that came to rely on the Tiled 1.9 approach of using
"class" consistently, a new "Tiled 1.9" compatibility mode has been
introduced.

Finally, new projects no longer default to the latest version, but
rather to the current version. This means that should there ever be a
reason to break compatibility in the future, such breakage will not
affect existing projects (when they are using a .tiled-project file at
least).
@bjorn
Copy link
Member Author

bjorn commented Feb 7, 2023

TODO:

  • Adjust TMX and JSON formats documentation and their changelogs.

@bjorn bjorn merged commit 40d28c5 into mapeditor:master Feb 9, 2023
@bjorn bjorn deleted the compatibility branch February 9, 2023 11:42
@bjorn bjorn self-assigned this Feb 9, 2023
@bjorn bjorn added this to the Tiled 1.10 milestone Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant