Skip to content

GSOC 2017: Wang Tiles

Benjamin Trotter edited this page Aug 28, 2017 · 2 revisions

Wang Tiles

This page is the final work product for the Google Summer of Code 2017 project Wang Tiles, by Benjamin Trotter.

Index

The Code

Over the course of the program, I created 7 pull requests comprising the code for wang tiles, and the shape fill tool.
In chronological order they are:

Wang Tiles:

Shape Fill Tool:

Overview of the Project

I brief description will be given here. For much more detail (with pictures!) my original project proposal can be viewed.

Tiling is a common idea when dealing with square textures or tiles. The idea is to match the pattern of adjacent edges; when aligning two tiles, the edge is unnoticeable as they blend into one another. For the rest of this document, this matching edge pattern will be referred to as a color of that edge. The easiest way to ensure consistent tiling is to make each tile have the same edge color, on all sides. This works, but can lead to very plain, repetitive filling. The solution is Wang Tiles. This simply allows one to fill an area with many tiles, with a variety of edge colors, and the filling algorithm makes sure that all adjacent edges have matching color.

In addition to adding wang tiles, to further improve on filling, I have added a new tool, the shape fill tool. Previously, to fill a rectangular area, one would have to first select an area then fill it. The new tool allows one to simply click and drag to fill the area. It also supports ellipse and custom polygon filling. Of course this tool can also use wang filing methods.

Some more detail and description of how to use the new feature in Tiled's docs.

What is done

Though I ended up being a bit behind on my timeline, everything came together in the end, and I completed all the main project goals I had in the beginning. Wang Tiles is fully merged into master, and works very closely to how I originally outlined. At the time of writing, the shape fill tool is yet to be merged, but works very well and does what I hoped.

What is left to do

Despite completing the main goals, there is still much which can be done. There are a number of stretch goals which I had hoped to have enough time for.
Such things as:

  • An automatic way to assign a wang set
  • Generating a true maze with wang tiles
  • Compatibility between wang tiles and terrain info

Overall I am very pleased with how far I got, and feel there is now a solid foundation for someone to build on in the future.

Final Thoughts

This has been an outstanding learning experience in so many ways. Before GSOC, I had not looked much into open source, and was quite unfamiliar with the territory. Further than that, I had not previously even worked on a project which used more than my own code. It has been a great, and challenging, time learning to work efficiently in a team environment; it has been interesting not only solving challenges in my code, but needing to learn, and work with the bulk of code which was written by others.

Past learning to work with a team, over the past three months I've acquired a great range of new skills. One of my favorite parts of the project became learning and using git for version control; it became a mini-game of problem solving between writing code. Before the project I had never worked with c++, and now I can barely operate without it.

All said, I think there was no better project fit for me than Tiled. It force me to traverse previously uncharted territory throughout computer science, and learn a great deal about many diverse topics. It has been a summer very well spent.