Skip to content

fix: update raw.ksy with verified fields, v<32 support, add raw_legacy.ksy#8

Open
aronwk-aaron wants to merge 2 commits into
lcdr:masterfrom
aronwk-aaron:raw-ksy-updates
Open

fix: update raw.ksy with verified fields, v<32 support, add raw_legacy.ksy#8
aronwk-aaron wants to merge 2 commits into
lcdr:masterfrom
aronwk-aaron:raw-ksy-updates

Conversation

@aronwk-aaron

Copy link
Copy Markdown

Summary

  • Rename densityscale, diffuse_rescolor_map_resolution, bitsblend_channel_mask based on Ghidra RE of the client binary
  • Add missing color_a (u1) to flair_attributes — was causing a 35 vs 36 byte mismatch, hidden by the size: 36 override
  • Replace unknown1/unknown2 catch-alls with proper version < 32 field definitions (legacy color map, v31 scene map, v<31 scene skip)
  • Add version >= 32 and vert_size != 0 guards on mesh data fields
  • Add doc annotations throughout

Verification

  • All changes verified against Ghidra RE of ReadNewTerrainFormat (0x0103b920), RAWReadHeightmap, RAWReadColorandLightMaps, RAWReadFlairData, RAWReadSceneMap, RAWReadMeshData, and the blend map reader in legouniverse.exe 1.10.64
  • Validated by parsing all 309 .raw files across multiple client versions (v31 and v32) — 309/309 pass with 0 bytes remaining

🤖 Generated with Claude Code

…y.ksy

Chunked format (raw.ksy, v30+):
- Rename density → scale, diffuse_res → color_map_resolution, bits → blend_channel_mask
- Add color_a to flair_attributes (35→36 byte fix)
- Replace unknown1/unknown2 with proper v<32 field definitions
- Add version/vert_size guards on mesh data

Legacy format (raw_legacy.ksy, v<30):
- New file using kaitai params for external map_version
- Flat grid format with version-gated fields across v0-v29
- Heightmap, color map, texture/material, scene map sections
- No known files exist; structure from Ghidra RE

All changes verified against Ghidra RE of legouniverse.exe 1.10.64.
Chunked format validated against 309 .raw files (309/309 pass).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aronwk-aaron aronwk-aaron changed the title fix: update raw.ksy with verified field names, v<32 support, missing color_a fix: update raw.ksy with verified fields, v<32 support, add raw_legacy.ksy Jun 25, 2026
These 16 bytes (vector3 + f4) are skipped by the client in every known
build from 0.179.12 through 1.10.64. Never read into any struct or used
at runtime.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant