You said each cell is independent, but you still generate one by one?
@willcorffКүн бұрын
Now what if you combined all the maze algorithms?
@divy12112 күн бұрын
the water and flow analogy for Binary tree maze generation is so beautiful, and the idea to use space filing curves is amazing. Awesome video!
@Aurarora2 күн бұрын
amogus in the thumbnail 💀
@the10ofdiamondscard3 күн бұрын
latest snapshot has pacman unicode characters in it... perfect for pac-mine
@DqwertyC3 күн бұрын
That's cool! I might try to use those if I update this to 1.21.4
@skittlez04964 күн бұрын
It would be amazing if you could implement origin shift to alter the maze while someone is attempting to complete it- like an actually realized labyrinth. Or, I suppose, you could be extra cruel and just set the maze generator at repeating pulses to generate an entirely new maze multiple times while someone is already in it
@DqwertyC2 күн бұрын
I think this would work with a long-ish delay between regenerating the maze. I tried it with a ~3s delay when I was building it, and it actually made solving the maze *easier*, because I could just wait a couple of seconds and a door to either the north or the east would probably open
@hanelyp14 күн бұрын
If every cell can be computed independently, using a pseudo-random based on the coordinate of the cell and a seed value, the maze could be generated as traversed. Use a height calculated from the coordinate and you can even have a "zero storage" maze, where all that needs to be remembered is your current cell and the random seed. Perfect for an infinite maze.
@arturovi4 күн бұрын
great video :))
@ryanthescion4 күн бұрын
Now I await the 3D tileable maze generator
@a52productions5 күн бұрын
Your intuition about slopes and paths to use as a basis for maze-generation is very suggestive, and reminds me a lot about conservative fields in vector calculus (vector fields that arise as the gradient of a sloped surface -- basically, they point downwards). I wonder if there's a way to extend this to a much larger class of surfaces, which we can take the gradient of to form basises for new mazes? Taking the gradient of a surface wouldn't be too bad once we had a representation of it, but representing and generating those surfaces in Minecraft would be much harder. You'd have to find a way to encode a loooot of different possible height values. I also don't think every possible random surface would work. Some non-rigorous exploration suggests that valid heightmaps need to have at most one local minima (cell with no neighbors lower than it) -- this is equivalent to the "single origin" condition given in the Origin Shift video. I'm not sure how one could generate such surfaces, without using techniques that are effectively maze-generation methods in and of themselves. For example, you could generate a path, permute it into a non-branching squiggle, then use that as the basis of your maze by turning it into a heightmap... but at that point why not just use origin shift? You could also use some kind of annealing method, where local minima are nudged together until there's only one left. But that would require global information, wouldn't be very fast, and would generally end up with the "origin" at the center. Hmm..
@danielrhouck5 күн бұрын
If you run origin shift for long work does it approach uniform spanning tree? Does it actually *reach* uniform spanning tree with the right stopping condition (eg. if you stop the origin has visited each cell you get a uniform spanning tree)?
@DqwertyC5 күн бұрын
I'm not certain, since the math behind the proofs is beyond me, but I think it would be for the same reasons Aldous-Broder is
@WaterDroplet026 күн бұрын
this is sick! is there a world download available? it'd be really fun to mess around with this
@Pystro6 күн бұрын
Interestingly, you aren't even limited to using space filling curves for the "heights". The only condition you have is that all cells except for one have at least one neighbor with a lower index (which then probably should be called an elevation rather than an index). Oh, and two neighboring cells have to have different values - but that's often of trivial; for example when even/odd values form a checkerboard pattern. You can for example generate such a height map by taking an existing maze, choosing a random origin point and calculating every cell's distance (along the paths) from that point. The indices of the cells can be pre-calculated from a fixed maze (if you just want to make it slightly less obvious how the maze is generated). Or you can use the maze generated in the previous run. The only downside with that is that the new maze will be quite similar to the previous one. But if you iterate generating a maze from the previous maze an infinite amount of times, you'll probably even get the property that all mazes are equally likely. Fun fact: If you take the taxicab distance from a corner you get back to the binary tree algorithm; And if you take the taxicab distance from the center you get the midpoint tree algorithm.
@DqwertyC5 күн бұрын
I had thought of something similar (using another maze as the heightmap for generating a new maze), but hadn't considered moving the origin between iterations. If the origin stays in a fixed location, I'm pretty sure the maze eventually devolves into a 'mid'-point tree, regardless of the starting state
@Pystro5 күн бұрын
@@DqwertyC Correct, if the origin stays in place, then you will eventually devolve into a mid-point tree. And while we're talking about devolving: The Hilbert Curve is technically one special case of a maze that a binary split algorithm (with a slightly modified order of the splits) can generate. Which makes it seem like you should technically have more possible mazes if you generate your heightmap from a "binary split" maze than if you used a Hilbert curve.
@Pystro5 күн бұрын
Another interesting (but not very challenging) arrangement of heights that I realized was possible after writing the initial comment: With the spiral heightmap, you're iterating over each edge of the remaining central "square" portion, and assigning heights that always decrease in counter-clockwise direction. This gives you 4 "pizza slices" where you're effectively running the binary tree generation. If you instead *alternate* the direction between clockwise and counter-clockwise on even/odd distances from the outer edge, or if you *randomly chose* between clockwise and counter-clockwise progression for each edge, then you'd effectively be running a sidewinder-like generation in each pizza slice.
@tonerrr42956 күн бұрын
i dont understand how some insane thing done in minecraft ends up in a video series by a youtuber with less thank 2 k subs! This deserves so much more recognition this is so cool!!!
@KensaKunVRC6 күн бұрын
9:29 erm…
@JUMPY_NEB6 күн бұрын
Do you use arrow keys to move or are you able to detect arrow keys in data packs?
@DqwertyC6 күн бұрын
Mojang recently added input predicates to the game, which allows a datapack to directly detect movement keys, even when the player is spectating or riding an entity and can't directly move themselves
@JUMPY_NEB6 күн бұрын
@ I know that just in the video you said to move in the games you use arrow keys Do you use arrow keys to move or WASD
@DqwertyC6 күн бұрын
@JUMPY_NEB I use wasd, but the datapack will detect whatever the player's movement keybinds are
@JUMPY_NEB6 күн бұрын
@ oh I see now thank you
@Nathouuuutheone6 күн бұрын
Instant repeater?
@lelaleasl6 күн бұрын
How about Wilson's, without erasing the loops. It wont make a tree, and sometimes theres gonna be loops (but i think thats interesting for gameplay) but it would be a lot faster
@lelaleasl6 күн бұрын
I like recursive division, cus it makes the maze feel like it has "biomes" places where the maze behaves and feels very differently
@jokerofspades-xt3bs6 күн бұрын
Origin shift seems like a perfect tool for a Minotaur style shifting maze. Maybe using command blocks to create a giant floating golden cube as the curser of the algorithm (above player height so it doesn’t just crush them).
@shayden72276 күн бұрын
I hate how great channels like this are not popular but stuff like skibidi tolet has people foaming at the mouth
@rorystockley59697 күн бұрын
Very cool
@PLMMJ7 күн бұрын
I feel like, if you need to do more painting stuff, you should have all the paintings lined up in your inventory and bring them to your hotbar when it's their turn. Then you would spend less time and mot have to re-check paintings.
@vsikifi7 күн бұрын
All these algorithms generate singly connected mazes that can be solved trivially by following one wall. Multiply connected mazes require the solver to actually memorize where he has been to avoid running in a loop.
@Andrew-jh2bn7 күн бұрын
As long as the maze starts and ends on the side, it can always be solved by following one wall. Now if you end in the middle, then yes you're correct.
@captainluma79917 күн бұрын
I know the title said 1 second maze generator, but that didn't stop my jaw from dropping after seeing it in action.
@jimiwills7 күн бұрын
That was really interesting ❤
@zealotoffire38337 күн бұрын
This inspired me to start working on a map generator as well, i decided to use spiral tree algorithm, and i so far have gotten a working 8 rt design or 0.8 second generating one. spiral algorithm doesnt generate as difficult ones as hilbert lookahead but the design i have is vertical and each tile is 4x4 with the center always being powered and the 1 layer aorund shared so it works with a standard 2x2 density pixel. im still working on it but so far i have a few pixels working all exactly 0.8 seconds.
@DqwertyC7 күн бұрын
Nice! I think with this randomizer I might be able to trim it down to half a second if I removed the latch system (so it's activated by turning on a switch instead of pressing a button), replaced the doors with iron doors, and got rid of the display. I think I could also save just a couple ticks by placing the randomizer between the display and the doors. At the end of the day, 1 second was a nice round number
@zealotoffire38337 күн бұрын
@@DqwertyC Yeah, my version works because i made this modified randomiser that when u power it and hold the power it will stay at the random state, and only stop when u stop powering, leading to a design of a giant array of signals some connecting to randomisers and some being the centre pixels taht are always on. the randomisers and each piexl i made take all 8 ticks and all the repeaters i can power with a syncronise signal using insta repeaters which means it should be 8 ticsk 😀
@zealotoffire38337 күн бұрын
@@DqwertyC also are yuo able to make a discord server for your community so ppl like me can post things like what im doing to other people who are interested 🙂
@DqwertyC7 күн бұрын
@@zealotoffire3833 I guess it's poorly named anymore, but the Command Block Cove (linked in the description) is my Discord
@SuperLlama888888 күн бұрын
Great job! Loved this series!
@Tsicky8 күн бұрын
Can you do a video trying to solve the maze from the inside
@Nachiebree8 күн бұрын
What do target blocks do for redstone? I haven't touched modern versions because I play modded, but I see targets everywhere in modern redstone.
@DqwertyC8 күн бұрын
In my case, I use them because they're a solid-block redstone component. Because they're solid, they'll turn off connected torches when powered, and because they're a redstone component, any neighboring redstone dust is guaranteed to point into it
@JasminUwU7 күн бұрын
@DqwertyC It's super convenient for small builds
@LordHonkInc8 күн бұрын
I remember seeing the video where CaptainLuma came up with the Origin Shift algo (before the name was even finalized), so seeing people refer to it alongside these much older and more sophisticated algos feels like hearing somebody prove Einstein's general relativity theorem by finding gravitational waves and going "oh yeah, I remember hearing him talk about that in that one Berlin pub in 1916"
@zackbuildit888 күн бұрын
One flaw of this: in normal pacman, you can't reverse direction in a hallway, so that you can't just turn away from a ghost to escape, but in this, you can
@DqwertyC8 күн бұрын
Huh, I didn't know this. For very version I can find, pacman can reverse, just never stop unless he runs into a wall. I don't have access to the original hardware, just emulators and remakes, and while there's a ton of info about ghost behavior there's not as much about pacman's actual movement
@zackbuildit888 күн бұрын
@DqwertyC hm, well, after checking for a minute myself, I actually may be thinking of a different version than the original Pac-Man? And it had just changed that specific feature? I'd just assumed that it would've been from the original game, but I'll try to find an emulator and check properly
@zackbuildit888 күн бұрын
@@DqwertyC update! I have checked, and the original arcade version did NOT restrict backwards movement for the player, only the ghosts! You did a solid job, I had been mistaken
@GameJam2308 күн бұрын
I think what could be really interesting is creating a tileable cell that combines this with origin shift to allow it to generate the base maze extremely fast but then also make it a changing maze that maintains its solvability. It would also make it more challenging to solve regardless of where the exit is placed
@brycehawken18338 күн бұрын
I’ve always made binary division, the downside is the lowest level has dead end that are obvious. The maybe upside is if you don’t see the large view it’s really hard to solve because you can’t tell if you have visited this area before because it locally all looks the same
@caspermadlener41918 күн бұрын
Binary tree mazes have the property that two people, at the start and finish of the maze, can always meet up in the highest point of Hilbert curve, since it is always possible to walk upwards. This affects the maze quality, but the speed makes up for it.
@zackbuildit888 күн бұрын
Well, for any valid non-segmented maze, every room already *would* be connected. This actually isn't a flaw of binary tree mazes specifically, it's true in general
@caspermadlener41918 күн бұрын
@zackbuildit88 Well, that's not exactly what I mean... The maze is generated based on a "height" map, independent of the specific maze. But from every point, there is only a single "higher" point, so you can always walk directly upwards, if you remember the height map. This means that you can always walk in a straight path towards the "highest" point on the map. If there is another person at the exit doing the same, you can meat up, and this solves the maze.
@zackbuildit888 күн бұрын
@caspermadlener4191 that requires knowing where you are and orienting that, though
@caspermadlener41918 күн бұрын
@@zackbuildit88 Yes, you might want to bring a map with you to orientate yourself, but spacial orientation is something you can learn
@C1OUS3R8 күн бұрын
This is dope
@MalcolmCooks8 күн бұрын
doctor: you have 1 second to live me: thank god I can still generate a random maze with redstone
@Golem6428 күн бұрын
Correction : "Thank god i c-"
@peglin51178 күн бұрын
The main problem I see with this maze is that it still feels really easy to solve. As long as you know there’s a hillbert curve generating the maze you can solve it by trying to follow the curve and trying to “cut corners” as often as possible
@jonk78218 күн бұрын
That's true, but since it's so fast, you could then run another maze algorithm on the existing maze, like origin shift, to make it more complicated. the main problem with origin shift was that it would take a while to get a complex maze, so if you start with a hilbert look ahead maze, it should be pretty complicated if only taking a few seconds longer to generate.
@DqwertyC8 күн бұрын
This would be true if the exit were at the end of the curve, but is still a valid point. Since the exit is near the middle of the curve, you don't know if you need to follow the curve while cutting corners to reach the exit, or if you need to skip towards the end of the curve and then backtrack to reach the exit
@captainluma79917 күн бұрын
Placing the entrance at the top right corner, and the exit at the bottom left solves this issue. (assuming the hilbert curve starts in the bottom left quadrant, and ends in the bottom right quadrant)
@filval3878 күн бұрын
The fact you not only managed to make it generate in exactly one second, but you even managed to use the new redstone to your advantage, and on top of that, you made an entire system to replace the configuration using command block just for showcasing the other algorithms... This is mad impressive! A possible feature to add would be to randomize an entrance and exit to the maze (Unless that's already a thing).
@choonyongtan56718 күн бұрын
That's insanely fast
@RaPsCaLLioN11388 күн бұрын
Very happy to see this and thanks for the shout out!
@guigui02468 күн бұрын
so to make this in survival I would need to manually select where to place pistons or not for the randomiser. I would have prefered it detecting automatically if there is a valid neighbour
@stekeln8 күн бұрын
Not every neighbor is a valid neighbor, but what neighbors are valid doesn't ever need to change. There is no point in complicating the redstone to calculate something that can be built into the wiring itself.
@guigui02468 күн бұрын
@@stekeln I know but I want to build the same cell over and over again without having to change the wiring, here the cell changes every time the size of the maze changes
@DqwertyC8 күн бұрын
If you flip the hilbert curve along its diagonal each iteration, the cells from the previous iteration would be the same. You'd still have to manually set each cell, but you could expand it without messing with previous cells
@guigui02468 күн бұрын
@@DqwertyC "You still have to manually set each cell" is what I would like to not have to do
@the_furf_of_july46528 күн бұрын
Only the one layer needs customization, so you can build from the bottom up to the pistons, draw the pattern with the pistons, then build the top part with the corridor and display.
@potatoking56028 күн бұрын
The fact that it's exactly 1s literally makes It Grian-Proof and that is amazong
@jaydentt8 күн бұрын
what ?
@SquidCoder8 күн бұрын
True but don't underestimate grian
@DqwertyC8 күн бұрын
I think he means that, because it finishes so fast, it can't be broken by spamming the start button
@iout8 күн бұрын
@@jaydentt Grian is a minecraft youtuber known for his love of pushing buttons (both physical and metaphorical) and he often breaks redstone machines by either spamming the buttons or messing up the order. Because of this, he has a tendency to catch problems no one else has even thought of. It’s a running joke among the hermitcraft and redstone communities that making something Grian-proof is the hardest quality to obtain. Because this maze generates entirely within one second, as long as the input is rate limited to less than one press per second, this should theoretically be Grian-proof. Though there’s truly only one way to test that claim.
@Nachiebree8 күн бұрын
@@iout Don't buttons take a second to un-push themselves?
@ceritaernest89918 күн бұрын
12:12 that's actually good
@p5ina8 күн бұрын
Wow, this is insane!
@thealientree38218 күн бұрын
I like how it feels like Wilson’s Algorithm was having a character arc.
@the_furf_of_july46528 күн бұрын
Would it be possible to do a different hybrid of aldous-broder-wilson? Rather than having an arbitrary threshold to switch from one to the other, have both methods run at once/alternating steps. The odds of both methods getting stuck at once would be lower, and the transition would be more gradual and convenient. My main concern is if this would still meet the same maze quality result.