Repository navigation
PSO writer: <pso> edits in .oiv packages install and uninstall - #137
Merged
Merged
Conversation
- rage-formats: XML → PSO (`Pso::from_xml`), using the original file as the template: its schema and other sections stay, the data and block map are rebuilt with the game's layout (one type per block, original block order, depth-first items, 0x70 padding, GTA V and RDR2 block maps and pointers). Structures, pointers, arrays (inline and external), strings, hashes, enums, flags, maps, vectors and matrices. CHKS is dropped when the data changes. - Reader fixes found by the round trip: RDR2 enum values are 16 bytes (flag and enum names were wrong), unknown enum values print as numbers, string arrays were escaped twice. - names::parse_value: the hash behind a printed name. - openrage verify --meta --rebuild and rpf8 --meta --rebuild: every PSO file to XML and back. GTA V Enhanced: 4,943 files, 3,973 byte-identical, all read back to the same XML. RDR2: 69,246 files, 52,656 identical, all others the same XML (2 not fully readable, skipped). - oiv: <pso> parses its XML commands and is applied like <xml> on the file's XML, then written back; preview shows the lines changed, journal and undo as for other edits. Names compared in XPaths are registered so hashes match them. - Docs: modding (supported kinds, what is still refused), cli, index table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenIV packages with
<pso>edits were refused. Now the PSO file is converted to XML, the nestedadd/replace/removeXPath edits are applied exactly like<xml>, and the result is written back as PSO. That needed a PSO writer.PSO writer (
rage-formats,Pso::from_xml)PSCH) and the other sections (PSIG,STRE, …) are kept. The data (PSIN) and the block map (PMAP) are rebuilt the way the game's files are laid out:0x70paddingCHKS(a checksum by an unknown method) is kept when the data comes out unchanged and dropped otherwise, as CodeWalker does.Reader fixes the round trip turned up
Round trip over both games (
verify --meta --rebuild,rpf8 --meta --rebuild)The byte differences are in bytes the XML doesn't carry: uninitialised struct padding, the unused 4th float of 3D vectors, the order of the two length fields of some counted strings, and the dropped
CHKSthat comes with them.Installer
<pso path>parses the same commands as<xml>. The preview showsN XML command(s) on the PSO data: x line(s) added, y removed.Item[Name = 'adder']) are registered first, so hashes print as those names and match.RSC7metadata (resource.ymt, e.g. ped variations) is still refused, with an explanation. Docs updated (modding.md,cli.md, index table).Tests
rage-formats: byte-identical round trip of a hand-built file, edits, refusals, RDR2 layout.<pso>replace + add on a fake game, check of the result, uninstall restores the original bytes.update/x64/dlcpacks/patchday5ng/dlc.rpf/x64/levels/gta5/vehicles.rpf/_manifest.ymf(nested archive; replace, remove and add). It installed to the scratchmodsfolder and reads back as intended. The edited file round-trips byte-identically, and uninstall restores the game's XML.cargo clippy -D warningsand the tests forrage-formats,openrage-app,openrage-clipass.openrage-guibuilds.rdr2-ped --checkstill resolves 122,696 of 122,703 parts (not compared with a run before the enum fix).Not checked in the game itself
CHKS(CodeWalker-written PSO files have none and are known to load), nor with any written RDR2 PSO.<pso>package from the internet has been tried, so differences in naming (e.g. how unknown hashes are written) are unverified.🤖 Generated with Claude Code