A customizable Python tool for generating maps for games and simulations.
Project description
TerraForge v1.3.3 🗺️
Procedural Biome/Island & Dungeon Map Generator using Simplex Noise
TerraForge is a versatile Python toolset for procedural map generation.
It includes tools for creating noise-based biome maps and multi-level dungeon layouts with fine-grained control over terrain shaping, biome placement, and dungeon structure.
🚀 Features
🌍 Biome Generator (TerraForge)
- Elevation, Moisture, and Temperature map generation
- Supports single and clustered multi-island generation
- Falloff support: Radial, Edge, or None
- Parameters for island spread, spacing, scale, and strength
- Basic biome color mapping based on environmental conditions
- Outputs high-resolution PNG images
- JSON preset import/export for reuse in games
🏰 Dungeon Generator (DungeonForge)
- Multi-level dungeon generation (3D stack of floors)
- Procedural room placement and corridor carving
- Up/down stairs for vertical navigation
- Console-based movement demo included
- Optional PNG export per dungeon level
- Tile color customization for export
- JSON preset import/export
📦 Requirements
📦 Installation
You can install TerraForge using pip.
pip install terraforge-core
🧪 Demos
Biome Map Generator
Run the included demo script:
python demo.py
The generated maps will be saved as biome_map, elevation_map, moisture_map, temperature_map, (noise_type)_map.
Dungeon Map Generator
Run either the included dungeon_demo script or dungeon_demo1 script.
python dungeon_demo.py
Console based demo with movement.
python dungeon_demo1.py
Generates .pngs for each dungeon level.
🚀 Usage - TerraForge (Biome Maps)
from terraforge import TerraForge
generator = TerraForge(map_size=300, image_size=(600, 600))
generator.generate(output_dir="maps")
🔁 Preset Workflow
generator.export_preset("world_preset.json")
generator.import_preset("world_preset.json")
generator.generate("maps")
🧩 Biome Schema (Presets)
Biomes are stored as a list of objects. Each biome requires:
color(hex string)rules(dict of noise_type -> [min, max])
Optional (recommended for tools like TerraForge Studio):
id(unique string per biome)name(display name)
Example biome:
{
"id": "forest",
"name": "Forest",
"color": "#3E7C3C",
"rules": {
"elevation": [0.4, 0.6],
"moisture": [0.5, 1.0]
}
}
Notes:
- id is optional, but if provided it must be unique within the preset.
- Rule ranges must satisfy min <= max.
🚀 Usage - DungeonForge (Dungeons)
from dungeonforge import DungeonForge
generator = DungeonForge()
dungeon_map = generator.generate()
🔁 Preset Workflow
generator.export_preset("dungeon_preset.json")
generator.import_preset("dungeon_preset.json")
generator.generate()
⚙️ Customization Options
Biome Generator
Edit the values in terraforge.py or the demo to control:
-
map_size and image_size
-
falloff type: "radial", "edge", or None
-
num_islands, island_spread, min_island_spacing
-
noise types (elevation, moisture, temperature)
-
biome_thresholds for noise types (elevation, moisture, and temperature)
Dungeon Generator
- Map size (width, height)
- Number of levels (z_levels)
- Maximum rooms and room size constraints
- Tile symbols and export colors
- Specify which levels to export (levels=[0, 2])
Related Tools
TerraForge Studio
A GUI tool built on top of the TerraForge library that allows you to quickly generate multi-level dungeons for games, prototypes, and tabletop use.
Related Libraries
- CQCalendar: A lightweight, tick-based time/calendar/lunar cycle system for Python games and simulations.
- MoonTex: A procedural moon texture generator for Python that creates stylized, noise-based moon phase images.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file terraforge_core-1.3.3.tar.gz.
File metadata
- Download URL: terraforge_core-1.3.3.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0be6fd75b41f589b376bd56a0ef1cf2ac79f1f41d374cb094bcf3ecfb78f2b63
|
|
| MD5 |
ba187967e14e7832bc277fd40ed183ed
|
|
| BLAKE2b-256 |
34dafd044ac6cab6a29adaed93cdb97f3f58986e454c8aa360712d7653427b7f
|
File details
Details for the file terraforge_core-1.3.3-py3-none-any.whl.
File metadata
- Download URL: terraforge_core-1.3.3-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76dbea1fd28f6535d16614240898146fbaab3690c11815cee4c4937baa995b85
|
|
| MD5 |
6aa8c85db5ae52d0b9a64eb5d9851834
|
|
| BLAKE2b-256 |
86317f4d596f37c3e4a8a18ac28167c410bbcc69354374ce25c42d282f2efba4
|