Unity Tutorial: ROGUELIKE Room / Dungeon Generation (Like the Binding of Isaac)

  Рет қаралды 21,106

Rootbin

Rootbin

Күн бұрын

Tutorial on how to make roguelike rooms and doors generation in Unity, like it's done in the binding of isaac.
Scripts coming soon.
Join the discord server: / discord
0:00 Setup Unity Scene
4:42 Coding "Room" script
6:14 Coding "RoomManager" script
20:15 Make rooms spawn randomly
21:49 Adjacent Rooms logic
25:00 Open Doors
35:06 Outro

Пікірлер: 50
@matthieuboissel3676
@matthieuboissel3676 4 ай бұрын
Hey! Great tutorial! Just want to post my solutions for the two problems i can see in your system. 1) The room overlapping Put this check in the TryGenerateRoomFunction : if (_roomGrid[x, y] != 0) return false; 2)The error when a room tries to be created outside of the grid Put this check also in the TryGenerateRoom function (put it before all the other checks by the way) : if (x >= gridSizeX || y >= gridSizeY || x < 0 || y < 0) return false; Hope this helps anyone!
@rootbindev
@rootbindev 4 ай бұрын
Thank you
@ke77i
@ke77i 3 ай бұрын
when you fix the overlapping the first room never spawns with any doors
@ynngih725
@ynngih725 21 күн бұрын
god damn, that was a dousey. I managed to follow along and got it to work like yours, but now I'm exhausted. Much appreciated, liked and subed.
@rootbindev
@rootbindev 21 күн бұрын
well done!
@FennrirWolf
@FennrirWolf 7 ай бұрын
Great tutorial! One of the better, well explained ones I have seen on this topic. Would love to see more on this series for sure!
@rootbindev
@rootbindev 7 ай бұрын
Thank you very much!
@PaniniDev
@PaniniDev 6 ай бұрын
AHHH Root how did I miss this upload of yours. I have always had notifs on D: Nonetheless, very organized tutorial!!
@rootbindev
@rootbindev 6 ай бұрын
Thank you Panini! :D
@MadChirpy
@MadChirpy 8 ай бұрын
Great video, please continue! Adding a few timestamps/chapters to videos as long as this one could be nice, just a thought. But good job, mate!
@littlenugget4711
@littlenugget4711 3 ай бұрын
Hey, awesome tutorial! I'm currently making a game for my school's game jam, and this helped soooo much. Thank you!
@rootbindev
@rootbindev 3 ай бұрын
Thank you, and Good luck with the game jam!
@picatsso6721
@picatsso6721 6 ай бұрын
Everything works just fine! Great tutorial! I'd like to see you explain how to spawn a boss room, a shop, secret rooms, like in Isaac!
@rootbindev
@rootbindev 6 ай бұрын
I'm glad you liked it! I might do that in the future!
@picatsso6721
@picatsso6721 6 ай бұрын
Oh, by the way, I just did it myself, with help of ChatGPT, now it's perfect: Boss Room is always has a connection to only one room and is always the furthest room from the start, also Treasure room and Shop room generating with only one room adjacent to them. It is still based on your code, just saying, if you are interested to see how AI implemented this - let me know.@@rootbindev
@LizzySphinx
@LizzySphinx 8 ай бұрын
LOVE THIS tutorial! Very thorough and to-the-point!
@rootbindev
@rootbindev 8 ай бұрын
thank you!
@migalesch1839
@migalesch1839 5 ай бұрын
thank you!
@ItsReece2
@ItsReece2 8 ай бұрын
This tutorial is great, well done and keep it up! I did notice that some of the rooms do overlap on top of each other during runtime. Do you know why?
@rootbindev
@rootbindev 8 ай бұрын
Did you follow the tutorial 100%? In my game, using this code I get no overlaps
@ItsReece2
@ItsReece2 8 ай бұрын
Yes, I did follow it but might be possible I missed something in the tutorial. I must say it's very uncommon it happens the overlap; normally overlaps from starting room and occasionally another room from the neighbouring nodes. @@rootbindev
@FennrirWolf
@FennrirWolf 7 ай бұрын
I also noticed this same issue. It is pretty far and few between, and also as Reece mentioned it is usually an overlap on top of the starting room. Rarer occasions do include non-starting rooms overlapping too. I'm not sure if this is the most efficient fix, but in our Update when we call the TryGenerateRoom 4 time, I added checks for neighbors prior to actually generating in any direction. I have not seen any overlap since I added these checks. if (gridX > 0 && roomGrid[gridX - 1, gridY] == 0) { //No neighbor to the left TryGenerateRoom(new Vector2Int(gridX - 1, gridY)); } if (gridX < gridSizeX - 1 && roomGrid[gridX + 1, gridY] == 0) { //No neighbor to the right TryGenerateRoom(new Vector2Int(gridX + 1, gridY)); } if (gridY > 0 && roomGrid[gridX, gridY - 1] == 0) { //No neighbor below TryGenerateRoom(new Vector2Int(gridX, gridY - 1)); } if (gridY < gridSizeY - 1 && roomGrid[gridX, gridY + 1] == 0) { //No neighbor above TryGenerateRoom(new Vector2Int(gridX, gridY + 1)); } @@rootbindev
@bsdrago
@bsdrago 6 ай бұрын
@@rootbindev I have the same problem, and you can see the problem in your video too (eg, 20:07). You can see 17 room created, but only "12" visible
@rootbindev
@rootbindev 6 ай бұрын
Try adding the checks that @FennrirWolf posted above@@bsdrago
@rvlli2377
@rvlli2377 9 күн бұрын
The camera in mine is square instead of rectangle but all of the settings are the same as what you have in the Inspector. What might need to be changed? edit: Found a solution: "By default, cameras will match the shape of your view in the Game window. To set it to the aspect ratio you want, go to the upper-left corner of the Game window, click "free aspect" and change it to the aspect ratio or resolution you want" In our case, I think it's 16:9
@LogicStudios_1
@LogicStudios_1 3 ай бұрын
Great tutorial, how would I go about instantiating something at the last room generated... Edit: Figured it out. Add this code where you set generationComplete = true. GameObject lastRoom = roomObjects.Last(); Instantiate(boss, lastRoom.transform.position, Quaternion.identity); Make sure your script is using System.Linq;
@rootbindev
@rootbindev 3 ай бұрын
Thank you for sharing!
@RG-vv4wcRG
@RG-vv4wcRG 7 ай бұрын
Nice
@rvlli2377
@rvlli2377 8 күн бұрын
How would the code change if we were to want the walls of adjacent rooms to be the same wall rather than having space in between the rooms?
@bixarrio5251
@bixarrio5251 7 күн бұрын
Change roomWidth to 17 and roomHeight to 9. The grid cells will then be the exact size of the room and the walls will lie on top of each other to make it look like they're the same wall
@MaximumSpice
@MaximumSpice 5 ай бұрын
I assume you forgot or didn't want to add the scripts in the description :(
@SurvivalGamingyt
@SurvivalGamingyt 5 ай бұрын
Would this also work with tilemap based rooms?
@AvoDev
@AvoDev 5 ай бұрын
yeah, I was able to do it with minimal effort, just create a tilemap grid on the room object, and give it some colliders.
@migalesch1839
@migalesch1839 5 ай бұрын
Sometimes rooms are generating inside of existing rooms, any idea how to fix this?
@rootbindev
@rootbindev 5 ай бұрын
I've noticed as some guys told me below, I'm not sure why
@codered_dev
@codered_dev 4 ай бұрын
ummm some dungeon patterns are repeating like
@MrBerfayHunalp
@MrBerfayHunalp 6 ай бұрын
where are the scripts
@rootbindev
@rootbindev 6 ай бұрын
I can send them at discord
@Arcann_bhp
@Arcann_bhp 6 ай бұрын
Does this work with tiles?
@rootbindev
@rootbindev 6 ай бұрын
I haven't tried it but it should work
@Arcann_bhp
@Arcann_bhp 6 ай бұрын
@@rootbindevalso how can you edit the room like as content, if there’s only one prefab how can you make different type of rooms
@rootbindev
@rootbindev 6 ай бұрын
Make another room prefab that suits your needs, and before instantiating the room you decide which prefab to Instantiate :) @@Arcann_bhp
@Arcann_bhp
@Arcann_bhp 6 ай бұрын
@@rootbindev so I can just make a list of room and then randomize with the length of the rooms?
@rootbindev
@rootbindev 6 ай бұрын
Exactly! Atleast that's how I would do @@Arcann_bhp
Unity Multiplayer in 3 minutes
3:01
Rootbin
Рет қаралды 3,2 М.
Making an Arcade Roguelike in 48 Hours | Sparkchild Devlog
12:34
Жайдарман | Туған күн 2024 | Алматы
2:22:55
Jaidarman OFFICIAL / JCI
Рет қаралды 1,8 МЛН
Clowns abuse children#Short #Officer Rabbit #angel
00:51
兔子警官
Рет қаралды 57 МЛН
THE POLICE TAKES ME! feat @PANDAGIRLOFFICIAL #shorts
00:31
PANDA BOI
Рет қаралды 25 МЛН
LOVE LETTER - POPPY PLAYTIME CHAPTER 3 | GH'S ANIMATION
00:15
I rewrote my dungeon generator!
4:27
UnitOfTime
Рет қаралды 152 М.
A CHASM of Mediocrity - Procedurally Generated Metroidvanias
20:34
ingeniousclown Gaming
Рет қаралды 524 М.
The moment we stopped understanding AI [AlexNet]
17:38
Welch Labs
Рет қаралды 660 М.
7  ПАРАДОКСОВ БЕСКОНЕЧНОСТИ
36:02
Mathin
Рет қаралды 608 М.
Pathfinding Explained in the Binding of Isaac!
9:36
Himsl Games
Рет қаралды 10 М.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,4 МЛН
I Played the HARDEST Skyblock
25:16
Lord Jon25
Рет қаралды 6 МЛН
A new way to generate worlds (stitched WFC)
10:51
Watt Designs
Рет қаралды 516 М.
This Godot 4 Scene Manager Does it ALL
28:50
Bacon and Games
Рет қаралды 21 М.
Herbert Wolverson - Procedural Map Generation Techniques
27:29
Roguelike Celebration
Рет қаралды 106 М.
Жайдарман | Туған күн 2024 | Алматы
2:22:55
Jaidarman OFFICIAL / JCI
Рет қаралды 1,8 МЛН