How would I made a randomly generated map for my game?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
How would I made a randomly generated map for my game?
I can understand making a random tile map which I don't find too difficult, but I am having trouble figuring out how to implement noise so that my map isn't too random. For example, I am interested creating a maze game and I don't want love to accidentally create a maze with no exit.
Re: How would I made a randomly generated map for my game?
The maze with 100% achieveblity: viewtopic.php?p=253993#p253993MaxGamz wrote: ↑Mon Aug 14, 2023 3:34 pm I can understand making a random tile map which I don't find too difficult, but I am having trouble figuring out how to implement noise so that my map isn't too random. For example, I am interested creating a maze game and I don't want love to accidentally create a maze with no exit.
Re: How would I made a randomly generated map for my game?
Thanks for the tool! This can come in handydarkfrei wrote: ↑Mon Aug 14, 2023 7:05 pmThe maze with 100% achieveblity: viewtopic.php?p=253993#p253993MaxGamz wrote: ↑Mon Aug 14, 2023 3:34 pm I can understand making a random tile map which I don't find too difficult, but I am having trouble figuring out how to implement noise so that my map isn't too random. For example, I am interested creating a maze game and I don't want love to accidentally create a maze with no exit.
Re: How would I made a randomly generated map for my game?
Mazes have the problem of being extremely non-local. This means that if you create a maze, the solution may pass through some cell at a very far distance, so that if that cell is covered, the whole maze is unsolvable. This non-locality is the reason why you usually don't use noise to generate a maze. It's possible, however, to make several tries until one of them has a solution - a flood-fill algorithm would be able to find out if there's a route from the entrance to the exit.
Surprisingly enough, I've discovered that mazes based on Truchet patterns (I mean of this kind:)
tend to connect very large areas of the screen, no matter the size of the pattern. If you use a Truchet pattern, it would probably take very few tries to find one that connects the entrance and the exit, and they are very quick to generate - flood-filling will probably be the slowest part. You can make an "upright Truchet" too; it takes just a bit of thinking to figure out how to arrange the tiles to make them upright. It will be likely that there are multiple paths to the exit too.
Apart from that, there's a thread dedicated to mazes: viewtopic.php?f=5&t=19873
Surprisingly enough, I've discovered that mazes based on Truchet patterns (I mean of this kind:)
tend to connect very large areas of the screen, no matter the size of the pattern. If you use a Truchet pattern, it would probably take very few tries to find one that connects the entrance and the exit, and they are very quick to generate - flood-filling will probably be the slowest part. You can make an "upright Truchet" too; it takes just a bit of thinking to figure out how to arrange the tiles to make them upright. It will be likely that there are multiple paths to the exit too.
Apart from that, there's a thread dedicated to mazes: viewtopic.php?f=5&t=19873
- BrotSagtMist
- Party member
- Posts: 665
- Joined: Fri Aug 06, 2021 10:30 pm
Re: How would I made a randomly generated map for my game?
There is no law that the map and way through the map have to be generated at the same time.
My usual approach here is to just make a way with some curves and then throw it onto a complete random junk map.
That way you get a guaranteed working solution without having to deal with verifying that it works.
My usual approach here is to just make a way with some curves and then throw it onto a complete random junk map.
That way you get a guaranteed working solution without having to deal with verifying that it works.
obey
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests