rw-parser icon indicating copy to clipboard operation
rw-parser copied to clipboard

CLI tool for analysis and inspection

Open Timic3 opened this issue 6 months ago • 2 comments

A nice addition would be CLI tool, mostly for analysis and inspection of DFF and TXD files. It should be able to display structure names and optionally data that are contained within structures. Since data in some sections are large, this will be omitted by default. The tool should also be able to display errors during parsing.

I was thinking it should output something akin to RWAnalyze tool by Steve-M. Example output:

+-- Clump (0xADDRESS)
   +-- Frame List (0xADDRESS)
      +-- Frame (0xADDRESS)
      +-- Frame (0xADDRESS)
   +-- Geometry List (0xADDRESS)

A chunk of code will probably have to be rewritten, so the structures are parsed on-the-fly, not all at once. Maybe this issue will also pave the way for GLTF/GLB/OBJ exporters. The point is, there should be logic separation between parsing the file and the output. Parser would hand out the data, exporters or outputs would declare what to do with the data.

Timic3 avatar Jul 28 '25 06:07 Timic3

A chunk of code will probably have to be rewritten, so the structures are parsed on-the-fly, not all at once. Maybe this issue will also pave the way for GLTF/GLB/OBJ exporters. The point is, there should be logic separation between parsing the file and the output. Parser would hand out the data, exporters or outputs would declare what to do with the data.

This should probably a separate issue, since this is huge refactor.

Timic3 avatar Jul 28 '25 06:07 Timic3

Yes, I also thought that it is necessary to change the logic of the file parsing, because in its current state it is capable of reading only one clamp and crashes if the file structure is even slightly different from the expected one. For example, if a BinMeshPLG is missing from the Geometry section, the parser will not handle it and will throw an error. This is relevant for some SA models, as well as for VC and III in most cases. I think that if we can change the parse method, we can avoid unexpected errors.

AlterSDB avatar Jul 28 '25 07:07 AlterSDB