Im making a rogue like game and I made a tilemap system which works fine everything spawns as it shoulld all connected. Anyways my issue is that because I randomly generate the tiles I cant really find a way to make the same type of tiles x and x tille with the same sprite to not be next to each other does anyone have any idea on how I can fix this. Also is there a way I can limit the amount of the specific tile that can used for example a market tile can I limit it to saying there can be max 4 and min 1 thanks for your help.
(Example of the problem)
[183163-ekran-alıntısı.png|183163]