Road - sk-zk/md155 GitHub Wiki

Item ID: 0x03 (3)
The item has a base part and a data part.

Base part

Field(s) Description
struct kdop_item

See k-DOP item.

Flags:

Bits 0-1: Left -> terrain noise
Bits 2-3: Right -> terrain noise
    0: 100%
    1: 50%
    2: 0%

Bits 4-5: Left -> terrain transition
Bits 6-7: Right -> terrain transition
    0: 16
    1: 8
    2: 4
    3: 32

Bits 8-9: Left -> sidewalk size
Bits 10-11: Right -> sidewalk size
    0: 8 m
    1: 4 m
    2: 2 m
    3: 0 m

Bit 12: Right -> vegetation collision
Bit 13: Left -> vegetation collision
Bit 14: Water reflection
Bit 15: Left hand traffic
Bit 16: Secret road
Bit 17: Right -> railings -> Invert railing
Bit 18: Left -> railings -> Invert railing
Bit 19: Is city road (legacy system flag)
Bit 20: Right -> model 0 -> Shift
Bit 21: Left -> model 0 -> Shift
Bit 22: No AI vehicles
Bit 24: High-poly road
Bit 25: Hide in UI map
Bit 26: No collision
Bit 27: No boundary
Bit 28: Right -> No detail vegetation
Bit 29: Left -> No detail vegetation
Bit 30: Stretch terrain (obsolete)

u32 road_flags

Bit 0: Low poly vegetation
Bit 1: Superfine (legacy system flag)
Bit 2: Ignore cut planes
Bit 5: Right -> model 1 -> Shift
Bit 6: Right -> model 1 -> Shift
Bit 7: No terrain shadows

Byte 1: DLC guard

Bit 17: Smooth detail vegetation
Bit 18: Right -> model 0 -> Flip
Bit 19: Right -> model 1 -> Flip
Bit 20: Left -> model 0 -> Flip
Bit 21: Left -> model 1 -> Flip
Bit 22: Left -> shoulder blocked
Bit 23: Right -> shoulder blocked
Bit 24: Left -> railings -> double-sided
Bit 25: Right -> railings -> double-sided
Bit 26: Left -> railings -> center part only
Bit 27: Right -> railings -> center part only
Bit 28: GPS avoid
Bit 31: Center -> No detail vegetation

token road_look Unit name of the road, as defined in /def/world/road_look.sii (legacy) or /def/world/road_look.template.sii (template).
token right_lanes_variant
token left_lanes_variant
Traffic rules.
token right_tmpl_variant
token left_tmpl_variant

Road variant on the right and left side.

On single carriageways, only the right variant is used and the left side is ignored.

token right_edge_right
token right_edge_left
token left_edge_right
token left_edge_left
Edge models, as defined in /def/world/road_edge.sii.
token right_profile
float right_profile_coef
token left_profile
float left_profile_coef
Terrain profile and coefficient on the right and left side.
token right_tmpl_look
token left_tmpl_look

Road look on the right and left side.

On single carriageways, only the right variant is used and the left side is ignored.

token road_material Road material for legacy roads. Has no effect on template roads.
token right_railing
s16 right_railing_offset
token left_railing
s16 left_railing_offset
Unit names of the railings, as defined in /def/world/railing.sii, and their offsets, multiplied by 100. This is repeated three times because there are three models per side.
s32 right_road_height
s32 left_road_height

Road height offsets, multiplied by 100.

For single carriageways, the left offset only affects the left terrain.

u64 node0_uid
u64 node1_uid
The UIDs of the backward and forward nodes of the road.
float length

Cached length of the road item. See Polyline item.

The minimum length of a road is >0.4 m for Superfine, 1.25 m for High Poly, and 3.75 m for normal resolution. The maximum length of a road is 1000 m.

Data part

Field(s) Description
token overlay_scheme Road overlay.
The following parameters are repeated for the right and left side:
token right_model
s16 right_model_offset
s16 right_model_dist

Unit names of the models as defined in /def/world/sign.sii, their offsets multiplied by 100, and their distances multiplied by 100.

Appears twice because there are two models per side.

u16 right_terrain_size Terrain size multiplied by 10. Maximum size is 6500.
array_struct right_vegetation Vegetation settings, see Vegetation struct. Repeated three times.
token right_sidewalk Sidewalk for legacy roads.
struct quad_info Terrain data. See Quad Info struct.
End of repeated section
token center_material Material for the center terrain.
u32 center_material_color Center mat color as RGBA.
u16 center_material_rot UV rotation of the material texture.
u32 rnd_seed The seed used for placing vegetation.
float previous_length Sum of the lengths of all preceding road items.
token center_vegetation Vegetation type for the center.
u16 center_veg_density Vegetation density, multiplied by 10.
u8 center_veg_scale Scale of vegetation models. See Vegetation struct for possible values.
u8 center_veg_offset Offset from the road, multiplied by 10.
u16 left_dvdm
u16 right_dvdm
u16 left_dvd
u16 right_dvd
No Detail Vegetation From and To settings, multiplied by 10.
u32 veg_sphere_count
array_struct veg_spheres
List of vegetation spheres. See Vegetation sphere struct.
u32 left_add_part_count
array_token left_add_parts
u32 right_add_part_count
array_token right_add_parts
List of enabled additional parts.
u32 left_edge_override_count
array_struct left_edge_override
u32 right_edge_override_count
array_struct right_edge_override

Places edge models along the specified section of the road rather than its entirety. The length of these segments matches the width of three road quads.

Field(s) Description
u16 position Index (in forward direction) of the section where the override begins.
u16 count Length of the override, in sections.
token edge The edge model, as defined in /def/world/road_edge.sii.
u32 left_variant_override_count
array_struct left_variant_override
u32 right_variant_override_count
array_struct right_variant_override

Applies a model variant to the specified sections of the road rather than its entirety. The length of these segments matches the width of three road quads.

On single carriageways, only the right override applies to the road.

Field(s) Description
u16 position Index (in forward direction) of the section where the override begins.
u16 count Length of the override, in sections.
token variant The variant.

Road resolution

The resolution of a road segment and associated terrain quads can be changed with the High-poly Road and Superfine flags.

For legacy roads, a road without either flag set has a maximum quad size of 15 m. High-poly flag it to 5 m, and the mutually exclusive Superfine sets it to 1 m.

With template roads, only the terrain quads are affected; the road geometry does not change. In addition, Superfine is not available. If set, it has the same effect as High-poly.

⚠️ **GitHub.com Fallback** ⚠️