Jump to content
  • Advertisement
Sign in to follow this  
doctorsixstring

Map Regions from Noise

This topic is 3964 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm looking for a starting point for techniques that would let me take an array of 2D Perlin noise and turn it into a set of polygons that can be used as a map. Perlin Noise Divided into regions Converted to terrain (blue=water, grey=mountain, green=grass) I think I need to analyze the noise as if I were generating a topographic map, where the altitude lines would be lines in a polygon representing that altitude. I'm open for any ideas, since I'm not really sure where to start. Feel free to let me know if there is a better way to create this style of map. I don't want to use my new-found understanding of Perlin noise to be a hammer in search of a nail.

Share this post


Link to post
Share on other sites
Advertisement
Why generate all that detail if you just throw away 99% of the information to come up with those coarse polygons at the end? That would be pretty much the definition of your hammer/nail problem.

What actual information do you want in your final map? If I was just trying to make polygons out of it, I'd probably start by iteratively joining adjacent polygons with similar slopes. But it depends what sort of game you're trying to make.

Share this post


Link to post
Share on other sites
Thanks for the link, smr. I'll do some more research on random level generation, since until now my efforts have been focused on playing with Perlin noise.

Kylotan, my goal is to create random maps for my 2D SF RTS. My original plan was to simply use Perlin noise to generate a tile map with space terrain (nebulas, asteroid fields, black holes, empty space). Lately, I've been thinking that it would be nice to avoid the grid and use any sort of shape I want, both for efficiency and for a more interesting look.



The above image is 256x256 pixels, but generally the map would be much larger and have even more regions.

As for your suggestion to "iteratively joining adjacent polygons", what exactly do you mean? Are you suggesting I start with a grid of polygons built from a noise height map and then join them together based on height or slope?

Share this post


Link to post
Share on other sites
Yes, that's exactly what I meant. But it assumes you actually care about the heights and so on. It seems like you don't care about heights, but just want to generate several regions. If that was the case, I'd probably look to a method that natively works with polygons from the beginning.

If you want to work with the noise map then perhaps some image processing or machine vision methods are what you need. Unfortunately some of those are very complex and mathematically heavy, and I don't know if what you want can be done trivially using a simple method. Perhaps someone on the AI forum might have a better idea.

Share this post


Link to post
Share on other sites
Perlin noise values don't necessarily need to represent heights, do they? I was thinking that they could be used as a grouping mechanism for generating natural-looking shapes out of areas with a given range of values.

In any case, I'm all for exploring other methods that natively work with polygons from the beginning. Do you have any algorithms to suggest?

Share this post


Link to post
Share on other sites
Assuming the polygonal nature of the regions is a requirement, the way I would do this is by first generating a semi-uniform mesh of polygons, then picking random ones to fill with nebulas. Maybe randomly pick a "seed" region and then iteratively expand the nebula to neighboring regions to get more interesting shapes.

In Weird Worlds I created a region mesh by placing polygons around each star, with the polygon edge at the halfway point between two neighboring stars. This results in convex polygons that are easy to use (e.g. when detecting if the mouse pointer is within a polygon). You can search for "Voronoi diagrams" to find out more about this technique.

Share this post


Link to post
Share on other sites
I really like the idea of generating a polygon mesh and generating regions from that. I'll do some thinking on both yours and Kylotan's methods of generating regions from the polygon mesh.

Your Wierd Worlds site is blocked here at work, so I'll check it out tonight. "Voronoi diagrams" seem promising, too.

Thanks for the replies, guys. I'll post back when I make some progress on these techniques.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!