QLNEO Posted September 7, 2017 Share Posted September 7, 2017 So, I'm making a game with procedurally-generated rooms, and I want them to have similar walls, but some tiles replaced with "cracked" versions, to make things look more organic. For that effect, the ideal would be that each tile would have a chance to be replaced by the alternative. I'm aware that Tiled has options for randomizing tiles during tileset construction, but I would have to create a limited number of tilemaps for each variation, I'd rather have them be generated at runtime. What's the better way to go about this? One thing I have in mind is using putTile for every tile to be replaced, but that would be a bit cumbersome and I would have to deal with two sources of tilemap data, the tilemap and the randomizer. Still doable, but I'd rather have the information in the tilemap itself, if that's possible. Link to comment Share on other sites More sharing options...
samme Posted September 7, 2017 Share Posted September 7, 2017 See the randomise, replace, shuffle, and swap examples in examples/v2/category/tilemaps. I don't quite understand though, do you want to know how to modify the tilemap or how you could store the relevant information in the tilemap? Link to comment Share on other sites More sharing options...
QLNEO Posted September 7, 2017 Author Share Posted September 7, 2017 My objective is to have two possible tiles (a normal and a "damaged" version of the same graphic) for a specific position, so that there's a chance, for each tile position, that what appears on the ingame tileset is the second version. What I wish, however, is to put that information in the tilemap if possible. If not possible, I'd want to know what are the other ways to do that. A randomly activated putTile() probably would be one of these, from what I gather. Link to comment Share on other sites More sharing options...
samme Posted September 7, 2017 Share Posted September 7, 2017 You can add metadata to placed Tile Objects in an Object Layer. Also you could add a hidden Tile Layer that's the "damaged" variant of the visible Tile Layer and use it only to select tiles from. Link to comment Share on other sites More sharing options...
Recommended Posts