November 2016 development updates

Week 44

Tiled Monday

This day was all about making progress on the wip/tilesetdocument branch. One problem, now that the map and tileset editors are only shown when opening a respective file, was that Tiled started up completely empty the first time. So I implemented a simple start page for when no files are open:

While doing this I also introduced a simple action registry. Apart from making it easier to reuse actions from various places in the code, I intend to use it in the future for configurable keyboard shortcuts. For now, it also allowed to easily make the “New Tileset” button in the Tilesets view work again (92fca32).

Then I fixed refresh of draw margins when tileset tile offset is changed (6be00dc). Previously this always happened for just the map using the embedded tileset, now all maps using the tileset need to be updated. Because this could potentially be quite a few, I’m delaying the recalculation until it is actually needed.

I noticed the tileset view for the first opened tileset would remain empty. Once I found out why it was easily fixed.

Thinking back about the workflow, it occurred to me that there is a problem when a user creates a new (external) tileset, then uses it on a map and then saves that map without having saved the tileset. Because at the point where the map is saved, it does not know how to refer to the tileset. I decided to solve this by immediately asking to save new maps and tilesets when creating them.

In the meantime, I’ve also removed the 5 pixel margin for dock widgets, simply because I think it looks better without and it makes it clearer where the views can be resized.

Finally, I merged a big update to the TMX Schema Definition by assofohdz.

Tiled Tuesday

I continued to work towards making the wip/tilesetdocument branch more functional. First I added back the ‘New’ button on the main tool bar, now as a menu to choose between a map or a tileset. Then I added a Tileset menu providing access the tileset properties, making sure it is only visible when editing a tileset.

Then I made the zoom actions also functional in the tileset editor (4a936bb), fixed issues with the Remove Tileset action (24c0712), fixed crash when changing tile probability (5f27116), fixed double loading of tilesets (3abe086) and restored ability to edit tileset parameters (9c062ab).

All in all, I was amazed how many things were still to be done, and more problems still remain. In the evening, I fixed up the tool bar appearance to look beter with the tabs sitting on top:

Tiled Friday

Making progress on the wip/tilesetdocument branch was great, but I also wanted to finally get a Tiled 0.17.1 bugfix release out. In addition, I wanted to add Linux binaries for this release as well. Even though I had already gotten some build working earlier this year and recently Simon Peter had been helping to get an AppImage building on Travis CI, it still took me the better part of the day to get a decent package out.

Problems that remained to be solved included getting plugins and translations to work and resolving a crash as soon as the file dialog was opened. I also first tried to get it to work with the Qbs build system, but eventually fell back on qmake. And I set it up to automatically deploy the AppImage to GitHub.

With that all done, I’ve pushed the v0.17.1 tag and did all the releasing work, which is still way more manual work than I’d like it to be. I’ll look for ways to automate it further, especially for OS X.

Week 45

Tiled Monday

In the morning I’ve been mostly replying to e-mail, forum posts and GitHub activity.

I spent a bit of time trying out a pull request adding an export to GameMaker: Studio. The plugin mostly worked fine, though I was quite surprised how inefficient the storage format was, and how bad the tile map editor in GameMaker: Studio really was. With a few modifications this plugin can be accepted. I noticed that in the meantime, YoYo Games has announced GameMaker Studio 2, and of course I took a bit of time to try that out as well. They have vastly improved their tile map editor in this version and their storage format is now more efficient as well. Still, I think it would be interesting to see if Tiled can also support the new version.

In the afternoon I continued on the wip/tilesetdocument branch, working on restoring the reloading functionality that is also used when files change on disk. Unfortunately it turned out to be quite tricky so I didn’t manage to finish it.

In the evening I still spent some time to set up snapshot builds for Linux. They are built on Travis CI as AppImage, the same as for releases, but are then pushed to itch.io using their butler tool. This way, it is easy to keep the snapshot up-to-date by installing it using the itch.io app.

Tiled Friday

This Friday I spent practically the whole day restoring the reload functionality and adding reloading of tilesets. The latter was tricky because it needs to keep any references to those tilesets valid, and any direct pointers to the tiles or terrains in the tileset need to be cleared. While working on this I ran into numerous issues and crashes that I’ve fixed as well.

One piece of functionality that is lost here, is that it is no longer possible to affect the tileset in any way while having a map selected. Allowing this would be confusing, since trying to undo any such change would fail because it is part of a different undo stack. This makes editing tile properties, collision and animation a little less accessible. On the other hand, it makes it clear that those things are stored with the tileset and overal it becomes easier to share tilesets between multiple maps. I’m still positive that Tiled will come out better than before in the end.

Looking Ahead

Tomorrow I’ll try to make more progress on the wip/tilesetdocument branch. The last bit of functionality that needs restoring is the “broken links” widget that tells you which external files could not be located. It’ll need to work for both maps and tilesets now. Then there are still other issues, like floating dock widgets not hiding when switching tabs. But hopefully the branch will be in a state where I can get some initial feedback on the change soon.

Week 46

Tiled Monday

In the morning I merged the GameMaker: Studio export plugin and made several adjustments while testing its functionality. The workflow for using this plugin will still need to be documented. I’m looking for feedback from anybody actually using GameMaker: Studio.

I also fixed crash when a map with a tile animation is loaded but the tileset image could not be loaded (#1393) and worked around a bug causing the wrong layer name getting edited when switching maps (#1396). Then I looked into a reported problem with loading large TGA images, but couldn’t find any issue apart from missing support for RLE compressed TGA images.

In the afternoon I worked on the wip/tilesetdocument branch, making small steps towards making it usable:

  • Support image collection tilesets when reloading tileset images (Ctrl+T) (362f66d)
  • Fixed crash when saving a new tileset for the second time (c71d002)
  • Fixed double entry for TSX format (767cff9)
  • Made reloading of tileset images also work for tileset files (403d4d7)

None of these changes were planned, but all of them were necessary. To be continued on Friday!

A post was split to a new topic: C bindings for reading TMX/TSX files

Week 46 (continued)

Tiled Friday

I got sick so I couldn’t be very productive. I tried to code a little bit anyway and I managed to:

  • Switch from QGLWidget to QOpenGLWidget (3fb30ab). I did this mainly because QGLWidget is broken on HiDpi screens, but it also avoids a dependency on QtOpenGL.
  • Fixed editing type and name for multiple objects (e49c2de).
  • Fixed ability to change the source image of a tile (fde4544).

Week 47

This week there was no Tiled Monday because I was visiting my mother in law with my family (while being sick). It is why there were three Tiled development days in week 44.

Tiled Friday

I worked this whole day on restoring the broken links widget. It is a nasty beast to work on, though it is an important bit of functionality for those running into it. I didn’t manage to finish it just yet.

Week 48

Tiled Monday

In the morning I released Tiled 0.17.2, bringing some bugfixes (most importantly avoiding a crash on macOS). I also merged two pull requests:

  • Support for Tileset margin and spacing for GameMaker plugin (#1400)
  • Up/down buttons in objects dock + pixel coordinates for objects in status bar (#1384)

After merging the second pull request and making some improvements, I realized I needed to reverse the order of the objects in the Objects view for those actions to really make sense (regarding rendering order when using “manual” object ordering). So I spent the rest of the day implementing this, but at the end I wasn’t happy with the implementation. I realized I could potentially do it in a nicer way by creating a reversing data model proxy, and I made a start on that as well but couldn’t finish it anymore.

Summary

Overall, I’ve made a great deal of progress on the wip/tilesetdocument branch this month, and I’m confident I’ll get to the point of merging it into master in December. At the same time, I’m considering to branch off a Tiled 0.18 release from master just before merging it, because I’d like to allow for a long testing and feedback period once wip/tilesetdocument is merged.

Merging that branch will be such a milestone for me, and I look forward to no longer having it around and focusing once more on adding all kinds of nice features to Tiled!