Search Unity

Question Issues figuring out how to manage tilemaps and prefab rooms getting positioned correctly

Discussion in '2D' started by PaperMouseGames, Jul 27, 2020.

  1. PaperMouseGames

    PaperMouseGames

    Joined:
    Jul 31, 2018
    Posts:
    434
    Hi there! I'm working on a 2D top down RPG (in the style of the old 2D final fantasies or Stardew Valley) and I wanted to create random dungeons. Rather than using something like cellular automata though, I was trying to use the approach of creating rooms and hallways and then stitching them together to create a dungeon.

    I had started using the tilemap system to build handcrafted areas. I really like creating areas with the tilemap tools because it's tile based so the items fit perfectly and are spaced perfectly. I even started creating rooms in the tile palette and then I'm able to paint them with ease onto the tilemap.

    That works great, and I also have a fairly good idea (I think) of how to stitch together prefab rooms with exits and entrances outside of the tilemap system.

    But the issue is that I'm wondering if there is a way I can make these two systems play together. Building rooms is so much easier using the tilemap system, but I'm not sure if I could maybe build them there, and then prefab them. Another option would be to somehow take the prefab rooms and build them onto the tilemap, but that seems more complicated.

    Any tips on how to get started with this would be really great. I found a few tips from googling, but I haven't been able to figure anything out yet beyond how to generate the rooms together.

    tl;dr: Basically I'm trying to build rooms and stitch them together, but I want to be consistent in how I do it, and the hand crafted areas of my game use the tilemap system so I'm trying to see if I can build tile palette rooms and then prefab those so that I can ensure all the tiles are spaced evenly for the prefab etc.