Skip to content
Connected RailsConnected Rails

Vegetation and fields

Trees are ordinary track objects — an objects/*.ron with a tree glTF is all a tree mod is. A line stores every tree as its own entry, geo-positioned (no track reference, height always from the terrain):

trees: [
// Empty object = the app's built-in placeholder tree.
(object: "trees:fichte_b", lat: 52.0006, lon: 10.004, yaw_deg: 0.0, scale: 1.3),
],

The trees mod ships the vegetation of Central Europe: forty-six catalogue entries — spruce, pine, silver fir, larch, Douglas fir, juniper; beech, oak, hornbeam, birch, alder, two maples, ash, lime, aspen, Lombardy poplar, two willows, elm, horse chestnut, rowan, wild cherry, black locust; hazel, hawthorn, elder, blackthorn. The shrub layer adds dog rose, blackberry, raspberry, dogwood, spindle, guelder rose, alder buckthorn, privet, broom, bilberry, heather, holly, barberry, fly honeysuckle and sea buckthorn; bracken, nettle and periwinkle cover the understorey. Each has three individually shaped variants (_a, _b, _c), four levels of detail and seasonal models. Broadleaf geometry comes from Midge “Mantissa” Sinnaeve’s hand-modelled CC0 packs; conifers use Poly Haven’s CC0 Fir Tree 01, Pine Tree 01 and Fir Sapling models with their authored clean LOD meshes and foliage cards. Shrubs and understorey use Poly Haven’s CC0 Shrub 01, Searsia Lucida, Wild Rooibos Bush, Fern 02, Nettle Plant and Periwinkle Plant meshes. Birch, cherry and fir photographs supply additional PBR textures. tools/trees/catalogue.json maps those forms to the logical species and tools/trees/import_mantissa.py creates game LODs without procedurally growing a trunk or crown. The first two levels retain source branches and actual source leaves or foliage cards: LOD1 is a reduced 3D version of the same individual, with matching height, crown extents and centre. Whole-tree renders begin only at 400 m or farther and use that individual’s exact LOD0 foliage selection. No LOD enlarges individual leaves. See tools/trees/README.md and mods/trees/LICENSES.md.

The same mod also ships 15 repeatable hedge sections: feldhecke, weissdornhecke, ligusterhecke, hainbuchenhecke and immergruene_hecke, each as _a, _b and _c. Formal sections are 6 m long, the mixed field hedge 8 m; their stated footprint is the exact placement length and width. Put them in the line’s trees: list, rotate their long model axis with yaw_deg, and place consecutive centres one section length apart. They deliberately use the vegetation path rather than objects:: that keeps terrain snapping, instancing, seasons and exactly one of their four LODs active. Near levels combine reduced CC0 source shrubs with thousands of small cards mapped to individual leaves in the source atlas, so the body stays closed without becoming a single blurry billboard.

A wood is rarely one species. Any tree object may carry stand-… tags saying which kinds of wood it grows in:

tags: ["laubbaum", "stand-laubwald", "stand-mischwald", "stand-allee"],

The route editor collects every stand-… tag the installed mods carry and offers them above the single species in the tree and forest tools. Picking one has the forest brush draw from all the species tagged with it, so a painted wood comes out mixed and no two trees in it are the same shape. There is no stand file and no registry — a mod that adds a species to an existing wood needs nothing but the tag the others already have, and one that invents stand-obstgarten gets a new entry in the list for free.

The stands the trees mod brings: mischwald, laubwald, nadelwald, bergwald, auwald, bach, heide, pionier, bahndamm, boeschung, hecke, feld, allee, park, stadt.

There is no separate forest construct: a wood is many tree entries. That is deliberate — whether a tree was hand-set, painted or imported, it is the same kind of row, so any tree can be moved, rescaled or deleted on its own afterwards. Trees stream in and out with their terrain tile and share meshes per species, so even a big wood renders as instanced draws.

In the route editor the tree tool (key 2 in the vegetation box) plants one tree per click. The forest brush (key 3) outlines an area — Enter or right-click bakes it into single trees (one per area per tree m², species from the tool options, clear of the track strip). File ▸ Import forest… reads an Overpass JSON extract (landuse=forest / natural=wood ways, same download path as the track import) and bakes each polygon the same way — an optional aid: whoever wants every tree hand-set simply never uses it, and an imported wood is thinned out or cleared exactly like a painted one. For bulk edits the marking brush (key 6) sweeps over the map and marks every tree, object or parametric building under the circle; Delete (or the panel button) removes them together in one undo step.

The countryside a line runs through is mostly farmed, and a field is not a green rectangle: it is winter wheat, and in April that is ankle-high and blue-green, in June waist-high, in late July gold and about to be cut, and in August a stubble field. A line stores the outline and the crop; everything else follows from the crop and the date:

fields: [
(
polygon: [(lat: 51.5901, lon: 8.1402), (lat: 51.5901, lon: 8.1436), …],
crop: "winter-cereal",
// What the register said, kept verbatim — nothing reads it, but it is
// what says where a wrong crop came from.
code: "115",
label: "Winterweichweizen",
// The direction the field was worked in, against grid east. Furrows,
// tramlines and the combine's swath all run along it.
direction_deg: 12.4,
source: "NW",
year: 2026,
seed: 8123481956122354,
),
],

crop is one of thirteen groups — the resolution at which two fields genuinely look different from a train window:

id id
winter-cereal wheat, rye, barley, triticale grassland meadow and pasture
summer-cereal the same sown in spring, plus oats vegetable beds, worked in strips
maize grain and silage orchard fruit, nuts, Christmas trees
rapeseed and the mustards, which flower like it vineyard vines
sugar-beet and fodder beet fallow set-aside, flowering strips, margins
potato other anything with no group of its own
legume peas, beans, lupins, soya

An id no table knows is drawn as bare ground and called out by the rule check, so a typo is visible rather than fatal.

Nothing about the appearance is stored. The crop plus the scenario’s date gives the growth stage, the colour, the ground cover and the row contrast; the seed shifts the field’s own year by up to a week either way, so two neighbouring wheat fields are never cut on the same afternoon. That is also what makes fields free over the network: every client works the picture out from the same three numbers.

The crop stands. Beyond the painted surface, each field grows plants — real low-poly crop models (Quaternius, CC0 — see THIRD_PARTY_LICENSES.md) where the camera is close, cut-out cards under and between them, and none at all past about 220 m, where the paint carries the field alone. What a plant looks like follows the same crop, day and seed as the paint under it: bare ground grows nothing, a young stand is short and thin, a cut field stands straw rather than half-height wheat, deep winter takes the crop away entirely. The plants belong to the program, not to a mod — the same rule as the ground textures — so a mod adds nothing and changes nothing here; a field’s look follows from its data alone.

Every EU member state has to publish what its farmers declared (Art. 67(3) of Regulation (EU) 2021/2116), and the German states do it as web services. File ▸ Import fields… in the route editor asks them:

  • Cover — the whole module inside its envelope, or the selected field on its own. The first is what a new module wants; the second is for re-fetching one parcel after correcting a crop mapping.
  • Cut at the boundary — cut the fields at the envelope, so the neighbouring module owns the rest. Off keeps whole every field whose middle is inside.
  • Smallest field, Clear of the track — below half a hectare a parcel is a margin strip, and nothing should lie on the formation the ground pulls up to rail height.
  • Fetch again — ask the services rather than reading what was fetched before.

The import runs on a thread of its own: a bar, the state being asked, and a Stop that means it. It ends in a summary — so many fields, so many hectares, this many of each crop, these warnings — and nothing is written until Add to the module is pressed. That is one undo step, so Ctrl+Z takes a whole import back out. A module import replaces what an earlier import put there and leaves hand-drawn fields alone. Headless, the same import is cargo run -p content --bin import-module -- --line <file.ron> — the dialog’s defaults, the summary on stderr, the module written back (see the Börde module below).

The field tool (landscape category) draws one by hand: clicks set the corners, Enter or right-click closes it, and the crop comes from the tool options. That is the way to fill a corner the register does not cover, and the only way in a fictional module.

lines/boerde.ron in the example mod is five kilometres across the Soester Börde with 134 real parcels beside it, its roads out of OpenStreetMap and the ground of the state’s DGM1 under it — example:boerdefahrt drives it:

Terminal window
cargo run -p app -- --scenario example:boerdefahrt
cargo run -p app -- --scenario example:boerdefahrt --date 2026-04-25 # the same fields in April

The module is deliberately plain — two buffer stops, one curve, one main signal — because everything worth looking at is beside the track. Drive it in the last week of July, which is what the scenario is set to, and the winter wheat is gold with half of it already cut, the maize is at full height and dark, and the beet is closed and darker still. Drive the same five kilometres in April and it is a different place: nothing about the appearance is stored, so the date decides all of it.

It is also the module the three imports are demonstrated on, end to end and headless:

Terminal window
cargo run -p content --bin import-module -- \
--line mods/example/lines/boerde.ron --fetch-dgm auto

That asks the register for the fields again, Overpass for the roads, downloads the DGM1 sheets NRW publishes on its open data (GeoTIFF, one per square kilometre, into cache/dgm/nw — --dgm <dir> names another folder, --fetch-dgm by another state), cuts the corridor’s terrain tiles into heights/boerde/ and fits the track to the ground — start at 92.4 m NHN, down to 85 m in the dip at km 2, up to 103.5 m at the east end, the grades rounded to 0.1 ‰ on half-kilometre nodes over the land’s trend. The route editor does the same three imports by dialog (File ▸ Import fields, File ▸ Import roads, the Height data (DGM) panel); the tool is the same code without the window, which is what makes the module reproducible.

Two things it shows that are easy to get wrong when building your own. The track has to sit at the height the ground is — put the rails eight metres below the plain and the line runs down a cutting for its whole length and you see banks instead of countryside. Where the module ships no DGM the ground is the terrain’s fallback height, and the track has to match that; where it ships one, as this one does since the DGM import, the fit above is what puts the rails on the land. And the import’s clearance decides how close the fields come: 15 m keeps them off the formation, and on a plain brings them up to the lineside where they belong.

Two levels, and which one a state offers decides how much the import can do. GSA is the applied-for parcel with its crop code — what a passenger perceives as one field. LPIS is the field block, arable or grassland and no finer; one block can hold half a dozen crops.

GSA, with the crop NW, NI (and HB, HH), BB (and BE), SN, TH dl-de/by-2-0 or CC BY 4.0
LPIS, blocks only BY, HE, MV, SL, ST, SH CC BY 4.0, dl-de/zero-2-0, or unstated
no register — OpenStreetMap instead RP ODbL 1.0

For an LPIS state the crop is drawn rather than guessed: the regional cropping statistics give the share of each crop on arable land, and the draw is seeded by the parcel’s own id. The single field is then wrong about as often as the statistics say it should be, and the landscape is right — the correct share of wheat, in fields of the right size, in the right places. From a train window that is the whole of the effect.

Rhineland-Palatinate publishes no InVeKoS service at all — the register entry is empty and the application portal is behind a login. There the import falls back to OpenStreetMap: landuse=farmland and its neighbours out of Overpass, with the crop drawn from the statistics the same way, or read off a crop=* tag where a mapper wrote one down. That gives the shape of the countryside — which piece is farmed, which is meadow, which is vineyard — at whatever coverage the mappers have managed, which is patchy. Note that OpenStreetMap is ODbL, which is share-alike: a module built on it carries that on. The same path is what a module outside Germany gets, where there is no register at all.

The better fallback for Rhineland-Palatinate would be the state’s own ATKIS Basis-DLM (dl-de/by-2-0 since June 2024, object class 41001 AX_Landwirtschaft with arable, grassland, vineyard and orchard on it). It comes out of a web shop as a whole-state file rather than a service, so it needs the same “point the editor at a file” path Schleswig-Holstein’s GeoPackage needs; neither is built yet.

The approach is national by nature: the registers are national, so are their schemas and their crop code lists. A module in Austria or the Netherlands finds no state under it and takes the same OpenStreetMap fallback — the outline from landuse=*, the crop from a crop=* tag or the statistics, the UTM zone from the longitude rather than from a state’s convention. The dialog says so before the import runs, and the import warns again in its summary, because ODbL is share-alike and thinner than a register.

Doing better means reading that country’s own IACS publication. They exist and they have the same shape — Austria’s AMA data is on data.gv.at under CC BY, with Feldstücke and Schläge carrying a SNAR_BEZEICHNUNG land-use code — so adding one is a service entry, a crop CSV and an attribution line, the same three things a German state needs. None is built: what is built is the mechanism, and the fallback that keeps a foreign module from being empty in the meantime.

The data is free, not unconditional. Most states ask for a source note; Schleswig-Holstein asks for nothing. The import collects which states it drew on and shows the note verbatim, ready to copy into the module’s credits, and the line records what it was built against:

field_sources: [(land: "NW", year: 2026, fetched: 1787059200)],

Three states have not stated an open licence — Mecklenburg-Vorpommern writes “UrhG”, Saxony-Anhalt says nothing, Baden-Württemberg publishes no open download. The import fetches them and marks the module: build and look with them, and get the answer in writing before a module that uses them is released. Bavaria’s Feldstückskarte is CC BY-ND — no derivatives, which is exactly what turning a polygon into a mesh is — so the import asks its LPIS service under CC BY instead and never touches that one.

Which bucket Kohlrübe belongs in is a judgement call, and the answer changes with the region. So the mapping is a CSV, not code:

# cache/fields/crops/nw.csv — code, render group, and documentation after it
602,potato,Kartoffeln,HF,16.63
603,sugar-beet,Zuckerrüben,HF,16.21

Drop a file into cache/fields/crops/ named after the state (nw.csv, by.csv, …) and it is read over the built-in table the next time the dialog opens; groups.csv and arable.csv override the weights the draws use. Only the first two columns are read — the rest is there so a human can see what a row is about.