In implementing a maze, I figured a simple thing will help creation. That, and anything sought in Prim's and Kruskal's algorithm seem to only go for walls over using actual blocks as stopping points for walls. Luckily, a generous person by the name of SaxonRahs posted this tutorial on simple maze generation. The way it goes starts with walling off the perimeter, then taking each space after every other in the middle and setting it to a block. That way, one has a set of pillars. With each pillar, one takes a random value and sets an empty space to a block.
It works surprisingly well for the regular rand() function and a set square, but when one goes outside of that set range, ESPECIALLY using seed values...not so much. I've asked them about how to go about working with seeding random values, but the actual application was made about 0.3 versions ago, so there's not too much hope. I also had to add an offset of their owner actor when spawning it in code; luckily there's a function provided that actually spawns a Blueprint class that you can attach as a property in the parent object, but they're not attached upon spawn. As a quick fix, I added the original location of the parent as an offset, but I'm still wondering how to attach the tiles properly on runtime.
Here is a shot of the seeded maze; note the lack of escape.
No comments:
Post a Comment