GodotCon July 2021!

Tiles editor progress report #2

By: Gilles Roudiere 5 February 2021

Two months have passed since my last progress report on the tiles editor rework. A lot of things have been implemented since then. Here are the news.

TileMap tools

I am really close to be done regarding the implementation of the TileMap editor. I have reimplemented most of the tools needed to modify TileMaps, along with new features.

I will start with the selection tool. This tool allows selecting tiles, moving them, deleting them, or copy-pasting them around:

TileMap selection tool

The paint, line and rect tools are making a comeback in 4.0, with a clean support for half-offset shapes:

TileMap drawing tools

I also implemented a bucket fill tool, which can either replace contiguous tiles or all tiles with the same IDs:

Bucket fill tool

All those paint tools support erasing tiles instead of painting them, but they also allow painting with patterns. The pattern used can be set either by selecting multiple tiles in the TileSet, by selecting tiles in the TileMap using the selection tool, or by using the TileMap picker. Of course the picker allows picking a single tile too, so that you do not have to search for the tiles to re-use in the TileSet panel:

Pattern painting

I also added an option making so that, instead of painting the pattern, the painting tools randomly pick a tile out of the ones in the pattern. With the scattering settings, which adds a probability for no tiles to be painted, it allows painting nice organic patterns:

Random pattern sampling and scattering

Tiles with invalid IDs are drawn using a dedicated texture, modulated with a random color generated from the ID. This makes invalid tiles with the same ID being painted with the same color. Those tiles can then be easily replaced with the bucket tool by valid tiles.

Replacing invalid tiles with bucket tool

Atlases setup

The TileSet editor, only supporting atlases right now, has received a few updates.

First of all, atlases now allow creating "alternative tiles". Those alternative tiles share the same texture region as their base tile but can have different properties. This will mainly allow for rotated/flipped versions of the base tile, but any other property could be different too:

Alternative tiles in atlases

As you can see, the atlas editor now features a nice zoom widget, it displays inactive tiles as dimmed, and has a checkboard as a background.

The TileSet editor features several simple ways to create, delete or move tiles around, with a selection mode and two drawing modes. It also features a right-click context menu:

Right-click context menu

Finally, the TileSet editor features an automatic tiles creation system, which detect which tiles are occupied in a texture to create corresponding tiles automatically. Another tool also allows to automatically cleanup tiles outside of the atlas texture. Those are quite slow for now, but I hope I will be able to optimize that. (edit: this is now fixed)

Auto-creation of tiles from an atlas

Early builds

That's it for now. However, if you want to try all of this by yourself, early builds are available, just right here. However, please read the following warning first.

IMPORTANT WARNING: Opening an existing project with these builds will make this project incompatible with any other Godot version. Try these build with a new project or create a backup of existing ones.

Early builds:

The master branch is really unstable right now, so some issues might not come from this tiles editors rework.

Also, for now, those builds can only import atlases from previous version, and only the graphical part is supported. You may give feedback on the already implemented features on this PR. As a reminder, you can see what is planned for the future in this proposal.

See you in the next progress report!