I want to make a game where the player makes a dungeon. What should i be learning?

I want to make a game where the player makes a dungeon. They would build rooms, tunnels, monsters for those rooms then heroes would come through the dungeon to kill them and get loot.

I what terms should i be looking up that would help me learn how to do this?

Is there a good tutorial to make rooms snap to each other as the player is placing them or anything like that?