Lights: modifier volume shapes, sizes and rotation; distant light random value #264

Manually merged
github merged 2 commits from gh-pr/264/head into gh-pr/264/base 2026-11-26 20:22:43 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-25 12:15 UTC · original
holdmysocks:six-192-distant-fields → master · +138 −9 · 3 files · 2 commits · merged 2026-11-25 13:17 UTC

Follow-up to #255: more of the distant-light and modifier-volume fields decoded.

Modifier volumes (tc_modifiers.jsonl)

  • Shape. fe27ffde is the volume's shape: box (9fde1ac6, 469), cylinder (27acc35b, 103) and ellipsoid (e63a0d71, 14). Every TC_cylinder… modifier is a cylinder or an ellipsoid. On 62 of the 103 cylinders, scale x equals y, so their axis is local z.
  • Size. A box's scale is its full size. For cylinders and ellipsoids, scale holds the radii. I checked this on the map files that hold a single volume: their extents are a sphere of radius |scale| / 2 around a box, often exactly, and never smaller. Around the other two shapes the radius is |scale|.
  • Rotation. The quaternion (x, y, z, w) applies as stored, not inverted as the entities' rotations are. 177 volumes are tilted. Applied as stored, 90 of them have a local axis exactly vertical. Inverted, none do that the other reading doesn't also give; 87 are upright either way. The other 50 lean a few degrees, for example car-park ramps. Many rotations have the form (a, b, b, a): a yaw times a 90° turn about X, with local y up.
  • New fields. The export adds shape, half_extents and world bounds (the rotated box's AABB), and the region filter now uses those bounds.
  • Still unknown. 854db4c2 (u32) is set on 25 volumes, with 15 distinct hashes. None matches a modifier, room, interior or dictionary name.

Distant lights (distant.jsonl)

I joined a 20 % sample (92,861 lights) by position to the placed light each comes from, and tested every distant column against every placed-light field.

  • a13c79ef → random. A half float spread evenly over 0..100. It is independent of the source light's fields (|Spearman r| < 0.04 for all of them), of the light's hash bits, of its position and of its type. That reads as a per-light random value. half_a13c79ef stays for compatibility.
  • time_multiplier. No placed-light field determines it, so it is set only on the distant record. 0 on 4.6 % of lights. Distant flags 2 and 7 occur only with 0, and 5b92fa4b = 8 holds 44 % of the zeros. Lights with 0 are always-on slightly more often (98 % vs 86 %). What it scales is still unknown.
  • LOD 8e6f0ba9 reads as two half floats (halves_8e6f0ba9). 0e852fda is two u16 (u16_0e852fda), the second equal to the first or one more. Both meanings are unknown.

The distant Hash is not a plain function of the entity id, archetype, light index or position (joaat, CRC and seeded variants tried), so the join stays positional.

cargo check --workspace --all-targets and cargo test -p sixng-core -p sixng-gui --release pass. A full sixng lights levels run gives the same counts as #255: 586 volumes, 4,364 rooms, 492,298 distant lights.

Second commit: distant intensity, light groups, LOD tangent

  • Spot intensity. A distant spot's intensity is the placed intensity × (F + (1 − F) · p). Here F = 2 / ((1 − cos inner) + (cos inner − cos outer) / 3), which is 4π over the solid angle of a cone whose falloff is squared from the inner to the outer angle, and p is the placed field 47d5d47a. p = 0 on most spots, meaning the full conversion; p = 1 means none; 0.25 and 0.5 blend. This matches 94 % of the non-zero distant spots exactly: 40° / 65° gives 5.74, and 10° / 40° gives 22.70. world.jsonl gives spots the result as distant_intensity.
  • Points and capsules. Points keep their intensity (88 %). A capsule's is divided by (1 + L)², and L grows with the capsule extent. The field L comes from is not found.
  • Light groups. 854db4c2 on a modifier volume matches the placed lights' field 58122c00. A road tunnel's modifier and its 662 lights share one hash. The other volumes with a group are interior states: dim / bright, clean / dirty, blackout, show lighting. Both are written as light_group. The group names are not known.
  • time_multiplier. The same for a given light of an archetype on 98.5 %, but it is stored on no placed-light field.
  • LOD 8e6f0ba9. The tangent, octahedral-encoded as two half floats, matching the placed tangent on 99.8 %. It is written as tangent.
  • LOD 0e852fda. A first / last index that rises with the light index, 0 / 0 on 47 %. What it indexes is not known.
**@⁠holdmysocks** on GitHub · 2026-11-25 12:15 UTC · [original](https://github.com/holdmysocks/SixNG/pull/264) `holdmysocks:six-192-distant-fields` → `master` · +138 −9 · 3 files · 2 commits · merged 2026-11-25 13:17 UTC Follow-up to #255: more of the distant-light and modifier-volume fields decoded. ## Modifier volumes (`tc_modifiers.jsonl`) - **Shape.** `fe27ffde` is the volume's shape: box (`9fde1ac6`, 469), cylinder (`27acc35b`, 103) and ellipsoid (`e63a0d71`, 14). Every `TC_cylinder…` modifier is a cylinder or an ellipsoid. On 62 of the 103 cylinders, `scale` x equals y, so their axis is local z. - **Size.** A box's `scale` is its full size. For cylinders and ellipsoids, `scale` holds the radii. I checked this on the map files that hold a single volume: their extents are a sphere of radius |scale| / 2 around a box, often exactly, and never smaller. Around the other two shapes the radius is |scale|. - **Rotation.** The quaternion (x, y, z, w) applies as stored, not inverted as the entities' rotations are. 177 volumes are tilted. Applied as stored, 90 of them have a local axis exactly vertical. Inverted, none do that the other reading doesn't also give; 87 are upright either way. The other 50 lean a few degrees, for example car-park ramps. Many rotations have the form (a, b, b, a): a yaw times a 90° turn about X, with local y up. - **New fields.** The export adds `shape`, `half_extents` and world `bounds` (the rotated box's AABB), and the region filter now uses those bounds. - **Still unknown.** `854db4c2` (u32) is set on 25 volumes, with 15 distinct hashes. None matches a modifier, room, interior or dictionary name. ## Distant lights (`distant.jsonl`) I joined a 20 % sample (92,861 lights) by position to the placed light each comes from, and tested every distant column against every placed-light field. - **`a13c79ef` → `random`.** A half float spread evenly over 0..100. It is independent of the source light's fields (|Spearman r| < 0.04 for all of them), of the light's hash bits, of its position and of its type. That reads as a per-light random value. `half_a13c79ef` stays for compatibility. - **`time_multiplier`.** No placed-light field determines it, so it is set only on the distant record. 0 on 4.6 % of lights. Distant `flags` 2 and 7 occur only with 0, and `5b92fa4b` = 8 holds 44 % of the zeros. Lights with 0 are always-on slightly more often (98 % vs 86 %). What it scales is still unknown. - **LOD `8e6f0ba9`** reads as two half floats (`halves_8e6f0ba9`). **`0e852fda`** is two u16 (`u16_0e852fda`), the second equal to the first or one more. Both meanings are unknown. The distant `Hash` is not a plain function of the entity id, archetype, light index or position (joaat, CRC and seeded variants tried), so the join stays positional. `cargo check --workspace --all-targets` and `cargo test -p sixng-core -p sixng-gui --release` pass. A full `sixng lights levels` run gives the same counts as #255: 586 volumes, 4,364 rooms, 492,298 distant lights. ## Second commit: distant intensity, light groups, LOD tangent - **Spot intensity.** A distant spot's intensity is the placed intensity × (F + (1 − F) · p). Here F = 2 / ((1 − cos inner) + (cos inner − cos outer) / 3), which is 4π over the solid angle of a cone whose falloff is squared from the inner to the outer angle, and p is the placed field `47d5d47a`. p = 0 on most spots, meaning the full conversion; p = 1 means none; 0.25 and 0.5 blend. This matches 94 % of the non-zero distant spots exactly: 40° / 65° gives 5.74, and 10° / 40° gives 22.70. `world.jsonl` gives spots the result as `distant_intensity`. - **Points and capsules.** Points keep their intensity (88 %). A capsule's is divided by (1 + L)², and L grows with the capsule extent. The field L comes from is not found. - **Light groups.** `854db4c2` on a modifier volume matches the placed lights' field `58122c00`. A road tunnel's modifier and its 662 lights share one hash. The other volumes with a group are interior states: dim / bright, clean / dirty, blackout, show lighting. Both are written as `light_group`. The group names are not known. - **`time_multiplier`.** The same for a given light of an archetype on 98.5 %, but it is stored on no placed-light field. - **LOD `8e6f0ba9`.** The tangent, octahedral-encoded as two half floats, matching the placed tangent on 99.8 %. It is written as `tangent`. - **LOD `0e852fda`.** A first / last index that rises with the light index, 0 / 0 on 47 %. What it indexes is not known.
fe27ffde is the volume shape (box, cylinder, ellipsoid). A box's scale is
its full size, the other shapes' their radii, and the rotation applies as
stored. tc_modifiers.jsonl gains shape, half_extents and world bounds.

The distant a13c79ef half float is a per-light random value (random).
LOD 8e6f0ba9 and 0e852fda are written decoded as two halves and two u16.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:22:41 +00:00
github manually merged commit 4e019f07f9 into gh-pr/264/base 2026-11-26 20:22:43 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.