Maze Thread

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Zer0
Citizen
Posts: 59
Joined: Sat Oct 06, 2012 9:55 am
Location: Sweden
Contact:

Re: Maze Thread

Post by Zer0 »

Ref wrote:Hi Zer0!.
Hi Ref!.
Ref wrote:Once I weeded out all the threading stuff, it was apparent why we were seeing the same maze being generated..
You needed to call math.randomseed(os.time()) in the thread ( and I forgot to do that )
Ref wrote:Maze generating library is actually very easy to use & stable.
Thanks found that one on http://pcg.wikidot.com/

Anyway here's a couple of mazes I made with the mechanics exmplained from "Algorithm" is not a four-letter word
Attachments
BinaryTree.love
Binary Tree
(3 KiB) Downloaded 250 times
RecursiveBacktracker.love
Recursive Backtracker
(3.2 KiB) Downloaded 427 times
KruskalsMaze.love
Kruskals Maze
(3.18 KiB) Downloaded 269 times
If you can't fix it, Kill it with fire. ( Preferably before it lays eggs. )
Germanunkol
Party member
Posts: 712
Joined: Fri Jun 22, 2012 4:54 pm
Contact:

Re: Maze Thread

Post by Germanunkol »

Zer0, those are very nice! It's very fun to watch. Although my definite favourite one is the recursive backtracer, the others are too biased for my taste.


Inspired by this thread, I wrote a map-creation system (sort of like a map editor except that you write code to generate the map) for my game and tried out a simple modified "Drunkard Walk" on it:
20x20 Map:
Image

40x40 Map:
Image

Edit: and a stress-test: 80x80 Map:
Image
This won't be very practical in the game (pathfinding in realtime would probably be too slow if there's around 40 trains on the map), but I'm really glad it worked!
Edit 2: Try to find the train on the last image :D
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
User avatar
silver_hawk
Prole
Posts: 36
Joined: Mon Feb 27, 2012 2:19 pm

Re: Maze Thread

Post by silver_hawk »

Some sample images from my dungeon generator, which will be released soon I hope ;)
It has multiple algorithms implemented, but this one is the maze algorithm tested, in 160 x 160 with tiles.

First one featuring the maze algorithm with tiles, and room creation on:
n0172zM.png
n0172zM.png (93.54 KiB) Viewed 6663 times
Second zoom in on the upper-left corner:
vTvJcVm.png
vTvJcVm.png (182.09 KiB) Viewed 6663 times
Third is a zoom in on the room number 23
GxzW0GM.png
GxzW0GM.png (344 KiB) Viewed 6663 times
The fourth is a maze only shown:
niYO2Jo.png
niYO2Jo.png (79.36 KiB) Viewed 6663 times
Hope to release this to the public soon, there is still some more balances to be done.
User avatar
Zer0
Citizen
Posts: 59
Joined: Sat Oct 06, 2012 9:55 am
Location: Sweden
Contact:

Re: Maze Thread

Post by Zer0 »

Germanunkol wrote:Zer0, those are very nice! It's very fun to watch. Although my definite favourite one is the recursive backtracer, the others are too biased for my taste.
I like that one to.
EDIT:
I also uploaded ( or my web designer did ) them to my website.
http://www.zer0problem.net/clicks/click.php?id=7 -- Weave Maze ( suprisingly fast )
http://www.zer0problem.net/clicks/click.php?id=8 -- Kruskals Maze ( Very good maps but boring ( not as boring as the binary but still boring ) )
http://www.zer0problem.net/clicks/click.php?id=9 -- Binary Tree ( Very boring to look at )
http://www.zer0problem.net/clicks/click.php?id=10 -- Recursive Backtracker ( It's like a snake trying the get out of a box )
Germanunkol wrote:Inspired by this thread, I wrote a map-creation system (sort of like a map editor except that you write code to generate the map) for my game and tried out a simple modified "Drunkard Walk" on it:
20x20 Map:
Image

40x40 Map:
Image

Edit: and a stress-test: 80x80 Map:
Image
This won't be very practical in the game (pathfinding in realtime would probably be too slow if there's around 40 trains on the map), but I'm really glad it worked!
Edit 2: Try to find the train on the last image :D
FOUND IT.. but I cheated, I replaced all the red and green in the image with blue.
It's visible down to the left under the window saying "map by Germanunkol"
Attachments
THE train
THE train
THETRAIN.png (705.63 KiB) Viewed 14341 times
Last edited by Zer0 on Thu Jul 25, 2013 3:07 pm, edited 1 time in total.
If you can't fix it, Kill it with fire. ( Preferably before it lays eggs. )
User avatar
Sodium
Prole
Posts: 42
Joined: Sun Jun 03, 2012 9:05 pm

Re: Maze Thread

Post by Sodium »

I did one too!! my first one.
it's pretty noob compared to those others in this topic but I rly enjoy making it, so much that I even put some things n shit on it.

changing lg.line for lg.square increased my fps in 100%. weird, ha?!
Attachments
A_maze.love
(11.07 KiB) Downloaded 243 times
I love okra. :P
User avatar
pakoskyfrog
Citizen
Posts: 62
Joined: Mon Feb 04, 2013 12:54 pm
Location: France

Re: Maze Thread

Post by pakoskyfrog »

Hellö everyone !
I did some experiments as well, and since i really dislike squared grids, guess what ? I tried these on hexagrids ! ^^

I didn't include a love file, since it was just a test/prototype, let's say it was coded with my feet :death: (especially the rendering function)
Attachments
Hexamaze 2
Hexamaze 2
Capture-hexamaze003.PNG (50.85 KiB) Viewed 14186 times
Hexamaze 1
Hexamaze 1
Capture-hexamaze002.PNG (51.29 KiB) Viewed 14186 times
Germanunkol
Party member
Posts: 712
Joined: Fri Jun 22, 2012 4:54 pm
Contact:

Re: Maze Thread

Post by Germanunkol »

pakoskyfrog wrote:Hellö everyone !
I did some experiments as well, and since i really dislike squared grids, guess what ? I tried these on hexagrids ! ^^

I didn't include a love file, since it was just a test/prototype, let's say it was coded with my feet :death: (especially the rendering function)
I wonder if I'd find my way faster in a hexa-based maze or a square based one... I really like the looks, well done!
Sodium wrote:I did one too!! my first one.
it's pretty noob compared to those others in this topic but I rly enjoy making it, so much that I even put some things n shit on it.
I like this one as well... looks nice, with the flame "running around" the screen :D
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
User avatar
Zer0
Citizen
Posts: 59
Joined: Sat Oct 06, 2012 9:55 am
Location: Sweden
Contact:

Re: Maze Thread

Post by Zer0 »

pakoskyfrog wrote:Hellö everyone !
I did some experiments as well, and since i really dislike squared grids, guess what ? I tried these on hexagrids ! ^^

I didn't include a love file, since it was just a test/prototype, let's say it was coded with my feet :death: (especially the rendering function)
I made one to, The map is probably stored differently though.

I am guessing as the X position in yours increases it move down towards the right and Y moves it down left.

Mine is even more screwed up with X ( actually being X ) and slightly modifying Y up if X is odd.
and Y is ... well it just moves along the Y axis

Mine is also animated!
Attachments
Hexagon.love
Updated
(1.78 KiB) Downloaded 430 times
Last edited by Zer0 on Thu Jul 25, 2013 11:12 am, edited 1 time in total.
If you can't fix it, Kill it with fire. ( Preferably before it lays eggs. )
Germanunkol
Party member
Posts: 712
Joined: Fri Jun 22, 2012 4:54 pm
Contact:

Re: Maze Thread

Post by Germanunkol »

Nice one!

But it doesn't fill the whole screen. Is this intended? It only draws in the middle of the screen until it reaches the one edge, then it continues a little further around the middle and then ends.
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
User avatar
Zer0
Citizen
Posts: 59
Joined: Sat Oct 06, 2012 9:55 am
Location: Sweden
Contact:

Re: Maze Thread

Post by Zer0 »

Germanunkol wrote:Nice one!
Thank you
Germanunkol wrote:But it doesn't fill the whole screen. Is this intended? It only draws in the middle of the screen until it reaches the one edge, then it continues a little further around the middle and then ends.
its a recursive backtracker and I didnt put a grid limit ( Because of how my map was saved ) therefore I put a length limit. and when it reaches that length it goes back and then keeps going a little less from another spot.
it goes beyond the edge of the screen and you can move with the arrow keys.

EDIT: I also updated the example in the earlier post.
CHANGES:
Move the map with the mouse. ( hold down 'l' )
Longer mazes.
better looking mazes.
highlights the 3 last hexagons in the path table.

EDIT2: I added a hexagon maze generator with a limited field
Attachments
HexaLimited.love
Hexa Limited
(1.82 KiB) Downloaded 214 times
If you can't fix it, Kill it with fire. ( Preferably before it lays eggs. )
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 10 guests