Electricity
Overview
Maps4FS electricity generation has two responsibilities:
Place electricity-related assets from OSM points (
power=pole,power=tower,highway=street_lamp,man_made=street_lamp).Build wire meshes for powerline networks from OSM lines (
power=minor_line,power=line).
The system is schema-driven and uses two files together:
templates/fs25-texture-schema.jsontemplates/fs25-electricity-schema.json
How the Pipeline Works
Texture schema matches OSM features and writes info-layer records.
Electricity component reads those records from map context.
Point records are mapped to categories, then to assets from electricity schema.
Assets are placed into
map.i3dasReferenceNodeentries.For wire-capable poles, line records are converted to connector-to-connector wires.
A combined wire network mesh is generated and referenced from
map.i3d.
Lights are point assets only and do not generate wire meshes.
Texture Schema: Electricity Entries
Electricity entries in texture schema are pseudo layers. They are typically external: true and invisible: true, used to collect OSM geometry into info layers.
Typical Line Entries
Use these for OSM powerline ways:
electricity_radius controls wire cylinder thickness.
Typical Point Entries
Use these for poles, towers, and street lights:
Electricity Schema: Field Reference
Each entry in fs25-electricity-schema.json defines one placeable asset profile.
Required fields
file(string): Asset path used in i3dFileentry.name(string): Base name used for placed nodes.categories(array of strings): Category match targets from texture schema (electricity_category).
Common optional fields
type(string): Logical role.pole,tower: wire-capable if connectors are present.light: light-only placement, excluded from wire topology.
rotation_offset_degrees(number): Rotation offset used for connector orientation.visual_rotation_offset_degrees(number): Optional separate visual offset.connectors(array): Connector points for wire generation.side(number): Horizontal offset in local pole right-axis.height(number): Vertical offset above ground.
align_to_road(number): Max distance to nearest road centerline for orientation.If nearest road is farther than this value, default yaw is kept.
snap_to_road(number): Offset from road edge where the point is snapped.Final snap offset is: half road width +
snap_to_road.
template_file(string): Source i3d to copy into map package before use.
Connectors Deep Dive
Connectors are the most important part of wire generation. They define where each wire attaches on a pole/tower asset.
If connector values are wrong, wires may look too high/low, offset from insulators, crossed, or attached to empty space.
What a connector is
A connector is one attachment point in pole-local coordinates:
side: left/right offset from pole center on the local right axis.height: vertical offset above ground for wire attachment.
The system transforms these local offsets into world space using the pole's resolved yaw.
Coordinate interpretation
For a placed pole:
Pole center in world space:
(x_world, y_ground, z_world)Connector world position:
x = x_world + side * right_xy = y_ground + heightz = z_world + side * right_z
Where (right_x, right_z) is the pole-local right direction derived from pole yaw.
Practical meaning:
Positive
sideputs connector on one side of the pole.Negative
sidemirrors it to the opposite side.Larger absolute
sidemoves wires farther from center.Larger
heightmoves wires higher.
Field-by-field detail
connectors (array of objects)
Purpose: list of wire attachment points for one asset profile.
Order: important. Matching tries to preserve non-crossing pairs between neighbor poles.
Minimum: for visible wires, use at least 2 connectors for typical distribution lines.
Connector object fields:
side(number)Unit: meters in asset/local pole scale.
Typical values:
small poles:
0.5to1.5large towers:
3.0to8.0
Use symmetric pairs for balanced left/right lines:
+a,-a.
height(number)Unit: meters above sampled terrain height at pole point.
Typical values:
distribution poles:
8to14high-voltage towers:
30+
Use grouped heights for multi-level crossarms.
Recommended patterns
2-wire symmetric pattern (basic)
Use for simple medium-voltage style visuals.
3-wire horizontal pattern
Use when center conductor is slightly higher.
Multi-level tower pattern
Use for high-voltage towers with separated circuits.
How connector matching works between poles
For each linked pole pair:
Connector world positions are computed on both poles.
Connectors are ordered by projection on the pair right-axis.
Normal and reversed pairings are compared.
Lower total pairing cost is selected to reduce crossing.
This means connector ordering and side symmetry strongly influence visual quality.
Tuning workflow (practical)
Start with symmetric two-connector setup.
Validate in Giants Editor using short and long spans.
Adjust
heightfirst (attachment realism).Adjust
sidesecond (spacing and non-overlap).Add extra connectors only after base pair looks correct.
If orientation seems wrong, adjust
rotation_offset_degrees(not connectors).
Common mistakes and fixes
Wires too close to pole center:
Increase absolute
side.
Wires floating above insulators:
Decrease
height.
Wires clipping crossarm:
Increase
heightslightly and/or adjustside.
Frequent crossing between neighbor poles:
Use symmetric
+side/-sidevalues and consistent heights.Keep connector count consistent for all assets in the same category.
Light assets unexpectedly creating wires:
Set
typetolightand omit connectors.
Notes on wires
Wires are created only from line records and wire-capable poles/towers.
Light entries (
type: "light") are intentionally excluded from wire linking.
Built-in Assets vs Custom Assets
Built-in game assets ($data/...)
$data/...)When file starts with $data/..., Maps4FS references game-provided assets directly. No copying is needed.
Examples:
$data/maps/mapAS/textures/props/highVoltageLinePole.i3d$data/placeables/mapEU/brandless/lightsResidential/streetLight01/streetLight01.i3d$data/placeables/brandless/lightsResidential/lightPole01/lightPole01.i3d
Custom assets (copied into map package)
Use this pattern when shipping custom i3d assets with your map:
Behavior:
template_fileis resolved from common roots (map dir, mod root, schema-relative paths).Source i3d is copied to
filepath under mod root.If a companion
.i3d.shapesexists, it is copied too.map.i3dstores the reference as a relative path frommap/map.i3ddirectory.
Path and Reference Rules
Prefer forward slashes in schema paths.
For custom assets, keep
fileunder your mod package (for exampleassets/electricity/...).map.i3dreferences are written relative tomap/map.i3d.$data/...paths should point to valid FS25 game files.
Road-Facing Lights
For light entries:
Set
typetolight.Set
align_to_roadto a numeric distance threshold (for example96).Optionally set
snap_to_roadto place the light near the road edge.
Example:
Alignment behavior:
Nearest point on fitted road segments is found.
Light yaw is aimed toward that road point when it is within
align_to_road.If
snap_to_roadis set, the point is moved to road edge offset (half width + snap_to_road).
If a light faces backward, tune rotation_offset_degrees by +90, -90, or 180 depending on the asset's local forward axis.
Minimal End-to-End Setup Checklist
Add electricity point and line pseudo layers in texture schema.
Ensure categories in texture schema and electricity schema match.
Add wire-capable entries (
connectors) for poles/towers.Add light entries with
type: "light"and optional road alignment fields.Generate map and verify references in
map/map.i3d.
Troubleshooting
No poles or lights appear
Confirm point pseudo layers write into
info_layer: "electricity_poles".Ensure category names match between schemas.
Ensure
filepath is valid.
Wires do not appear
Confirm line pseudo layers write into
info_layer: "electricity_lines".Confirm wire-capable entries have valid
connectors.Confirm OSM includes matching
power=line/power=minor_lineways.
Light points get wires
Ensure light entries use
type: "light".
Lights do not face roads
Ensure roads exist in texture schema and produce
roads_polylinescontext.Set
align_to_roadto a larger numeric threshold if roads are sparse.Set or tune
snap_to_roadto keep lights close to road edges.Tune
rotation_offset_degreesfor local model orientation.
Related Docs
Last updated