A simplistic world map generator written in python.
This project was meant to be a way to generate world maps for 2D top-down games based on a random seed.
- Generate a random binary matrix.
- Smooth matrix by blurring neighboring cells and rounding back to binary.
- Find spawns
- Pick 2 random playable cells
- Run modified k-means to move spawns into logical areas on map.
- If position is outside map area, move to closest cell.
- Run A* type search to ensure spawns are reachable.
- Start at first spawn and search for the other.
- Return when other spawn is found.
- If spawn not found there must be an 'island' that all searched cells are a part of.
- Set new map area to searched cells.
- Goto step 3 and find new spawns.
- Generate visual version of map.