Jump to content

In-game randomization of tiles?


QLNEO
 Share

Recommended Posts

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

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...