Тёмный

MAKE A MAZE IN UNITY 

b3agz
Подписаться 14 тыс.
Просмотров 18 тыс.
50% 1

Опубликовано:

 

30 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 92   
@Hadoukanen
@Hadoukanen 2 года назад
A maze ing 😂
@redcubedev
@redcubedev 2 года назад
was literally about to make the same joke lmao
@Animacs541
@Animacs541 Год назад
@@redcubedev I hate you to
@ParkusYT
@ParkusYT Год назад
Very nice, works perfectly, could you please expand this video with showing how to implement random spawning rooms in between, like rooms with a door or a completely different room, because i cannot figure out how to do this by myself
@TheTurkkid34
@TheTurkkid34 Год назад
Would it be possible to show the steps you took into adding all the additional features such as the lamps, ground, colored walls, and moving through the maze with the first person controller?
@b3agz
@b3agz 11 месяцев назад
It wouldn't make for much of a video I'm afraid. The first person controller is just the default one unity provides. The lamps and walls are assets from the asset store and I just replaced the default cubes.
@thvk98
@thvk98 2 года назад
please complete mine craft series (player walk on stab)
@TimeZonesDev
@TimeZonesDev 6 месяцев назад
Hey! Loved the video! I've been making a little mini game and this helped a lot. It might make things much faster if you gave out the script that you use. I completely understand if you don't because you want more traction. But, I recently tried to use wave function collapse, in Unity 3D, and it would've saved a lot of time if I just had the script to start out with. Thanks for the video though!
@b3agz
@b3agz 6 месяцев назад
So I started putting the scripts up on Patreon for the people that support me over there. Unfortunately it undermines the "reward" part if I also share them here. I'm glad the video was useful though!
@khhs
@khhs 2 года назад
So, how about a cooking stream for 10k?
@redcubedev
@redcubedev 2 года назад
yes please
@MrCrompz
@MrCrompz 2 года назад
I love how the 'maze' is the backrooms
@mumie_08
@mumie_08 Год назад
Great Video. Can you help me please ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at :0) System.ThrowHelper.ThrowArgumentOutOfRangeException () (at :0) MazeGenerator.CarvePath (System.Int32 x, System.Int32 y) (at Assets/MazeGenerator.cs:149) MazeGenerator.GetMaze () (at Assets/MazeGenerator.cs:26) MazeRenderer.Start () (at Assets/MazeRenderer.cs:14)
@damienarchaglet8088
@damienarchaglet8088 Год назад
my maze keeps coming out in complete like its not knocking down enough wall and if i do more than 5 x5 it doesn't go be on 5x5
@CozierBroom
@CozierBroom 9 месяцев назад
i have the same problem and idk what i did wrong haha
@dprazo
@dprazo Месяц назад
Please how can I add navigation that adapts with the maze randomly generated. Ive been on this for almost 3 days
@CozierBroom
@CozierBroom 9 месяцев назад
So with this can i add like a player spawn and a exit? And some obstacles?
@b3agz
@b3agz 9 месяцев назад
Yeah, this is just the code for making a maze, you can do whatever you want to it once the maze is in place.
@zencmd6762
@zencmd6762 Год назад
Hey man, how long does it usually take to generate the maze? its like unity just freezes up after i press start, i followed your tutorial very thoroughly and im not sure what the problem could be... :(
@Timmah2013
@Timmah2013 Год назад
Hello i enjoed that tutorial but i have got an error IndexOutOfRangeException: Index was outside the bounds of the array. MazeRenderer.Start () (at Assets/Scripts/MazeRenderer.cs:24) its the bool top = maze[x, y].topWall; line whats the solution?
@darteco6507
@darteco6507 Год назад
Dude, I’ve been looking for like 3 DAYS! And this is EXACTLY what I needed. Thank you so much. +1 sub
@b3agz
@b3agz Год назад
Glad it was useful :)
@darteco6507
@darteco6507 Год назад
@@b3agz I have a question, how would I go about placing random stuff on walls. Like if I wanted to place an outlet on a wall every once in a while how would I go about doing that?
@b3agz
@b3agz Год назад
The easiest way would be to make a prefab of your outlet where it's offset to the centre, so you put the prefab down at the same location as the maze node and the outlet is on the wall (rotate for different walls) then spawn them in as you need
@darteco6507
@darteco6507 Год назад
@@b3agz I’m sorry, I still don’t really understand, if I put the outlet in the prefab would it still be random or would it be on every wall?
@Kallax2
@Kallax2 Год назад
@@darteco6507 oh every wall but if you code a bit you can make it appear not everywhere
@BackTasty
@BackTasty 2 года назад
you are so fucking underrated... love your channel
@DeggyYT
@DeggyYT 5 месяцев назад
pls send the script, it so hard to write it
@mynameanonym62
@mynameanonym62 Год назад
Hello, I wanna ask if its possible to bake the ground, because me and my friend wanna make the backrooms projekt and we need an enemy. We tried alot to bake the ground but ut doesnt work. Do you have a solution? Thanks!
@b3agz
@b3agz Год назад
Do you mean navmesh? It is possible to bake a navmesh at runtime but I can't remember what's involved. A hacky solution would be to have a giant invisible plane pre-baked (so the whole floor is walkable) and put Nav Mesh Obstacle components on the wall prefabs... buuuut I don't know how performant that would be
@smilyxd
@smilyxd Год назад
Hello, can you please continue the Minecraft series, maybe cave generation? Thank you.
@LitesLAB
@LitesLAB 2 года назад
I would love an update video on your Game like MineCraft series, will all the code still work? Maybe show how to do cave generation? Structure generation?
@Spookyboy-xy6jh
@Spookyboy-xy6jh Год назад
first of all great video but i was wondering how did u make the comments on each line so fast it almost seemed likeu had a keybind for it can u explain how u did it maybe?
@b3agz
@b3agz Год назад
A combination of my IDE auto-suggesting and me editing out long silences or unwanted noises like breathing or sniffing. If there's nothing critical happening on screen and I'm not talking, I usually cut it out.
@Rose-fm5ue
@Rose-fm5ue 11 месяцев назад
Great tutorial! Thank you so much? How can i create an exit for this maze? Like it has starting location but no ending?
@b3agz
@b3agz 11 месяцев назад
The easiest way would be to track progress "carving" through the maze and place your exit at the last cell. The complexity would depend on whether you wanted the end in a random location or, like, at the maze edge.
@Rose-fm5ue
@Rose-fm5ue 11 месяцев назад
@@b3agzthank you so much! I will try to do it :)❤
@llama878
@llama878 Год назад
hello bro, how are you? first of all thank you very much for the tutorial, the best I've seen on this subject, but I tried to make the algorithm for a 2d game with top down perspective, I finished it, but as expected it didn't work very well, the generation It only worked on the left and right, it didn't do anything on the top or bottom walls, also some walls were placed along the way, I'm quite new to this, can you help me? Or could you tell me a discord or reddit server where they can help me?
@b3agz
@b3agz Год назад
Hi! If you check the description of the video there's a link to my Discord server. Start a new thread in the #help-request channel and we can try get to the bottom of your problem.
@llama878
@llama878 Год назад
@@b3agz thanxs
@RandomDude00001
@RandomDude00001 4 месяца назад
Hi, it's me again, and past few days have passed and I still don't get it. I'm trying to add more cells for the generation and I cant really get it to work any idea how? or maybe you can help?
@gabrielwhite9881
@gabrielwhite9881 2 года назад
@b3agz Great to have u back. ;) and very interesting Video. ;) i think i will steal that algorithm for some small parts of my game. ;) thx
@Ethans_tech
@Ethans_tech 2 года назад
Are you planning to do any more of the Minecraft series?
@bossllama47
@bossllama47 8 месяцев назад
So...I have an issue... When I generate my maze, everything goes good, except for the fact that some of my topWalls aren't generating on the topWall border side. But some of them do! I wonder if it's a specific problem with how my algorithm decides which walls to break. I must've misplaced or mislabeled something. Everything in the prefab is right. Something with the code... Any help would be appreciated.
@StigDesign
@StigDesign Год назад
watching this later :D
@KeyakiOfficial
@KeyakiOfficial 3 месяца назад
I really liked to learn the logics behind maze generations, great tutorial !! :D
@vishnu2737
@vishnu2737 2 года назад
How do we place some object in the maze in random location?
@b3agz
@b3agz 2 года назад
If you set your maze cell prefab up like I did where the origin point is in the centre of the prefab (ie, if you placed the prefab at 0,0, the centre of the prefab would be at 0,0) then just get a random X and Y value between 0 and the maze size and put your item there. If your maze cell prefab isn't centred you'll have to add the offset.
@RandomDude00001
@RandomDude00001 5 месяцев назад
How did you add the roof though?
@RandomDude00001
@RandomDude00001 5 месяцев назад
Oh well sorry for this but I figure it out it already hehehe ........ I just did desame for the floor sorry
@a2aka3boor99
@a2aka3boor99 Год назад
is there no script?
@camsdonostudios7662
@camsdonostudios7662 2 года назад
First
@_k1r1t0_
@_k1r1t0_ 2 года назад
second
@Matthew-Liu09
@Matthew-Liu09 10 месяцев назад
it won't let me put the maze cell object script into the maze cell
@NikosK-05
@NikosK-05 11 месяцев назад
Can you make a link to download the file in your website?
@dannchap9946
@dannchap9946 9 месяцев назад
Hi, Just wondering, when i run the generation code, it says "The name CarvePath doesn't exist in this current context" this is at part 21:06 of the video. Wondering if anyone could help. Thanks
@b3agz
@b3agz 9 месяцев назад
Hi! So, CarvePath is a function we create earlier in the video. If you're getting that error, you might have a typo. Bear in mind that functions are case sensitive, so if you called it carvePath or carvepath, then you would get that error trying to call CarvePath. Also if you renamed the function to something else.
@oml8964
@oml8964 2 года назад
for me its all just dead ends idk how to fix it, theres no maze to actually go through. well not all dead ends like it isnt cubicals, there connected but all the paths lead to dead ends
@b3agz
@b3agz 2 года назад
There's other algorithms to consider but the easiest way I can think with this have the algorithm do "trial" runs (essentially do a path, save it, but don't modify the map yet) and have it loop until it finds one that's long enough (however long you want it) and reaches an outer wall. Then just knock those outer walls out of the way.
@oml8964
@oml8964 2 года назад
i know its not to do with what wall gameobject is selected as what name in the script because, the edge of the maze has no openings, and all of the edges are correct to what they should be, i genuinely am so confused
@oml8964
@oml8964 2 года назад
@@b3agz i found the issue it was because i put if (primaryWall.x > primaryWall.x) thank u for the quick reply
@oml8964
@oml8964 2 года назад
@@b3agz but for some reason there are still areas completely blocked off u cant get in them, and if u spawn in them u cant get out of them
@b3agz
@b3agz 2 года назад
Ah I see what you mean. To fix that using this algorithm, once the carving path function has ended, search through the grid for any unvisited cells and run the algorithm again, repeat until all cells have been visited. You'll never completely get rid of closed off areas but adding that step should take care of most of them
@meepsterboi
@meepsterboi Год назад
Literally perfect for what I needed
@khadijatoritoke1385
@khadijatoritoke1385 6 месяцев назад
Thanks for this video. Can this implementation work for 3D?
@RandomDude00001
@RandomDude00001 4 месяца назад
but it's 3D wait what?
@ilya_rusin
@ilya_rusin Год назад
It looks like The Stanley Parable game.
@Madkevop7
@Madkevop7 8 месяцев назад
The corner walls would be z fighting, any ideas how to fix 🙏
@b3agz
@b3agz 8 месяцев назад
The simplest way to deal with this is to have a little more going on in the maze cell prefab. For example, make the walls so they don't overlap and add corner pillars. Obviously you'll have to enable/disable the corner pillars as well, but it should allow you to have nothing overlapping.
@Matthew-Liu09
@Matthew-Liu09 10 месяцев назад
there are a bunch of errors when i do it
@SuperZloyUser
@SuperZloyUser Год назад
Hey great video :) But I came across a bug in the generation algorithm: line 167 in your video should be moved to the beginning of the cycle, after line 144 🙂
@gabacat
@gabacat 8 месяцев назад
Very useful! Is there a way to randomly generate coins and enemies is the maze?
@b3agz
@b3agz 8 месяцев назад
The simplest most basic way to achieve that would be to bake it into the maze cell prefab. When you enable/disable walls, randomly enable a coin or enemy in the cell. You'd probably want add some probability in there to make sure your maze isn't overflowing with coins and enemies though. You could do that by running a simple random number check. For example, for a 20% chance to spawn a coin, get a random number between 0 and 10. If that number is less than 2, spawn coin.
@zemague5704
@zemague5704 10 месяцев назад
can you provide the code, I dont know how to code so having to copy everything is kinda of a pain in the ass, if you could give the code I would really appreciate it
@b3agz
@b3agz 9 месяцев назад
If you hop in the Discord server it's pinned in the #technical-stuff channel... I know that seems like shameless promotion but you're free to hop straight back out of the server if you don't want to hang around ;)
@zemague5704
@zemague5704 9 месяцев назад
@@b3agz thx a lot, don't worry, I just didn't saw the discord link, it's good to have a community, as a beginner self taught game dev it's helpful to have more people who can give advice, for now it has been only chat gpt
@redcubedev
@redcubedev 2 года назад
c o o k i n g s t r e a m
@b3agz
@b3agz 2 года назад
>:(
@redcubedev
@redcubedev 2 года назад
@@b3agz cooking tinned beans on stream 😳 we've come full circle
@evakoshkaa
@evakoshkaa Год назад
Hi! Sorry, this is completely new to me, we are trying to figre out, how to set up a maze for our navigation study with people with ASD; which programme is it that you open at 1:38? When I try to do it, it only says "unable to open , open external application preferences"
@evakoshkaa
@evakoshkaa Год назад
I've donwloaded assembly-CSharp, I think that's what it is? - but it's still not working :(
@RandomDude00001
@RandomDude00001 4 месяца назад
thats visual studio you need it to code
@evakoshkaa
@evakoshkaa 4 месяца назад
@@RandomDude00001 Thank you; this is all completely new to me, I tried to avoid having to learn coding, but I might need it if I can't find a ready paradigm
@slowestjabroni
@slowestjabroni Год назад
no github links?
@dominicschaefer8738
@dominicschaefer8738 2 года назад
I love love love procedural generation! Great little tutorial and so nice to see you back! When is the next B3agzJam?
@b3agz
@b3agz 2 года назад
No definitive plans as of yet. B3agz Jam tends to happen when I get enough comments asking when the next one is :D
@dominicschaefer8738
@dominicschaefer8738 2 года назад
@@b3agz well, here’s one for ya.
Далее
Easy maze generator using the unity terrain tool
10:34
#kikakim
00:10
Просмотров 8 млн
Simple Physics Based Plane Controller in Unity
28:43
Просмотров 41 тыс.
The Home Server I've Been Wanting
18:14
Просмотров 180 тыс.
Maze Generation Unity Tutorial
40:28
Просмотров 43 тыс.
Radxa X4: An N100 Pi
20:48
Просмотров 53 тыс.
How to Make a Survival/RPG Style Inventory in Unity
1:24:49
RANDOM DUNGEON GENERATOR - EASY UNITY TUTORIAL - #1
7:47
#kikakim
00:10
Просмотров 8 млн