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

Saved file, compress more than just the layer data #1191

Closed
voidburn opened this issue Feb 1, 2016 · 6 comments
Closed

Saved file, compress more than just the layer data #1191

voidburn opened this issue Feb 1, 2016 · 6 comments
Labels
feature It's a feature, not a bug.

Comments

@voidburn
Copy link

voidburn commented Feb 1, 2016

A map with tons of animations and objects in object groups can still produce a very large file, how hard would it be to extend the data compression to as many properties as possible, other than simply the layer data?

@bjorn
Copy link
Member

bjorn commented Feb 1, 2016

At that point, it would make more sense to compress the entire file. That will however make it impossible to see what is changing in version control software (I realize this is already the case for compressed layer data, but in that case the diff wasn't much use already anyway).

If you really need a compressed file also in version control, then support for .tmx.gz files could be added for example. In fact, the old Tiled Java version already supported this.

@bjorn bjorn added the feature It's a feature, not a bug. label Feb 1, 2016
@voidburn
Copy link
Author

voidburn commented Feb 1, 2016

As long as the editor detects the gz format and deflates the file on load, yeah, it could make sense as a completely different save option rather than internal format. Usually the only times I need to open the TMX in a text editor is when it ends up using absolute paths to external assets (images) instead of relative ones (tbh it should never use absolute paths, there's no deployment scenario in which it makes sense). Without that issue I hardly ever had to check the source, and even if so, I can switch the format on the fly and resave to inspect the xml.

@bjorn
Copy link
Member

bjorn commented Feb 2, 2016

Yeah, the idea is to support a .tmx.gz format transparently for saving and loading.

@bjorn
Copy link
Member

bjorn commented Feb 2, 2016

(tbh it should never use absolute paths, there's no deployment scenario in which it makes sense)

I agree they never make sense, but if the user chooses files that are on different drives then Tiled has no other way to refer to them. Of course, in addition to falling back to absolute paths, it could also warn the user when he tries to add references to such files.

Unfortunately, choosing files is not the only way to mess up the references. Another way is to save your map to a different drive than where you assets are. Of course, a similar warning message could be added there.

Btw, since Tiled 0.15 there is no real need anymore to use a text editor to correct such references. You can now do it from the Tiled UI.

@voidburn
Copy link
Author

voidburn commented Feb 2, 2016

Indeed the paths issue is a thorny argument, but editing directly in the UI is very welcome feature!

A solution could be specifying working paths where TileD can search for the assets (the user can be prompted the first time he tries to import something), and then just reference the assets by unique name. Pretty much like packing sprites inside an atlas works, minus the hassle of having to keep track of their coordinates. It would keep the references in the XML clean, and move the path dependency/resolution on its own tag. Not to mention, the user could be given the option of adding a new path or copying the asset into an existing one, if something is chosen from an external drive/resource.

@bjorn
Copy link
Member

bjorn commented Feb 2, 2016

Yeah, that last suggestion is something I should consider once Tiled has support for projects. Until then there is not really a good place to store such a working path.

@voidburn voidburn closed this as completed Aug 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature It's a feature, not a bug.
Projects
None yet
Development

No branches or pull requests

2 participants