Creating roads with no diagonal tiles


#1

I need to add a lot of roads for my map, each 1-tile wide but road tiles must not be placed diagonally i.e. tiles must connect in four directions only. Currently I am using the stamp tool to draw freely but fixing all the diagonal tiles into L-shape is a pain. Is there any easier way to create roads like this?

EDIT: I don’t have any corner tiles, I can only use a bunch of 1x1 tiles that are mostly filled :(.
EDIT 2: Here is the problem illustrated, I cannot do any adjustments to the tiles :man_facepalming:


(魔大农) #2

When holding down shift you can draw lines using the stamp tool, this still works with stamps consisting of multiple tiles. So in your case you could draw a diagonal line using a stamp of two corner tiles, if I correctly understood your situation.


#3

I don’t have any corner tiles and holding shift still places some of the tiles in diagonal :frowning: Thanks for helping tho.


(魔大农) #4

Could you share your tileset for clarification?


#5

I am not allowed to share it :man_facepalming: but here is my problem illustrated


(魔大农) #6

You still seem unaware of the ability to stamp multiple tiles simultaneously. Try dragging the mouse over a small bit of your map, while holding down the right mouse button, to create a multi-tile stamp.


#7

This might help a bit but not much, I need thousands of these roads connecting to nodes scattered on the map. Thanks for the help.


(Thorbjørn Lindeijer) #8

So the problem seems to be that when drawing with the stamp brush, the lines it makes can end up not covering the corners, sometimes making only diagonal connections.

This happens especially when moving the mouse fast or drawing lines while being zoomed out, since the lines drawn from one mouse position to the next are computed based on Bresemham’s line algorithm, which specifically avoids including those corners.

It seems to me that for your use-case, Tiled should have a drawing mode that specifically does include those corners. Currently it doesn’t have that, but soon (within a few weeks) it should be possible to make a scripted brush that does this. Alternatively you could look into modifying Tiled’s Bresenham implementation and compiling a custom version of Tiled for your needs. With the current version of Tiled, another workaround would be to draw those roads slowly, making sure to draw the tiles at the corners.