Maze Thread

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Autogenerated Perfect Maze

Post by Robin »

kikito wrote:I'll contribute with a presentation that I didn't do myself, but it's awesome nevertheless:
Nice. It seems I unwittingly implemented Prim's algorithm for maze generation.

EDIT: nope, it's the "growing tree" one, although I did use the term "frontier". I experimented with taking the newest and introducing a bias for older nodes, but I prefer the straight up random one, that works similar to Prim's.
Help us help you: attach a .love.
User avatar
silver_hawk
Prole
Posts: 36
Joined: Mon Feb 27, 2012 2:19 pm

Re: Autogenerated Perfect Maze

Post by silver_hawk »

Great link about mazes, the best part is the "weave" algorithmns, didn't know they existed :D ty :ultrahappy:
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: Autogenerated Perfect Maze

Post by Ref »

Zer0 wrote:
Ref wrote:2. I get the same maze every time. (See that you have a shuffle function but ...)
that's odd... try adding math.randomseed(os.time()) not sure if I forgot that
A little help.
Tried seeding in a number of locations and calling random.shuffle a random number of times but still seem to get the same maze.
Overlooking something obvious.
See attachment for what I'm getting (added map overlay).
Attachments
automazetest.love
test of automaze generation
(3.64 KiB) Downloaded 263 times
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Autogenerated Perfect Maze

Post by Taehl »

Great link! It looks like I happened to make something similar to that "growing tree" algorithm.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
User avatar
Zer0
Citizen
Posts: 59
Joined: Sat Oct 06, 2012 9:55 am
Location: Sweden
Contact:

Re: Autogenerated Perfect Maze

Post by Zer0 »

Ref wrote:
Zer0 wrote:
Ref wrote:2. I get the same maze every time. (See that you have a shuffle function but ...)
that's odd... try adding math.randomseed(os.time()) not sure if I forgot that
A little help.
Tried seeding in a number of locations and calling random.shuffle a random number of times but still seem to get the same maze.
Overlooking something obvious.
See attachment for what I'm getting (added map overlay).
Happens to me to, just never realised it was the same map.

Anyway here's another one that gives DIFFERENT mazes.
It's also animated. ( kinda )
Attachments
New Maze ( without loops )
New Maze ( without loops )
love 2013-03-01 17-30-59-35.jpg (213.04 KiB) Viewed 7739 times
PerfectSpotMaze.love
The Maze!
(2.18 KiB) Downloaded 230 times
Old Maze ( with loops )
Old Maze ( with loops )
love 2013-03-01 16-20-07-32.jpg (213.66 KiB) Viewed 7781 times
Last edited by Zer0 on Fri Mar 01, 2013 4:33 pm, edited 4 times in total.
If you can't fix it, Kill it with fire. ( Preferably before it lays eggs. )
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: Autogenerated Perfect Maze

Post by micha »

Zer0 wrote: Anyway here's another one that gives DIFFERENT mazes.
Nice one. I like the visualization. However, the maze in the lower picture (the one with the tunnels) is not a maze. There are many parts in the maze that are not connected to the rest.

Edit: You were faster than me and removed the picture already.
User avatar
Zer0
Citizen
Posts: 59
Joined: Sat Oct 06, 2012 9:55 am
Location: Sweden
Contact:

Re: Autogenerated Perfect Maze

Post by Zer0 »

micha wrote:Nice one. I like the visualization. However, the maze in the lower picture (the one with the tunnels) is not a maze. There are many parts in the maze that are not connected to the rest.
I know.
I am making a weave maze ( if that was the name ) I just need to figure that thing out. :awesome:

EDIT: I am now done with the weave maze.
Attachments
Maze 2!
Maze 2!
love 2013-03-01 17-48-04-85.jpg (215.04 KiB) Viewed 7735 times
Maze 1!
Maze 1!
love 2013-03-01 17-48-06-51.jpg (215.03 KiB) Viewed 7735 times
WeaveMaze.love
Weaves!
(2.24 KiB) Downloaded 198 times
If you can't fix it, Kill it with fire. ( Preferably before it lays eggs. )
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Autogenerated Perfect Maze

Post by Jasoco »

Zer0 wrote:that character is from Oracle of seasons and oracle of ages. I used to have both those games on my old GBC
It's from Link's Awakening. (And Oracle) Shirley you've heard of Link's Awakening?
User avatar
Zer0
Citizen
Posts: 59
Joined: Sat Oct 06, 2012 9:55 am
Location: Sweden
Contact:

Re: Autogenerated Perfect Maze

Post by Zer0 »

Jasoco wrote:
Zer0 wrote:that character is from Oracle of seasons and oracle of ages. I used to have both those games on my old GBC
It's from Link's Awakening. (And Oracle) Shirley you've heard of Link's Awakening?
Heard of it. I didn't own a copy but I played on someone elses GBC. ( Very Little )

Anyway here's the Perfect Weaveform Maze Generator in LÖVE Webplayer.
http://zer0.3owl.com/clicks/click.php?id=7
If you can't fix it, Kill it with fire. ( Preferably before it lays eggs. )
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: Maze Thread

Post by Ref »

Hi Zer0!
Once I weeded out all the threading stuff, it was apparent why we were seeing the same maze being generated.
Maze generating library is actually very easy to use & stable.
Thanks, greatly appreciated.
Attached script continuously generates random mazes.
The number of cells can be changed (on the fly) using either the arrow keys or wasd.
The 't' key shows the actually content of the maze map and 'f5' saves the maze to Love's hidden directory.
Plan to use with an A-star program.
Attachments
automazegentest2.love
simple demo of Zer0's amazing library
(2.52 KiB) Downloaded 229 times
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Semrush [Bot] and 3 guests