Steam Revolution | Documentation

Custom levels and terrain editing

Local level workflow

Player-created maps are stored in user_data/levels/<name>/. Create or select a local map from the map menu, then use the map-editing controls to draw terrain, add industries, generate a random map, rebuild the map, or open its folder. Industry placement is available while editing a local map and not while a simulation is running. After placing an industry, its type and editable properties can be changed in the industry dialog.

Random map generation replaces the map's source content: it regenerates the settings, terrain layers, forest density maps, and industry instances, but leaves definitions.txt intact. The definitions determine which forests, tree species, industries, and industry conversion chains are available to generation. Random generation writes editable source files rather than only producing an opaque baked map.

Random industry generation starts from city industry types marked city true whose recipes produce the shipped token_level completion resource. Those recipes define the map's goals. The generator then works backward from each recipe's inputs, adding industry types whose selected recipes produce those resources and continuing through their inputs to form supply chains. At least one such city recipe is required for random map generation to work; define the city recipes in definitions.txt, and provide producer recipes for the inputs you want the generated chain to supply.

You can edit those source files after random generation, or create them yourself without generating a random map. The source files describe the map; click the map editor's Rebuild map button to read them and create the runtime files level.dat and level.baked. Rebuild after changing source terrain layers, industry instances, settings, or definitions so the game data reflects those edits.

Settings and terrain layers

A standalone level's settings.txt specifies map size in 16-tile chunks and can specify a seed. Each source image uses the dimensions implied by that size: width = chunks_x * 16 + 1 and height = chunks_y * 16 + 1. For example, size 8 3 means images are 129 by 49 pixels.

size 8 3
seed 234

Terrain layers are data maps, not decorative artwork. The game writes binary PGM images as P5 and binary RGB PPM images as P6. Use the same dimensions for every supplied layer.

Definitions: shared base plus level overrides

On startup the game loads the shipped levels/definitions.txt first. It supplies the common resources, industries, buildings, trees, forests, mesh palettes, and ambience definitions. A custom level may add definitions or override selected base definitions in its own definitions.txt; it does not need to copy the entire shipped file. References such as a building's mesh name or an industry's building list resolve against the combined definitions.

The current definition header is steam_revolution_definitions, version 1. Top-level blocks include industry, resource, building, tree, forest, mesh, engine, and ambiance. Internal names are stable identifiers; name is the display label.

Defining a transportable resource

Add a top-level resource block to define cargo that industries can consume or produce and trains can carry. A cargo resource needs mesh references for how it appears in a train, on a loader, and in storage. These can reuse meshes from the shipped definitions or refer to meshes defined by the custom level.

resource glass {
    name "Glass"
    role cargo
    train_mesh train_lumber
    loader_mesh loader_lumber
    storage_mesh storage1
}

Here, glass is the internal identifier used by recipes and schedules, while Glass is its display name. For example, an industry recipe can say produces glass or consumes glass, and a train schedule can list cars { glass }. The example reuses the shipped lumber appearance; replace those mesh names with your own definitions for custom visuals. A cargo resource appears in the schedule editor when an industry instance in the level produces it.

Customizing engines

An engine block configures one of the three engine choices: wood, coal, or oil. Each engine must use a distinct cargo resource as its fuel. Changing the fuel doesn't change the engine choice's speed or cost. A custom level only needs to list the fields it wants to override.

engine wood {
    fuel wood
    engine_mesh train_engine_wood
    tender_mesh train_tender_wood
    smoke_mesh smoke_wood
    smoke_offset 0.18 0 0.475
}

Mesh fields refer to named mesh definitions. smoke_offset gives the spawn point relative to the locomotive mesh origin, in mesh units: forward, left, and up. The offset follows the locomotive on turns and slopes.

Defining forests and selecting species

A forest is a named placement pattern in definitions.txt. Its positive spacing sets the interval between candidate positions; actual trees are jittered within each cell, so spacing controls density rather than a strict minimum distance between trees. Each species line names a tree type defined by a tree block. You can define several forests in the same file. If a level definition file contains any forest blocks, that set replaces all inherited forests; without forest blocks, inherited forests remain. Each forest's density maps determine where it can place trees, so different forests can cover different parts of the map or overlap one another.

forest lowland {
    spacing 1
    species pine
    species oak
}

forest upland {
    spacing 2
    species pine
}

This example uses the shipped pine and oak tree types. It needs density_lowland_pine.pgm, density_lowland_oak.pgm, and density_upland_pine.pgm. Each image has the same dimensions as the terrain layers. Random-map generation creates these maps; for a manually authored map, provide one for every forest/species pair.

At each candidate position, the grayscale values from that forest's species maps control tree density: a total of zero means no tree, while larger totals make placement more likely, capped at 255. Once a tree position is chosen, the species is selected randomly in proportion to each map's value at that location. For example, pine value 192 and oak value 64 gives pine a 3-in-4 chance and oak a 1-in-4 chance there. A value of zero excludes that species at that position. The generator also requires land without water or buildings, and each forest places at most one tree per candidate cell.

An industry definition can set its display name, ambience, city flag, building list, and one or more recipes. Each recipe is a separate conversion. Resource counts are optional and default to one. Its optional required property is used only by level-authoring help to generate the resource graph: required true marks an input relationship as required, while required false marks it as boosting. This property has no effect on simulation or production.

steam_revolution_definitions
version 1

industry city {
    recipe {
        consumes 2 wheat
        produces token_level
    }
}

This example adds a recipe to the shipped city type while retaining its existing buildings and city flag. When the first recipe is supplied for an existing industry, it replaces that type's inherited recipe list; list all recipes you want the override to keep. A buildings {... } block replaces the inherited building list when present; fields omitted from an override otherwise retain their base values. A package can use the completion resources already defined by the game, but cannot assign or change completion-resource roles.

The shipped levels/definitions.txt is a real, distributed example and the source of truth for base asset names. In particular, it demonstrates mesh/material declarations, resource mesh references, and the industry/building relationships custom levels can reuse.

Instances and multiple cities

A custom level's instances.txt places industry instances using types from the combined definitions. Its current header is steam_revolution_instances, version 1. Every block has one type name and exactly one position. The same type can appear in many blocks: those are separate instances that share the type's recipes and assets.

steam_revolution_instances
version 1

industry city {
    position 48 32
    size 24
    name "Northport"
}

industry city {
    position 96 48
    size 18
    name "Southport"
}

industry coal_mine {
    position 28 24
    size 12
    seed 7
    building coal_mine_center_1 0 0 0
}

The two city blocks above are distinct cities with their own positions, names, and building-area budgets, but they share the city type's behavior. A type marked city true is treated as a city type by map generation and city-related logic. To give cities different recipes or asset lists, define separate industry types and use the desired type name in each instance.

size is the industry's building-area budget, not its map dimensions. The game fills that budget with buildings from the type's building list. A building line places a named building at an offset from the industry position; the last value is a quarter-turn rotation from 0 to 3. Explicit buildings are placed first and count toward the area budget. seed controls deterministic random placement, and quoted name sets the instance's display name. The in-game map editor saves local industry source data to instances.txt.

Level-specific balance

A custom level can include an optional balance.txt in its package folder to change simulation balance settings for that level. Use one setting name and value per line; the file can be partial, so omitted settings keep their normal defaults. When the game starts a simulation, it loads the level's balance settings first, then applies any settings from a balance file supplied with the -balance command-line option, which take precedence for matching settings. See Simulation and Balance for additional balance settings and details.

industryProductionTicks 40
trainCarsMax 13
cargoLoadSpeed 0.041666667

Custom-level package files

A typical local map folder contains some or all of these files:

Campaign instance files are not used as custom-level examples here: their city industry types are campaign-specific. The format example above uses the distributed base type and is sufficient to explain repeated instances; a more representative packaged level example can be added when one exists.

Back to documentation