Skip to content

Latest commit

 

History

History
437 lines (372 loc) · 16.3 KB

REGION_SETTINGS.md

File metadata and controls

437 lines (372 loc) · 16.3 KB

Region Settings

The region_settings define the attributes for map generation that apply to an entire region. The general settings define the default overmap terrain and ground cover, as well as the factors that control forest and swamp growth. Additional sections are as follows:

Section Description
field_coverage Defines the flora that cover the field overmap terrain.
city Defines the structural compositions of cities.
map_extras Defines the map extra groups referenced by overmap terrains.
weather Defines the base weather attributes for the region.

Note that for the default region, all attributes and sections are required.

Fields

Identifier Description
type Type identifier. Must be "region_settings".
id Unique identfier for this region.
default_oter Default overmap terrain for this region.
default_groundcover List of terrain types and weights applied as default ground cover.
num_forests Number of forest "chunks".
forest_size_min Minimum size for a forest chunk, in # of overmap terrains.
forest_size_max Maximum size for a forest chunk, in # of overmap terrains
swamp_maxsize Maximum size for a swamp chunk, in # of overmap terrains.
swamp_river_influence Impacts swamp chance near rivers. Higher = more.
swamp_spread_chance One in X chance that a swamp is created outside a forest or field.

Example

{
	"type": "region_settings",
	"id": "default",
	"default_oter": "field",
	"default_groundcover": [
		["t_grass", 4],
		["t_dirt", 1]
	],
	"num_forests": 250,
	"forest_size_min": 15,
	"forest_size_max": 40,
	"swamp_maxsize": 4,
	"swamp_river_influence": 5,
	"swamp_spread_chance": 8500
}

Field Coverage

The field_coverage section defines the furniture and terrain that make up the flora that cover the field overmap terrain.

Fields

Identifier Description
percent_coverage % of tiles in the overmap terrain that have a plant.
default_ter Default terrain feature for plants.
other List of features with % chance when default_ter isn't used.
boost_chance % of field overmap terrains with boosted plant growth.
boosted_percent_coverage % of tiles in the boosted that have a plant.
boosted_other List of features in the boosted with % chance when default_ter isn't used.
boosted_other_percent % of boosted_percent_coverage that will be covered by boosted_other.

Example

{
	"field_coverage": {
		"percent_coverage": 0.9333,
		"default_ter": "t_shrub",
		"other": {
			"t_shrub_blueberry": 0.4166,
			"t_shrub_strawberry": 0.4166,
			"f_mutpoppy": 8.3333
		},
		"boost_chance": 0.833,
		"boosted_percent_coverage": 2.5,
		"boosted_other": {
			"t_shrub_blueberry": 40.0,
			"f_dandelion": 6.6
		},
		"boosted_other_percent": 50.0
	}
}

Forest Map Generation Settings

The forest_mapgen_settings section defines the attributes used in generating forest (forest, forest_thick, forest_water) terrains, including their items, groundcover, terrain and furniture.

General Structure

At the top level, the forest_mapgen_settings is a collection of named configurations where each entry has the name of the overmap terrain that it applies to, e.g. forest, forest_thick, forest_water. It is possible to define settings for overmap terrains that are not rendered by the forest mapgen, but will be used when blending forest terrains with other terrain types.

{
	"forest_mapgen_settings": {
		"forest": {},
		"forest_thick": {},
		"forest_water": {}
	}
}

Each terrain then has an independent set of configuration values that control the mapgen.

Fields

Identifier Description
sparseness_adjacency_factor Value relative to neighbors controls how sparse the overmap terrain will be.
item_group Item group used to place items randomly within the overmap terrain.
item_group_chance % chance, between 1 and 100, that an item will be placed.
item_spawn_iterations Number of times that the item spawning will be called.
clear_groundcover Clear all previously defined groundcover for this overmap terrain.
groundcover Weighted list of terrains used for base groundcover.
clear_components Clear all previously defined components for this overmap terrain.
components Collection of components that make up the terrains and furniture placed.
clear_terrain_furniture Clear all previously defined terrain_furniture for this overmap terrain.
terrain_furniture Collection of furniture conditionally placed based on terrain.

Example

{
	"forest": {
		"sparseness_adjacency_factor": 3,
		"item_group": "forest",
		"item_group_chance": 60,
		"item_spawn_iterations": 1,
		"clear_groundcover": false,
		"groundcover": {
			"t_grass": 3,
			"t_dirt": 1
		},
		"clear_components": false,
		"components": {},
		"clear_terrain_furniture": false,
		"terrain_furniture": {}
	}
}

Components

The components are a collection of named objects with a sequence, chance, and set of types that, during mapgen, are rolled in sequence to pick a feature to be placed at a given location. The names for the components are only relevant for the purposes of overriding them in region overlays.

Fields

Identifier Description
sequence Sequence in which components are processed.
chance One in X chance that something from this component will be placed.
clear_types Clear all previously defined types for this component.
types Weighted list of terrains and furniture that make up this component.

Example

{
	"trees": {
		"sequence": 0,
		"chance": 12,
		"clear_types": false,
		"types": {
			"t_tree_young": 128,
			"t_tree": 32,
			"t_tree_birch": 32,
			"t_tree_pine": 32,
			"t_tree_maple": 32,
			"t_tree_willow": 32,
			"t_tree_hickory": 32,
			"t_tree_blackjack": 8,
			"t_tree_coffee": 8,
			"t_tree_apple": 2,
			"t_tree_apricot": 2,
			"t_tree_cherry": 2,
			"t_tree_peach": 2,
			"t_tree_pear": 2,
			"t_tree_plum": 2,
			"t_tree_deadpine": 1,
			"t_tree_hickory_dead": 1,
			"t_tree_dead": 1
		}
	},
	"shrubs_and_flowers": {
		"sequence": 1,
		"chance": 10,
		"clear_types": false,
		"types": {
			"t_underbrush": 8,
			"t_shrub_blueberry": 1,
			"t_shrub_strawberry": 1,
			"t_shrub": 1,
			"f_chamomile": 1,
			"f_dandelion": 1,
			"f_datura": 1,
			"f_dahlia": 1,
			"f_bluebell": 1,
			"f_mutpoppy": 1
		}
	}
}

Terrain Furniture

The terrain furniture are a collection of terrain ids with a chance of having furniture picked from a weighted list for that given terrain and placed on it during mapgen after the normal mapgen has completed. This is used, for example, to place cattails on fresh water in swamps. Cattails could be simply placed in the components section and placed during the normal forest mapgen, but that would not guarantee their placement on fresh water only, while this does.

Fields

Identifier Description
chance One in X chance that furniture from this component will be placed.
clear_furniture Clear all previously defined furniture for this terrain.
furniture Weighted list of furniture that will be placed on this terrain.

Example

{
	"t_water_sh" : {
		"chance": 2,
		"clear_furniture": false,
		"furniture": {
			"f_cattails": 1
		}
	}
}

Forest Trail Settings

The forest_trail_settings section defines the attributes used in generating trails in the forests, including their likelihood of spawning, their connectivity, their chance for spawning trailheads, and some general tuning of the actual trail width/position in mapgen.

Fields

Identifier Description
chance One in X chance a contiguous forest will have a trail system.
border_point_chance One in X chance that the N/S/E/W-most point of the forest will be part of the trail system.
minimum_forest_size Minimum contiguous forest size before a trail system can be spawned.
random_point_min Minimum # of random points from contiguous forest used to form trail system.
random_point_max Maximum # of random points from contiguous forest used to form trail system.
random_point_size_scalar Forest size is divided by this and added to the minimum number of random points.
trailhead_chance One in X chance a trailhead will spawn at end of trail near field.
trailhead_road_distance Maximum distance trailhead can be from a road and still be created.
trail_center_variance Center of the trail in mapgen is offset in X and Y by a random amount between +/- variance
trail_width_offset_min Trail width in mapgen is offset by rng(trail_width_offset_min, trail_width_offset_max).
trail_width_offset_max Trail width is mapgen offset by rng(trail_width_offset_min, trail_width_offset_max).
clear_trail_terrain Clear all previously defined trail_terrain.
trail_terrain Weighted list of terrain that will used for the trail.

Example

{
	"forest_trail_settings": {
		"chance": 2,
		"border_point_chance": 2,
		"minimum_forest_size": 100,
		"random_point_min": 4,
		"random_point_max": 50,
		"random_point_size_scalar": 100,
		"trailhead_chance": 1,
		"trailhead_road_distance": 6,
		"trail_center_variance": 3,
		"trail_width_offset_min": 1,
		"trail_width_offset_max": 3,
		"clear_trail_terrain": false,
		"trail_terrain": {
			"t_dirt": 1
		}
	}
}

City

The city section defines the possible overmap terrains and specials that may be used as buildings in a city, their weighted chances of placement, and some attributes that control the relative placements of various classes of buildings.

Fields

Identifier Description
type City type identifier--currently unused.
shop_radius Radial frequency of shop placement. Smaller number = more shops.
park_radius Radial frequency of park placement. Smaller number = more parks.
house_basement_chance One in X chance that a house has a basement.
houses Weighted list of overmap terrains and specials used for houses.
basements Weighted list of overmap terrains and specials used for basements.
parks Weighted list of overmap terrains and specials used for parks.
shops Weighted list of overmap terrains and specials used for shops.

Placing shops, parks, and houses

When picking a building to place in a given location, the game considers the city size, the location's distance from the city center, and finally the shop_radius and park_radius values for the region. It then tries to place a shop, then a park, and finally a house, where the chance to place the shop or park are based on the formula rng( 0, 99 ) > X_radius * distance from city center / city size.

Example

{
	"city": {
		"type": "town",
		"shop_radius": 80,
		"park_radius": 90,
		"house_basement_chance": 5,
		"houses": {
			"house_two_story_basement": 1,
			"house": 1000,
			"house_base": 333,
			"emptyresidentiallot": 20
		},
		"basements": {
			"basement": 1000,
			"basement_hidden_lab_stairs": 50,
			"basement_bionic": 50
		},
		"parks": {
			"park": 4,
			"pool": 1
		},
		"shops": {
			"s_gas": 5,
			"s_pharm": 3,
			"s_grocery": 15
		}
	}
}

Map Extras

The map_extras section defines the named collections of map extras--special mapgen events applied on top of the defined mapgen--that may be referenced by the extras property of an overmap terrain. This includes both the chance of an extra occurring as well as the weighted list of extras.

Fields

Identifier Description
chance One in X chance that the overmap terrain will spawn a map extra.
extras Weighted list of map extras that can spawn.

Example

{
	"map_extras": {
		"field": {
			"chance": 90,
			"extras": {
				"mx_helicopter": 40,
				"mx_portal_in": 1
			}
		}
	}
}

Weather

The weather section defines the base weather attributes used for the region.

Fields

Identifier Description
base_temperature Base temperature for the region in degrees Celsius.
base_humidity Base humidity for the region in relative humidity %
base_pressure Base pressure for the region in millibars.
base_acid Base acid for the region in ? units. Value >= 1 is considered acidic.

Example

{
	"weather": {
		"base_temperature": 6.5,
		"base_humidity": 66.0,
		"base_pressure": 1015.0,
		"base_acid": 0.0
	}
}

Region Overlay

A region_overlay allows the specification of region_settings values which will be applied to specified regions, merging with or overwriting the existing values. It is only necessary to specify those values which should be changed.

Fields

Identifier Description
type Type identifier. Must be "region_overlay".
id Unique identfier for this region overlay.
regions A list of regions to which this overlay should be applied. "all" will apply to all regions.

All additional fields and sections are as defined for a region_overlay.

Example

[{
	"type": "region_overlay",
	"id": "example_overlay",
	"regions": ["all"],
	"city": {
		"parks": {
			"examplepark": 1
		}
	}
}]