Skip to content
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

Worlds #56

Open
RobLoach opened this issue May 4, 2021 · 3 comments
Open

Worlds #56

RobLoach opened this issue May 4, 2021 · 3 comments
Labels

Comments

@RobLoach
Copy link
Contributor

RobLoach commented May 4, 2021

Be able to load .world World data, along with all the associated maps.

It's JSON, so that means we'd need a JSON library, unfortunately. Perhaps best handled outside of the tmx library as an addon?

@baylej baylej added the feature label Nov 15, 2021
@baylej
Copy link
Owner

baylej commented Jan 26, 2022

There used to be a JSON importer in libTMX using the jansson library, but supporting two file formats that have the exact same features was too much work for me only.
As XML is the historical format and the main format, and as the JSON format is more of an export format, plus the JSON produced by Tiled is considered inconsistent and unconventional by the creator of Tiled (mapeditor/tiled#3212), I decided to drop support for the JSON format.

Unfortunately the JSON fomat has been choosen for world files instead of XML, I was puzzled when the news came out first, is my project (libTMX) obsolete? will JSON supercede XML as the main format to encode maps as well?

For now I decided to do nothing and let users of LibTMX handle these world files.

@bjorn
Copy link

bjorn commented Mar 30, 2022

Unfortunately the JSON fomat has been choosen for world files instead of XML, I was puzzled when the news came out first, is my project (libTMX) obsolete? will JSON supercede XML as the main format to encode maps as well?

I don't think this library is obsolete. It may just make sense to bring back JSON support in the future, potentially dropping the XML format instead to save some work.

It just seems to me that in general, in the past decade JSON has mostly replaced XML as common interchange format. That started with HTTP APIs of course, but it is also seen in recent standards like glTF 2.0, and game development tools, like GameMaker switching from XML to JSON. I think the main reason is that it's easier to parse, often even directly into strongly typed classes, making it very convenient to work with.

So, in trying to make working with Tiled maps as easy as possible, I'm leaning towards defaulting to a JSON based format in the future, though probably only after those issues with the current format have been addressed. New features like the worlds and the recently added export of "property types" only support JSON, since coding support for multiple file formats for each new asset makes things more complex and I don't really see a benefit in doing that.

@baylej
Copy link
Owner

baylej commented Apr 7, 2022

Thanks for clarifying the situation.
I'll revive the json loader when Tiled fully adopts json as its main format.
There will probably be a feature gap because that code is old, also some features provided by the libxml2 don't exist in the json parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants