Feedback on my maze generator

local Maze = MazeEngine.new(10, 10):Generate({1, 1}, 0.5)

local Maze = MazeEngine.new(50, 50):Generate()

I don’t really know what to do next, I’m a bit confuse of how it should actually look like.

13 Likes

Looks nice. Could use improvement such as faster generation.

That’s because there’s a wait for visualization it can be disabled with:

local Maze = MazeEngine.new(10, 10)

-- By deafult currently is set to true
Maze:SetVisaulize(false):Generate({1, 1})

Thats convenient, well it looks really nice and everything is perfect so… I like this but I do not see a use in this other than showing it off.

Actually I plan to make open sourced, and I’m a bit confused of how it would be customizable either the player use his own wall or just set the color and change the size and eveything.

Maybe have the generate take in a table in this format :

{
  X = 10,
  Y = 10,
  Color = Color3.fromRGB(255, 255, 255)
}
1 Like

Looks amazing! Really likes how it clears everything up at the end too.

1 Like

Should I also like implement it’s own path finding, since the maze is actually stored on a table; path finding would be viable and fast since I’ll just be comparing numbers, not parts or using raycast.

I got the path finding working the algorithm is called the A*; on a 500 x 500 grid size it takes about 6 seconds to find the fastest path from start to end, this is what it looks like when debug mode for path finding is enabled on a 100x100 and 50x50:



Edit: Some optimization is till possible such as heap optimization, the slowest part of when generating the possible path is this:

--node is a metatable with __eq it's not a number
for _, node in ipairs(openSet) do
	if (node < currentNode) then
		currentNode = node
	end
end

It loops the entire table weather the node’s GCost or HCost is lower.