Tilemap: Multiple tiles in one position? (layers of tiles)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Paternostro
:warning: Old Version Published before Godot 3 was released.

Pretty straight forward question: I want to be able to place more than one tile in the same position, I have square tiles that are full, and that are half cut to be able to some nice borders, but to do that I have to be able to place my half cut tiles on top of an existing tile of another type.

When I try to place a tile in a occupied space it will just replace the older one. I tried to look at the whole inspector, search for it, but couldn’t find a thing about this. I don’t know if I’m missing something obvious because to me it’s a pretty basic feature of a tilemap.

Here is an example: Full and half cut stone tiles.

Here you can see an example: Full and half cut stone tiles

:bust_in_silhouette: Reply From: MrMonk

Create a second tilemap (you can use the same tilset, on both tilemaps). Then you can add two tiles on the same location.
When you check for tile type/collision events, make sure you change the tilemap name in the collision function.

If many tilemaps can collide, put them in different layers.

eons | 2017-04-04 11:18

Thank you for your reply MrMonk I thought about that aswell. But apart from the borders I think a common issue is the need to be able to place other stuff like vegetation, rocks, walls, general furniture on top of each other (this is my case aswell).

That could quickly turn into an organizational issue, since I would have to create and manage a TileMap for each. There is an alternative appart from this and coding my own solution?

If you have any thoughts about this or other possible resolution I would love to know.

Paternostro | 2017-04-05 00:12

well, from what I’ve seen, tile map projects have many tilemaps combined with static bodies, that are not part of the tilemap/tileset, but act as a specialized tile. In my current project I have two tilemaps (one is on a different collision mask), and about 5 specific tiles made from staticbodies with collision shape and navigation poly. I use tilemaps when I need many tiles of the same type, otherwise I use staticbody tiles.
Aslo I must say I don’t really understand the complexity of your problem, do you need specific collisions for different type of tiles ? If you don’t can’t you use just simple sprites to fill in your design ?
I also use an “invisible” tile, is part of a tilemap, and I’m using it for navigation where I need a break in, but I also need that part not break the navigation path. (not sure if it’s of any use to you)

MrMonk | 2017-04-05 08:18

It’s my first time using Godot, and I’m still trying to discover if it’s a good option for my project. In this moment I’m not worring about collisions nor navigation, but with the efficiency the artists will have while mapping the gameworld. It seems to me rather workful to have them manually copying, altering and placing nodes in comparison to just dragging and dropping them in a multilayered tilemap editor. You can imagine for example, the painful work of placing a great number of tables with different objects on top of them.

I’m also worried about making them manage multiple tilemaps for every layer there is, as it could lead to future organizational problems. I guess the only option is coding my own solution?

Paternostro | 2017-04-05 14:57

have you seen this:
Tiled Map Importer - Godot Asset Library
it allows you to make your maps into the tilemap editor (http://www.mapeditor.org/) and used them into Godot. I never used it though, but it says:
“Support for image and object layers”… I don’t have other ideas, Godot’s editor is “single layered” and the only way you could have multiple layers is through addition of more tilemaps…

MrMonk | 2017-04-05 17:36

The asset could be really helpful, I’ll surely give it a go. If not I’ll make sure to post here whatever I find useful. Thank you very much for your time and patience :slight_smile:

Paternostro | 2017-04-05 22:58

If there are many different objects, using snap on the editor should be enough if you need regular objects placed on a grid.

There is another plugin for other type of design (non tiled) but may work fine with grid designs as well, look for “asset dropper” on the asset lib.

eons | 2017-04-06 05:47