MBINCompiler icon indicating copy to clipboard operation
MBINCompiler copied to clipboard

Support for custom MBIN data/metadata

Open monkeyman192 opened this issue 7 years ago • 6 comments

A proposed change to be implemented is the addition of data/metadata that is not read by NMS but can be read by either a standard exml viewer or a custom mbin viewer. Before releasing the specification it would be good to know exactly what we want to have in the additional data.

Some ideas include:

  • Comments
  • Author details
  • Credits

Any other ideas for what could be added?

monkeyman192 avatar Aug 20 '18 00:08 monkeyman192

I'd like a description field where we can include notes and/or a description of what the file is for and anything that may be weird about it. If we're limited in space this could just be a url or something to a wiki with more details

theFisher86 avatar Aug 20 '18 02:08 theFisher86

However, for our purposes specifically I'd be more interested in a "per struct metadata" than a "per file" if that'd be possible

theFisher86 avatar Aug 20 '18 02:08 theFisher86

We should keep it generic and allow custom fields. Comments should have their own structure since they have to be parsed out of the XML and so that the rest of the metadata can be handled without edge cases.

eg. for Metadata At the top-level of the EXML file, before or after the Data node:

<Metadata>
    <Property name="Info" value="MetaText.xml" />
        <Property name="Name" value="" />
        <Property name="Version" value="1.0.0" />
        <Property name="Description" value="" />
        <Property name="Author" value="Gary" />
        <Property name="URL" value="http://domain.com" />
        <Property name="Credits" value="John" />
        <Property name="Credits" value="Sally" />
    </Property>
    <Property name="Attachments" value="MetaFile.xml" >
        <Property name="Screenshot" value="screenshot.png" />
        <Property name="Notes" value="warandpeace.txt" />
        <Property name="CustomData" value="custom.bin" />
    </Property>
</Metadata> 

GaticusHax avatar Aug 20 '18 02:08 GaticusHax

If we're not limited in size though it could be extremely useful to store what's been changed from vanilla in metadata. Could just be like an xpath to the changed field or something...but that may require too much

theFisher86 avatar Aug 20 '18 02:08 theFisher86

what sort of metadata would you attach to a struct?

GaticusHax avatar Aug 20 '18 02:08 GaticusHax

The V2 header format technically supports custom MBIN metadata by appropriating bytes 0x58 to 0x5F (officially padding/ignored bytes in vanilla NMS) to store an offset to the custom metadata but no other functionality is implemented yet to facilitate reading or writing.

The general structure of the metadata has also yet to be determined. It must be generic enough to support different types of metadata, such as those that have been discussed in this issue already.

Storing EXML comments as MBIN metadata should be addressed in a separate issue form this one.

GaticusHax avatar Nov 03 '19 04:11 GaticusHax