tf3-AutoMapGen – Technical Details
Extended technical information for the project introduced in the previous post.
1. Why a custom climate mod?
TF3 has node-based climate graphs: on import they place vegetation and rocks; on loading they assign ground materials.
The standard temperate climate uses forest, rock and snow thresholds near 310, 330–350 and 380–430 game metres. On real Alpine terrain (reference elevation 250 m, scale 0.5), these altitude zones would be far too low.
The single global water level also means elevated mountain rivers must use painted water textures.
tf3-AutoMapGen extends the existing climate graphs instead of replacing them.
2. Source data and generated files
Sources:
- Elevation: elevation models accessed through OpenTopography (or supplied as local GeoTIFF files).
- Land cover: ESA WorldCover 10 m (forests, cropland, grassland and other land-cover classes).
- Map features: OpenStreetMap, including waterways, paths and settlements; OSM extracts can be obtained from Geofabrik.
- Game resources: the local TF3 installation, especially the existing climate graphs and terrain assets.
Outputs:
- A 16-bit heightmap using the game's 4 m-per-pixel grid, including terrain adjustment around planned towns and industries, shaped river banks and a water-level solution.
- A biome map, determined from elevation bands and slope-related rules.
- Import layers for forest, meadow, cropland, rock, riverbed, water, shore, crop textures and mountain / transition areas.
- A generated climate mod with extended node trees.
- A towns-and-industries import file, two small supporting map mods (field/hiking paths as streets and industry naming) and preview images.
The standard temperate climate declares two import layers ('rivers' and 'mountains'). A custom climate can declare additional layers, up to 12 in total. The current Alpine Realistic preset uses all 12 slots.
3. How the generated climate works
Import tree (runs during map import):
Uses masks for forest and rock placement within the game's resolution limits. Species vary by altitude and biome, with boulders in rocky areas, forests and riverbeds.
Material tree (evaluated on map loading):
Uses masks, biomes and altitude rules for meadows, crops, rock, scree, riverbeds, painted water, shores and waterfalls, optionally with texture noise.
The configurable Alpine Realistic preset uses:
- Tree line: 2,100 m above sea level
- Scree: from 2,100 m
- Rock: from 2,200 m
- Snow: from 2,500 m
These are stylistic settings, not measured local climate data.
The terrain graphs work in game metres, so thresholds are converted by:
game height = (real elevation - reference height) × scale
At reference height 250 m and scale 0.5, a 2,500 m snow line becomes 1,125 game metres. Maps with matching settings can share a climate mod.
The look is defined in TOML presets (surfaces, altitude zones, forests, rocks, mask assignments). Landscape configurations can also modify the appearance across a map.
4. Framework architecture
Simplified workflow architecture:

The tool uses a generic, graph-based processing framework. Its map generator is assembled from smaller nodes with typed inputs and outputs rather than implemented as one monolithic script.
The main processing groups are:
Source Data → Terraforming → Planning → Final Terrain → Biome Creation
Additional branches generate the climate mod and supporting map mods.
The map graph has roughly 190 reusable nodes, including subgraphs.
Map-generation graph (overview):

The design separates:
- Data: typed, immutable height fields, masks, plans and graph objects.
- Parameters: TOML climate, landscape and project settings.
- Processing: individual Python functions.
- Composition: JSON graph documents describing how nodes are connected.
- Execution: validation, dependency ordering, caching, memory handling and previews.
The engine validates types, links and parameters. Versioned lineage keys allow unchanged intermediate results to be reused, so changing forest parameters need not recalculate rivers.
Parameters and graph variants allow new regions without rewriting code. The framework core is game-independent.
5. GUI and workflow
Local browser GUI with the Innsbruck–Karwendel project selected:

Typical workflow:
- Select a geographical area, map size, aspect ratio, scale and climate settings in the local browser GUI (or use the command line).
- Download or load the elevation data, land-cover tiles and OSM data. OpenTopography requires a free API key for supported downloads. Later runs reuse cached data.
- Execute the graph to generate the heightmap, biome map, import layers, climate mod, town/industry data, support mods and previews.
- Open the TF3 map editor, select the generated climate, import the images using the height and water-level values provided by the GUI, and import towns and industries.
Outputs can be copied to the TF3 user-data folder; the editor import remains manual.
6. Evaluation
The three maps demonstrate Alpine altitude zones (Karwendel), agricultural land-cover patterns (Zurich–Schaffhausen) and large-scale landscape transitions (Brenner). Results are qualitative, not pixel-accurate; there are no systematic performance benchmarks or controlled comparisons with the default climate yet.
7. Current limitations
- Import-layer resolution: the game samples layers more coarsely than the heightmap grid. Narrow paths and streams cannot be reproduced precisely; imported layers are essentially binary masks.
- Assets and layers: only a limited number of masks, ground textures and vegetation/rock assets are available.
- Water: the single water level requires painted rivers above that level; those are not real water.
- Performance: high-resolution masks, elaborate material graphs and dense vegetation can increase RAM use and loading times. In-game terraforming can trigger expensive recomputation. These costs have not yet been benchmarked systematically.
- Scope: the current preset is focused on Alpine terrain and is based on the temperate climate. Dry and tropical climates are not yet implemented.
- Road networks: paths and country-road traces can influence terrain, but a complete road network between towns is not yet generated.
- Testing: only a few maps, mainly in the Alps, have been tested in the game so far.
8. Related work and planned next steps
Related projects include TPF3 Map Studio by sharpi13822 and Terra2Fever3. I have not evaluated them in depth, so this is not a comparison or review. Their workflows and my focus on generated import layers plus climate mods may complement each other.
Next: publish the code, create more maps, benchmark performance and add configurable climate presets.
References / attribution
Source code: https://github.com/Froggy94/tf3-AutoMapGen
Feedback welcome! I am particularly interested in whether the landscape and terrain look right on different systems, whether the generated maps work reliably in longer games, and which limitations matter most in practice.