#Understanding Tilemap Layers

16 messages · Page 1 of 1 (latest)

vapid berry
#

I have a bit of an issue with generating procedural generated maps with terrain brushes.
Tried reaching out in the chat, but had no luck.
I am generating a map data within a couple of dictionaries and basically bundling them up to paint them with set_cell_terrain_connect() after all positions are calculated.

The problem I am having is that when I do paint them they refuse to be painted next to each other even though they are on completely different layers and I wish to understand why this is and if this requires me to generate two tilemaps on top of each other?
I would like to stick with as little nodes as possible to make the scenes rather clean.

As shown bellow, I use two different terrain "brushes" and set them to be painted on two different layers which I set up in the tilemap already.
As the picture shows in this example I set up using primitive textures, they do not connect.When using a click to tile command to check the data of said tile, it clearly shows that there should be a ladder close to the ground platform, but it's clearly not painted.
The top tile is using the top of the ladder tile, which makes sense since it's not connected to anything up top and I need to paint over the platform for that to make sense, but the problem still persist with the bottom of the ladder.

set_cells_terrain_connect(0, ground_cells, 0, 2, true) set_cells_terrain_connect(1, ladder_cells, 0, 1, true)

fallen pine
#

Are you able to draw what you want manually?

#

Just as a sanity check

vapid berry
#

On different layers? Let me try...

#

So when I paint it manually with the terrains it works completely fine,.
Shiny ladder is the only one on the ladder layer, the rest are on the ground layer.

#

I'm assuming the layers are array like in order, so starting on layer 0 and so on counting up?

#

I even moved one further behind

vapid berry
#

Oh, I think something has to do with the last parameter in set_cells_terrain_connect(1, ladder_cells, 0, 1, false).
I set it to false and the ladders just started connecting...Gonna play around more..

#

It still doesn't make sense, I am telling it to ignore empty spaces and it refuses to paint, but when I tell it to not ignore them it does paint the rule tile that has a connection to the south...I need to read up and understand that boolean somehow...

broken fern
#

I assume your ladder is using a different terrain rule to your other tiles?

#

I ask because on the top of your ladder you only have one requirement - that there's ladder underneath it. It doesn't need a platform to connect to, nor does it look for one.

#

As for the bottom tile, you didn't share the rule set for that one. Could be something there worth looking into, or could be an extra tile that mistakenly believes it's possible to connect.

vapid berry
#

I did not have a bottom of the ladder, and that might have been why it was confused.

vapid berry
#

So my problem seem to be understanding this:
If ignore_empty_terrains is true, empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints.

English is not my native language, so maybe the phrasing is just unusual, but I thought it should be set to true to for example;
"(0,0) is a main ladder, (0,-1) is the top of the ladder, then because there is no ladder that needs painted at (0,1) and there are no other terrain pieces customized to handle the bottom, just default to whatever fits best".
But this seems to happen when you set it to false instead.

fallen pine
#

It may be that when it's set to true, it can attempt to use an empty tile as the best fit?

#

So by setting it to false, you force it to place something in each spot, which forces there to actually be ladder tiles along the entire length