How would I prevent dead ends from my game map?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
MaxGamz
Party member
Posts: 102
Joined: Fri Oct 28, 2022 3:09 am

How would I prevent dead ends from my game map?

Post by MaxGamz »

I started working on making a randomly generation cave map, however the main issue I have is that there are a lot of dead ends which make it harder for the player to traverse from one end to another. I also need space for enemies to move freely around. I want it to not just be predictable but also ensure that there is a way out.
TestMap.love
(460 Bytes) Downloaded 28 times
User avatar
darkfrei
Party member
Posts: 1184
Joined: Sat Feb 08, 2020 11:09 pm

Re: How would I prevent dead ends from my game map?

Post by darkfrei »

MaxGamz wrote: Tue Sep 05, 2023 2:19 pm I started working on making a randomly generation cave map, however the main issue I have is that there are a lot of dead ends which make it harder for the player to traverse from one end to another. I also need space for enemies to move freely around. I want it to not just be predictable but also ensure that there is a way out.

TestMap.love
Random is too difficult to predict, use something like Reaction diffusion or other type of cellular automaton to calculate it.
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
dusoft
Party member
Posts: 521
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: How would I prevent dead ends from my game map?

Post by dusoft »

darkfrei wrote: Tue Sep 05, 2023 4:49 pm
MaxGamz wrote: Tue Sep 05, 2023 2:19 pm I started working on making a randomly generation cave map, however the main issue I have is that there are a lot of dead ends which make it harder for the player to traverse from one end to another. I also need space for enemies to move freely around. I want it to not just be predictable but also ensure that there is a way out.

TestMap.love
Random is too difficult to predict, use something like Reaction diffusion or other type of cellular automaton to calculate it.
Or index dead ends and do connections (portals) between them. But the proposed diffusion mechanism is better.
User avatar
milon
Party member
Posts: 472
Joined: Thu Jan 18, 2018 9:14 pm

Re: How would I prevent dead ends from my game map?

Post by milon »

Procedural maze/cave/map generation is a vast topic. These are good ideas, but there's more ways to do it. Poke around online and see what you find - you may come across a solution that works better for you. (Not saying reaction diffusion is bad at all - I just have no way of knowing if it's your best solution.)
Any code samples/ideas by me should be considered Public Domain (no attribution needed) license unless otherwise stated.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 12 guests