Skip to content

BaseConfig

Part of type

Source: api/tealdef/api/type.d.tl

BaseConfig

record global api/tealdef/api/type.d.tl:3468

global record BaseConfig

Base configuration of a single game

Fields

Name Type Description
animal Animal Defines the properties of an animal
locations Locations Town and industry placement at map generation.
settings Settings Graphics quality settings (view distances and LOD scaling per quality mode).
particles Particles Particle textures.
water Water Water textures.
emission Emissions Noise and pollution bounds and town noise settings; read with api.res.getBaseConfig().emission.
scaffold {string : {string : {string}}} Models for construction sites per era, as a map from era to a map from part (scaffold, crane) to a list of .mdl files.
costs {string : number} Named cost values and cost scale factors, as a map from key to number.
advancedOptions AdvancedOptions Advanced game options (maintenance effects, subsidies, landmark resources, reforestation).
economy Economy Cargo and passenger income scripts and town and industry development settings.
terrain Terrain Legacy terrain mesh settings (deprecated).
environment ResName Resource name of the environment (see api.res.environmentRep).
economyId ResName Resource name of the selected economy (.eco); the base game sets it from the economy entry of the game settings.
nameId ResName Resource name of the selected name list; the base game sets it from the nameList entry of the game settings.
climate ResName Resource name of the selected climate (.clima), e.g. ::/climates/temperate/temperate.clima; the base game sets it from the climate entry of the game settings.
trackCatenaryYearFrom integer Year from which rail electrification (catenary) becomes available (base game 1921).
busLaneYearFrom integer Year from which bus lanes become available (base game 1925).
terrainToolMinStrength number Minimum strength of the terrain tool (base game 5).
terrainToolMaxStrength number Maximum strength of the terrain tool (base game 100).
enforceMainConnections boolean
townDevelopInterval number Interval between town development updates (base game 60).
chargeMaintenanceInterval number Interval at which maintenance is charged (base game 60).
simulateCargoWeight boolean Whether the weight of transported cargo is simulated (base game true).
simPersonDestinationRecomputationProbability number Probability that a simulated person recomputes its destination (base game 1.0).
townMajorStreetAngleRange number Angle range in degrees within which the directions of a town's major streets are randomized (base game 0).
townConnectionMaxBridgeLength number Towns are connected by bridges only if the distance is below this value (base game 250).
maxVehicleCloneAmount number
trainAccelerationFactor number Multiplier for train acceleration (base game 1.0).
trainBrakeDeceleration number
terrainToolMinSize number Minimum brush size of the terrain tool.
terrainToolMaxSize number Maximum brush size of the terrain tool in the game; one size unit covers 4 m² (base game 32).
terrainToolScale number Factor applied to the terrain tool brush sizes when they are listed in the construction menu.
terrainToolMaxSizeEditor number Maximum brush size of the terrain tool in the map editor; one size unit covers 4 m² (base game 256).
terrainPainterMinSize number Minimum brush size of the terrain painter; the game GUI also uses it as the terrain tool minimum.
terrainPainterMaxSize number Maximum brush size of the terrain painter in the game; one size unit covers 1 m² (base game 256).
terrainPainterMaxSizeEditor number Maximum brush size of the terrain painter in the map editor; one size unit covers 1 m² (base game 256).
terrainPainterScale number Factor applied to the terrain painter brush sizes.
assetBrushMinSize number Minimum brush size of the asset tools (placing and erasing assets and vegetation).
assetBrushMaxSize number Maximum brush size of the asset tools; one size unit covers 1 m² (base game 256).
assetBrushScale number Factor applied to the asset brush sizes when they are listed in the construction menu.
treeCostYearMultipliers {integer : number} Tree cost multipliers by year, as a map from year to factor; the GUI evaluates it with api.engine.util.construction.getCostMultiplierForYear.
townInitialMajorStreetAngleRange number Like townMajorStreetAngleRange (degrees), but only applied when a town is first created (base game 0).
townCapacityScalingFactor number Capacity scaling factor passed to the town builder (townBuilder.capacityScalingFactor) when a town is placed.
sandboxMode boolean Whether sandbox mode is active; the urbangames_sandbox mod sets it to true.
noCosts boolean Whether building and buying is free; the urbangames_no_costs mod sets it to true.
constructionScript ScriptRef Script used to build constructions from their modules.

BaseConfig.AdvancedOptions

record api/tealdef/api/type.d.tl:3470

record AdvancedOptions

Advanced gameplay option

Used in the base game: 3 times in 2 files

base/content/game_mechanics/game_mechanics/towns/town_util_parallel.script.tl:33

local advancedOptions : BaseConfig.AdvancedOptions = api.res.getBaseConfig().advancedOptions
base/content/game_mechanics/game_mechanics/towns/town_util.tl:449
local advancedOptions : BaseConfig.AdvancedOptions = api.res.getBaseConfig().advancedOptions

Fields

Name Type Description
trafficSpeedSensitivityScale number Scale of how sensitive town traffic ratings are to traffic speed; passed to api.engine.util.town.computeTownsTrafficSpeedMap. The base game sets it to 1.0.
vehicleMaintenanceEmissionsEffect number Strength of the effect of vehicle maintenance on emissions; the base game sets it from the "vehicle maintenance effect" game setting (0 to 2).
vehicleMaintenancePerformanceEffect number Strength of the effect of vehicle maintenance on performance; the base game sets it from the "vehicle maintenance effect" game setting (0 to 2).
vehicleMaintenanceRunningCostsEffect number Strength of the effect of vehicle maintenance on running costs; the base game sets it from the "vehicle maintenance effect" game setting (0 to 2).
missionVehicleMaintenanceDisableRepair boolean Disables vehicle repair; set by campaign missions.
missionDisableTunnelBuilding boolean Disables tunnel building; set by campaign missions.
missionEmissionsScriptFactor number Factor applied to the noise and pollution power that the emissions script sets on entities.
simPersonHappinessDecayAtVehicle number Rate at which the happiness of sim persons decreases while in a vehicle; campaign missions scale it.
simPersonHappinessDecayAtTerminal number Rate at which the happiness of sim persons decreases while waiting at a terminal; campaign missions scale it.
subventionMode integer How often subsidy (subvention) offers appear; 0 disables them.
subventionRisk integer Risk level of subsidy (subvention) offers, from 0 to 3.
subventionFinancialRewardMultiplier number Multiplier for the financial reward of subsidies (subventions)
landmarkResources number Multiplier for the resource amounts landmarks require (0, 0.5, 1, 2 or 4 depending on the game setting).
isReforestationActive boolean Whether reforestation is active; the base game turns it off in the map editor.

BaseConfig.Animal

record api/tealdef/api/type.d.tl:3492

record Animal

Configuration for animal spawning

Fields

Name Type Description
populationDensityMultiplier number Multiply the density (in square exemplars per square km) by this factor for all animals
useLocalSpawning boolean Spawning only looks at the existing population within localTileSize squared boxes instead of the entire map (results in density more similarly distributed to the actual scoring functions)
localTileSize number Size used for controlling local spawning
notifyAnimalDespawn boolean Add notification when a named animal despawns

Functions

new() : Animal api/tealdef/api/type.d.tl:3494

Creates a new object of type Animal

Returns Animal

BaseConfig.Locations

record api/tealdef/api/type.d.tl:3508

record Locations

Configuration for the placement of industry and towns on max generation

Used in the base game: 4 times in 2 files

base/content/gui/gui/map_editor/map_editor.tl:498

locations : BaseConfig.Locations
base/content/gui/gui/menu/new_game_or_map_settings_page.tl:385
locationsConfig : BaseConfig.Locations

Fields

Name Type Description
town TownParamList Configuration for town spawning at map generation
industry IndustryParamList Configuration for industry spawning at map generation
makeInitialStreets boolean Add small streets at the edge of industries

Functions

new() : Locations api/tealdef/api/type.d.tl:3510

Creates a new object of type Locations

Returns Locations

BaseConfig.Locations.IndustryParamList

record api/tealdef/api/type.d.tl:3513

record IndustryParamList

Configuration parameters for industries

Fields

Name Type Description
absoluteMinimum integer Spawning will ensure at least this number of industries is present on the map
maxNumberPerArea number Spawning will ensure that the density per square km will not exceed this number
industryDensity number Spawning will try to spawn this number of industries
randomSize boolean Productivity will be randomized slightly to induce more variation
industryProductivity number Scale the industry productivity by this factor

Functions

new() : IndustryParamList api/tealdef/api/type.d.tl:3515

Creates a new object of type IndustryParamList

Returns IndustryParamList

BaseConfig.Locations.TownParamList

record api/tealdef/api/type.d.tl:3529

record TownParamList

Configuration parameters for towns

Fields

Name Type Description
maxNumberPerArea number Spawning will ensure at most this density per square km
allowInRoughTerrain boolean Town will be able to spawn in uneven and slightly unsuitable terrain, the resulting town might be smaller than it's target size
townFrequency number Number of towns per sqm
populationDensity number Population will be scaled by this factor

Functions

new() : TownParamList api/tealdef/api/type.d.tl:3531

Creates a new object of type TownParamList

Returns TownParamList

BaseConfig.Terrain

record api/tealdef/api/type.d.tl:3554

record Terrain

Configuration for the terrain mesh (Deprecated)

Fields

Name Type Description
lodErrorMultiplier number (Deprecated) Only used with legacy terrain, determines the quality of the terrain mesh

BaseConfig.Economy

record api/tealdef/api/type.d.tl:3560

record Economy

Configures cargo relations and industry developement for a single game

Fields

Name Type Description
cargoIncomeScript ScriptRef A script reference controlling the income of a given cargo given specific parameters
passengerIncomeScript ScriptRef A script reference controlling the income of a given passengers given specific parameters
townDevelopment TownDevelopment Controls the automatic development of towns
industryDevelopment IndustryDevelopment Controls the automatic developement of industries

Functions

new() : Economy api/tealdef/api/type.d.tl:3562

Creates a new empty economy

Returns Economy

BaseConfig.Economy.TownDevelopment

record api/tealdef/api/type.d.tl:3565

record TownDevelopment

Parameters for the town developement

Fields

Name Type Description
cargoNeedsPerTown integer Number of initial cargo needs when the town ist first built
townGrowthMinDistrictFraction number The minimum a distric fraction (compared to other disctricts) can shrink

BaseConfig.Economy.IndustryDevelopment

record api/tealdef/api/type.d.tl:3572

record IndustryDevelopment

Parameters for the industry developement

Fields

Name Type Description
spawnTargetTimeSpan number Unused
spawnProbabilityExponent number Control the frequency at which enw industries appear
spawnIndustries boolean Control whether new industry might spawn on the map
unusedTimeSpan number Control the mean time after which an industry will begin closing after not being used
closureCountdownTimeSpan number Controls the grace period the player has to prevent closure
closureProbability number Controls how likely an unused industry has of being closed
extendTimeSpan number Control how often the industry will build new satellites

BaseConfig.Settings

record api/tealdef/api/type.d.tl:3600

record Settings

Graphic settings for main quality modes, camera tool and cockpit

Fields

Name Type Description
geometryQualityOptions {GeometryQualityOption} Quality settings for:

Functions

new() : Settings api/tealdef/api/type.d.tl:3602

Creates a new graphic settings parameters

Returns Settings

BaseConfig.Settings.GeometryQualityOption

record api/tealdef/api/type.d.tl:3605

record GeometryQualityOption

Contains information about graphi quality of a single game

Fields

Name Type Description
viewNearFar Vec2f Distance im meters of near and far plane
fogStartEndFarPerc Vec2f Unused
lodDistanceScaling number A factor multiplying all lod distances

Functions

new() : GeometryQualityOption api/tealdef/api/type.d.tl:3607

Creates a new GeometryQualityOption

Returns GeometryQualityOption

BaseConfig.Water

record api/tealdef/api/type.d.tl:3621

record Water

Configures water look and feel

Fields

Name Type Description
textures Textures Configures water textures

BaseConfig.Water.Textures

record api/tealdef/api/type.d.tl:3623

record Textures

Configures water textures

Fields

Name Type Description
foamNormal string Normal texture for water foam
foamDetail string Extra detail texture for water foam
foam string Albedo texture for water foam

BaseConfig.Particles

record api/tealdef/api/type.d.tl:3637

record Particles

Notes

Particle rendering configuration; holds the textures shared by particle effects.

Fields

Name Type Description
textures Textures Shared particle textures.

BaseConfig.Particles.Textures

record api/tealdef/api/type.d.tl:3638

record Textures

Notes

Shared textures used by particle effects.

Fields

Name Type Description
noise0 string First noise texture for particles (base game: ::/base/tex/particle_noise0.dds).
noise1 string Second noise texture for particles (base game: ::/base/tex/particle_noise1.dds).
smoke string Smoke texture for particles (base game: ::/base/tex/particle_smoke.dds).
smokeNormal string Normal map for the smoke particle texture (base game: ::/base/tex/particle_smoke_normal.dds).

BaseConfig.Emissions

record api/tealdef/api/type.d.tl:3648

record Emissions

Notes

Noise and pollution settings for the emission layers and for how noise affects towns.

Details

The base game copies the bounds from /game_mechanics/emission/emission_config.tl (noise 63-85 dB, pollution 57-80) in its preRunFn. Scripts read it with api.res.getBaseConfig().emission.

Fields

Name Type Description
noiseLowerBoundDB number Lower bound of the noise scale in decibels, used as the minimum when sampling and displaying noise (base game 63).
noiseUpperBoundDB number Upper bound of the noise scale in decibels, used as the maximum when sampling and displaying noise (base game 85).
pollutionLowerBoundDB number Lower bound of the pollution scale, used as the minimum when sampling and displaying pollution (base game 57).
pollutionUpperBoundDB number Upper bound of the pollution scale, used as the maximum when sampling and displaying pollution (base game 80).
townNoiseResidentialAffected boolean Whether noise affects residential town buildings; town_util.getNoiseLandUseTypes includes LandUseType.RESIDENTIAL when set.
townNoiseCommercialAffected boolean Whether noise affects commercial town buildings; town_util.getNoiseLandUseTypes includes LandUseType.COMMERCIAL when set.
townNoiseIndustrialAffected boolean Whether noise affects industrial town buildings; town_util.getNoiseLandUseTypes includes LandUseType.INDUSTRIAL when set.