Extrude border strange behaviour


#1

Hello everyone,

I’m currently playing with tiles and tilemaps.
What I do is having a lot of small tilemaps that I change dynamically to create some kind of autotiling.

I was having some weird lines between my tiles when the camera moves so I tried to set “extrude borders” to 4 and it worked well.

After the last update, my tiling went crazy. And when I set “extrude border” to 0 then the problem disappear.

Is there something I don’t understand about this parameter or is this a bug ?

Here you can see the difference

EDIT :

For some reasons after having touched some parameters this issue stopped and the game began to run normally. Just after that I closed Defold and launched it again and the issue came back even if nothing has changed in the project.

The bundles however never show this behavior will it be macOS or HTML5 even when the build acts crazy.


#2

not sure myself but definitely not doing the latest update after seeing that xD

Edit: it looks like the borders are extruding on the tile source file maybe? instead of on the map


#3

I’m very new to Defold so really I’m not sure to quite get what the “extrude border” parameter does, but for what I understand it creates another texture under the hood that have some borders between tiles to avoid edge bleeding, and uses that textures to draw the tilemaps. By setting the tiles dynamically in script I should not take those new borders in consideration right ?


#4

Not quite, but almost. I wouldn’t call it “under the hood”, you can see that your atlas changes as you change the image.


Our atlas without any properties

04

Margin

Adds a margin to your images by moving them appart from each other.
59
The bounding boxes of our images are the same size but there is now a small gap between the images.

Inner Padding

Adds a padding inside of your image bounding box, effectively making the sprite bigger.
25
_ Notice that the bounding boxes of the sprites are still touching but there is a lot of transparent pixels between the images._

Extrude Borders

Samples the pixel that is at the border of the sprite and extrudes it out.06
You can clearly see that it is extruding the pixels at the border.


#5

Yes in an atlas I can see the differences with “extrude border” but not in a tilesource. Is it normal ?


#6

Yes, it is normal. I would assume it is because the width and height “crops” the image. Makes me wonder if the tilemap we see is the one that is exported how ever.


#7

Ok I think I have found what is causing this strange behavior.
It is interesting in fact, it was because two tilesources were using the same image.
Don’t know exactly what was happening but surely now with two different images the bug does not occur anymore.

This issue is listed in the Defold github