With my wife and children visiting my mother in law for a few days, I’ve had a lot of time for Tiled development this week. As I’ve hinted in last weeks’ update, I’ve used this as an opportunity to dive into the problem of editing external tileset files.
But first I wanted to fix a crash in the Terrain Brush that was probably introduced while adding the terrain erasing mode. At the same time I fixed two small oddities.
Then I started rearranging the Tiled main window. The idea here is that to enable editing of external tilesets, you should be able to open and save these tilesets just like maps. So they will be open documents alongside maps. Since much of the Tiled UI only makes sense to show when editing maps, I’m rearranging it so that which views are available depends on what kind of file you have selected. Here’s a picture to illustrate this:
This is the biggest code change to Tiled since a long time, and actually the amount of required changes as well as open questions was far bigger than I had imagined. On Friday I spent the whole day moving over dock widgets and changing a lot of code to work with a “TilesetDocument” rather than a “MapDocument”.
First Pair Programming Session
On Saturday I did the first pair-programming session with Will Luongo, as part of his Patreon reward. Will had me pick a topic and I suggested we work on making Tiled reuse an existing instance of the program when available. This allows Tiled to open maps from the file manager in tabs rather than separate Tiled instances.
We used Zoom for desktop sharing and video conferencing. Will did all the typing and I’ve guided him while integrating the QtSingleApplication solution, using it to send a message to the existing Tiled instance and having it open the requested files and activate its window. Two hours later we had it working, and Will opened a pull request that I’ve merged to master the next morning, when also the Qbs build was fixed and the Windows installer adjusted to the new dependency on QtNetwork.
It was a very nice experience for both of us and I’m looking forward to doing this again, also with whoever else is interested to get into Tiled development this way! Don’t hesitate to contact me if this sounds interesting for you as well.
I’ve continued making things work on the external tileset editing branch, by making Open File action work also for tileset files, which required more strict detection code since some extensions (like .xml and .json) could be used by both tileset and map files. Then I fixed restoring of previously open documents. Restoring the state of a previously open map works even better now since it no longer only happens when opening Tiled itself. Also the main tool bar had to be moved below the tab bar. Finally in the evening I made saving work for tileset files as well.
All in all, it was a very productive week in which I spent the equivalent of three full days on Tiled. However, also a lot of work remains before the external tilesets branch can be merged back. And there are a lot of questions to answer as well. For example:
When you start a new tileset, it now opens in its own tab. How do you start using it on any open map? Should Tiled show all open tilesets in the Tilesets view and automatically determine the list of tilesets used by a map? Is it a problem that you would then no longer be able to choose a specific tileset order? And is then a separate action needed to remove any usage of a certain tileset from a map?
I don’t personally like that you can’t make any changes anymore to the tileset while you’re editing a map. You need to switch to the tileset file to do that. This means for example, that I can’t see the affect of changing the “tile offset” property of a tileset anymore, since you can’t see the map while editing the tileset. So probably now Tiled needs some way to have multiple windows in the same session? That will need even more big changes in the code.
Any feedback is welcome, either just based on the above screenshots and my concerns raised, or by trying out the
wip/tilesetdocument branch (a Windows installer is available on AppVeyor).
I also had some time to release Tiled 0.15.2, fixing some small issues in the current stable release and including a new Turkish translation and updated Brazilian Portuguese translation.
Since the editing of external tilesets is turning into a huge change, I’ve decided to release the current master as Tiled 0.16. The string freeze has already started so that translations can be updated, and I hope to make the release around the 20th of this month.
Apart from making the best of that release, work will continue towards Tiled 1.0, where the above mentioned changes that bring tileset files alongside map files will have the biggest impact.
Don’t forget to let me know your thoughts!