Polygonal map generator for games. Generates island maps with a focus on mountains, rivers, coastlines.
Procedural Content Generation for Polygonal Maps.
The main idea behind the algorithm is taken from Amit's Polygonal Map Generation for Games.
The main code of this repository is based on Rellikiox's Map Generator.
- Using OpenGL or DirectX to represent 3D terrain (and remove dependency on SFML).
- Implement math library for Vector3 to structure 3-dimensional points.
- Create graphics tool to control parameters.
- Add polygonal map generator for basement (e.g. lava, mineral, cave, ground water, and so on).
- Add parameters to control map generation (e.g. the number of islands, maximum heights of map, and so on).
- Seed
- The number of points
- The size of map
- The number of islands
- The size of island
- The number of rivers
- The size of river
- Noise
- Biome ratio
- Land ratio
- Output data options
- Etc
- Create console tool to control these parameters.
- Place a number of random but uniformly distributed points (using Poisson Disk Sampling).
- Calculate the Voronoi diagram of the points (using Lloyd's algorithm).
- Using Perlin Noise determine which cells are land and which are water.
- Calculate the elevation of each point as its distance to the sea. Normalize all the heights.
- Place river sources in random spots and let them flow downwards.
- Calculate the moisture od each point given its distance to the sea (less moisture) and rivers (more moisture).
- Using Conex Hull algorithm determine the order of points (for sf::ConvexShape).
- Code refactoring - No warning messages at warning level 4.
- libnoise
- SFML
The class is licensed under the MIT License:
Copyright © 2016 Chris Ohk
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.