This project is a pet project procedural world generator built using Python and Pygame, with heavy utilization of libraries such as NumPy, SciPy, and PyTorch. The application generates procedural worlds with labeled continents rendered with various terrain types such as deep water, shallow water, grasslands, forests, mountains, and snow.
- Procedural generation of world maps using Perlin noise.
- Rendering using Pygame.
- Ability to label and highlight continents.
- Better approximation for geological processes in terrain generation.
- 🐍 Python 3.7+
- 📦 PIP (Python package installer)
# Clone the repository
git clone https://github.com/AlrikOlson/worldmap-generator
# Navigate to the project directory
cd worldmap-generator
# Install the required dependencies
pip install -r requirements.txt
Simply run the main script to start the procedural world generator.
python src/main.py
-
Open the Project: Open the project folder in VS Code.
-
Install Extensions:
- Install the Python extension for VS Code.
-
Run the Project:
- Open the Run and Debug side panel (using the play icon on the sidebar or
Ctrl+Shift+D
). - Select the configuration "Python: Debug Map Generator".
- Click the green play button or press
F5
to start debugging.
- Open the Run and Debug side panel (using the play icon on the sidebar or
- 🔄 Spacebar: Generate a new random world.
The project is organized into several packages:
- core: Contains the primary logic for the game, world generation, rendering, and continent labeling.
- procedural: Contains modules for generating procedural terrain using Perlin noise, and applying geological and erosion processes.
- ui: Contains UI components like buttons.
- utils: Contains utility classes for device management, random seed management, and progress updates.
pygame
: For rendering and window management.numpy
: For numerical operations.torch
: For computational operations (supports CUDA and MPS).scipy
: For labeling contiguous regions (used in continent labeling).
Install all dependencies using:
pip install -r requirements.txt
This project is just a pet project of mine and is in no way something that should be used for real world projects. It was heavily assisted by AI language models, specifically OpenAI's GPT-4 Omni and Claude 3 Opus by Anthropic. These models were utilized to generate significant portions of the codebase as well as the project documentation.